diff -Nru sumo-0.21.0+dfsg/AUTHORS sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/AUTHORS --- sumo-0.21.0+dfsg/AUTHORS 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/AUTHORS 2015-04-17 05:44:20.000000000 +0000 @@ -32,7 +32,7 @@ Karol Stosiek kstosiek Maximilian Wittmann wittmax Marek Heinrich mahei -Melanie Knocke mknocke +Melanie Weber mknocke Mario Krumnow mkrumnow Riccardo Belletti rickybo89 Anna Chiara Bellini acbellini @@ -47,4 +47,6 @@ Lyle Johnson Peter Wagner <> piwagner Eric Melde <> melde -Evamarie Wiessner \ No newline at end of file +Evamarie Wiessner +Andreas Kendziorra <> kend-an +Robert Hilbrich <> rhilbrich diff -Nru sumo-0.21.0+dfsg/bin/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/bin/Makefile.am --- sumo-0.21.0+dfsg/bin/Makefile.am 2014-02-25 23:02:18.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/bin/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -5,10 +5,6 @@ endif endif -if INTERNAL -MAROUTER_APP = marouter -endif - if TRACI TRACI_TESTCLIENT_APP = TraCITestClient endif @@ -18,6 +14,7 @@ dfrouter dfrouterD dfrouterInt dfrouterIntD \ duarouter duarouterD duarouterInt duarouterIntD \ jtrrouter jtrrouterD jtrrouterInt jtrrouterIntD \ +marouter marouterD marouterInt marouterIntD \ netconvert netconvertD netconvertInt netconvertIntD \ netgenerate netgenerateD netgenerateInt netgenerateIntD \ od2trips od2tripsD od2tripsInt od2tripsIntD \ @@ -25,67 +22,84 @@ activitygen activitygenD activitygenInt activitygenIntD \ TraCITestClient TraCITestClientD TraCITestClientInt TraCITestClientIntD \ sumo-unittest sumo-unittestD \ -netedit neteditD marouter marouterD \ +netedit neteditD \ emissionsDrivingCycle emissionsDrivingCycleD emissionsDrivingCycleInt emissionsDrivingCycleIntD \ emissionsMap emissionsMapD emissionsMapInt emissionsMapIntD install: all -all: sumo dfrouter duarouter jtrrouter netconvert netgenerate od2trips polyconvert activitygen emissionsDrivingCycle emissionsMap $(GUI_APP) $(NETEDIT_APP) $(MAROUTER_APP) $(TRACI_TESTCLIENT_APP) +all: sumo dfrouter duarouter jtrrouter netconvert netgenerate od2trips polyconvert activitygen emissionsDrivingCycle emissionsMap marouter $(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 if [ ! -e sumo -a -e sumoD ]; then ln -s sumoD sumo; fi + if [ ! -e meso -a -e mesoD ]; then ln -s mesoD meso; 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 if [ ! -e dfrouter -a -e dfrouterD ]; then ln -s dfrouterD dfrouter; fi + if [ ! -e dfrouterInt -a -e dfrouterIntD ]; then ln -s dfrouterIntD dfrouterInt; 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 if [ ! -e duarouter -a -e duarouterD ]; then ln -s duarouterD duarouter; fi + if [ ! -e duarouterInt -a -e duarouterIntD ]; then ln -s duarouterIntD duarouterInt; 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 if [ ! -e jtrrouter -a -e jtrrouterD ]; then ln -s jtrrouterD jtrrouter; fi + if [ ! -e jtrrouterInt -a -e jtrrouterIntD ]; then ln -s jtrrouterIntD jtrrouterInt; fi netconvert: ../src/netconvert cp ../src/netconvert ./`echo netconvert | 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 if [ ! -e netconvert -a -e netconvertD ]; then ln -s netconvertD netconvert; fi + if [ ! -e netconvertInt -a -e netconvertIntD ]; then ln -s netconvertIntD netconvertInt; 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 if [ ! -e netgenerate -a -e netgenerateD ]; then ln -s netgenerateD netgenerate; fi -od2trips: ../src/od2trips/od2trips - cp ../src/od2trips/od2trips ./`echo od2trips | sed '$(transform)'` + if [ ! -e netgenerateInt -a -e netgenerateIntD ]; then ln -s netgenerateIntD netgenerateInt; fi +od2trips: ../src/od2trips + cp ../src/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 if [ ! -e od2trips -a -e od2tripsD ]; then ln -s od2tripsD od2trips; fi + if [ ! -e od2tripsInt -a -e od2tripsIntD ]; then ln -s od2tripsIntD od2tripsInt; 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 if [ ! -e polyconvert -a -e polyconvertD ]; then ln -s polyconvertD polyconvert; fi + if [ ! -e polyconvertInt -a -e polyconvertIntD ]; then ln -s polyconvertIntD polyconvertInt; fi activitygen: ../src/activitygen/activitygen cp ../src/activitygen/activitygen ./`echo activitygen | sed '$(transform)'` if [ ! -e activitygen -a -e activitygenInt ]; then ln -s activitygenInt activitygen; fi if [ ! -e activitygenD -a -e activitygenIntD ]; then ln -s activitygenIntD activitygenD; fi if [ ! -e activitygen -a -e activitygenD ]; then ln -s activitygenD activitygen; fi + if [ ! -e activitygenInt -a -e activitygenIntD ]; then ln -s activitygenIntD activitygenInt; fi emissionsDrivingCycle: ../src/tools/emissionsDrivingCycle cp ../src/tools/emissionsDrivingCycle ./`echo emissionsDrivingCycle | sed '$(transform)'` if [ ! -e emissionsDrivingCycle -a -e emissionsDrivingCycleInt ]; then ln -s emissionsDrivingCycleInt emissionsDrivingCycle; fi if [ ! -e emissionsDrivingCycleD -a -e emissionsDrivingCycleIntD ]; then ln -s emissionsDrivingCycleIntD emissionsDrivingCycleD; fi if [ ! -e emissionsDrivingCycle -a -e emissionsDrivingCycleD ]; then ln -s emissionsDrivingCycleD emissionsDrivingCycle; fi + if [ ! -e emissionsDrivingCycleInt -a -e emissionsDrivingCycleIntD ]; then ln -s emissionsDrivingCycleIntD emissionsDrivingCycleInt; fi emissionsMap: ../src/tools/emissionsMap cp ../src/tools/emissionsMap ./`echo emissionsMap | sed '$(transform)'` if [ ! -e emissionsMap -a -e emissionsMapInt ]; then ln -s emissionsMapInt emissionsMap; fi if [ ! -e emissionsMapD -a -e emissionsMapIntD ]; then ln -s emissionsMapIntD emissionsMapD; fi if [ ! -e emissionsMap -a -e emissionsMapD ]; then ln -s emissionsMapD emissionsMap; fi + if [ ! -e emissionsMapInt -a -e emissionsMapIntD ]; then ln -s emissionsMapIntD emissionsMapInt; fi +marouter: ../src/marouter/marouter + cp ../src/marouter/marouter ./`echo marouter | sed '$(transform)'` + if [ ! -e marouter -a -e marouterInt ]; then ln -s marouterInt marouter; fi + if [ ! -e marouterD -a -e marouterIntD ]; then ln -s marouterIntD marouterD; fi + if [ ! -e marouter -a -e marouterD ]; then ln -s marouterD marouter; fi + if [ ! -e marouter -a -e marouterIntD ]; then ln -s marouterIntD marouterInt; 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 @@ -94,9 +108,6 @@ $(NETEDIT_APP): ../src/netedit/$(NETEDIT_APP) cp ../src/netedit/$(NETEDIT_APP) ./`echo $(NETEDIT_APP) | sed '$(transform)'` if [ ! -e $(NETEDIT_APP) -a -e $(NETEDIT_APP)D ]; then ln -s $(NETEDIT_APP)D $(NETEDIT_APP); fi -$(MAROUTER_APP): ../src/marouter/$(MAROUTER_APP) - cp ../src/marouter/$(MAROUTER_APP) ./`echo $(MAROUTER_APP) | sed '$(transform)'` - if [ ! -e $(MAROUTER_APP) -a -e $(MAROUTER_APP)D ]; then ln -s $(MAROUTER_APP)D $(MAROUTER_APP); fi $(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 diff -Nru sumo-0.21.0+dfsg/bin/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/bin/Makefile.in --- sumo-0.21.0+dfsg/bin/Makefile.in 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/bin/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -146,6 +146,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -156,7 +158,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -252,13 +253,13 @@ top_srcdir = @top_srcdir@ @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 \ +marouter marouterD marouterInt marouterIntD \ netconvert netconvertD netconvertInt netconvertIntD \ netgenerate netgenerateD netgenerateInt netgenerateIntD \ od2trips od2tripsD od2tripsInt od2tripsIntD \ @@ -266,7 +267,7 @@ activitygen activitygenD activitygenInt activitygenIntD \ TraCITestClient TraCITestClientD TraCITestClientInt TraCITestClientIntD \ sumo-unittest sumo-unittestD \ -netedit neteditD marouter marouterD \ +netedit neteditD \ emissionsDrivingCycle emissionsDrivingCycleD emissionsDrivingCycleInt emissionsDrivingCycleIntD \ emissionsMap emissionsMapD emissionsMapInt emissionsMapIntD @@ -462,62 +463,79 @@ install: all -all: sumo dfrouter duarouter jtrrouter netconvert netgenerate od2trips polyconvert activitygen emissionsDrivingCycle emissionsMap $(GUI_APP) $(NETEDIT_APP) $(MAROUTER_APP) $(TRACI_TESTCLIENT_APP) +all: sumo dfrouter duarouter jtrrouter netconvert netgenerate od2trips polyconvert activitygen emissionsDrivingCycle emissionsMap marouter $(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 if [ ! -e sumo -a -e sumoD ]; then ln -s sumoD sumo; fi + if [ ! -e meso -a -e mesoD ]; then ln -s mesoD meso; 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 if [ ! -e dfrouter -a -e dfrouterD ]; then ln -s dfrouterD dfrouter; fi + if [ ! -e dfrouterInt -a -e dfrouterIntD ]; then ln -s dfrouterIntD dfrouterInt; 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 if [ ! -e duarouter -a -e duarouterD ]; then ln -s duarouterD duarouter; fi + if [ ! -e duarouterInt -a -e duarouterIntD ]; then ln -s duarouterIntD duarouterInt; 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 if [ ! -e jtrrouter -a -e jtrrouterD ]; then ln -s jtrrouterD jtrrouter; fi + if [ ! -e jtrrouterInt -a -e jtrrouterIntD ]; then ln -s jtrrouterIntD jtrrouterInt; fi netconvert: ../src/netconvert cp ../src/netconvert ./`echo netconvert | 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 if [ ! -e netconvert -a -e netconvertD ]; then ln -s netconvertD netconvert; fi + if [ ! -e netconvertInt -a -e netconvertIntD ]; then ln -s netconvertIntD netconvertInt; 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 if [ ! -e netgenerate -a -e netgenerateD ]; then ln -s netgenerateD netgenerate; fi -od2trips: ../src/od2trips/od2trips - cp ../src/od2trips/od2trips ./`echo od2trips | sed '$(transform)'` + if [ ! -e netgenerateInt -a -e netgenerateIntD ]; then ln -s netgenerateIntD netgenerateInt; fi +od2trips: ../src/od2trips + cp ../src/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 if [ ! -e od2trips -a -e od2tripsD ]; then ln -s od2tripsD od2trips; fi + if [ ! -e od2tripsInt -a -e od2tripsIntD ]; then ln -s od2tripsIntD od2tripsInt; 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 if [ ! -e polyconvert -a -e polyconvertD ]; then ln -s polyconvertD polyconvert; fi + if [ ! -e polyconvertInt -a -e polyconvertIntD ]; then ln -s polyconvertIntD polyconvertInt; fi activitygen: ../src/activitygen/activitygen cp ../src/activitygen/activitygen ./`echo activitygen | sed '$(transform)'` if [ ! -e activitygen -a -e activitygenInt ]; then ln -s activitygenInt activitygen; fi if [ ! -e activitygenD -a -e activitygenIntD ]; then ln -s activitygenIntD activitygenD; fi if [ ! -e activitygen -a -e activitygenD ]; then ln -s activitygenD activitygen; fi + if [ ! -e activitygenInt -a -e activitygenIntD ]; then ln -s activitygenIntD activitygenInt; fi emissionsDrivingCycle: ../src/tools/emissionsDrivingCycle cp ../src/tools/emissionsDrivingCycle ./`echo emissionsDrivingCycle | sed '$(transform)'` if [ ! -e emissionsDrivingCycle -a -e emissionsDrivingCycleInt ]; then ln -s emissionsDrivingCycleInt emissionsDrivingCycle; fi if [ ! -e emissionsDrivingCycleD -a -e emissionsDrivingCycleIntD ]; then ln -s emissionsDrivingCycleIntD emissionsDrivingCycleD; fi if [ ! -e emissionsDrivingCycle -a -e emissionsDrivingCycleD ]; then ln -s emissionsDrivingCycleD emissionsDrivingCycle; fi + if [ ! -e emissionsDrivingCycleInt -a -e emissionsDrivingCycleIntD ]; then ln -s emissionsDrivingCycleIntD emissionsDrivingCycleInt; fi emissionsMap: ../src/tools/emissionsMap cp ../src/tools/emissionsMap ./`echo emissionsMap | sed '$(transform)'` if [ ! -e emissionsMap -a -e emissionsMapInt ]; then ln -s emissionsMapInt emissionsMap; fi if [ ! -e emissionsMapD -a -e emissionsMapIntD ]; then ln -s emissionsMapIntD emissionsMapD; fi if [ ! -e emissionsMap -a -e emissionsMapD ]; then ln -s emissionsMapD emissionsMap; fi + if [ ! -e emissionsMapInt -a -e emissionsMapIntD ]; then ln -s emissionsMapIntD emissionsMapInt; fi +marouter: ../src/marouter/marouter + cp ../src/marouter/marouter ./`echo marouter | sed '$(transform)'` + if [ ! -e marouter -a -e marouterInt ]; then ln -s marouterInt marouter; fi + if [ ! -e marouterD -a -e marouterIntD ]; then ln -s marouterIntD marouterD; fi + if [ ! -e marouter -a -e marouterD ]; then ln -s marouterD marouter; fi + if [ ! -e marouter -a -e marouterIntD ]; then ln -s marouterIntD marouterInt; 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 @@ -526,9 +544,6 @@ $(NETEDIT_APP): ../src/netedit/$(NETEDIT_APP) cp ../src/netedit/$(NETEDIT_APP) ./`echo $(NETEDIT_APP) | sed '$(transform)'` if [ ! -e $(NETEDIT_APP) -a -e $(NETEDIT_APP)D ]; then ln -s $(NETEDIT_APP)D $(NETEDIT_APP); fi -$(MAROUTER_APP): ../src/marouter/$(MAROUTER_APP) - cp ../src/marouter/$(MAROUTER_APP) ./`echo $(MAROUTER_APP) | sed '$(transform)'` - if [ ! -e $(MAROUTER_APP) -a -e $(MAROUTER_APP)D ]; then ln -s $(MAROUTER_APP)D $(MAROUTER_APP); fi $(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 diff -Nru sumo-0.21.0+dfsg/config.guess sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/config.guess --- sumo-0.21.0+dfsg/config.guess 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/config.guess 2015-04-17 05:44:20.000000000 +0000 @@ -1,12 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. -timestamp='2013-06-10' +timestamp='2009-11-20' # This file 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 +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -15,22 +17,26 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. # -# Originally written by Per Bothner. +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -# -# Please send patches with a ChangeLog entry to config-patches@gnu.org. - me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +56,8 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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." @@ -132,34 +139,13 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - eval $set_cc_for_build - cat <<-EOF > $dummy.c - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - ;; -esac - case "${UNAME_MACHINE}" in - i?86) - test -z "$VENDOR" && VENDOR=pc - ;; - *) - test -z "$VENDOR" && VENDOR=unknown - ;; + i?86) + test -z "$VENDOR" && VENDOR=pc + ;; + *) + test -z "$VENDOR" && VENDOR=unknown + ;; esac test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse @@ -168,7 +154,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -204,7 +190,7 @@ fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -225,10 +211,6 @@ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-${VENDOR}-bitrig${UNAME_RELEASE} - exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-${VENDOR}-openbsd${UNAME_RELEASE} @@ -251,7 +233,7 @@ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -297,10 +279,7 @@ # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; + exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -326,12 +305,12 @@ echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) + arm:riscos:*:*|arm:RISCOS:*:*) echo arm-${VENDOR}-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -425,23 +404,23 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-${VENDOR}-mint${UNAME_RELEASE} - exit ;; + echo m68k-${VENDOR}-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -511,8 +490,8 @@ echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -525,7 +504,7 @@ else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -582,7 +561,7 @@ echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[4567]) + *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -625,52 +604,52 @@ 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include + sed 's/^ //' << EOF >$dummy.c - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -761,22 +740,22 @@ exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -800,14 +779,14 @@ exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -819,35 +798,30 @@ echo ${UNAME_MACHINE}-${VENDOR}-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case ${UNAME_MACHINE} in + pc98) + echo i386-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) - echo ${UNAME_PROCESSOR}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + echo ${UNAME_MACHINE}-${VENDOR}-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; - *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; @@ -884,22 +858,15 @@ exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-${VENDOR}-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo ${UNAME_MACHINE}-${VENDOR}-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} - exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -909,56 +876,52 @@ EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}eabi - else - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}eabihf - fi + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + echo frv-${VENDOR}-linux-gnu exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -977,63 +940,51 @@ #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-${LIBC}"; exit; } + test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} - exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + echo or32-${VENDOR}-linux-gnu exit ;; padre:Linux:*:*) - echo sparc-${VENDOR}-linux-${LIBC} + echo sparc-${VENDOR}-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-${VENDOR}-linux-${LIBC} + echo hppa64-${VENDOR}-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-${VENDOR}-linux-${LIBC} ;; - PA8*) echo hppa2.0-${VENDOR}-linux-${LIBC} ;; - *) echo hppa-${VENDOR}-linux-${LIBC} ;; + PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;; + PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;; + *) echo hppa-${VENDOR}-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-${VENDOR}-linux-${LIBC} + echo powerpc64-${VENDOR}-linux-gnu exit ;; ppc:Linux:*:*) - echo powerpc-${VENDOR}-linux-${LIBC} - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-${VENDOR}-linux-${LIBC} - exit ;; - ppcle:Linux:*:*) - echo powerpcle-${VENDOR}-linux-${LIBC} + echo powerpc-${VENDOR}-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} - exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + echo x86_64-${VENDOR}-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-linux-${LIBC} + echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1042,11 +993,11 @@ echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1064,7 +1015,7 @@ echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-${VENODR}-lynxos${UNAME_RELEASE} + echo i386-${VENDOR}-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp @@ -1078,7 +1029,7 @@ fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1106,13 +1057,13 @@ exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1123,7 +1074,7 @@ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-${VENODR}-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-${VENDOR}-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1147,8 +1098,8 @@ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1191,10 +1142,10 @@ echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1220,11 +1171,11 @@ exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-${VENDOR}-sysv${UNAME_RELEASE} + echo mips-${VENDOR}-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1237,9 +1188,6 @@ BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; - x86_64:Haiku:*:*) - echo x86_64-${VENDOR}-haiku - exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1266,21 +1214,19 @@ exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - fi + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1294,10 +1240,7 @@ *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) + NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1342,13 +1285,13 @@ echo pdp10-${VENDOR}-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1366,11 +1309,11 @@ i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-${VENDOR}-esx - exit ;; esac +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + eval $set_cc_for_build cat >$dummy.c < printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff -Nru sumo-0.21.0+dfsg/config.sub sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/config.sub --- sumo-0.21.0+dfsg/config.sub 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/config.sub 2015-04-17 05:44:20.000000000 +0000 @@ -1,31 +1,38 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2013 Free Software Foundation, Inc. - -timestamp='2013-04-24' - -# This file 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 +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-11-20' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). +# the same distribution terms that you use for the rest of that program. -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +75,8 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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." @@ -115,18 +123,13 @@ # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] @@ -149,12 +152,12 @@ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -170,10 +173,10 @@ os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -218,12 +221,6 @@ -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; -lynx*) os=-lynxos ;; @@ -248,27 +245,20 @@ # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ - | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | be32 | be64 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -286,45 +276,34 @@ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ + | nios | nios2 \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | rl78 | rx \ + | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | v850 | v850e \ | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; @@ -334,21 +313,6 @@ basic_machine=mt-unknown ;; - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -363,30 +327,25 @@ # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ - | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ - | be32-* | be64-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -404,34 +363,29 @@ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ + | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ + | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -456,7 +410,7 @@ basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -526,20 +480,11 @@ basic_machine=powerpc-ibm os=-cnk ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -571,7 +516,7 @@ basic_machine=craynv-cray os=-unicosmp ;; - cr16 | cr16-*) + cr16) basic_machine=cr16-unknown os=-elf ;; @@ -729,6 +674,7 @@ i370-ibm* | ibm*) basic_machine=i370-ibm ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -786,13 +732,9 @@ basic_machine=ns32k-utek os=-sysv ;; - microblaze*) + microblaze) basic_machine=microblaze-xilinx ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -829,18 +771,10 @@ ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; - msys) - basic_machine=i386-pc - os=-msys - ;; mvs) basic_machine=i370-ibm os=-mvs ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -905,12 +839,6 @@ np1) basic_machine=np1-gould ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -993,10 +921,9 @@ ;; power) basic_machine=power-ibm ;; - ppc | ppcbe) basic_machine=powerpc-unknown + ppc) basic_machine=powerpc-unknown ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1021,11 +948,7 @@ basic_machine=i586-unknown os=-pw32 ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) + rdos) basic_machine=i386-pc os=-rdos ;; @@ -1094,9 +1017,6 @@ basic_machine=i860-stratus os=-sysv4 ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; sun2) basic_machine=m68000-sun ;; @@ -1153,8 +1073,20 @@ basic_machine=t90-cray os=-unicos ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; tile*) - basic_machine=$basic_machine-unknown + basic_machine=tile-unknown os=-linux-gnu ;; tx39) @@ -1224,9 +1156,6 @@ xps | xps100) basic_machine=xps100-honeywell ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1324,11 +1253,11 @@ if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + -auroraux) + os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -1352,21 +1281,20 @@ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1413,7 +1341,7 @@ -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1462,7 +1390,7 @@ -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1498,14 +1426,15 @@ -aros*) os=-aros ;; + -kaos*) + os=-kaos + ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; - -nacl*) - ;; -none) ;; *) @@ -1528,10 +1457,10 @@ # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1543,20 +1472,8 @@ arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1576,11 +1493,14 @@ ;; m68000-sun) os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 ;; m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1589,9 +1509,6 @@ mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;; @@ -1610,7 +1527,7 @@ *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) diff -Nru sumo-0.21.0+dfsg/configure sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/configure --- sumo-0.21.0+dfsg/configure 2014-06-11 22:03:54.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/configure 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sumo 0.21.0. +# Generated by GNU Autoconf 2.69 for sumo 0.23.0. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='sumo' PACKAGE_TARNAME='sumo' -PACKAGE_VERSION='0.21.0' -PACKAGE_STRING='sumo 0.21.0' +PACKAGE_VERSION='0.23.0' +PACKAGE_STRING='sumo 0.23.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -642,7 +642,8 @@ PYTHON_LIBS WITH_GTEST_FALSE WITH_GTEST_TRUE -LIB_GTEST +GTEST_LDFLAGS +GTEST_CONFIG WITH_GUI_FALSE WITH_GUI_TRUE FOX_LDFLAGS @@ -815,7 +816,7 @@ with_proj_includes with_gdal_config with_fox_config -with_gtest +with_gtest_config with_python ' ac_precious_vars='build_alias @@ -1376,7 +1377,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.21.0 to adapt to many kinds of systems. +\`configure' configures sumo 0.23.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1447,7 +1448,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sumo 0.21.0:";; + short | recursive ) echo "Configuration of sumo 0.23.0:";; esac cat <<\_ACEOF @@ -1502,9 +1503,9 @@ where the PROJ includes are (overrides previous settings). --with-gdal-config=FILE specify an alternative gdal-config file - --with-fox-config=FILE specify an alternative fox-config file - --with-gtest=DIR where googletest is installed (libraries in DIR/lib, - headers in DIR/include). + --with-fox-config=FILE specify an alternative fox-config executable + --with-gtest-config=FILE + specify an alternative gtest-config. --with-python enable python scripting. Some influential environment variables: @@ -1594,7 +1595,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sumo configure 0.21.0 +sumo configure 0.23.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1990,12 +1991,12 @@ } # ac_fn_cxx_try_link -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- +# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. -ac_fn_c_check_header_mongrel () +ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : @@ -2016,7 +2017,7 @@ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no @@ -2032,7 +2033,7 @@ /* end confdefs.h. */ #include <$2> _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no @@ -2042,7 +2043,7 @@ $as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} @@ -2075,13 +2076,13 @@ fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_header_mongrel +} # ac_fn_cxx_check_header_mongrel -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- +# ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES +# --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. -ac_fn_c_check_type () +ac_fn_cxx_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 @@ -2102,7 +2103,7 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -2115,7 +2116,7 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : else eval "$3=yes" @@ -2129,12 +2130,121 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_type +} # ac_fn_cxx_check_type + +# ac_fn_cxx_check_func LINENO FUNC VAR +# ------------------------------------ +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_cxx_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_func + +# ac_fn_cxx_try_run LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_cxx_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +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_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { 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_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_run cat >config.log <<_ACEOF 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.21.0, which was +It was created by sumo $as_me 0.23.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3113,7 +3223,7 @@ # Define the identity of the package. PACKAGE='sumo' - VERSION='0.21.0' + VERSION='0.23.0' cat >>confdefs.h <<_ACEOF @@ -3281,7 +3391,18 @@ +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 x$CXX = xclang++; then + CXXFLAGS="-msse2 $CXXFLAGS" +else + CXXFLAGS="-msse2 -mfpmath=sse $CXXFLAGS" +fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; @@ -4095,11 +4216,11 @@ 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 +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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -4423,11 +4544,11 @@ 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 +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 ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -4680,11 +4801,11 @@ 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 +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 depcc="$CXX" am_compiler_list= @@ -6589,7 +6710,7 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_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 @@ -7212,6 +7333,7 @@ + # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; @@ -8307,7 +8429,6 @@ - func_stripname_cnf () { case ${2} in @@ -12290,11 +12411,11 @@ 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 +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 CC="$lt_save_CC" @@ -12428,11 +12549,11 @@ 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 +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 else _lt_caught_CXX_error=yes @@ -15480,11 +15601,11 @@ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes -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 +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 @@ -15515,6 +15636,13 @@ enableval=$enable_memcheck; fi +if test x$enable_memcheck = xyes; then + if test x$CXX = xclang++; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-memcheck does not work with clang yet" >&5 +$as_echo "$as_me: WARNING: --enable-memcheck does not work with clang yet" >&2;} + enable_memcheck="no" + fi +fi if test x$enable_memcheck = xyes; then CHECK_MEMORY_LEAKS_TRUE= CHECK_MEMORY_LEAKS_FALSE='#' @@ -15795,7 +15923,7 @@ fi - if test -d $srcdir/src/internal; then + if test -d $srcdir/src/mesosim; then INTERNAL_TRUE= INTERNAL_FALSE='#' else @@ -15908,7 +16036,7 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" @@ -15950,7 +16078,7 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" @@ -15983,7 +16111,8 @@ if test x"$with_xerces_includes" = x; then CPPFLAGS="$CPPFLAGS -I/usr/local/include -I/usr/include" export CPPFLAGS - ac_fn_c_check_header_mongrel "$LINENO" "xercesc/util/XercesVersion.hpp" "ac_cv_header_xercesc_util_XercesVersion_hpp" "$ac_includes_default" + +ac_fn_cxx_check_header_mongrel "$LINENO" "xercesc/util/XercesVersion.hpp" "ac_cv_header_xercesc_util_XercesVersion_hpp" "$ac_includes_default" if test "x$ac_cv_header_xercesc_util_XercesVersion_hpp" = xyes; then : AM_CPPFLAGS="$CPPFLAGS $AM_CPPFLAGS" else @@ -15994,7 +16123,7 @@ else CPPFLAGS="-I$with_xerces_includes" export CPPFLAGS - ac_fn_c_check_header_mongrel "$LINENO" "xercesc/util/XercesVersion.hpp" "ac_cv_header_xercesc_util_XercesVersion_hpp" "$ac_includes_default" + ac_fn_cxx_check_header_mongrel "$LINENO" "xercesc/util/XercesVersion.hpp" "ac_cv_header_xercesc_util_XercesVersion_hpp" "$ac_includes_default" if test "x$ac_cv_header_xercesc_util_XercesVersion_hpp" = xyes; then : AM_CPPFLAGS="$CPPFLAGS $AM_CPPFLAGS" else @@ -16053,7 +16182,7 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_proj_main=yes else ac_cv_lib_proj_main=no @@ -16094,7 +16223,7 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_proj_main=yes else ac_cv_lib_proj_main=no @@ -16122,7 +16251,7 @@ fi if test x"$with_proj_includes" = x; then - ac_fn_c_check_header_mongrel "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default" + ac_fn_cxx_check_header_mongrel "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default" if test "x$ac_cv_header_proj_api_h" = xyes; then : with_proj_includes=yes else @@ -16135,7 +16264,7 @@ save_cppflags=$CPPFLAGS CPPFLAGS="-I$with_proj_includes" export CPPFLAGS - ac_fn_c_check_header_mongrel "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default" + ac_fn_cxx_check_header_mongrel "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default" if test "x$ac_cv_header_proj_api_h" = xyes; then : AM_CPPFLAGS="$CPPFLAGS $AM_CPPFLAGS" else @@ -16229,7 +16358,7 @@ save_cppflags=$CPPFLAGS CPPFLAGS="$GDAL_CFLAGS" export CPPFLAGS - ac_fn_c_check_header_mongrel "$LINENO" "ogr_api.h" "ac_cv_header_ogr_api_h" "$ac_includes_default" + ac_fn_cxx_check_header_mongrel "$LINENO" "ogr_api.h" "ac_cv_header_ogr_api_h" "$ac_includes_default" if test "x$ac_cv_header_ogr_api_h" = xyes; then : AM_CPPFLAGS="$CPPFLAGS $AM_CPPFLAGS" else @@ -16299,8 +16428,8 @@ if test -z $FOX_CONFIG; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find fox-config from libgdal within the current path. Specify path with option --with-fox-config." >&5 -$as_echo "$as_me: WARNING: could not find fox-config from libgdal within the current path. Specify path with option --with-fox-config." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find fox-config from libfox within the current path. Specify path with option --with-fox-config." >&5 +$as_echo "$as_me: WARNING: could not find fox-config from libfox within the current path. Specify path with option --with-fox-config." >&2;} fi else if test -f $FOX_CONFIG; then @@ -16321,7 +16450,7 @@ save_cppflags=$CPPFLAGS CPPFLAGS="$FOX_CFLAGS" export CPPFLAGS - ac_fn_c_check_header_mongrel "$LINENO" "fxver.h" "ac_cv_header_fxver_h" "$ac_includes_default" + ac_fn_cxx_check_header_mongrel "$LINENO" "fxver.h" "ac_cv_header_fxver_h" "$ac_includes_default" if test "x$ac_cv_header_fxver_h" = xyes; then : AM_CPPFLAGS="$CPPFLAGS $AM_CPPFLAGS" else @@ -16330,6 +16459,9 @@ CPPFLAGS=$save_cppflags + +$as_echo "#define HAVE_FOX 1" >>confdefs.h + ac_enabled="$ac_enabled GUI" fi else @@ -16346,20 +16478,89 @@ -# Check whether --with-gtest was given. -if test "${with_gtest+set}" = set; then : - withval=$with_gtest; +# Check whether --with-gtest-config was given. +if test "${with_gtest_config+set}" = set; then : + withval=$with_gtest_config; GTEST_CONFIG="$withval" +else + GTEST_CONFIG="" fi -if test x"$with_gtest" == x; then - with_gtest=no +if test x"$with_gtest_config" != xno; then + if test -z $GTEST_CONFIG; then + # Extract the first word of "gtest-config", so it can be a program name with args. +set dummy gtest-config; 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_path_GTEST_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GTEST_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTEST_CONFIG="$GTEST_CONFIG" # Let the user override the test with a path. + ;; + *) + 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GTEST_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $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 + + ;; +esac fi -if test x"$with_gtest" != xno; then - LIB_GTEST="$with_gtest/lib/libgtest.a" +GTEST_CONFIG=$ac_cv_path_GTEST_CONFIG +if test -n "$GTEST_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTEST_CONFIG" >&5 +$as_echo "$GTEST_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + - AM_CPPFLAGS="-I$with_gtest/include $AM_CPPFLAGS" + else + if test -f $GTEST_CONFIG; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using user-specified gtest-config file: $GTEST_CONFIG" >&5 +$as_echo "Using user-specified gtest-config file: $GTEST_CONFIG" >&6; } + else + as_fn_error $? "the user-specified gtest-config file $GTEST_CONFIG does not exist" "$LINENO" 5 + fi + fi + + if test -z $GTEST_CONFIG; then + ac_disabled="$ac_disabled UnitTests" + else + GTEST_CFLAGS="`$GTEST_CONFIG --cxxflags`" + GTEST_LDFLAGS="`$GTEST_CONFIG --libs`" + + + save_cppflags=$CPPFLAGS + CPPFLAGS="$GTEST_CFLAGS" + export CPPFLAGS + ac_fn_cxx_check_header_mongrel "$LINENO" "gtest/gtest.h" "ac_cv_header_gtest_gtest_h" "$ac_includes_default" +if test "x$ac_cv_header_gtest_gtest_h" = xyes; then : + AM_CPPFLAGS="$CPPFLAGS $AM_CPPFLAGS" +else + as_fn_error $? "gtest-includes not found." "$LINENO" 5 fi - if test x"$with_gtest" != xno; then + + + CPPFLAGS=$save_cppflags + ac_enabled="$ac_enabled UnitTests" + fi +else + ac_disabled="$ac_disabled UnitTests" +fi + if test x"$GTEST_CONFIG" != x && test x"$with_gtest_config" != xno; then WITH_GTEST_TRUE= WITH_GTEST_FALSE='#' else @@ -16367,11 +16568,6 @@ WITH_GTEST_FALSE= fi -if test x"$with_gtest" != xno; then - ac_enabled="$ac_enabled UnitTests" -else - ac_disabled="$ac_disabled UnitTests" -fi @@ -16390,7 +16586,7 @@ PYTHON_INCLUDES=`python -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('INCLUDEPY')"` CPPFLAGS="$CPPFLAGS -I$PYTHON_INCLUDES" export CPPFLAGS - ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default" + ac_fn_cxx_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default" if test "x$ac_cv_header_Python_h" = xyes; then : AM_CPPFLAGS="$CPPFLAGS $AM_CPPFLAGS" else @@ -16418,12 +16614,12 @@ fi if test -d src/osgview; then - ac_fn_c_check_header_mongrel "$LINENO" "osg/Config" "ac_cv_header_osg_Config" "$ac_includes_default" + ac_fn_cxx_check_header_mongrel "$LINENO" "osg/Config" "ac_cv_header_osg_Config" "$ac_includes_default" if test "x$ac_cv_header_osg_Config" = xyes; then : $as_echo "#define HAVE_OSG 1" >>confdefs.h - OSG_LIBS="-losg -losgGA -losgViewer -losgUtil -losgDB -lOpenThreads" + OSG_LIBS="-losg -losgGA -losgViewer -losgUtil -losgDB -lOpenThreads -losgText" ac_enabled="$ac_enabled OSG" else ac_disabled="$ac_disabled OSG" @@ -16437,7 +16633,7 @@ -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else @@ -16467,7 +16663,7 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_working_alloca_h=yes else ac_cv_working_alloca_h=no @@ -16520,7 +16716,7 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_func_alloca_works=yes else ac_cv_func_alloca_works=no @@ -16574,7 +16770,7 @@ if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF @@ -16615,7 +16811,7 @@ return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_c_stack_direction=1 else ac_cv_c_stack_direction=-1 @@ -16654,7 +16850,7 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no @@ -16727,7 +16923,7 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_header_stdc=no @@ -16749,7 +16945,7 @@ for ac_header in float.h limits.h malloc.h math.h stddef.h stdlib.h string.h sys/time.h unistd.h wchar.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +ac_fn_cxx_check_header_mongrel "$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 @@ -16827,7 +17023,7 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no @@ -16836,7 +17032,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } - ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" + ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF @@ -16919,7 +17115,7 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no @@ -16950,7 +17146,7 @@ #endif _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -16976,7 +17172,7 @@ ;; esac -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else @@ -17007,7 +17203,7 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no @@ -17042,7 +17238,7 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h @@ -17076,7 +17272,7 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_volatile=yes else ac_cv_c_volatile=no @@ -17108,7 +17304,7 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_error_at_line=yes else ac_cv_lib_error_at_line=no @@ -17129,7 +17325,7 @@ for ac_header in stdlib.h do : - ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" + ac_fn_cxx_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 @@ -17163,7 +17359,7 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no @@ -17197,7 +17393,7 @@ for ac_header in sys/select.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +ac_fn_cxx_check_header_mongrel "$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 @@ -17235,7 +17431,7 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -17287,7 +17483,7 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void @@ -17328,7 +17524,7 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_lstat_dereferences_slashed_symlink=yes else ac_cv_func_lstat_dereferences_slashed_symlink=no @@ -17384,7 +17580,7 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_stat_empty_string_bug=no else ac_cv_func_stat_empty_string_bug=yes @@ -17413,7 +17609,7 @@ for ac_func in floor getcwd gettimeofday memset pow select socket sqrt do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -17424,7 +17620,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/tools/Makefile src/traci_testclient/Makefile src/traci-server/Makefile src/utils/Makefile src/utils/common/Makefile src/utils/distribution/Makefile src/utils/emissions/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/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/lcmodels/Makefile src/microsim/logging/Makefile src/microsim/output/Makefile src/microsim/pedestrians/Makefile src/microsim/traffic_lights/Makefile src/microsim/trigger/Makefile src/marouter/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/od/Makefile src/polyconvert/Makefile src/router/Makefile src/dfrouter/Makefile src/duarouter/Makefile src/jtrrouter/Makefile src/tools/Makefile src/traci_testclient/Makefile src/traci-server/Makefile src/utils/Makefile src/utils/common/Makefile src/utils/distribution/Makefile src/utils/emissions/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/vehicle/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/foxtools/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 @@ -17988,7 +18184,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.21.0, which was +This file was extended by sumo $as_me 0.23.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18054,7 +18250,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.21.0 +sumo config.status 0.23.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -18581,10 +18777,13 @@ "src/microsim/actions/Makefile") CONFIG_FILES="$CONFIG_FILES src/microsim/actions/Makefile" ;; "src/microsim/cfmodels/Makefile") CONFIG_FILES="$CONFIG_FILES src/microsim/cfmodels/Makefile" ;; "src/microsim/devices/Makefile") CONFIG_FILES="$CONFIG_FILES src/microsim/devices/Makefile" ;; + "src/microsim/lcmodels/Makefile") CONFIG_FILES="$CONFIG_FILES src/microsim/lcmodels/Makefile" ;; "src/microsim/logging/Makefile") CONFIG_FILES="$CONFIG_FILES src/microsim/logging/Makefile" ;; "src/microsim/output/Makefile") CONFIG_FILES="$CONFIG_FILES src/microsim/output/Makefile" ;; + "src/microsim/pedestrians/Makefile") CONFIG_FILES="$CONFIG_FILES src/microsim/pedestrians/Makefile" ;; "src/microsim/traffic_lights/Makefile") CONFIG_FILES="$CONFIG_FILES src/microsim/traffic_lights/Makefile" ;; "src/microsim/trigger/Makefile") CONFIG_FILES="$CONFIG_FILES src/microsim/trigger/Makefile" ;; + "src/marouter/Makefile") CONFIG_FILES="$CONFIG_FILES src/marouter/Makefile" ;; "src/netbuild/Makefile") CONFIG_FILES="$CONFIG_FILES src/netbuild/Makefile" ;; "src/netgen/Makefile") CONFIG_FILES="$CONFIG_FILES src/netgen/Makefile" ;; "src/netimport/Makefile") CONFIG_FILES="$CONFIG_FILES src/netimport/Makefile" ;; @@ -18593,7 +18792,7 @@ "src/netimport/vissim/typeloader/Makefile") CONFIG_FILES="$CONFIG_FILES src/netimport/vissim/typeloader/Makefile" ;; "src/netload/Makefile") CONFIG_FILES="$CONFIG_FILES src/netload/Makefile" ;; "src/netwrite/Makefile") CONFIG_FILES="$CONFIG_FILES src/netwrite/Makefile" ;; - "src/od2trips/Makefile") CONFIG_FILES="$CONFIG_FILES src/od2trips/Makefile" ;; + "src/od/Makefile") CONFIG_FILES="$CONFIG_FILES src/od/Makefile" ;; "src/polyconvert/Makefile") CONFIG_FILES="$CONFIG_FILES src/polyconvert/Makefile" ;; "src/router/Makefile") CONFIG_FILES="$CONFIG_FILES src/router/Makefile" ;; "src/dfrouter/Makefile") CONFIG_FILES="$CONFIG_FILES src/dfrouter/Makefile" ;; @@ -18621,6 +18820,7 @@ "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/vehicle/Makefile") CONFIG_FILES="$CONFIG_FILES src/utils/vehicle/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" ;; @@ -18628,6 +18828,7 @@ "unittest/src/netbuild/Makefile") CONFIG_FILES="$CONFIG_FILES unittest/src/netbuild/Makefile" ;; "unittest/src/utils/Makefile") CONFIG_FILES="$CONFIG_FILES unittest/src/utils/Makefile" ;; "unittest/src/utils/common/Makefile") CONFIG_FILES="$CONFIG_FILES unittest/src/utils/common/Makefile" ;; + "unittest/src/utils/foxtools/Makefile") CONFIG_FILES="$CONFIG_FILES unittest/src/utils/foxtools/Makefile" ;; "unittest/src/utils/geom/Makefile") CONFIG_FILES="$CONFIG_FILES unittest/src/utils/geom/Makefile" ;; "unittest/src/utils/iodevices/Makefile") CONFIG_FILES="$CONFIG_FILES unittest/src/utils/iodevices/Makefile" ;; "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; diff -Nru sumo-0.21.0+dfsg/configure.ac sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/configure.ac --- sumo-0.21.0+dfsg/configure.ac 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/configure.ac 2015-04-17 05:44:23.000000000 +0000 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(sumo, 0.21.0) +AC_INIT(sumo, 0.23.0) AC_CONFIG_SRCDIR(src/sumo_main.cpp) AC_CANONICAL_SYSTEM @@ -9,9 +9,15 @@ dnl enable automake-support AM_INIT_AUTOMAKE([gnu dist-zip tar-ustar]) +AC_LANG([C++]) dnl the debug check has to be made before the program checks dnl because it modifies CXXFLAGS +if test x$CXX = xclang++; then + CXXFLAGS="-msse2 $CXXFLAGS" +else + CXXFLAGS="-msse2 -mfpmath=sse $CXXFLAGS" +fi AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],[enable sumo debugging code [default=no].])]) if test x$enable_debug = xyes; then AC_DEFINE(_DEBUG, 1, [Define to 1 in order to enable sumo debugging code.]) @@ -48,6 +54,12 @@ dnl Check for enable-features that shall go into config.h AC_ARG_ENABLE([memcheck], [AS_HELP_STRING([--enable-memcheck],[enable compilation of memory leak checks [default=no].])]) +if test x$enable_memcheck = xyes; then + if test x$CXX = xclang++; then + AC_MSG_WARN([--enable-memcheck does not work with clang yet]) + enable_memcheck="no" + fi +fi AM_CONDITIONAL(CHECK_MEMORY_LEAKS, test x$enable_memcheck = xyes) if test x$enable_memcheck = xyes; then AC_DEFINE(CHECK_MEMORY_LEAKS, 1, [Define to 1 in order to enable memory checks.]) @@ -94,19 +106,17 @@ [AC_DEFINE([XERCES3_SIZE_t],[unsigned int],[Define length for Xerces 2.])]) -AM_CONDITIONAL(INTERNAL, test -d $srcdir/src/internal) -m4_syscmd([test -d src/internal]) +AM_CONDITIONAL(INTERNAL, test -d $srcdir/src/mesosim) +m4_syscmd([test -d src/mesosim]) m4_if(m4_sysval,[0],[ 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]) - INTERNAL_DIRS="mesosim marouter internal" + AC_CONFIG_FILES([src/mesogui/Makefile src/mesosim/Makefile src/netedit/Makefile src/osgview/Makefile]) + INTERNAL_DIRS="mesosim" 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 Internal" - program_transform_name="s,\$\$,Int,; s,sumoInt,meso,; s,sumo-guiInt,meso-gui,; s,marouterInt,marouter,; s,neteditInt,netedit,; $program_transform_name" + program_transform_name="s,\$\$,Int,; s,sumoInt,meso,; s,sumo-guiInt,meso-gui,; s,neteditInt,netedit,; $program_transform_name" ]) AC_ARG_ENABLE([traci],[AS_HELP_STRING([--disable-traci],[disable Traffic Control Interface (TraCI) Server [default=no].])]) @@ -286,13 +296,13 @@ dnl - - - - - - - - - - - - - - - - - - - - - - - dnl ... for fox AC_ARG_WITH([fox-config], - [AS_HELP_STRING([--with-fox-config=FILE], [specify an alternative fox-config file])], + [AS_HELP_STRING([--with-fox-config=FILE], [specify an alternative fox-config executable])], [FOX_CONFIG="$withval"], [FOX_CONFIG=""]) if test x"$with_fox_config" != xno; then if test -z $FOX_CONFIG; then AC_PATH_PROG([FOX_CONFIG], [fox-config]) if test -z $FOX_CONFIG; then - AC_MSG_WARN([could not find fox-config from libgdal within the current path. Specify path with option --with-fox-config.]) + AC_MSG_WARN([could not find fox-config from libfox within the current path. Specify path with option --with-fox-config.]) fi else if test -f $FOX_CONFIG; then @@ -315,6 +325,7 @@ AC_CHECK_HEADER([fxver.h], [AM_CPPFLAGS="$CPPFLAGS $AM_CPPFLAGS"], [AC_MSG_ERROR([fox-includes not found.])]) CPPFLAGS=$save_cppflags + AC_DEFINE([HAVE_FOX], [1], [defined if FOX is available]) ac_enabled="$ac_enabled GUI" fi else @@ -325,21 +336,38 @@ dnl - - - - - - - - - - - - - - - - - - - - - - - dnl ... for gtest -AC_ARG_WITH([gtest], [AS_HELP_STRING([--with-gtest=DIR],[where googletest is installed (libraries in DIR/lib, headers in DIR/include).])]) -if test x"$with_gtest" == x; then - with_gtest=no -fi -if test x"$with_gtest" != xno; then - LIB_GTEST="$with_gtest/lib/libgtest.a" - AC_SUBST(LIB_GTEST) - AM_CPPFLAGS="-I$with_gtest/include $AM_CPPFLAGS" -fi -AM_CONDITIONAL([WITH_GTEST], [test x"$with_gtest" != xno]) -if test x"$with_gtest" != xno; then - ac_enabled="$ac_enabled UnitTests" +AC_ARG_WITH([gtest-config], [AS_HELP_STRING([--with-gtest-config=FILE], [specify an alternative gtest-config.])], + [GTEST_CONFIG="$withval"], [GTEST_CONFIG=""]) +if test x"$with_gtest_config" != xno; then + if test -z $GTEST_CONFIG; then + AC_PATH_PROG([GTEST_CONFIG], [gtest-config]) + else + if test -f $GTEST_CONFIG; then + AC_MSG_RESULT([Using user-specified gtest-config file: $GTEST_CONFIG]) + else + AC_MSG_ERROR([the user-specified gtest-config file $GTEST_CONFIG does not exist]) + fi + fi + + if test -z $GTEST_CONFIG; then + ac_disabled="$ac_disabled UnitTests" + else + GTEST_CFLAGS="`$GTEST_CONFIG --cxxflags`" + GTEST_LDFLAGS="`$GTEST_CONFIG --libs`" + AC_SUBST([GTEST_LDFLAGS]) + + save_cppflags=$CPPFLAGS + CPPFLAGS="$GTEST_CFLAGS" + export CPPFLAGS + AC_CHECK_HEADER([gtest/gtest.h], [AM_CPPFLAGS="$CPPFLAGS $AM_CPPFLAGS"], + [AC_MSG_ERROR([gtest-includes not found.])]) + CPPFLAGS=$save_cppflags + ac_enabled="$ac_enabled UnitTests" + fi else ac_disabled="$ac_disabled UnitTests" fi +AM_CONDITIONAL([WITH_GTEST], [test x"$GTEST_CONFIG" != x && test x"$with_gtest_config" != xno]) dnl - - - - - - - - - - - - - - - - - - - - - - - @@ -370,7 +398,7 @@ if test -d src/osgview; then AC_CHECK_HEADER([osg/Config], [AC_DEFINE([HAVE_OSG], [1], [defined if osg is available]) - OSG_LIBS="-losg -losgGA -losgViewer -losgUtil -losgDB -lOpenThreads" AC_SUBST(OSG_LIBS) + OSG_LIBS="-losg -losgGA -losgViewer -losgUtil -losgDB -lOpenThreads -losgText" AC_SUBST(OSG_LIBS) ac_enabled="$ac_enabled OSG"], [ac_disabled="$ac_disabled OSG"]) fi @@ -414,7 +442,6 @@ 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 @@ -428,10 +455,13 @@ src/microsim/actions/Makefile src/microsim/cfmodels/Makefile src/microsim/devices/Makefile +src/microsim/lcmodels/Makefile src/microsim/logging/Makefile src/microsim/output/Makefile +src/microsim/pedestrians/Makefile src/microsim/traffic_lights/Makefile src/microsim/trigger/Makefile +src/marouter/Makefile src/netbuild/Makefile src/netgen/Makefile src/netimport/Makefile @@ -440,7 +470,7 @@ src/netimport/vissim/typeloader/Makefile src/netload/Makefile src/netwrite/Makefile -src/od2trips/Makefile +src/od/Makefile src/polyconvert/Makefile src/router/Makefile src/dfrouter/Makefile @@ -468,6 +498,7 @@ src/utils/options/Makefile src/utils/shapes/Makefile src/utils/traci/Makefile +src/utils/vehicle/Makefile src/utils/xml/Makefile unittest/Makefile unittest/src/Makefile @@ -475,6 +506,7 @@ unittest/src/netbuild/Makefile unittest/src/utils/Makefile unittest/src/utils/common/Makefile +unittest/src/utils/foxtools/Makefile unittest/src/utils/geom/Makefile unittest/src/utils/iodevices/Makefile bin/Makefile diff -Nru sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_D_EU4.csv sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_D_EU4.csv --- sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_D_EU4.csv 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_D_EU4.csv 2015-04-17 05:44:20.000000000 +0000 @@ -1,33 +1,35 @@ -cp_norm,NOx,HC,CO,PM,PN,NO -c[-],[g/h],[g/h],[g/h],[g/h],[g/h],[g/h] --1.5,1.25298178355482,0.0723744009800665,0,0.0345888101295681,101926446843854,0.791264814784053 --1.25,1.62428562142857,0.0997062535714286,0.210354903571429,0.108423663785714,156928357142857,0.959953442857143 --1,1.99558945930233,0.127038106162791,0.443609837209302,0.182258517441861,211930267441860,1.12864207093023 --0.75,3.73958317857143,0.216759771785714,0.9437594875,0.315450929285714,378197321428571,2.11284728571429 --0.5,6.7320394375,0.338277266666667,1.04381325,0.457500085729167,613142083333333,3.83647446875 --0.25,9.06480933163265,0.406372228571429,0.836836714795918,0.518266707959183,702251326530612,5.17662223979592 -0,10.3940027698412,0.346265593650794,0.650448834126986,0.461489657328041,600032698412698,5.89577891798941 -0.25,18.3126344104478,0.552116719651741,1.34607977014925,0.815633077039802,1.1159926119403E+15,10.4515148656717 -0.5,25.7987408920188,0.650540601173709,1.92420126267605,1.09336431941315,1.44409014084507E+15,14.8011372018779 -0.75,36.8819300847458,0.739321211864407,2.31526922485876,1.50550430014124,1.92116892655367E+15,21.3032773728814 -1,53.060060150376,0.753709578947368,3.18363545639098,1.95305214511278,2.45150187969925E+15,30.7774014661654 -1.25,75.3463405172414,0.813434975862068,3.60131793678161,2.27624697885058,2.88893965517241E+15,43.9555122988506 -1.5,89.909355,0.86390655375,2.694837,2.466183735625,3.23176625E+15,52.647611375 -1.75,108.229302058824,0.944799294117647,1.71403205882353,2.86585188529412,3.82746764705882E+15,63.802445 -2,130.142007142857,0.996648885714286,1.66945621428571,3.09279836785714,4.59393571428571E+15,77.0248328571429 -2.25,156.2132,1.08148825,2.29745325,3.037823625,4.9037E+15,92.707035 -2.5,203.507916666667,1.089179125,4.190410375,2.65041680416667,4.23358333333333E+15,118.709300833333 -2.75,250.802633333333,1.09687,6.0833675,2.26300998333333,3.56346666666667E+15,144.711566666667 -3,278.937775,1.22284825,3.152181375,2.717360925,3.9749125E+15,161.9503875 -3.25,284.078257142857,1.33721485714286,2.1323295,3.61263088571429,5.12109285714286E+15,166.278464285714 -3.5,282.8726375,1.498094875,2.13463075,5.447522875,6.3053E+15,167.3941625 -3.75,299.0879,1.591279,2.2330475,6.983426,7.0135E+15,179.0453 -4,303.689241071429,1.7295937202381,2.26738725,8.71865503452381,8.0390380952381E+15,183.672811309524 -4.25,311.1940625,1.85662579166667,2.31774625,10.4040525916667,8.98524166666667E+15,190.056229166667 -4.5,318.698883928571,1.98365786309524,2.36810525,12.0894501488095,9.93144523809524E+15,196.439647023809 -4.75,326.203705357143,2.11068993452381,2.41846425,13.7748477059524,1.08776488095238E+16,202.823064880952 -5,333.708526785714,2.23772200595238,2.46882325,15.4602452630952,1.18238523809524E+16,209.206482738095 -5.25,341.213348214286,2.36475407738095,2.51918225,17.1456428202381,1.2770055952381E+16,215.589900595238 -5.5,348.718169642857,2.49178614880952,2.56954125,18.8310403773809,1.37162595238095E+16,221.973318452381 -5.75,356.222991071428,2.6188182202381,2.61990025,20.5164379345238,1.46624630952381E+16,228.356736309524 -6,363.7278125,2.74585029166667,2.67025925,22.2018354916667,1.56086666666667E+16,234.740154166667 \ No newline at end of file +cp_norm(drive),NOx,HC,CO,PM,PN,NO +[-],[g/h],[g/h],[g/h],[g/h],[#/h],[g/h] +Pdrive (Engine)= 22.11115 +idle,5.955342,0.1406479,0.2413937,0.1616896,1.111105E+14,3.263419 +-1.5,-2.576232,-0.1389703,-0.4065005,-0.2009129,-2.761986E+14,-1.469783 +-1.25,-0.389158,-0.01329479,-0.002300322,-0.02079403,-4.531862E+13,-0.2257273 +-1,1.797917,0.1123807,0.4018998,0.1593248,1.855614E+14,1.018328 +-0.75,3.984991,0.2380562,0.8061,0.3394436,4.164413E+14,2.262383 +-0.5,6.76352,0.3292956,1.062789,0.4497962,5.836751E+14,3.863992 +-0.25,8.32956,0.389348,0.8385231,0.4956411,6.642329E+14,4.735249 +0,12.58213,0.4284569,0.7813259,0.5850523,8.026378E+14,7.191719 +0.25,19.62311,0.5647688,1.416378,0.8449895,1.152981E+15,11.22942 +0.5,27.78785,0.6734931,1.878894,1.178246,1.543017E+15,15.98242 +0.75,40.30426,0.7420521,2.544242,1.590989,2.014126E+15,23.28452 +1,58.02473,0.7680771,3.155005,2.063316,2.589906E+15,33.76013 +1.25,79.04489,0.8196165,2.823195,2.329949,2.995602E+15,46.12777 +1.5,97.38378,0.9033943,1.988912,2.69727,3.524081E+15,57.3409 +1.75,112.9292,0.9568881,1.74368,2.874488,3.961159E+15,66.59665 +2,140.8948,1.026206,2.155553,3.014926,4.624136E+15,83.28246 +2.25,165.7707,1.039235,8.567539,2.731716,4.229687E+15,97.15863 +2.5,227.8597,1.048754,13.83295,2.359693,3.676876E+15,131.9496 +2.75,253.1145,1.164797,3.480716,2.650474,4.510258E+15,147.7743 +3,269.503,1.312524,2.388683,3.925892,5.253795E+15,158.6066 +3.25,278.0219,1.40402,2.06147,4.675897,5.935875E+15,164.2055 +3.5,286.5407,1.495517,1.734256,5.425901,6.617955E+15,169.8044 +3.75,295.0596,1.587013,1.407043,6.175906,7.300035E+15,175.4033 +4,303.5785,1.678509,1.079829,6.925911,7.982115E+15,181.0022 +4.25,312.0973,1.770006,0.7526155,7.675916,8.664195E+15,186.601 +4.5,320.6162,1.861502,0.4254019,8.42592,9.346275E+15,192.1999 +4.75,329.135,1.952998,0.0981884,9.175925,1.002836E+16,197.7988 +5,337.6539,2.044495,-0.2290251,9.92593,1.071044E+16,203.3977 +5.25,346.1728,2.135991,-0.5562387,10.67593,1.139252E+16,208.9965 +5.5,354.6916,2.227487,-0.8834522,11.42594,1.20746E+16,214.5954 +5.75,363.2105,2.318983,-1.210666,12.17594,1.275668E+16,220.1943 +6,371.7293,2.41048,-1.537879,12.92595,1.343876E+16,225.7932 diff -Nru sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_D_EU4.dec.csv sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_D_EU4.dec.csv --- sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_D_EU4.dec.csv 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_D_EU4.dec.csv 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,31 @@ +v,decel_coast +[km/h],[m/s²] +10,-0.3525988 +15,-0.3821267 +20,-0.3977517 +25,-0.3907145 +30,-0.3716978 +35,-0.3561859 +40,-0.3349187 +45,-0.3182591 +50,-0.3246279 +55,-0.3301134 +60,-0.3352075 +65,-0.340262 +70,-0.3460579 +75,-0.3577655 +80,-0.3707729 +85,-0.3842998 +90,-0.3984441 +95,-0.4138175 +100,-0.4333191 +105,-0.4537386 +110,-0.4751647 +115,-0.4976779 +120,-0.5213535 +125,-0.5509461 +130,-0.5839656 +135,-0.6183105 +140,-0.6539034 +145,-0.6920814 +150,-0.7326561 diff -Nru sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_D_EU4_FC.csv sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_D_EU4_FC.csv --- sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_D_EU4_FC.csv 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_D_EU4_FC.csv 2015-04-17 05:44:20.000000000 +0000 @@ -1,27 +1,17 @@ -cp_norm,FC -[-],[g/h] --0.2,281.634390517241 --0.15,588.568510344828 --0.1,952.624854081632 --0.05,1313.362928 -0,1304.71881029411 -0.05,2308.65211040462 -0.1,2964.06562953367 -0.15,3937.05530701755 -0.2,4772.18831521739 -0.25,5876.22674752476 -0.3,6776.02131666667 -0.35,7718.98551851852 -0.4,8541.33866666667 -0.45,9499.84375 -0.5,10082.6741666667 -0.55,10827.3645833333 -0.6,11572.055 -0.65,11933.17 -0.7,13088.595 -0.75,13891.1725 -0.8,14691.435 -0.85,15493.2408333333 -0.9,16294.6608333333 -0.95,17096.0808333333 -1,17897.5008333333 \ No newline at end of file +cp_norm(rated),FC +[-],[g/h/kWrated] +Pdrive (Engine)= 22.11115 +idle,6.225251 +-0.2,3.857434 +-0.1,10.89407 +0,18.83705 +0.1,32.91733 +0.2,51.09933 +0.3,72.51001 +0.4,90.11015 +0.5,107.4671 +0.6,124.532 +0.7,140.9465 +0.8000001,157.361 +0.9000001,173.7755 +1,190.19 diff -Nru sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_D_EU4.PHEMLight.veh sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_D_EU4.PHEMLight.veh --- sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_D_EU4.PHEMLight.veh 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_D_EU4.PHEMLight.veh 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,134 @@ +c PHEMLight Vehicle Input filefc (based on PHEM .veh file format) +c PHEM 11.6.2 +c 10.10.2014 11:59:25 +c Vehicle mass [kg] +1500 +c Vehicle loading [kg] +50 +c Cd value [-] +0.3113 +c Cross sectional area [m^2] +2.16 +c Delta [-] (not supported since Version 10.7) +0 +c Engine rotational inertia [kg*m^2] +0.5234 +c Wheels equivalent rotational inertia [kg] (= I_wheel/rdyn^2) +41.3424 +c Gearbox rotational inertia [kg*m^2] +0.06046 +c Auxiliaries base power demand (normalized) [-] +0 +c Engine rated power [kW] +93 +c Engine rated speed [rpm] +4073 +c Engine idling speed [rpm] +816 +c --- +0 +c Rolling resistance coefficients +c Fr0 +0.009 +c Fr1 +5E-05 +c Fr2 +0 +c Fr3 +0 +c Fr4 +1.6E-09 +c --- +0 +c Transmission loss factor +0.3 +c Transmission +c Axle ratio [-] +3.7284, +c Wheel effective diameter [m] +0.6264 +c Transmission gears: Ratio [-], path to efficiency map filefc (optional) +c Gear 1 +3.7079, +c Gear 2 +2.0237, +c Gear 3 +1.2784, +c Gear 4 +0.9359, +c Gear 5 +0.7414, +c Gear 6 +0.6162, +c Gear 7 +0, +c Gear 8 +0, +c Gear 9 +0, +c Gear 10 +0, +c Gear 11 +0, +c Gear 12 +0, +c Gear 13 +0, +c Gear 14 +0, +c Gear 15 +0, +c Gear 16 +0, +c Gear shift behaviour: +c Gearshift model (Version fast driver) +c shift up at ratio rpm/rated rpm in actual gear greater than +0.7840928 +c shift down when rpm/rated rpm in lower gear is higher than +0.6081684 +c Gearshift model (Version economic driver) +c shift up at ratio rpm/rated rpm in higher gear greater than +0.5601891 +c Shift down when ratio rpm/rated rpm in actual gear is lower than +0.5202062 +c Share of version economic driver (0 to 1) +0 +c Share of version mixed model (0 to 1) +1 +cVehiclemasstypeforPHEMlight +LV +cFueltypeforPHEMlight +D +c P_n_max_v0 +5 +c P_n_max_p0 +0.13 +c P_n_max_v1 +26 +c P_n_max_p1 +0.75 +c vehicle speed [km/h] (converted to m/s after read-in), gear ratio [-], rotational mass factor [-] +0,3.7079,1.67 +10.53695,3.7079,1.67 +28.99677,2.0237,1.2 +43.68127,1.2784,1.08 +69.56696,0.9359,1.05 +94.3671,0.7414,1.03 +121.0647,0.6162,1.02 +250,0.6162,1.02 +c n_norm, pe_drag _norm +0,-0.015 +0.002,-0.015 +0.05,-0.017 +0.1,-0.02 +0.2,-0.028 +0.3,-0.039 +0.4,-0.05 +0.5,-0.063 +0.6,-0.078 +0.7,-0.098 +0.8,-0.121 +0.9,-0.145 +1,-0.169 +1.1,-0.198 +1.2,-0.232 diff -Nru sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_D_EU4.veh sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_D_EU4.veh --- sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_D_EU4.veh 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_D_EU4.veh 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -cPHEMVehicleInputFile, -cEuro4Diesel, -cAveragevehicle, -cHBEFAv3.2, -c, -cVehiclemass[kg], -1500, -cVehicleloading[kg], -50, -cCdvalue[-], -0.3113, -cCrosssectionalarea[m^2], -2.16, -cDelta[-], -0, -cEnginerotationalinertia[kg*m^2], -0.5234, -cWheelsequivalentrotationalinertia[kg](=I_wheel/rdyn^2), -41.3424, -cGearboxrotationalinertia[kg*m^2], -0.06046, -cAuxiliariesbasepowerdemand(normalized)[-], -0, -cEngineratedpower[kW], -93, -cEngineratedspeed[rpm], -4073, -cEngineidlingspeed[rpm], -816, -c---, -0, -cRollingresistancecoefficients, -cFr0, -0.009, -cFr1, -0.00005, -cFr2, -0, -cFr3, -0, -cFr4, -1.60E-09, -c---, -0, -cTransmissionlossfactor(standardPC:0.3), -0.3, -cTransmission, -cAxleratio[-], -3.7284, -cWheeleffectivediameter[m], -0.6264, -cTransmissiongears:Ratio[-], -cGear1, -3.7079, -cGear2, -2.0237, -cGear3, -1.2784, -cGear4, -0.9359, -cGear5, -0.7414, -cGear6, -0.6162, -cGear7, -0, -cGear8, -0, -cGear9, -0, -cGear10, -0, -cGear11, -0, -cGear12, -0, -cGear13, -0, -cGear14, -0, -cGear15, -0, -cGear16, -0, -cGearshiftbehaviour:, -cGearshiftmodel(Versionfastdriver), -cshiftupatratiorpm/ratedrpminactualgeargreaterthan, -0.73, -cshiftdownwhenrpm/ratedrpminlowergearishigherthan, -0.51, -cGearshiftmodel(Versioneconomicdriver), -cshiftupatratiorpm/ratedrpminhighergeargreaterthan, -0.45, -cShiftdownwhenratiorpm/ratedrpminactualgearislowerthan, -0.4, -cShareofversioneconomicdriver(0to1), -0, -cShareofversionmixedmodel(0to1), -1, -cVehiclemasstypeforPHEMlight, -LV, -cFueltypeforPHEMlight, -D, -c P_n_max_v0 -5 -c P_n_max_p0 -0.13 -c P_n_max_v1 -26 -c P_n_max_p1 -0.75 -c Speed Rotational Mass Factor Table in [km/h] converted upon reading in [m/s] -0.0,1.67 -10.6,1.67 -29.6,1.20 -42.6,1.08 -65.4,1.05 -89.0,1.03 -119.8,1.02 -250.0,1.02 \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_G_EU4.csv sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_G_EU4.csv --- sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_G_EU4.csv 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_G_EU4.csv 2015-04-17 05:44:20.000000000 +0000 @@ -1,33 +1,35 @@ -cp_norm,NOx,HC,CO,PM,PN,NO -c[-],[g/h],[g/h],[g/h],[g/h],[g/h],[g/h] --1.5,0.417147201086957,0.0645064963043478,29.2034766521739,0.155686922052174,97522040130434.8,0.396289856956522 --1.25,0.29735215,0.06480991,16.225635,0.08414246,55221095000000,0.28248455 --1,0.177557098913043,0.0651133236956522,3.24779334782609,0.0125979979478261,12920149869565.2,0.168679243043478 --0.75,0.264582355142857,0.0929334152,3.39790699714286,0.00545985420857143,12449012714285.7,0.251353241428571 --0.5,0.545208852083333,0.117782875,4.60118320833333,0.0126939037104167,17190460312500,0.51794840625 --0.25,0.75082243960396,0.157157343960396,6.68652824752475,0.00764910602772278,14286701891089.1,0.713281310891089 -0,0.787291116292136,0.113938778539326,5.47379498876404,0.00879202750000001,10780823101123.6,0.747926544382022 -0.25,1.88337654293194,0.168068014188482,8.46711441884817,0.0132060630198953,19823012910994.8,1.78920774712042 -0.5,2.55442566502463,0.222892233300492,9.98367549753694,0.0224553255062562,27772851477832.5,2.42670438423645 -0.75,3.65235048502994,0.37527371257485,18.2429452275449,0.0843717114251497,55860961137724.6,3.46973294011976 -1,5.65022853543307,0.640153907874016,36.138719023622,0.177120208188976,89099302834645.7,5.36771718897638 -1.25,8.48614546938776,1.18482094285714,90.362963877551,0.322148489081633,126974279795918,8.061838 -1.5,12.3556295714286,1.58226727321429,121.306685178571,0.466455101428571,211330917857143,11.7378482678571 -1.75,14.1961070588235,2.47005558235294,217.172671764706,0.667177129411765,303406852941177,13.4863023529412 -2,16.0733127272727,2.82210063636364,245.9378,1.05268718181818,550091272727273,15.2696490909091 -2.25,19.1372153846154,3.20946238461538,336.717876923077,1.54523869230769,866250869230769,18.1803538461538 -2.5,19.82232,4.92618177777778,609.705488888889,3.27712422222222,1.19567433333333E+15,18.8312033333333 -2.75,24.54561,6.9752126,1123.93826,4.083524,1.2627762E+15,23.318332 -3,25.41823,8.54181533333333,1560.80633333333,3.74934733333333,1.414682E+15,24.14732 -3.25,28.8579633333333,10.4300367925926,2049.25087185185,4.17555496296296,1.51005184444444E+15,27.4150684444444 -3.5,31.6559183333333,12.2378535703704,2524.80129407407,4.41166651851852,1.61955567777778E+15,30.0731267777778 -3.75,34.4538733333333,14.0456703481482,3000.3517162963,4.64777807407407,1.72905951111111E+15,32.7311851111111 -4,37.2518283333333,15.8534871259259,3475.90213851852,4.88388962962963,1.83856334444444E+15,35.3892434444444 -4.25,40.0497833333333,17.6613039037037,3951.45256074074,5.12000118518518,1.94806717777778E+15,38.0473017777778 -4.5,42.8477383333333,19.4691206814815,4427.00298296296,5.35611274074074,2.05757101111111E+15,40.7053601111111 -4.75,45.6456933333333,21.2769374592593,4902.55340518518,5.5922242962963,2.16707484444444E+15,43.3634184444444 -5,48.4436483333333,23.084754237037,5378.10382740741,5.82833585185185,2.27657867777778E+15,46.0214767777778 -5.25,51.2416033333333,24.8925710148148,5853.65424962963,6.06444740740741,2.38608251111111E+15,48.6795351111111 -5.5,54.0395583333333,26.7003877925926,6329.20467185185,6.30055896296296,2.49558634444445E+15,51.3375934444444 -5.75,56.8375133333333,28.5082045703704,6804.75509407407,6.53667051851852,2.60509017777778E+15,53.9956517777778 -6,59.6354683333333,30.3160213481482,7280.3055162963,6.77278207407407,2.71459401111111E+15,56.6537101111111 \ No newline at end of file +cp_norm(drive),NOx,HC,CO,PM,PN,NO +[-],[g/h],[g/h],[g/h],[g/h],[#/h],[g/h] +Pdrive (Engine)= 19.39067 +idle,0.2311569,0.06580319,1.57672,0.0005531011,3.260417E+12,0.2195989 +-1.5,0.3098871,0.05490542,16.24198,0.1208655,5.262424E+13,0.2943927 +-1.25,0.2780301,0.06236606,11.80099,0.08224616,3.909569E+13,0.2641286 +-1,0.2461731,0.0698267,7.359998,0.0436268,2.556714E+13,0.2338644 +-0.75,0.214316,0.07728734,2.919005,0.005007447,1.203859E+13,0.2036003 +-0.5,0.4842853,0.1181871,4.410676,0.009723747,1.518959E+13,0.4600711 +-0.25,0.7335005,0.160183,7.348531,0.008589056,1.449587E+13,0.6968251 +0,1.027868,0.1308419,6.967961,0.01039302,1.371341E+13,0.9764751 +0.25,1.879347,0.1673481,8.292696,0.0111202,1.944705E+13,1.78538 +0.5,2.755008,0.2400655,10.51681,0.02782438,3.09744E+13,2.617256 +0.75,4.158228,0.4294027,21.32977,0.1036785,6.424386E+13,3.950318 +1,6.191795,0.776246,47.51457,0.2247769,1.031063E+14,5.882205 +1.25,10.13954,1.374057,106.1412,0.3900392,1.611524E+14,9.632558 +1.5,12.61938,2.230839,199.4636,0.5781541,2.525558E+14,11.98842 +1.75,13.94988,2.562111,215.1183,0.7788944,3.76344E+14,13.25239 +2,18.94407,3.035618,303.0314,1.404961,7.892802E+14,17.99687 +2.25,19.77032,3.542301,424.2019,2.518004,1.084592E+15,18.78181 +2.5,22.55479,6.882059,956.8351,3.546072,1.275273E+15,21.42705 +2.75,26.3791,8.126064,1536.675,3.824628,1.386037E+15,25.06014 +3,30.20341,9.37007,2116.515,4.103183,1.496801E+15,28.69324 +3.25,34.02771,10.61407,2696.355,4.381738,1.607565E+15,32.32632 +3.5,37.85201,11.85808,3276.196,4.660293,1.71833E+15,35.95941 +3.75,41.67632,13.10209,3856.036,4.938848,1.829094E+15,39.5925 +4,45.50062,14.34609,4435.876,5.217402,1.939858E+15,43.22559 +4.25,49.32492,15.5901,5015.716,5.495957,2.050622E+15,46.85867 +4.5,53.14922,16.8341,5595.557,5.774512,2.161387E+15,50.49176 +4.75,56.97353,18.07811,6175.397,6.053067,2.272151E+15,54.12485 +5,60.79783,19.32211,6755.237,6.331622,2.382915E+15,57.75793 +5.25,64.62213,20.56612,7335.078,6.610177,2.493679E+15,61.39102 +5.5,68.44643,21.81012,7914.918,6.888732,2.604444E+15,65.02411 +5.75,72.27074,23.05413,8494.758,7.167287,2.715208E+15,68.6572 +6,76.09504,24.29813,9074.598,7.445842,2.825972E+15,72.29028 diff -Nru sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_G_EU4.dec.csv sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_G_EU4.dec.csv --- sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_G_EU4.dec.csv 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_G_EU4.dec.csv 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,31 @@ +v,decel_coast +[km/h],[m/s²] +10,-0.2684278 +15,-0.2693753 +20,-0.2692612 +25,-0.2715204 +30,-0.2762249 +35,-0.2731925 +40,-0.270826 +45,-0.2707604 +50,-0.2779272 +55,-0.2865081 +60,-0.2963224 +65,-0.3074608 +70,-0.3201242 +75,-0.3352677 +80,-0.3517197 +85,-0.3695383 +90,-0.388737 +95,-0.4093591 +100,-0.4314485 +105,-0.4557404 +110,-0.4830516 +115,-0.5114193 +120,-0.5411544 +125,-0.5724216 +130,-0.6052775 +135,-0.6400956 +140,-0.6765129 +145,-0.7145674 +150,-0.7543085 diff -Nru sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_G_EU4_FC.csv sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_G_EU4_FC.csv --- sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_G_EU4_FC.csv 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_G_EU4_FC.csv 2015-04-17 05:44:20.000000000 +0000 @@ -1,27 +1,17 @@ -cp_norm,FC -[-],[g/h] --0.2,258.800717285714 --0.15,676.8973625 --0.1,924.174551923077 --0.05,1198.74491190476 -0,1307.56603148148 -0.05,2288.80135172414 -0.1,2803.68414193548 -0.15,3553.71129341317 -0.2,4500.87151327434 -0.25,5403.65275454546 -0.3,6375.49635443038 -0.35,7067.9238 -0.4,8152.90521739131 -0.45,9120.33266666667 -0.5,9651.74828571429 -0.55,10583.1989090909 -0.6,11238.2385714286 -0.65,12523.8033333333 -0.7,13636.32 -0.75,14574.915 -0.8,15629.4577777778 -0.85,16655.0136111111 -0.9,17680.5694444444 -0.95,18706.1252777778 -1,19731.6811111111 \ No newline at end of file +cp_norm(rated),FC +[-],[g/h/kWrated] +Pdrive (Engine)= 19.39067 +idle,10.82389 +-0.2,4.995791 +-0.1,13.34568 +0,22.62047 +0.1,39.36962 +0.2,61.06668 +0.3,87.8808 +0.4,108.9163 +0.5,137.4741 +0.6,155.8149 +0.7,186.5109 +0.8000001,217.2069 +0.9000001,247.903 +1,278.599 diff -Nru sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_G_EU4.PHEMLight.veh sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_G_EU4.PHEMLight.veh --- sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_G_EU4.PHEMLight.veh 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_G_EU4.PHEMLight.veh 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,133 @@ +c PHEMLight Vehicle Input filefc (based on PHEM .veh file format) +c PHEM 11.6.2 +c 10.10.2014 11:59:36 +c Vehicle mass [kg] +1235 +c Vehicle loading [kg] +50 +c Cd value [-] +0.3113 +c Cross sectional area [m^2] +2.11756 +c Delta [-] (not supported since Version 10.7) +0 +c Engine rotational inertia [kg*m^2] +0.5 +c Wheels equivalent rotational inertia [kg] (= I_wheel/rdyn^2) +40 +c Gearbox rotational inertia [kg*m^2] +0.06 +c Auxiliaries base power demand (normalized) [-] +0 +c Engine rated power [kW] +72 +c Engine rated speed [rpm] +5565 +c Engine idling speed [rpm] +798 +c --- +0 +c Rolling resistance coefficients +c Fr0 +0.009 +c Fr1 +5E-05 +c Fr2 +0 +c Fr3 +0 +c Fr4 +1.6E-09 +c --- +0 +c Transmission loss factor +0.3 +c Transmission +c Axle ratio [-] +4.0826, +c Wheel effective diameter [m] +0.6064 +c Transmission gears: Ratio [-], path to efficiency map filefc (optional) +c Gear 1 +3.6298, +c Gear 2 +2.0523, +c Gear 3 +1.3801, +c Gear 4 +1.0477, +c Gear 5 +0.8423, +c Gear 6 +0, +c Gear 7 +0, +c Gear 8 +0, +c Gear 9 +0, +c Gear 10 +0, +c Gear 11 +0, +c Gear 12 +0, +c Gear 13 +0, +c Gear 14 +0, +c Gear 15 +0, +c Gear 16 +0, +c Gear shift behaviour: +c Gearshift model (Version fast driver) +c shift up at ratio rpm/rated rpm in actual gear greater than +0.768717 +c shift down when rpm/rated rpm in lower gear is higher than +0.5802642 +c Gearshift model (Version economic driver) +c shift up at ratio rpm/rated rpm in higher gear greater than +0.5288679 +c Shift down when ratio rpm/rated rpm in actual gear is lower than +0.4860377 +c Share of version economic driver (0 to 1) +0 +c Share of version mixed model (0 to 1) +1 +cVehiclemasstypeforPHEMlight +LV +cFueltypeforPHEMlight +G +c P_n_max_v0 +5 +c P_n_max_p0 +0.15 +c P_n_max_v1 +40 +c P_n_max_p1 +0.8 +c vehicle speed [km/h] (converted to m/s after read-in), gear ratio [-], rotational mass factor [-] +0,3.6298,2.008095 +12.31168,3.6298,2.008095 +29.96561,2.0523,1.316293 +44.09933,1.3801,1.145397 +69.54142,1.0477,1.077003 +103.4718,0.8423,1.053688 +250,0.8423,1.053688 +c n_norm, pe_drag _norm +0,-0.012 +0.071,-0.017 +0.128,-0.022 +0.186,-0.026 +0.244,-0.03 +0.302,-0.034 +0.419,-0.043 +0.535,-0.052 +0.651,-0.06 +0.768,-0.069 +0.884,-0.078 +1,-0.086 +1.117,-0.095 +1.233,-0.103 +1.349,-0.112 diff -Nru sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_G_EU4.veh sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_G_EU4.veh --- sumo-0.21.0+dfsg/data/emissions/PHEMlight/PKW_G_EU4.veh 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/emissions/PHEMlight/PKW_G_EU4.veh 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -cPHEMVehicleInputFile, -cEuro4Petrol, -cAveragevehicle, -cHBEFAv3.2, -c, -cVehiclemass[kg], -1235, -cVehicleloading[kg], -50, -cCdvalue[-], -0.3113, -cCrosssectionalarea[m^2], -2.117560071, -cDelta[-], -0, -cEnginerotationalinertia[kg*m^2], -0.5, -cWheelsequivalentrotationalinertia[kg](=I_wheel/rdyn^2), -40.00, -cGearboxrotationalinertia[kg*m^2], -0.06, -cAuxiliariesbasepowerdemand(normalized)[-], -0, -cEngineratedpower[kW], -72, -cEngineratedspeed[rpm], -5565, -cEngineidlingspeed[rpm], -798, -c---, -0, -cRollingresistancecoefficients, -cFr0, -0.009, -cFr1, -0.00005, -cFr2, -0, -cFr3, -0, -cFr4, -1.60E-09, -c---, -0, -cTransmissionlossfactor(standardPC:0.3), -0.3, -cTransmission, -cAxleratio[-], -4.0826, -cWheeleffectivediameter[m], -0.6064, -cTransmissiongears:Ratio[-], -cGear1, -3.6298, -cGear2, -2.0523, -cGear3, -1.3801, -cGear4, -1.0477, -cGear5, -0.8423, -cGear6, -0, -cGear7, -0, -cGear8, -0, -cGear9, -0, -cGear10, -0, -cGear11, -0, -cGear12, -0, -cGear13, -0, -cGear14, -0, -cGear15, -0, -cGear16, -0, -cGearshiftbehaviour:, -cGearshiftmodel(Versionfastdriver), -cshiftupatratiorpm/ratedrpminactualgeargreaterthan, -0.73, -cshiftdownwhenrpm/ratedrpminlowergearishigherthan, -0.51, -cGearshiftmodel(Versioneconomicdriver), -cshiftupatratiorpm/ratedrpminhighergeargreaterthan, -0.45, -cShiftdownwhenratiorpm/ratedrpminactualgearislowerthan, -0.4, -cShareofversioneconomicdriver(0to1), -0, -cShareofversionmixedmodel(0to1), -1, -cVehiclemasstypeforPHEMlight -LV -cFueltypeforPHEMlight -G -c P_n_max_v0 -5 -c P_n_max_p0 -0.15 -c P_n_max_v1 -40 -c P_n_max_p1 -0.8 -c Speed Rotational Mass Factor Table in [km/h] converted upon reading in [m/s] -0,2.008094715 -12.31167981,2.008094715 -29.96561347,1.316293179 -44.0993348,1.145396922 -69.54141727,1.077003073 -103.4718211,1.05368822 -250,1.05368822 -250,1.05368822 \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/data/typemap/osmNetconvertPedestrians.typ.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/typemap/osmNetconvertPedestrians.typ.xml --- sumo-0.21.0+dfsg/data/typemap/osmNetconvertPedestrians.typ.xml 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/typemap/osmNetconvertPedestrians.typ.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,37 +1,37 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + /> + /> + /> + - + - + - + - + diff -Nru sumo-0.21.0+dfsg/data/typemap/osmNetconvertRuralDe.typ.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/typemap/osmNetconvertRuralDe.typ.xml --- sumo-0.21.0+dfsg/data/typemap/osmNetconvertRuralDe.typ.xml 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/typemap/osmNetconvertRuralDe.typ.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru sumo-0.21.0+dfsg/data/typemap/osmNetconvertShips.typ.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/typemap/osmNetconvertShips.typ.xml --- sumo-0.21.0+dfsg/data/typemap/osmNetconvertShips.typ.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/typemap/osmNetconvertShips.typ.xml 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,4 @@ + + + + diff -Nru sumo-0.21.0+dfsg/data/typemap/osmNetconvert.typ.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/typemap/osmNetconvert.typ.xml --- sumo-0.21.0+dfsg/data/typemap/osmNetconvert.typ.xml 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/typemap/osmNetconvert.typ.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,13 +1,39 @@ - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/data/typemap/osmNetconvertUrbanDe.typ.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/typemap/osmNetconvertUrbanDe.typ.xml --- sumo-0.21.0+dfsg/data/typemap/osmNetconvertUrbanDe.typ.xml 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/typemap/osmNetconvertUrbanDe.typ.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,49 +1,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/data/xsd/activitygenConfiguration.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/activitygenConfiguration.xsd --- sumo-0.21.0+dfsg/data/xsd/activitygenConfiguration.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/activitygenConfiguration.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -25,14 +25,13 @@ + - - diff -Nru sumo-0.21.0+dfsg/data/xsd/additional_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/additional_file.xsd --- sumo-0.21.0+dfsg/data/xsd/additional_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/additional_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -8,6 +8,7 @@ + @@ -26,6 +27,7 @@ + @@ -203,6 +205,8 @@ + + @@ -241,6 +245,15 @@ + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/data/xsd/baseTypes.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/baseTypes.xsd --- sumo-0.21.0+dfsg/data/xsd/baseTypes.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/baseTypes.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -9,13 +9,30 @@ - + - + + + + + + + + + + + + + + + + + + @@ -174,8 +191,8 @@ - + @@ -186,7 +203,7 @@ - + diff -Nru sumo-0.21.0+dfsg/data/xsd/connections_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/connections_file.xsd --- sumo-0.21.0+dfsg/data/xsd/connections_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/connections_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -11,6 +11,7 @@ + @@ -58,6 +59,12 @@ + - \ No newline at end of file + + + + + + diff -Nru sumo-0.21.0+dfsg/data/xsd/dfrouterConfiguration.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/dfrouterConfiguration.xsd --- sumo-0.21.0+dfsg/data/xsd/dfrouterConfiguration.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/dfrouterConfiguration.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -27,6 +27,7 @@ + diff -Nru sumo-0.21.0+dfsg/data/xsd/duarouterConfiguration.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/duarouterConfiguration.xsd --- sumo-0.21.0+dfsg/data/xsd/duarouterConfiguration.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/duarouterConfiguration.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -34,6 +34,7 @@ + @@ -44,6 +45,7 @@ + @@ -52,6 +54,7 @@ + diff -Nru sumo-0.21.0+dfsg/data/xsd/edgediff_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/edgediff_file.xsd --- sumo-0.21.0+dfsg/data/xsd/edgediff_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/edgediff_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -13,6 +13,7 @@ + @@ -45,6 +46,7 @@ + @@ -83,4 +85,9 @@ + + + + + diff -Nru sumo-0.21.0+dfsg/data/xsd/edges_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/edges_file.xsd --- sumo-0.21.0+dfsg/data/xsd/edges_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/edges_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -11,9 +11,10 @@ - - - + + + + @@ -44,6 +45,7 @@ + @@ -76,6 +78,12 @@ + + + + + + diff -Nru sumo-0.21.0+dfsg/data/xsd/emission_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/emission_file.xsd --- sumo-0.21.0+dfsg/data/xsd/emission_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/emission_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -33,8 +33,8 @@ - - + + diff -Nru sumo-0.21.0+dfsg/data/xsd/fcd_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/fcd_file.xsd --- sumo-0.21.0+dfsg/data/xsd/fcd_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/fcd_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -31,7 +31,7 @@ - + diff -Nru sumo-0.21.0+dfsg/data/xsd/full_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/full_file.xsd --- sumo-0.21.0+dfsg/data/xsd/full_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/full_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -74,14 +74,14 @@ - + - - - + + + diff -Nru sumo-0.21.0+dfsg/data/xsd/jtrrouterConfiguration.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/jtrrouterConfiguration.xsd --- sumo-0.21.0+dfsg/data/xsd/jtrrouterConfiguration.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/jtrrouterConfiguration.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -29,6 +29,7 @@ + @@ -39,12 +40,14 @@ + + diff -Nru sumo-0.21.0+dfsg/data/xsd/marouterConfiguration.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/marouterConfiguration.xsd --- sumo-0.21.0+dfsg/data/xsd/marouterConfiguration.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/marouterConfiguration.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -31,10 +31,12 @@ + + diff -Nru sumo-0.21.0+dfsg/data/xsd/netconvertConfiguration.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/netconvertConfiguration.xsd --- sumo-0.21.0+dfsg/data/xsd/netconvertConfiguration.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/netconvertConfiguration.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -39,15 +39,16 @@ + + - @@ -186,11 +187,13 @@ + + diff -Nru sumo-0.21.0+dfsg/data/xsd/net_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/net_file.xsd --- sumo-0.21.0+dfsg/data/xsd/net_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/net_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -87,6 +87,7 @@ + @@ -108,6 +109,7 @@ + @@ -115,6 +117,8 @@ + + diff -Nru sumo-0.21.0+dfsg/data/xsd/netgenerateConfiguration.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/netgenerateConfiguration.xsd --- sumo-0.21.0+dfsg/data/xsd/netgenerateConfiguration.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/netgenerateConfiguration.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -65,10 +65,10 @@ + - @@ -129,11 +129,13 @@ + + diff -Nru sumo-0.21.0+dfsg/data/xsd/netstate_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/netstate_file.xsd --- sumo-0.21.0+dfsg/data/xsd/netstate_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/netstate_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -23,10 +23,11 @@ + + - @@ -36,7 +37,6 @@ - @@ -46,12 +46,22 @@ + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/data/xsd/nodes_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/nodes_file.xsd --- sumo-0.21.0+dfsg/data/xsd/nodes_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/nodes_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -43,6 +43,7 @@ + @@ -52,6 +53,7 @@ + diff -Nru sumo-0.21.0+dfsg/data/xsd/od2tripsConfiguration.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/od2tripsConfiguration.xsd --- sumo-0.21.0+dfsg/data/xsd/od2tripsConfiguration.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/od2tripsConfiguration.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -27,6 +27,7 @@ + diff -Nru sumo-0.21.0+dfsg/data/xsd/polyconvertConfiguration.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/polyconvertConfiguration.xsd --- sumo-0.21.0+dfsg/data/xsd/polyconvertConfiguration.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/polyconvertConfiguration.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -38,6 +38,7 @@ + @@ -51,6 +52,7 @@ + diff -Nru sumo-0.21.0+dfsg/data/xsd/routes_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/routes_file.xsd --- sumo-0.21.0+dfsg/data/xsd/routes_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/routes_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -11,11 +11,12 @@ - + + diff -Nru sumo-0.21.0+dfsg/data/xsd/routeTypes.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/routeTypes.xsd --- sumo-0.21.0+dfsg/data/xsd/routeTypes.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/routeTypes.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -11,10 +11,10 @@ - - - - + + + + @@ -34,6 +34,12 @@ + + + + + + @@ -42,6 +48,17 @@ + + + + + + + + + + + @@ -53,6 +70,7 @@ + @@ -68,6 +86,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -186,6 +271,7 @@ + @@ -289,15 +375,18 @@ + - - + + + + @@ -312,6 +401,7 @@ + @@ -351,6 +441,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/data/xsd/sumoConfiguration.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/sumoConfiguration.xsd --- sumo-0.21.0+dfsg/data/xsd/sumoConfiguration.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/sumoConfiguration.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -11,10 +11,10 @@ + - @@ -37,8 +37,10 @@ + + @@ -49,10 +51,13 @@ + + + @@ -88,10 +93,29 @@ - + + + + + + + + + + + + + + + + + + + + @@ -128,26 +152,13 @@ + - - - - - - - - - - - - - - @@ -174,6 +185,7 @@ + diff -Nru sumo-0.21.0+dfsg/data/xsd/taz_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/taz_file.xsd --- sumo-0.21.0+dfsg/data/xsd/taz_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/taz_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -17,6 +17,7 @@ + diff -Nru sumo-0.21.0+dfsg/data/xsd/tripinfo_file.xsd sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/tripinfo_file.xsd --- sumo-0.21.0+dfsg/data/xsd/tripinfo_file.xsd 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/data/xsd/tripinfo_file.xsd 2015-04-17 05:44:20.000000000 +0000 @@ -8,6 +8,7 @@ + @@ -24,13 +25,14 @@ - + - - + + + @@ -75,6 +77,18 @@ + + + + + + + + + + + + @@ -92,5 +106,18 @@ + + + + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/debian/bzr-builder.manifest sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/bzr-builder.manifest --- sumo-0.21.0+dfsg/debian/bzr-builder.manifest 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/bzr-builder.manifest 2015-04-17 05:44:23.000000000 +0000 @@ -0,0 +1,3 @@ +# bzr-builder format 0.3 deb-version {debupstream}+5+11 +lp:~sumo/+junk/sumo revid:gladky.anton@gmail.com-20150416212722-pkbewc5vub8jj3zl +nest packaging lp:~sumo/+junk/sumo-debian debian revid:gladky.anton@gmail.com-20150417054250-9pj28unmpkf5gcp3 diff -Nru sumo-0.21.0+dfsg/debian/changelog sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/changelog --- sumo-0.21.0+dfsg/debian/changelog 2014-06-20 21:03:32.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/changelog 2015-04-17 05:44:23.000000000 +0000 @@ -1,12 +1,10 @@ -sumo (0.21.0+dfsg-1) unstable; urgency=medium +sumo (0.23.0+dfsg+5+11~ubuntu14.10.1) utopic; urgency=low - * [d7097c6] Imported Upstream version 0.21.0+dfsg - * [655607d] Refresh patches. - * [04454ca] Add autopkgtest. + * Auto build. - -- Anton Gladky Fri, 20 Jun 2014 23:03:11 +0200 + -- Anton Gladky Fri, 17 Apr 2015 05:44:23 +0000 -sumo (0.20.0+dfsg-1) unstable; urgency=medium +sumo (0.23.0+dfsg-1) unstable; urgency=medium * [83c56d0] Remove debian/README.source * [fd5408c] Imported Upstream version 0.20.0+dfsg @@ -126,49 +124,49 @@ -- Anton Gladky Sun, 27 May 2012 16:28:54 +0200 -sumo (0.15.0~dfsg-1) unstable; urgency=low +sumo (0.15.0~dfsg-1) unstable; urgency=low * Initial packaging in Debian. (Closes: #669160) -- Anton Gladky Mon, 23 Apr 2012 19:17:01 +0200 -sumo (0.14.0-1) unstable; urgency=low +sumo (0.14.0-1) unstable; urgency=low * New upstream release. -- Michael Behrisch Thu, 12 Jan 2012 23:46:43 +0100 -sumo (0.13.1-1) unstable; urgency=low +sumo (0.13.1-1) unstable; urgency=low * New upstream release. -- Michael Behrisch Tue, 01 Nov 2011 10:24:24 +0100 -sumo (0.13.0-1) unstable; urgency=low +sumo (0.13.0-1) unstable; urgency=low * New upstream release. -- Michael Behrisch Wed, 13 Jul 2011 16:58:57 +0200 -sumo (0.12.3-1) unstable; urgency=low +sumo (0.12.3-1) unstable; urgency=low * New upstream release. -- Michael Behrisch Wed, 13 Apr 2011 19:28:57 +0200 -sumo (0.10.2-1) unstable; urgency=low +sumo (0.10.2-1) unstable; urgency=low * New upstream release. -- Michael Behrisch Mon, 16 Mar 2009 22:00:47 +0100 -sumo (0.10.1-1) unstable; urgency=low +sumo (0.10.1-1) unstable; urgency=low * Update -- Michael Behrisch Sun, 15 Feb 2009 22:34:33 +0200 -sumo (0.9.10-1) unstable; urgency=low +sumo (0.9.10-1) unstable; urgency=low * Initial Release diff -Nru sumo-0.21.0+dfsg/debian/control sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/control --- sumo-0.21.0+dfsg/debian/control 2014-06-20 21:00:42.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/control 2015-04-17 05:44:22.000000000 +0000 @@ -26,7 +26,6 @@ Build-Depends-Indep: doxygen, python -XS-Testsuite: autopkgtest Package: sumo Architecture: any diff -Nru sumo-0.21.0+dfsg/debian/patches/add_missing_link.patch sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/patches/add_missing_link.patch --- sumo-0.21.0+dfsg/debian/patches/add_missing_link.patch 2014-06-20 20:48:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/patches/add_missing_link.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -Description: Added missing libs to link, fixing FTBFS. -Author: Daniel T Chen , Julian Taylor -Origin: https://launchpadlibrarian.net/137511659/sumo_0.16.0~dfsg-1~exp1_0.16.0~dfsg-1~exp1ubuntu1.diff.gz -Bug-Debian: http://bugs.debian.org/710373 -Reviewed-By: Anton Gladky -Last-Update: 2013-08-30 - -Index: sumo/src/Makefile.am -=================================================================== ---- sumo.orig/src/Makefile.am -+++ sumo/src/Makefile.am -@@ -1,4 +1,4 @@ --XERCES_LIBS = -l$(LIB_XERCES) -+XERCES_LIBS = -l$(LIB_XERCES) -lpthread -lGLU -lGL - - if INTERNAL - MESO_LIBS = ./mesosim/libmesosim.a -Index: sumo/src/Makefile.in -=================================================================== ---- sumo.orig/src/Makefile.in -+++ sumo/src/Makefile.in -@@ -351,7 +351,7 @@ STRIP = @STRIP@ - VERSION = @VERSION@ - XERCES_CFLAGS = @XERCES_CFLAGS@ - XERCES_LDFLAGS = @XERCES_LDFLAGS@ --XERCES_LIBS = -l$(LIB_XERCES) -+XERCES_LIBS = -l$(LIB_XERCES) -lpthread -lGLU -lGL - abs_builddir = @abs_builddir@ - abs_srcdir = @abs_srcdir@ - abs_top_builddir = @abs_top_builddir@ diff -Nru sumo-0.21.0+dfsg/debian/patches/fix_scripts_headers.patch sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/patches/fix_scripts_headers.patch --- sumo-0.21.0+dfsg/debian/patches/fix_scripts_headers.patch 2014-06-20 20:48:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/patches/fix_scripts_headers.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,817 +0,0 @@ -Description: fixes headers of scripts -Author: Anton Gladky -Last-Update: 2012-12-04 - -Index: sumo/tools/projects/TaxiFCD_Krieg/src/analysis/Taxi.py -=================================================================== ---- sumo.orig/tools/projects/TaxiFCD_Krieg/src/analysis/Taxi.py -+++ sumo/tools/projects/TaxiFCD_Krieg/src/analysis/Taxi.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/env python - # -*- coding: Latin-1 -*- - """ - @file CalcTime.py -Index: sumo/tools/projects/TaxiFCD_Krieg/src/util/Path.py -=================================================================== ---- sumo.orig/tools/projects/TaxiFCD_Krieg/src/util/Path.py -+++ sumo/tools/projects/TaxiFCD_Krieg/src/util/Path.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/env python - # -*- coding: Latin-1 -*- - """ - @file Path.py -Index: sumo/tools/projects/TaxiFCD_Krieg/src/util/ProgressBar.py -=================================================================== ---- sumo.orig/tools/projects/TaxiFCD_Krieg/src/util/ProgressBar.py -+++ sumo/tools/projects/TaxiFCD_Krieg/src/util/ProgressBar.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/env python - # -*- coding: Latin-1 -*- - """ - @file ProgressBar.py -Index: sumo/tools/projects/TaxiFCD_Krieg/src/util/CalcTime.py -=================================================================== ---- sumo.orig/tools/projects/TaxiFCD_Krieg/src/util/CalcTime.py -+++ sumo/tools/projects/TaxiFCD_Krieg/src/util/CalcTime.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/env python - # -*- coding: Latin-1 -*- - """ - @file CalcTime.py -Index: sumo/tools/projects/TaxiFCD_Krieg/src/util/Reader.py -=================================================================== ---- sumo.orig/tools/projects/TaxiFCD_Krieg/src/util/Reader.py -+++ sumo/tools/projects/TaxiFCD_Krieg/src/util/Reader.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/env python - # -*- coding: Latin-1 -*- - """ - @file Reader.py -Index: sumo/tools/projects/TaxiFCD_Krieg/src/util/BinarySearch.py -=================================================================== ---- sumo.orig/tools/projects/TaxiFCD_Krieg/src/util/BinarySearch.py -+++ sumo/tools/projects/TaxiFCD_Krieg/src/util/BinarySearch.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/env python - # -*- coding: Latin-1 -*- - """ - @file BinarySearch.py -Index: sumo/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutes.py -=================================================================== ---- sumo.orig/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutes.py -+++ sumo/tools/projects/TaxiFCD_Krieg/src/fcdToRoutes/GenerateTaxiRoutes.py -@@ -1,3 +1,4 @@ -+#!/usr/bin/env python - # -*- coding: Latin-1 -*- - """ - @file GenerateTaxiRoutes.py -Index: sumo/docs/examples/sumo/variable_speed_signs/aggregated_25.xml -=================================================================== ---- /dev/null -+++ sumo/docs/examples/sumo/variable_speed_signs/aggregated_25.xml -@@ -0,0 +1,113 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -Index: sumo/docs/examples/sumo/output/cross3ltl_emissions/summary.xml -=================================================================== ---- /dev/null -+++ sumo/docs/examples/sumo/output/cross3ltl_emissions/summary.xml -@@ -0,0 +1,470 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -Index: sumo/docs/examples/sumo/output/cross3ltl_tripinfo/tripinfos.xml -=================================================================== ---- /dev/null -+++ sumo/docs/examples/sumo/output/cross3ltl_tripinfo/tripinfos.xml -@@ -0,0 +1,78 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -Index: sumo/docs/examples/sumo/busses/vehroutes.xml -=================================================================== ---- /dev/null -+++ sumo/docs/examples/sumo/busses/vehroutes.xml -@@ -0,0 +1,38 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -Index: sumo/docs/examples/sumo/vehicle_stops/vehroutes.xml -=================================================================== ---- /dev/null -+++ sumo/docs/examples/sumo/vehicle_stops/vehroutes.xml -@@ -0,0 +1,26 @@ -+ -+ -+ -+ -+ -+ diff -Nru sumo-0.21.0+dfsg/debian/patches/remove_embedded_gl2ps.patch sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/patches/remove_embedded_gl2ps.patch --- sumo-0.21.0+dfsg/debian/patches/remove_embedded_gl2ps.patch 2014-06-20 20:47:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/patches/remove_embedded_gl2ps.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -Description: Remove from compilation embedded copy of gl2ps, use packaged version instead. -Author: Anton Gladky -Last-Update: 2012-12-04 - -Index: sumo/src/Makefile.am -=================================================================== ---- sumo.orig/src/Makefile.am -+++ sumo/src/Makefile.am -@@ -85,7 +85,6 @@ sumo_gui_LDADD = ./gui/libgui.a \ - ./utils/foxtools/libfoxtools.a \ - $(MESOGUI_LIBS) \ - $(sumo_LDADD) \ --./foreign/gl2ps/libgl2ps.a \ - ./foreign/polyfonts/libpolyfonts.a \ - ./gui/GUIManipulator.o \ - ./gui/GUITLLogicPhasesTrackerWindow.o \ -Index: sumo/src/Makefile.in -=================================================================== ---- sumo.orig/src/Makefile.in -+++ sumo/src/Makefile.in -@@ -155,7 +155,6 @@ am__DEPENDENCIES_3 = ./netload/libnetloa - @WITH_GUI_TRUE@ ./utils/gui/tracker/libguiutilstracker.a \ - @WITH_GUI_TRUE@ ./utils/foxtools/libfoxtools.a $(MESOGUI_LIBS) \ - @WITH_GUI_TRUE@ $(am__DEPENDENCIES_3) \ --@WITH_GUI_TRUE@ ./foreign/gl2ps/libgl2ps.a \ - @WITH_GUI_TRUE@ ./foreign/polyfonts/libpolyfonts.a \ - @WITH_GUI_TRUE@ ./gui/GUIManipulator.o \ - @WITH_GUI_TRUE@ ./gui/GUITLLogicPhasesTrackerWindow.o \ -@@ -474,7 +473,6 @@ $(XERCES_LDFLAGS) $(GDAL_LDFLAGS) $(PROJ - @WITH_GUI_TRUE@./utils/foxtools/libfoxtools.a \ - @WITH_GUI_TRUE@$(MESOGUI_LIBS) \ - @WITH_GUI_TRUE@$(sumo_LDADD) \ --@WITH_GUI_TRUE@./foreign/gl2ps/libgl2ps.a \ - @WITH_GUI_TRUE@./foreign/polyfonts/libpolyfonts.a \ - @WITH_GUI_TRUE@./gui/GUIManipulator.o \ - @WITH_GUI_TRUE@./gui/GUITLLogicPhasesTrackerWindow.o \ -Index: sumo/src/foreign/Makefile.am -=================================================================== ---- sumo.orig/src/foreign/Makefile.am -+++ sumo/src/foreign/Makefile.am -@@ -3,7 +3,7 @@ MEMDIRS = nvwa - endif - - if WITH_GUI --GUIDIRS = gl2ps polyfonts rtree -+GUIDIRS = polyfonts rtree - endif - - -Index: sumo/src/foreign/Makefile.in -=================================================================== ---- sumo.orig/src/foreign/Makefile.in -+++ sumo/src/foreign/Makefile.in -@@ -142,7 +142,7 @@ am__define_uniq_tagged_files = \ - done | $(am__uniquify_input)` - ETAGS = etags - CTAGS = ctags --DIST_SUBDIRS = eulerspiral mersenne tcpip nvwa gl2ps polyfonts rtree -+DIST_SUBDIRS = eulerspiral mersenne tcpip nvwa polyfonts rtree - DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - am__relativize = \ - dir0=`pwd`; \ -@@ -311,7 +311,7 @@ top_build_prefix = @top_build_prefix@ - top_builddir = @top_builddir@ - top_srcdir = @top_srcdir@ - @CHECK_MEMORY_LEAKS_TRUE@MEMDIRS = nvwa --@WITH_GUI_TRUE@GUIDIRS = gl2ps polyfonts rtree -+@WITH_GUI_TRUE@GUIDIRS = polyfonts rtree - EXTRA_DIST = additional.txt - SUBDIRS = eulerspiral mersenne tcpip $(MEMDIRS) $(GUIDIRS) - all: all-recursive -Index: sumo/src/utils/gui/windows/GUISUMOAbstractView.cpp -=================================================================== ---- sumo.orig/src/utils/gui/windows/GUISUMOAbstractView.cpp -+++ sumo/src/utils/gui/windows/GUISUMOAbstractView.cpp -@@ -39,7 +39,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include diff -Nru sumo-0.21.0+dfsg/debian/patches/series sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/patches/series --- sumo-0.21.0+dfsg/debian/patches/series 2013-11-30 17:52:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -remove_embedded_gl2ps.patch -fix_scripts_headers.patch -add_missing_link.patch diff -Nru sumo-0.21.0+dfsg/debian/README.source sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/README.source --- sumo-0.21.0+dfsg/debian/README.source 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/README.source 2015-04-17 05:44:22.000000000 +0000 @@ -0,0 +1,2 @@ +Files src/foreign/eulerspiral/* were removed due to license issue. +Corresponding changes in the code were done with drop_eulerspiral.patch diff -Nru sumo-0.21.0+dfsg/debian/rules sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/rules --- sumo-0.21.0+dfsg/debian/rules 2014-06-20 21:01:52.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/rules 2015-04-17 05:44:22.000000000 +0000 @@ -29,18 +29,16 @@ rm ./tools/contributed/sumoplayer/LICENSE rm ./tools/contributed/traci4j/COPYING rm ./tools/contributed/trafficmodeler/src/resources/icons/Thumbs.db - rm ./tools/contributed/traci4j/.gitignore find ./tools -name '*.java' -print0 | xargs -0 chmod -x find ./tools/contributed/traci4j -type f -print0 | xargs -0 chmod -x chmod -x ./tools/projects/TaxiFCD_Krieg/src/backup/BackupFolder.pyw - chmod -x ./tools/build/dailyBuildMSVC8.bat override_dh_auto_build-arch: dh_auto_build -a $(MAKE) man override_dh_auto_test-arch: - mkdir $(CURDIR)/tests_auto - cd $(CURDIR)/tests_auto; cp ../docs/examples/sumo/visualization/parade/* ./; ../bin/sumo -b 0 -e 10000 -n net.net.xml -r input_routes.rou.xml -c parade.sumocfg --summary-output sum.out - cat $(CURDIR)/tests_auto/sum.out - rm -rf $(CURDIR)/tests_auto + mkdir $(CURDIR)/tests + cd $(CURDIR)/tests; cp ../docs/examples/sumo/visualization/parade/* ./; ../bin/sumo -b 0 -e 10000 -n net.net.xml -r input_routes.rou.xml -c parade.sumocfg --summary-output sum.out + cat $(CURDIR)/tests/sum.out + rm -rf $(CURDIR)/tests diff -Nru sumo-0.21.0+dfsg/debian/scripts/remove_jar_files.sh sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/scripts/remove_jar_files.sh --- sumo-0.21.0+dfsg/debian/scripts/remove_jar_files.sh 2014-06-20 20:44:45.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/scripts/remove_jar_files.sh 2015-04-17 05:44:22.000000000 +0000 @@ -1,5 +1,3 @@ #!/bin/sh -# Script removes *.jar and *.pdf files. (Closes: #728777) +# Script removes *.jar files. (Closes: #728777) find ./ -name *.jar | xargs rm -find ./ -name *.pdf | xargs rm -rm -rf build diff -Nru sumo-0.21.0+dfsg/debian/source/format sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/source/format --- sumo-0.21.0+dfsg/debian/source/format 2013-11-30 17:52:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/source/format 2015-04-17 05:44:23.000000000 +0000 @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) diff -Nru sumo-0.21.0+dfsg/debian/source/options sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/source/options --- sumo-0.21.0+dfsg/debian/source/options 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/source/options 2015-04-17 05:44:22.000000000 +0000 @@ -0,0 +1 @@ +tar-ignore = .pc diff -Nru sumo-0.21.0+dfsg/debian/tests/control sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/tests/control --- sumo-0.21.0+dfsg/debian/tests/control 2014-06-20 20:59:36.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -Tests: parade -Depends: sumo diff -Nru sumo-0.21.0+dfsg/debian/tests/parade sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/tests/parade --- sumo-0.21.0+dfsg/debian/tests/parade 2014-06-20 20:57:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/debian/tests/parade 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -#!/bin/sh -# autopkgtest check -# (C) 2014 Anton Gladky - -set -e - -export OMPI_MCA_orte_rsh_agent=/bin/false - -WORKDIR=$(mktemp -d) -trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM -cp docs/examples/sumo/visualization/parade/* $WORKDIR/ -cd $WORKDIR - -sumo -b 0 -e 10000 -n net.net.xml -r input_routes.rou.xml -c parade.sumocfg --summary-output sum.out -cat sum.out -echo "run: OK" diff -Nru sumo-0.21.0+dfsg/depcomp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/depcomp --- sumo-0.21.0+dfsg/depcomp 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/depcomp 2015-04-17 05:44:20.000000000 +0000 @@ -1,9 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2013-05-30.07; # UTC +scriptversion=2009-04-28.21; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +# Software Foundation, Inc. # 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 @@ -27,9 +28,9 @@ case $1 in '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] @@ -39,11 +40,11 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by 'PROGRAMS ARGS'. - object Object file output by 'PROGRAMS ARGS'. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. + tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . @@ -56,66 +57,6 @@ ;; esac -# Get the directory component of the given path, and save it in the -# global variables '$dir'. Note that this directory component will -# be either empty or ending with a '/' character. This is deliberate. -set_dir_from () -{ - case $1 in - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; - *) dir=;; - esac -} - -# Get the suffix-stripped basename of the given path, and save it the -# global variable '$base'. -set_base_from () -{ - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` -} - -# If no dependency file was actually created by the compiler invocation, -# we still have to create a dummy depfile, to avoid errors with the -# Makefile "include basename.Plo" scheme. -make_dummy_depfile () -{ - echo "#dummy" > "$depfile" -} - -# Factor out some common post-processing of the generated depfile. -# Requires the auxiliary global variable '$tmpdepfile' to be set. -aix_post_process_depfile () -{ - # If the compiler actually managed to produce a dependency file, - # post-process it. - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependency.h'. - # Do two passes, one to just change these to - # $object: dependency.h - # and one to simply output - # dependency.h: - # which is needed to avoid the deleted-header problem. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" - } > "$depfile" - rm -f "$tmpdepfile" - else - make_dummy_depfile - fi -} - -# A tabulation character. -tab=' ' -# A newline character. -nl=' -' -# Character ranges might be problematic outside the C locale. -# These definitions help. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ -lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 -alpha=${upper}${lower} - if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -128,9 +69,6 @@ rm -f "$tmpdepfile" -# Avoid interferences from the environment. -gccflag= dashmflag= - # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -142,32 +80,18 @@ fi if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. - gccflag=-qmakedep=gcc,-MF - depmode=gcc + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp fi case "$depmode" in @@ -190,7 +114,8 @@ done "$@" stat=$? - if test $stat -ne 0; then + if test $stat -eq 0; then : + else rm -f "$tmpdepfile" exit $stat fi @@ -198,17 +123,13 @@ ;; gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. -## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). Also, it might not be -## supported by the other compilers which use the 'gcc' depmode. +## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -216,31 +137,31 @@ fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? - if test $stat -ne 0; then + if test $stat -eq 0; then : + else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" - # The second -e expression handles DOS-style file names with drive - # letters. + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the "deleted header file" problem. +## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. -## Some versions of gcc put a space before the ':'. On the theory + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. +## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -258,7 +179,8 @@ "$@" -MDupdate "$tmpdepfile" fi stat=$? - if test $stat -ne 0; then + if test $stat -eq 0; then : + else rm -f "$tmpdepfile" exit $stat fi @@ -266,41 +188,43 @@ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like '#:fec' to the end of the + # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ - | tr "$nl" ' ' >> "$depfile" + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> "$depfile" echo >> "$depfile" + # The second pass generates a dummy entry for each header file. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" else - make_dummy_depfile + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; -xlc) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts '$object:' at the + # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - set_dir_from "$object" - set_base_from "$object" + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u @@ -313,7 +237,9 @@ "$@" -M fi stat=$? - if test $stat -ne 0; then + + if test $stat -eq 0; then : + else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi @@ -322,100 +248,44 @@ do test -f "$tmpdepfile" && break done - aix_post_process_depfile - ;; - -tcc) - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 - # FIXME: That version still under development at the moment of writing. - # Make that this statement remains true also for stable, released - # versions. - # It will wrap lines (doesn't matter whether long or short) with a - # trailing '\', as in: - # - # foo.o : \ - # foo.c \ - # foo.h \ - # - # It will put a trailing '\' even on the last line, and will use leading - # spaces rather than leading tabs (at least since its commit 0394caf7 - # "Emit spaces for -MD"). - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" fi - rm -f "$depfile" - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. - # We have to change lines of the first kind to '$object: \'. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" - # And for each line of the second kind, we have to emit a 'dep.h:' - # dummy dependency, to avoid the deleted-header problem. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; -## The order of this option in the case statement is important, since the -## shell code in configure will try each of these formats in the order -## listed in this file. A plain '-MD' option would be understood by many -## compilers, so we must ensure this comes after the gcc and icc options. -pgcc) - # Portland's C compiler understands '-MD'. - # Will always output deps to 'file.d' where file is the root name of the - # source file under compilation, even if file resides in a subdirectory. - # The object file name does not affect the name of the '.d' file. - # pgcc 10.2 will output +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\' : + # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... - set_dir_from "$object" - # Use the source, not the object, to determine the base name, since - # that's sadly what pgcc will do too. - set_base_from "$source" - tmpdepfile=$base.d - - # For projects that build the same source file twice into different object - # files, the pgcc approach of using the *source* file root name can cause - # problems in parallel builds. Use a locking strategy to avoid stomping on - # the same $tmpdepfile. - lockdir=$base.d-lock - trap " - echo '$0: caught signal, cleaning up...' >&2 - rmdir '$lockdir' - exit 1 - " 1 2 13 15 - numtries=100 - i=$numtries - while test $i -gt 0; do - # mkdir is a portable test-and-set. - if mkdir "$lockdir" 2>/dev/null; then - # This process acquired the lock. - "$@" -MD - stat=$? - # Release the lock. - rmdir "$lockdir" - break - else - # If the lock is being held by a different process, wait - # until the winning process is done or we timeout. - while test -d "$lockdir" && test $i -gt 0; do - sleep 1 - i=`expr $i - 1` - done - fi - i=`expr $i - 1` - done - trap - 1 2 13 15 - if test $i -le 0; then - echo "$0: failed to acquire lock after $numtries attempts" >&2 - echo "$0: check lockdir '$lockdir'" >&2 - exit 1 - fi - if test $stat -ne 0; then + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else rm -f "$tmpdepfile" exit $stat fi @@ -427,8 +297,8 @@ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ - | sed -e 's/$/ :/' >> "$depfile" + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -439,8 +309,9 @@ # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. - set_dir_from "$object" - set_base_from "$object" + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d @@ -451,7 +322,8 @@ "$@" +Maked fi stat=$? - if test $stat -ne 0; then + if test $stat -eq 0; then : + else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi @@ -461,107 +333,77 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" - # Add 'dependent.h:' lines. + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" else - make_dummy_depfile + echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - set_dir_from "$object" - set_base_from "$object" - - if test "$libtool" = yes; then - # Libtool generates 2 separate objects for the 2 libraries. These - # two compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir$base.o.d # libtool 1.5 - tmpdepfile2=$dir.libs/$base.o.d # Likewise. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - # Same post-processing that is required for AIX mode. - aix_post_process_depfile - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/'"$tab"'\1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/'"$tab"'/ - G - p -}' >> "$depfile" - echo >> "$depfile" # make sure the fragment doesn't end with a backslash - rm -f "$tmpdepfile" - ;; + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; #nosideeffect) # This comment above is used by automake to tell side-effect @@ -580,7 +422,7 @@ shift fi - # Remove '-o $object'. + # Remove `-o $object'. IFS=" " for arg do @@ -600,18 +442,18 @@ done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for ':' + # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this sed invocation - # correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -661,15 +503,12 @@ touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process the last invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed '1,2d' "$tmpdepfile" \ - | tr ' ' "$nl" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; @@ -686,7 +525,7 @@ shift fi - # Remove '-o $object'. + # Remove `-o $object'. IFS=" " for arg do @@ -705,10 +544,10 @@ esac done - "$@" -E \ - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - | sed '$ s: \\$::' > "$tmpdepfile" + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" @@ -740,23 +579,23 @@ shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; + set fnord "$@" + shift + shift + ;; *) - set fnord "$@" "$arg" - shift - shift - ;; + set fnord "$@" "$arg" + shift + shift + ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" - echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; diff -Nru sumo-0.21.0+dfsg/docs/examples/dfrouter/dfrouter.dfrocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/dfrouter/dfrouter.dfrocfg --- sumo-0.21.0+dfsg/docs/examples/dfrouter/dfrouter.dfrocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/dfrouter/dfrouter.dfrocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/dfrouter/input_tri.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/dfrouter/input_tri.net.xml --- sumo-0.21.0+dfsg/docs/examples/dfrouter/input_tri.net.xml 2014-06-06 22:02:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/dfrouter/input_tri.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes/flows2routes.duarcfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes/flows2routes.duarcfg --- sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes/flows2routes.duarcfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes/flows2routes.duarcfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes/input_net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes/input_net.net.xml --- sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes/input_net.net.xml 2014-06-06 22:02:54.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes/input_net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + @@ -34,7 +34,7 @@ - + @@ -44,7 +44,7 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes_100s_interval/flows2routes_100s_interval.duarcfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes_100s_interval/flows2routes_100s_interval.duarcfg --- sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes_100s_interval/flows2routes_100s_interval.duarcfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes_100s_interval/flows2routes_100s_interval.duarcfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes_100s_interval/input_net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes_100s_interval/input_net.net.xml --- sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes_100s_interval/input_net.net.xml 2014-06-06 22:02:54.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes_100s_interval/input_net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + @@ -34,7 +34,7 @@ - + @@ -44,7 +44,7 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes_100s_interval_ext/flows2routes_100s_interval_ext.duarcfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes_100s_interval_ext/flows2routes_100s_interval_ext.duarcfg --- sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes_100s_interval_ext/flows2routes_100s_interval_ext.duarcfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes_100s_interval_ext/flows2routes_100s_interval_ext.duarcfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes_100s_interval_ext/input_net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes_100s_interval_ext/input_net.net.xml --- sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes_100s_interval_ext/input_net.net.xml 2014-06-06 22:02:54.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes_100s_interval_ext/input_net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + @@ -34,7 +34,7 @@ - + @@ -44,7 +44,7 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes_200s_interval/flows2routes_200s_interval.duarcfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes_200s_interval/flows2routes_200s_interval.duarcfg --- sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes_200s_interval/flows2routes_200s_interval.duarcfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes_200s_interval/flows2routes_200s_interval.duarcfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes_200s_interval/input_net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes_200s_interval/input_net.net.xml --- sumo-0.21.0+dfsg/docs/examples/duarouter/flows2routes_200s_interval/input_net.net.xml 2014-06-06 22:02:54.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/flows2routes_200s_interval/input_net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + @@ -34,7 +34,7 @@ - + @@ -44,7 +44,7 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/duarouter/trips2routes/input_net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/trips2routes/input_net.net.xml --- sumo-0.21.0+dfsg/docs/examples/duarouter/trips2routes/input_net.net.xml 2014-06-06 22:02:54.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/trips2routes/input_net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + @@ -34,7 +34,7 @@ - + @@ -44,7 +44,7 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/duarouter/trips2routes/trips2routes.duarcfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/trips2routes/trips2routes.duarcfg --- sumo-0.21.0+dfsg/docs/examples/duarouter/trips2routes/trips2routes.duarcfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/duarouter/trips2routes/trips2routes.duarcfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/jtrrouter/straight_only_sinks/input_net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/jtrrouter/straight_only_sinks/input_net.net.xml --- sumo-0.21.0+dfsg/docs/examples/jtrrouter/straight_only_sinks/input_net.net.xml 2014-06-06 22:02:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/jtrrouter/straight_only_sinks/input_net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + @@ -85,14 +85,14 @@ - - - - + + + + diff -Nru sumo-0.21.0+dfsg/docs/examples/jtrrouter/straight_only_sinks/straight_only_sinks.jtrrcfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/jtrrouter/straight_only_sinks/straight_only_sinks.jtrrcfg --- sumo-0.21.0+dfsg/docs/examples/jtrrouter/straight_only_sinks/straight_only_sinks.jtrrcfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/jtrrouter/straight_only_sinks/straight_only_sinks.jtrrcfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/jtrrouter/turns/input_net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/jtrrouter/turns/input_net.net.xml --- sumo-0.21.0+dfsg/docs/examples/jtrrouter/turns/input_net.net.xml 2014-06-06 22:02:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/jtrrouter/turns/input_net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + @@ -85,14 +85,14 @@ - - - - + + + + diff -Nru sumo-0.21.0+dfsg/docs/examples/jtrrouter/turns/input_turns.turns.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/jtrrouter/turns/input_turns.turns.xml --- sumo-0.21.0+dfsg/docs/examples/jtrrouter/turns/input_turns.turns.xml 2013-09-07 22:03:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/jtrrouter/turns/input_turns.turns.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/jtrrouter/turns/turns.jtrrcfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/jtrrouter/turns/turns.jtrrcfg --- sumo-0.21.0+dfsg/docs/examples/jtrrouter/turns/turns.jtrrcfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/jtrrouter/turns/turns.jtrrcfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_edge2edge_conns/cross3l_edge2edge_conns.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_edge2edge_conns/cross3l_edge2edge_conns.netccfg --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_edge2edge_conns/cross3l_edge2edge_conns.netccfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_edge2edge_conns/cross3l_edge2edge_conns.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_edge2edge_conns/input_connections.con.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_edge2edge_conns/input_connections.con.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_edge2edge_conns/input_connections.con.xml 2013-09-07 22:03:03.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_edge2edge_conns/input_connections.con.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_edge2edge_conns/input_edges.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_edge2edge_conns/input_edges.edg.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_edge2edge_conns/input_edges.edg.xml 2013-09-07 22:03:03.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_edge2edge_conns/input_edges.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_edge2edge_conns/input_nodes.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_edge2edge_conns/input_nodes.nod.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_edge2edge_conns/input_nodes.nod.xml 2013-09-07 22:03:03.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_edge2edge_conns/input_nodes.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_lane2lane_conns/cross3l_lane2lane_conns.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_lane2lane_conns/cross3l_lane2lane_conns.netccfg --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_lane2lane_conns/cross3l_lane2lane_conns.netccfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_lane2lane_conns/cross3l_lane2lane_conns.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_lane2lane_conns/input_connections.con.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_lane2lane_conns/input_connections.con.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_lane2lane_conns/input_connections.con.xml 2013-09-07 22:03:03.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_lane2lane_conns/input_connections.con.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_lane2lane_conns/input_edges.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_lane2lane_conns/input_edges.edg.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_lane2lane_conns/input_edges.edg.xml 2013-09-07 22:03:03.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_lane2lane_conns/input_edges.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_lane2lane_conns/input_nodes.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_lane2lane_conns/input_nodes.nod.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_lane2lane_conns/input_nodes.nod.xml 2013-09-07 22:03:03.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_lane2lane_conns/input_nodes.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_no_turnarounds/cross3l_no_turnarounds.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_no_turnarounds/cross3l_no_turnarounds.netccfg --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_no_turnarounds/cross3l_no_turnarounds.netccfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_no_turnarounds/cross3l_no_turnarounds.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_no_turnarounds/input_edges.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_no_turnarounds/input_edges.edg.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_no_turnarounds/input_edges.edg.xml 2013-09-07 22:03:03.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_no_turnarounds/input_edges.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_no_turnarounds/input_nodes.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_no_turnarounds/input_nodes.nod.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_no_turnarounds/input_nodes.nod.xml 2013-09-07 22:03:03.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_no_turnarounds/input_nodes.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_prohibitions/cross3l_prohibitions.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_prohibitions/cross3l_prohibitions.netccfg --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_prohibitions/cross3l_prohibitions.netccfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_prohibitions/cross3l_prohibitions.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_prohibitions/input_connections.con.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_prohibitions/input_connections.con.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_prohibitions/input_connections.con.xml 2013-09-07 22:03:02.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_prohibitions/input_connections.con.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_prohibitions/input_edges.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_prohibitions/input_edges.edg.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_prohibitions/input_edges.edg.xml 2013-09-07 22:03:03.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_prohibitions/input_edges.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_prohibitions/input_nodes.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_prohibitions/input_nodes.nod.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_prohibitions/input_nodes.nod.xml 2013-09-07 22:03:03.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_prohibitions/input_nodes.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_unconstrained/cross3l_unconstrained.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_unconstrained/cross3l_unconstrained.netccfg --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_unconstrained/cross3l_unconstrained.netccfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_unconstrained/cross3l_unconstrained.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_unconstrained/input_edges.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_unconstrained/input_edges.edg.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_unconstrained/input_edges.edg.xml 2013-09-07 22:03:03.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_unconstrained/input_edges.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_unconstrained/input_nodes.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_unconstrained/input_nodes.nod.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/connections/cross3l_unconstrained/input_nodes.nod.xml 2013-09-07 22:03:03.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/connections/cross3l_unconstrained/input_nodes.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/dlr-testtrack/dlr-testtrack.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/dlr-testtrack/dlr-testtrack.netccfg --- sumo-0.21.0+dfsg/docs/examples/netconvert/dlr-testtrack/dlr-testtrack.netccfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/dlr-testtrack/dlr-testtrack.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/dlr-testtrack/input_connections.con.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/dlr-testtrack/input_connections.con.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/dlr-testtrack/input_connections.con.xml 2013-09-07 22:03:10.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/dlr-testtrack/input_connections.con.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/dlr-testtrack/input_edges.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/dlr-testtrack/input_edges.edg.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/dlr-testtrack/input_edges.edg.xml 2013-09-07 22:03:10.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/dlr-testtrack/input_edges.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/dlr-testtrack/input_nodes.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/dlr-testtrack/input_nodes.nod.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/dlr-testtrack/input_nodes.nod.xml 2013-09-07 22:03:10.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/dlr-testtrack/input_nodes.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/hokkaido/hokkaido.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/hokkaido/hokkaido.netccfg --- sumo-0.21.0+dfsg/docs/examples/netconvert/hokkaido/hokkaido.netccfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/hokkaido/hokkaido.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/hokkaido/input_edges.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/hokkaido/input_edges.edg.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/hokkaido/input_edges.edg.xml 2013-09-07 22:03:04.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/hokkaido/input_edges.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/hokkaido/input_nodes.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/hokkaido/input_nodes.nod.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/hokkaido/input_nodes.nod.xml 2013-09-07 22:03:04.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/hokkaido/input_nodes.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/OSM/adlershof_dlr/adlershof_dlr.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/OSM/adlershof_dlr/adlershof_dlr.netccfg --- sumo-0.21.0+dfsg/docs/examples/netconvert/OSM/adlershof_dlr/adlershof_dlr.netccfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/OSM/adlershof_dlr/adlershof_dlr.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/cross_notypes_kmh.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/cross_notypes_kmh.netccfg --- sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/cross_notypes_kmh.netccfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/cross_notypes_kmh.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/input_edges.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/input_edges.edg.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/input_edges.edg.xml 2013-09-07 22:03:04.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/input_edges.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/input_nodes.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/input_nodes.nod.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/input_nodes.nod.xml 2013-09-07 22:03:04.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/input_nodes.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/input_types.typ.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/input_types.typ.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/input_types.typ.xml 2013-09-07 22:03:04.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_notypes_kmh/input_types.typ.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/cross_usingtypes_kmh.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/cross_usingtypes_kmh.netccfg --- sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/cross_usingtypes_kmh.netccfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/cross_usingtypes_kmh.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/input_edges.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/input_edges.edg.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/input_edges.edg.xml 2013-09-07 22:03:04.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/input_edges.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/input_nodes.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/input_nodes.nod.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/input_nodes.nod.xml 2013-09-07 22:03:04.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/input_nodes.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/input_types.typ.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/input_types.typ.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/input_types.typ.xml 2013-09-07 22:03:04.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/speed_in_kmh/cross_usingtypes_kmh/input_types.typ.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_notypes/cross_notypes.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_notypes/cross_notypes.netccfg --- sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_notypes/cross_notypes.netccfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_notypes/cross_notypes.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_notypes/input_edges.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_notypes/input_edges.edg.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_notypes/input_edges.edg.xml 2013-09-07 22:03:06.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_notypes/input_edges.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_notypes/input_nodes.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_notypes/input_nodes.nod.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_notypes/input_nodes.nod.xml 2013-09-07 22:03:06.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_notypes/input_nodes.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_notypes/input_types.typ.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_notypes/input_types.typ.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_notypes/input_types.typ.xml 2013-09-07 22:03:06.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_notypes/input_types.typ.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_usingtypes/cross_usingtypes.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_usingtypes/cross_usingtypes.netccfg --- sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_usingtypes/cross_usingtypes.netccfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_usingtypes/cross_usingtypes.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_usingtypes/input_edges.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_usingtypes/input_edges.edg.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_usingtypes/input_edges.edg.xml 2013-09-07 22:03:06.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_usingtypes/input_edges.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_usingtypes/input_nodes.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_usingtypes/input_nodes.nod.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_usingtypes/input_nodes.nod.xml 2013-09-07 22:03:06.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_usingtypes/input_nodes.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_usingtypes/input_types.typ.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_usingtypes/input_types.typ.xml --- sumo-0.21.0+dfsg/docs/examples/netconvert/types/cross_usingtypes/input_types.typ.xml 2013-09-07 22:03:06.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/netconvert/types/cross_usingtypes/input_types.typ.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/busses/busses.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/busses/busses.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/busses/busses.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/busses/busses.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/busses/input_additional.add.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/busses/input_additional.add.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/busses/input_additional.add.xml 2014-04-11 22:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/busses/input_additional.add.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/busses/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/busses/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/busses/input_routes.rou.xml 2013-09-07 22:02:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/busses/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/busses/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/busses/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/busses/net.net.xml 2014-06-06 22:02:38.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/busses/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,9 +1,9 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/busses/vehroutes.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/busses/vehroutes.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/busses/vehroutes.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/busses/vehroutes.xml 2015-04-17 05:44:23.000000000 +0000 @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/hokkaido/hokkaido.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/hokkaido/hokkaido.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/hokkaido/hokkaido.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/hokkaido/hokkaido.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/hokkaido/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/hokkaido/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/hokkaido/input_routes.rou.xml 2013-09-07 22:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/hokkaido/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/hokkaido/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/hokkaido/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/hokkaido/net.net.xml 2014-06-06 22:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/hokkaido/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_emission/cross3ltl_emission.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_emission/cross3ltl_emission.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_emission/cross3ltl_emission.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_emission/cross3ltl_emission.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_emission/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_emission/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_emission/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_emission/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_emission/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_emission/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_emission/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_emission/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_emissions/summary.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_emissions/summary.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_emissions/summary.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_emissions/summary.xml 2015-04-17 05:44:23.000000000 +0000 @@ -0,0 +1,470 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_fcd/cross3ltl_fcd.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_fcd/cross3ltl_fcd.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_fcd/cross3ltl_fcd.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_fcd/cross3ltl_fcd.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_fcd/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_fcd/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_fcd/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_fcd/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_fcd/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_fcd/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_fcd/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_fcd/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_full/cross3ltl_full.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_full/cross3ltl_full.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_full/cross3ltl_full.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_full/cross3ltl_full.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_full/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_full/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_full/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_full/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_full/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_full/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_full/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_full/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_inductloops/cross3ltl_inductloops.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_inductloops/cross3ltl_inductloops.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_inductloops/cross3ltl_inductloops.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_inductloops/cross3ltl_inductloops.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_inductloops/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_inductloops/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_inductloops/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_inductloops/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_inductloops/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_inductloops/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_inductloops/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_inductloops/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_constrained/cross3ltl_meandata_constrained.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_constrained/cross3ltl_meandata_constrained.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_constrained/cross3ltl_meandata_constrained.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_constrained/cross3ltl_meandata_constrained.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_constrained/input_additional.add.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_constrained/input_additional.add.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_constrained/input_additional.add.xml 2013-10-29 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_constrained/input_additional.add.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_constrained/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_constrained/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_constrained/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_constrained/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_constrained/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_constrained/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_constrained/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_constrained/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_edges/cross3ltl_meandata_edges.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_edges/cross3ltl_meandata_edges.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_edges/cross3ltl_meandata_edges.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_edges/cross3ltl_meandata_edges.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_edges/input_additional.add.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_edges/input_additional.add.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_edges/input_additional.add.xml 2013-10-29 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_edges/input_additional.add.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_edges/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_edges/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_edges/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_edges/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_edges/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_edges/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_edges/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_edges/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_lanes/cross3ltl_meandata_lanes.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_lanes/cross3ltl_meandata_lanes.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_lanes/cross3ltl_meandata_lanes.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_lanes/cross3ltl_meandata_lanes.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_lanes/input_additional.add.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_lanes/input_additional.add.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_lanes/input_additional.add.xml 2013-10-29 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_lanes/input_additional.add.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_lanes/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_lanes/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_lanes/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_lanes/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_lanes/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_lanes/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_meandata_lanes/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_meandata_lanes/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_queue/cross3ltl_queue.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_queue/cross3ltl_queue.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_queue/cross3ltl_queue.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_queue/cross3ltl_queue.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_queue/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_queue/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_queue/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_queue/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_queue/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_queue/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_queue/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_queue/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_rawdump/cross3ltl_rawdump.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_rawdump/cross3ltl_rawdump.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_rawdump/cross3ltl_rawdump.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_rawdump/cross3ltl_rawdump.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_rawdump/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_rawdump/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_rawdump/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_rawdump/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_rawdump/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_rawdump/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_rawdump/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_rawdump/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_summary/cross3ltl_summary.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_summary/cross3ltl_summary.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_summary/cross3ltl_summary.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_summary/cross3ltl_summary.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_summary/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_summary/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_summary/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_summary/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_summary/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_summary/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_summary/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_summary/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_tripinfo/cross3ltl_tripinfo.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_tripinfo/cross3ltl_tripinfo.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_tripinfo/cross3ltl_tripinfo.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_tripinfo/cross3ltl_tripinfo.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_tripinfo/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_tripinfo/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_tripinfo/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_tripinfo/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_tripinfo/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_tripinfo/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_tripinfo/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_tripinfo/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_tripinfo/tripinfos.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_tripinfo/tripinfos.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_tripinfo/tripinfos.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_tripinfo/tripinfos.xml 2015-04-17 05:44:23.000000000 +0000 @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vehroutes/cross3ltl_vehroutes.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vehroutes/cross3ltl_vehroutes.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vehroutes/cross3ltl_vehroutes.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vehroutes/cross3ltl_vehroutes.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vehroutes/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vehroutes/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vehroutes/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vehroutes/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vehroutes/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vehroutes/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vehroutes/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vehroutes/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vtypeprobe/cross3ltl_vtypeprobe.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vtypeprobe/cross3ltl_vtypeprobe.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vtypeprobe/cross3ltl_vtypeprobe.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vtypeprobe/cross3ltl_vtypeprobe.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vtypeprobe/input_additional.add.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vtypeprobe/input_additional.add.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vtypeprobe/input_additional.add.xml 2013-09-07 22:02:53.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vtypeprobe/input_additional.add.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vtypeprobe/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vtypeprobe/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vtypeprobe/input_routes.rou.xml 2013-09-11 22:02:59.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vtypeprobe/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vtypeprobe/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vtypeprobe/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/output/cross3ltl_vtypeprobe/net.net.xml 2014-06-06 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/output/cross3ltl_vtypeprobe/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box1l/box1l.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box1l/box1l.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box1l/box1l.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box1l/box1l.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box1l/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box1l/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box1l/input_routes.rou.xml 2013-09-07 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box1l/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box1l/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box1l/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box1l/net.net.xml 2014-06-06 22:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box1l/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box2l/box2l.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box2l/box2l.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box2l/box2l.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box2l/box2l.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box2l/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box2l/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box2l/input_routes.rou.xml 2013-09-07 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box2l/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box2l/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box2l/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box2l/net.net.xml 2014-06-06 22:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box2l/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + @@ -31,11 +31,11 @@ - + - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box3l/box3l.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box3l/box3l.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box3l/box3l.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box3l/box3l.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box3l/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box3l/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box3l/input_routes.rou.xml 2013-09-07 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box3l/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box3l/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box3l/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box3l/net.net.xml 2014-06-06 22:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box3l/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box4l/box4l.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box4l/box4l.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box4l/box4l.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box4l/box4l.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box4l/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box4l/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box4l/input_routes.rou.xml 2013-09-07 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box4l/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box4l/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box4l/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/box/box4l/net.net.xml 2014-06-06 22:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/box/box4l/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross1l/cross1l.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross1l/cross1l.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross1l/cross1l.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross1l/cross1l.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross1l/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross1l/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross1l/input_routes.rou.xml 2013-09-07 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross1l/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross1l/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross1l/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross1l/net.net.xml 2014-06-06 22:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross1l/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross1ltl/cross1ltl.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross1ltl/cross1ltl.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross1ltl/cross1ltl.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross1ltl/cross1ltl.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross1ltl/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross1ltl/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross1ltl/input_routes.rou.xml 2013-09-07 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross1ltl/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross1ltl/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross1ltl/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross1ltl/net.net.xml 2014-06-06 22:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross1ltl/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross3l/cross3l.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross3l/cross3l.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross3l/cross3l.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross3l/cross3l.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross3l/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross3l/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross3l/input_routes.rou.xml 2013-09-07 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross3l/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross3l/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross3l/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross3l/net.net.xml 2014-06-06 22:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross3l/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross3ltl/cross3ltl.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross3ltl/cross3ltl.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross3ltl/cross3ltl.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross3ltl/cross3ltl.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross3ltl/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross3ltl/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross3ltl/input_routes.rou.xml 2013-09-07 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross3ltl/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross3ltl/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross3ltl/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/simple_nets/cross/cross3ltl/net.net.xml 2014-06-06 22:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/simple_nets/cross/cross3ltl/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/variable_speed_signs/aggregated_25.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/variable_speed_signs/aggregated_25.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/variable_speed_signs/aggregated_25.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/variable_speed_signs/aggregated_25.xml 2015-04-17 05:44:23.000000000 +0000 @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/variable_speed_signs/input_additional2.add.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/variable_speed_signs/input_additional2.add.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/variable_speed_signs/input_additional2.add.xml 2013-10-29 23:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/variable_speed_signs/input_additional2.add.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,3 +1,3 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/variable_speed_signs/input_additional.add.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/variable_speed_signs/input_additional.add.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/variable_speed_signs/input_additional.add.xml 2013-10-29 23:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/variable_speed_signs/input_additional.add.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,3 +1,3 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/variable_speed_signs/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/variable_speed_signs/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/variable_speed_signs/input_routes.rou.xml 2013-09-07 22:02:32.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/variable_speed_signs/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/variable_speed_signs/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/variable_speed_signs/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/variable_speed_signs/net.net.xml 2014-06-06 22:02:38.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/variable_speed_signs/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/variable_speed_signs/variable_speed_signs.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/variable_speed_signs/variable_speed_signs.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/variable_speed_signs/variable_speed_signs.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/variable_speed_signs/variable_speed_signs.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/vehicle_stops/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/vehicle_stops/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/vehicle_stops/input_routes.rou.xml 2013-09-07 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/vehicle_stops/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/vehicle_stops/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/vehicle_stops/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/vehicle_stops/net.net.xml 2014-06-06 22:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/vehicle_stops/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/vehicle_stops/vehicle_stops.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/vehicle_stops/vehicle_stops.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/vehicle_stops/vehicle_stops.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/vehicle_stops/vehicle_stops.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/vehicle_stops/vehroutes.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/vehicle_stops/vehroutes.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/vehicle_stops/vehroutes.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/vehicle_stops/vehroutes.xml 2015-04-17 05:44:23.000000000 +0000 @@ -0,0 +1,26 @@ + + + + + + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/visualization/parade/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/visualization/parade/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/visualization/parade/input_routes.rou.xml 2014-04-14 22:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/visualization/parade/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/visualization/parade/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/visualization/parade/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/sumo/visualization/parade/net.net.xml 2014-06-06 22:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/visualization/parade/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/sumo/visualization/parade/parade.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/visualization/parade/parade.sumocfg --- sumo-0.21.0+dfsg/docs/examples/sumo/visualization/parade/parade.sumocfg 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/sumo/visualization/parade/parade.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/dua-iterate/dua-iterate.bat sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/dua-iterate/dua-iterate.bat --- sumo-0.21.0+dfsg/docs/examples/tools/dua-iterate/dua-iterate.bat 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/dua-iterate/dua-iterate.bat 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1 @@ +%SUMO_HOME%/tools/assign/duaIterate.py -n input_net.net.xml -t input_trips.trips.xml -l 5 \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/dua-iterate/dua-iterate.sh sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/dua-iterate/dua-iterate.sh --- sumo-0.21.0+dfsg/docs/examples/tools/dua-iterate/dua-iterate.sh 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/dua-iterate/dua-iterate.sh 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1 @@ +$SUMO_HOME/tools/assign/duaIterate.py -n input_net.net.xml -t input_trips.trips.xml -l 5 \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/dua-iterate/input_net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/dua-iterate/input_net.net.xml --- sumo-0.21.0+dfsg/docs/examples/tools/dua-iterate/input_net.net.xml 2014-06-06 22:02:46.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/dua-iterate/input_net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/dua-iterate/routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/dua-iterate/routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/tools/dua-iterate/routes.rou.xml 2013-09-07 22:02:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/dua-iterate/routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/flowrouter/flowrouter.bat sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/flowrouter/flowrouter.bat --- sumo-0.21.0+dfsg/docs/examples/tools/flowrouter/flowrouter.bat 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/flowrouter/flowrouter.bat 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1 @@ +%SUMO_HOME%/tools/detector/flowrouter.py -n input_net.net.xml -d input_detectors.det.xml -f input_flows.txt \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/flowrouter/flowrouter.sh sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/flowrouter/flowrouter.sh --- sumo-0.21.0+dfsg/docs/examples/tools/flowrouter/flowrouter.sh 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/flowrouter/flowrouter.sh 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1 @@ +$SUMO_HOME/tools/detector/flowrouter.py -n input_net.net.xml -d input_detectors.det.xml -f input_flows.txt \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/flowrouter/input_detectors.det.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/flowrouter/input_detectors.det.xml --- sumo-0.21.0+dfsg/docs/examples/tools/flowrouter/input_detectors.det.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/flowrouter/input_detectors.det.xml 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/flowrouter/input_flows.txt sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/flowrouter/input_flows.txt --- sumo-0.21.0+dfsg/docs/examples/tools/flowrouter/input_flows.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/flowrouter/input_flows.txt 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,36 @@ +Detector;Time;qPKW +1;0;26 +2;0;16 +4;0;15 +6;0;61 +9;0;249 +13;0;49 +15;0;47 +17;0;26 +19;0;212 +21;0;62 +23;0;0 +25;0;204 +28;0;1 +32;0;337 +33;0;69 +34;0;0 +35;0;1 +36;0;303 +39;0;76 +46;0;15 +47;0;97 +48;0;281 +49;0;249 +50;0;119 +51;0;22 +53;0;2 +54;0;0 +57;0;0 +60;0;21 +61;0;5 +62;0;43 +63;0;13 +64;0;56 +65;0;2 +66;0;0 diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/flowrouter/input_net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/flowrouter/input_net.net.xml --- sumo-0.21.0+dfsg/docs/examples/tools/flowrouter/input_net.net.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/flowrouter/input_net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,381 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/traceExporter/fcd.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/traceExporter/fcd.xml --- sumo-0.21.0+dfsg/docs/examples/tools/traceExporter/fcd.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/traceExporter/fcd.xml 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,497 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/traceExporter/input_routes.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/traceExporter/input_routes.rou.xml --- sumo-0.21.0+dfsg/docs/examples/tools/traceExporter/input_routes.rou.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/traceExporter/input_routes.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/traceExporter/net.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/traceExporter/net.net.xml --- sumo-0.21.0+dfsg/docs/examples/tools/traceExporter/net.net.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/traceExporter/net.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/traceExporter/traceExporter.bat sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/traceExporter/traceExporter.bat --- sumo-0.21.0+dfsg/docs/examples/tools/traceExporter/traceExporter.bat 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/traceExporter/traceExporter.bat 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1 @@ +%SUMO_HOME%/tools/traceExporter.py -i fcd.xml -n net.net.xml --ns2mobility-output mobilityfile.tcl \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/docs/examples/tools/traceExporter/traceExporter.sh sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/traceExporter/traceExporter.sh --- sumo-0.21.0+dfsg/docs/examples/tools/traceExporter/traceExporter.sh 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/examples/tools/traceExporter/traceExporter.sh 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1 @@ +$SUMO_HOME/tools/traceExporter.py -i fcd.xml -n net.net.xml --ns2mobility-output mobilityfile.tcl \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/docs/tutorial/city_mobil/agentManager.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/agentManager.py --- sumo-0.21.0+dfsg/docs/tutorial/city_mobil/agentManager.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/agentManager.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2008-10-09 -@version $Id: agentManager.py 16253 2014-04-25 12:09:01Z behrisch $ +@version $Id: agentManager.py 18096 2015-03-17 09:50:59Z behrisch $ Control the CityMobil parking lot with a multi agent system. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -17,18 +17,21 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import vehicleControl, statistics +import vehicleControl +import statistics from constants import * + class PersonAgent: + def __init__(self, id): self.id = id - + def startRequest(self, source, target, cybers): minCost = INFINITY minCar = None for car in cybers: - cost = car.request(self, source, target) + cost = car.request(self, source, target) if (cost < minCost): if minCar: minCar.reject(self) @@ -38,18 +41,22 @@ car.reject(self) minCar.accept(self) + class Task: + def __init__(self, person, source, target, estCost): self.person = person self.source = source self.target = target self.estCost = estCost self.startStep = None - + def __repr__(self): return "<%s %s %s %s>" % (self.person.id, self.source, self.target, self.startStep) + class CyberAgent: + def __init__(self, id): self.id = id self.load = 0 @@ -60,7 +67,7 @@ self.totalEstimatedCost = 0 self.position = None self.broken = False - + def request(self, person, source, target): if self.broken: estCost = INFINITY @@ -79,7 +86,6 @@ def reject(self, person): del self.pending[person] - def _findNextTarget(self, wait): minTarget = "z" @@ -100,7 +106,7 @@ if task.source < minDownstreamSource and task.source > edge: minDownstreamSource = task.source if minDownstreamTarget != "z": - minTarget = minDownstreamTarget + minTarget = minDownstreamTarget elif minDownstreamSource < minTarget: minTarget = minDownstreamSource elif minTarget < edge and minSource < minTarget: @@ -124,12 +130,13 @@ statistics.personUnloaded(task.person.id, step) self.load -= 1 wait += WAIT_PER_PERSON - self.costMatrix[(task.source, task.target)] = step - task.startStep + self.costMatrix[ + (task.source, task.target)] = step - task.startStep self.totalEstimatedCost -= task.estCost else: running.append(task) self.running = running - if self.load < vehicleControl.getCapacity(): + if self.load < vehicleControl.getCapacity(): tasks = [] for task in self.tasks: if task.source == self.position and self.load < vehicleControl.getCapacity(): @@ -151,6 +158,7 @@ for task in tasks: task.person.startRequest(task.source, task.target, cybers) + class AgentManager(vehicleControl.Manager): def __init__(self): @@ -166,7 +174,7 @@ def cyberCarArrived(self, vehicleID, edge): if vehicleID in self.agents: - cyberCar = self.agents[vehicleID] + cyberCar = self.agents[vehicleID] else: cyberCar = CyberAgent(vehicleID) self.agents[vehicleID] = cyberCar diff -Nru sumo-0.21.0+dfsg/docs/tutorial/city_mobil/constants.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/constants.py --- sumo-0.21.0+dfsg/docs/tutorial/city_mobil/constants.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/constants.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2008-07-21 -@version $Id: constants.py 16379 2014-05-14 09:28:38Z behrisch $ +@version $Id: constants.py 18096 2015-03-17 09:50:59Z behrisch $ Defining constants for the CityMobil parking lot. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -17,14 +17,15 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import os, sys +import os +import sys INFINITY = 1e400 PREFIX = "park" DOUBLE_ROWS = 8 ROW_DIST = 35 -STOP_POS = ROW_DIST-12 +STOP_POS = ROW_DIST - 12 SLOTS_PER_ROW = 10 SLOT_WIDTH = 5 SLOT_LENGTH = 9 @@ -40,7 +41,8 @@ BREAK_DELAY = 1200 PORT = 8883 -SUMO_HOME = os.path.realpath(os.environ.get("SUMO_HOME", os.path.join(os.path.dirname(__file__), "..", "..", "..", ".."))) +SUMO_HOME = os.path.realpath(os.environ.get( + "SUMO_HOME", os.path.join(os.path.dirname(__file__), "..", "..", "..", ".."))) sys.path.append(os.path.join(SUMO_HOME, "tools")) try: from sumolib import checkBinary diff -Nru sumo-0.21.0+dfsg/docs/tutorial/city_mobil/createNet.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/createNet.py --- sumo-0.21.0+dfsg/docs/tutorial/city_mobil/createNet.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/createNet.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,13 +5,13 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2008-07-04 -@version $Id: createNet.py 16253 2014-04-25 12:09:01Z behrisch $ +@version $Id: createNet.py 18096 2015-03-17 09:50:59Z behrisch $ Create the XML input files for the generation of the SUMO network of the CityMobil parking lot. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -19,7 +19,8 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import os, random +import os +import random from constants import * occupied = 0 @@ -34,70 +35,90 @@ """ % (CYBER_LENGTH, CYBER_SPEED) -#streets +# streets nodeID = "main-0" -print >> nodes, '' -print >> nodes, '' % nodeID +print >> nodes, '' +print >> nodes, '' % nodeID print >> edges, '' % nodeID for row in range(DOUBLE_ROWS): - nextNodeID = "main%s-%s" % (row, row+1) + nextNodeID = "main%s-%s" % (row, row + 1) if row + 1 == DOUBLE_ROWS: - nextNodeID = "main%s-" % row - x = (row+1) * ROW_DIST - print >> nodes, '' % (nextNodeID, x) - print >> edges, '' % (row, nodeID, nextNodeID) - nodeID = nextNodeID -print >> nodes, '' % (x+100) + nextNodeID = "main%s-" % row + x = (row + 1) * ROW_DIST + print >> nodes, '' % (nextNodeID, x) + print >> edges, '' % ( + row, nodeID, nextNodeID) + nodeID = nextNodeID +print >> nodes, '' % (x + 100) print >> edges, '' % nodeID -roads = ["road-0"] -for row in range(DOUBLE_ROWS-1): - roads.append("road%s-%s" % (row, row+1)) -roads.append("road%s-" % (row+1)) +roads = ["road-0"] +for row in range(DOUBLE_ROWS - 1): + roads.append("road%s-%s" % (row, row + 1)) +roads.append("road%s-" % (row + 1)) for idx, road in enumerate(roads): nodeID = road.replace("road", "main") for slot in range(SLOTS_PER_ROW): partID = "%s-%s" % (road, slot) - print >> nodes, '' % (partID, idx*ROW_DIST, (slot+1)*SLOT_WIDTH) - print >> edges, '' % (partID, nodeID, partID) - print >> edges, '' % (partID, partID, nodeID) + print >> nodes, '' % ( + partID, idx * ROW_DIST, (slot + 1) * SLOT_WIDTH) + print >> edges, '' % ( + partID, nodeID, partID) + print >> edges, '' % ( + partID, partID, nodeID) nodeID = "%st" % partID for row in range(DOUBLE_ROWS): for slot in range(SLOTS_PER_ROW): slotID = "slot%s-%sl" % (row, slot) source = "%s-%st" % (roads[row], slot) - print >> nodes, '' % (slotID, row*ROW_DIST+SLOT_LENGTH, (slot+1)*SLOT_WIDTH) - print >> edges, '' % (slotID, source, slotID) - print >> edges, '' % (slotID, slotID, source) + print >> nodes, '' % ( + slotID, row * ROW_DIST + SLOT_LENGTH, (slot + 1) * SLOT_WIDTH) + print >> edges, '' % ( + slotID, source, slotID) + print >> edges, '' % ( + slotID, slotID, source) slotID = "slot%s-%sr" % (row, slot) - source = "%s-%st" % (roads[row+1], slot) - print >> nodes, '' % (slotID, (row+1)*ROW_DIST-SLOT_LENGTH, (slot+1)*SLOT_WIDTH) - print >> edges, '' % (slotID, source, slotID) - print >> edges, '' % (slotID, slotID, source) -#footpaths -y = (SLOTS_PER_ROW+1) * SLOT_WIDTH + source = "%s-%st" % (roads[row + 1], slot) + print >> nodes, '' % ( + slotID, (row + 1) * ROW_DIST - SLOT_LENGTH, (slot + 1) * SLOT_WIDTH) + print >> edges, '' % ( + slotID, source, slotID) + print >> edges, '' % ( + slotID, slotID, source) +# footpaths +y = (SLOTS_PER_ROW + 1) * SLOT_WIDTH print >> nodes, '' % y print >> edges, '' for row in range(DOUBLE_ROWS): nodeID = "foot%s" % row - x = row * ROW_DIST + ROW_DIST/2 - print >> nodes, '' % (nodeID, x, y) + x = row * ROW_DIST + ROW_DIST / 2 + print >> nodes, '' % (nodeID, x, y) if row > 0: - edgeID = "footmain%sto%s" % (row-1, row) - print >> edges, '' % (edgeID, row-1, row) + edgeID = "footmain%sto%s" % (row - 1, row) + print >> edges, '' % ( + edgeID, row - 1, row) for slot in reversed(range(SLOTS_PER_ROW)): slotID = "foot%s-%s" % (row, slot) - print >> nodes, '' % (slotID, x, (slot+1)*SLOT_WIDTH) - print >> edges, '' % (nodeID, slot, nodeID, slotID) - print >> edges, '' % (nodeID, slot, slotID, nodeID) - print >> nodes, '' % (slotID, x+SLOT_FOOT_LENGTH, (slot+1)*SLOT_WIDTH) - print >> edges, '' % (slotID, slotID, slotID) - print >> edges, '' % (slotID, slotID, slotID) - print >> nodes, '' % (slotID, x-SLOT_FOOT_LENGTH, (slot+1)*SLOT_WIDTH) - print >> edges, '' % (slotID, slotID, slotID) - print >> edges, '' % (slotID, slotID, slotID) + print >> nodes, '' % ( + slotID, x, (slot + 1) * SLOT_WIDTH) + print >> edges, '' % ( + nodeID, slot, nodeID, slotID) + print >> edges, '' % ( + nodeID, slot, slotID, nodeID) + print >> nodes, '' % ( + slotID, x + SLOT_FOOT_LENGTH, (slot + 1) * SLOT_WIDTH) + print >> edges, '' % ( + slotID, slotID, slotID) + print >> edges, '' % ( + slotID, slotID, slotID) + print >> nodes, '' % ( + slotID, x - SLOT_FOOT_LENGTH, (slot + 1) * SLOT_WIDTH) + print >> edges, '' % ( + slotID, slotID, slotID) + print >> edges, '' % ( + slotID, slotID, slotID) nodeID = slotID - vSlot = slotID.replace("foot", "slot") - if random.uniform(0,1) < OCCUPATION_PROBABILITY: + vSlot = slotID.replace("foot", "slot") + if random.uniform(0, 1) < OCCUPATION_PROBABILITY: occupied += 1 print >> routes, """\ @@ -108,7 +129,7 @@ """ % (slotID, CAR_CAPACITY, slotID, slotID) - if random.uniform(0,1) < OCCUPATION_PROBABILITY: + if random.uniform(0, 1) < OCCUPATION_PROBABILITY: occupied += 1 print >> routes, """\ @@ -119,37 +140,42 @@ """ % (slotID, CAR_CAPACITY, slotID, slotID) -x = DOUBLE_ROWS * ROW_DIST + ROW_DIST/2 -print >> nodes, '' % (DOUBLE_ROWS, x, y) -edgeID = "footmain%sto%s" % (DOUBLE_ROWS-1, DOUBLE_ROWS) -print >> edges, '' % (edgeID, DOUBLE_ROWS-1, DOUBLE_ROWS) -print >> nodes, '' % (x+100, y) -print >> edges, '' % DOUBLE_ROWS -print >> nodes, '' % (x+100, y-10) +x = DOUBLE_ROWS * ROW_DIST + ROW_DIST / 2 +print >> nodes, '' % (DOUBLE_ROWS, x, y) +edgeID = "footmain%sto%s" % (DOUBLE_ROWS - 1, DOUBLE_ROWS) +print >> edges, '' % ( + edgeID, DOUBLE_ROWS - 1, DOUBLE_ROWS) +print >> nodes, '' % (x + 100, y) +print >> edges, '' % DOUBLE_ROWS +print >> nodes, '' % (x + 100, y - 10) print >> edges, '' % DOUBLE_ROWS -#cybercar (automated bus) -y = (SLOTS_PER_ROW+3) * SLOT_WIDTH +# cybercar (automated bus) +y = (SLOTS_PER_ROW + 3) * SLOT_WIDTH print >> nodes, '' % y -print >> edges, '' -print >> edges, '' -for row in range(DOUBLE_ROWS+1): +print >> edges, '' +print >> edges, '' +for row in range(DOUBLE_ROWS + 1): nodeID = "cyber%s" % row - x = row * ROW_DIST + ROW_DIST/2 - print >> nodes, '' % (nodeID, x, y) + x = row * ROW_DIST + ROW_DIST / 2 + print >> nodes, '' % (nodeID, x, y) if row > 0: - edgeID = "cyber%sto%s" % (row-1, row) - print >> edges, '' % (edgeID, row-1, row) - print >> edges, '' % (edgeID, row, row-1) + edgeID = "cyber%sto%s" % (row - 1, row) + print >> edges, '' % ( + edgeID, row - 1, row) + print >> edges, '' % ( + edgeID, row, row - 1) if row < DOUBLE_ROWS: - print >> connections, '' % (edgeID, row, row+1) - print >> connections, '' % (row, row+1, edgeID) + print >> connections, '' % ( + edgeID, row, row + 1) + print >> connections, '' % ( + row, row + 1, edgeID) else: print >> connections, '' % edgeID print >> connections, '' % edgeID -print >> nodes, '' % (x+100, y) -print >> edges, '' % row -print >> edges, '' % row +print >> nodes, '' % (x + 100, y) +print >> edges, '' % row +print >> edges, '' % row print >> nodes, "" @@ -159,7 +185,8 @@ print >> connections, "" connections.close() -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)) +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, """ @@ -179,13 +206,15 @@ stops = open("%s.add.xml" % PREFIX, "w") print >> stops, "" for row in range(DOUBLE_ROWS): - edgeID = "cyber%sto%s" % (row, row+1) + edgeID = "cyber%sto%s" % (row, row + 1) print >> stops, ' > stops, 'startPos="%s" endPos="%s"/>' % (STOP_POS-2*CYBER_LENGTH-1, STOP_POS) + print >> stops, 'startPos="%s" endPos="%s"/>' % ( + STOP_POS - 2 * CYBER_LENGTH - 1, STOP_POS) for edge in ["cyberin", "cyberout"]: print >> stops, ' > stops, 'startPos="%s" endPos="%s"/>' % (90-2*CYBER_LENGTH-1, 90) -print >> stops, ' ' + print >> stops, 'startPos="%s" endPos="%s"/>' % ( + 90 - 2 * CYBER_LENGTH - 1, 90) +print >> stops, ' ' print >> stops, "" stops.close() @@ -198,11 +227,11 @@ if occupied < totalSlots: print >> routes, """ - """ % (period, totalSlots-occupied) + """ % (period, totalSlots - occupied) if occupied > 0: print >> routes, """ - """ % (period, occupied*CAR_CAPACITY) + """ % (period, occupied * CAR_CAPACITY) print >> routes, "" routes.close() diff -Nru sumo-0.21.0+dfsg/docs/tutorial/city_mobil/runner.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/runner.py --- sumo-0.21.0+dfsg/docs/tutorial/city_mobil/runner.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/runner.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2011-10-28 -@version $Id: runner.py 16253 2014-04-25 12:09:01Z behrisch $ +@version $Id: runner.py 18096 2015-03-17 09:50:59Z behrisch $ This script is a test runner for the CityMobil scenario. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -19,9 +19,12 @@ """ -import os, sys +import os +import sys import shutil -import vehicleControl, simpleManager, agentManager +import vehicleControl +import simpleManager +import agentManager # build/check network import createNet @@ -29,5 +32,7 @@ vehicleControl.init(simpleManager.SimpleManager(), True) # perform agent scenario vehicleControl.init(agentManager.AgentManager(), True) -try: shutil.copy("all-the-results.txt", "../result2") -except: print "Missing 'all-the-results.txt'" +try: + shutil.copy("all-the-results.txt", "../result2") +except: + print "Missing 'all-the-results.txt'" diff -Nru sumo-0.21.0+dfsg/docs/tutorial/city_mobil/simpleManager.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/simpleManager.py --- sumo-0.21.0+dfsg/docs/tutorial/city_mobil/simpleManager.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/simpleManager.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2008-10-09 -@version $Id: simpleManager.py 16253 2014-04-25 12:09:01Z behrisch $ +@version $Id: simpleManager.py 18096 2015-03-17 09:50:59Z behrisch $ Control the CityMobil parking lot with a simple first come first serve approach. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -18,9 +18,11 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import vehicleControl, statistics +import vehicleControl +import statistics from constants import * + class SimpleManager(vehicleControl.Manager): def __init__(self): @@ -54,8 +56,9 @@ row = -1 else: row = int(edge[5]) - if row < DOUBLE_ROWS-1: - vehicleControl.stopAt(vehicleID, "cyber%sto%s" % (row+1, row+2)) + if row < DOUBLE_ROWS - 1: + vehicleControl.stopAt( + vehicleID, "cyber%sto%s" % (row + 1, row + 2)) else: vehicleControl.stopAt(vehicleID, "cyberout") self.cyberCarLoad[vehicleID] = load diff -Nru sumo-0.21.0+dfsg/docs/tutorial/city_mobil/statistics.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/statistics.py --- sumo-0.21.0+dfsg/docs/tutorial/city_mobil/statistics.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/statistics.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2008-10-17 -@version $Id: statistics.py 16253 2014-04-25 12:09:01Z behrisch $ +@version $Id: statistics.py 18096 2015-03-17 09:50:59Z behrisch $ Collecting statistics for the CityMobil parking lot -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -20,7 +20,9 @@ persons = {} personsRunning = 0 + class Person: + def __init__(self, id, source, target, step): self.id = id self.source = source @@ -29,22 +31,27 @@ self.depart = None self.arrive = None + def personArrived(personID, edge, target, step): global personsRunning persons[personID] = Person(personID, edge, target, step) personsRunning += 1 + def personLoaded(personID, step): persons[personID].depart = step + def personUnloaded(personID, step): global personsRunning persons[personID].arrive = step personsRunning -= 1 + def evaluate(forTest=False): try: - import numpy, math + import numpy + import math except ImportError: print "No numpy available, skipping statistics" return @@ -52,23 +59,23 @@ routeTimes = {} for person in persons.itervalues(): waitTimes.append(person.depart - person.waitStart) - route = (person.source, person.target) + route = (person.source, person.target) if not route in routeTimes: - routeTimes[route] = [] - routeTimes[route].append(person.arrive - person.depart) + routeTimes[route] = [] + routeTimes[route].append(person.arrive - person.depart) waitArray = numpy.array(waitTimes) 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) if forTest: print route, timeArray.max() < 1000, timeArray.mean() < 1000, math.sqrt(timeArray.var()) < 100 - else: + else: print route, timeArray.max(), timeArray.mean(), math.sqrt(timeArray.var()) - + co2 = 0. for line in open("aggregated.xml"): if "cyber" in line: @@ -76,10 +83,10 @@ if pos >= 9: endpos = line.find('"', pos) co2 += float(line[pos:endpos]) - + if forTest: print "CO2:", co2 < 10000000 - else: + else: print "CO2:", co2 if __name__ == "__main__": @@ -114,8 +121,10 @@ rdev.append(float(line.split()[-1])) stats.close() figure() - errorbar(demand, simpleWaitMean, simpleWaitDev, lw=2, ms=10, fmt='o', label='standard bus scenario') - errorbar(demand, agentWaitMean, agentWaitDev, lw=2, ms=10, color="red", fmt='o', label='agent controlled cyber cars') + errorbar(demand, simpleWaitMean, simpleWaitDev, lw=2, + ms=10, fmt='o', label='standard bus scenario') + errorbar(demand, agentWaitMean, agentWaitDev, lw=2, ms=10, + color="red", fmt='o', label='agent controlled cyber cars') xlim(0, 50) ylim(0, 3300) xlabel('Repeater interval (s)') @@ -124,8 +133,10 @@ legend(numpoints=1) savefig("waitingtime.png") figure() - errorbar(demand, simpleRouteMean, simpleRouteDev, lw=2, ms=10, fmt='o', label='standard bus scenario') - errorbar(demand, agentRouteMean, agentRouteDev, lw=2, ms=10, color="red", fmt='o', label='agent controlled cyber cars') + errorbar(demand, simpleRouteMean, simpleRouteDev, lw=2, + ms=10, fmt='o', label='standard bus scenario') + errorbar(demand, agentRouteMean, agentRouteDev, lw=2, ms=10, + color="red", fmt='o', label='agent controlled cyber cars') xlim(0, 50) ylim(0, 300) xlabel('Repeater interval (s)') diff -Nru sumo-0.21.0+dfsg/docs/tutorial/city_mobil/vehicleControl.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/vehicleControl.py --- sumo-0.21.0+dfsg/docs/tutorial/city_mobil/vehicleControl.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/city_mobil/vehicleControl.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ @author Daniel Krajzewicz @author Lena Kalleske @date 2008-07-21 -@version $Id: vehicleControl.py 16253 2014-04-25 12:09:01Z behrisch $ +@version $Id: vehicleControl.py 18096 2015-03-17 09:50:59Z behrisch $ Control the CityMobil parking lot via TraCI. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -18,26 +18,35 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import subprocess, random, sys, os +import subprocess +import random +import sys +import os from optparse import OptionParser -from constants import * # sys.path is modified here +from constants import * # sys.path is modified here import traci import traci.constants as tc import statistics + class Manager: + def personArrived(self, vehicleID, edge, target): raise NotImplementedError + def cyberCarArrived(self, vehicleID, edge): raise NotImplementedError + def cyberCarBroken(self, vehicleID, edge): pass + def setNewTargets(self): pass + class Status: def __init__(self, edge, pos): @@ -52,9 +61,10 @@ def __repr__(self): return "%s,%s" % (self.edge, self.pos) + class Setting: step = 0 - manager = None + manager = None verbose = False cyber = False @@ -64,6 +74,7 @@ persons = {} waiting = {} + def init(manager, forTest=False): optParser = OptionParser() optParser.add_option("-v", "--verbose", action="store_true", dest="verbose", @@ -83,7 +94,8 @@ sumoConfig = "%s%02i.sumocfg" % (PREFIX, options.demand) if options.cyber: sumoConfig = "%s%02i_cyber.sumocfg" % (PREFIX, options.demand) - sumoProcess = subprocess.Popen([sumoExe, sumoConfig], stdout=sys.stdout, stderr=sys.stderr) + sumoProcess = subprocess.Popen( + [sumoExe, sumoConfig], stdout=sys.stdout, stderr=sys.stderr) traci.init(PORT) traci.simulation.subscribe() setting.manager = manager @@ -98,17 +110,21 @@ traci.close() sumoProcess.wait() + def getCapacity(): if setting.cyber: return CYBER_CAPACITY return BUS_CAPACITY + def getStep(): return setting.step + def getPosition(vehicleID): return vehicleStatus[vehicleID].edge + def stopAt(vehicleID, edge, pos=None): if pos == None: pos = STOP_POS @@ -123,6 +139,7 @@ vehicleStatus[vehicleID].target = edge vehicleStatus[vehicleID].targetPos = pos + def leaveStop(vehicleID, newTarget=None, delay=0.): v = vehicleStatus[vehicleID] if newTarget: @@ -132,6 +149,7 @@ v.targetPos = None v.parking = False + def _rerouteCar(vehicleID): slotEdge = "" for rowIdx in range(DOUBLE_ROWS): @@ -140,20 +158,23 @@ slotEdge = "slot%s-%s%s" % (rowIdx, idx, dir) if not slotEdge in occupancy: occupancy[slotEdge] = vehicleID - stopAt(vehicleID, slotEdge, SLOT_LENGTH-5.) + stopAt(vehicleID, slotEdge, SLOT_LENGTH - 5.) return + def _reroutePersons(edge): if edge in persons: for person in persons[edge]: if not vehicleStatus[person].slot: row = int(edge[4]) - targetEdge = "footmain%sto%s" % (row, row+1) - traci.vehicle.setStop(person, edge.replace("slot", "-foot"), 1., 0, 0.) + targetEdge = "footmain%sto%s" % (row, row + 1) + traci.vehicle.setStop( + person, edge.replace("slot", "-foot"), 1., 0, 0.) stopAt(person, targetEdge) vehicleStatus[person].parking = False vehicleStatus[person].slot = edge + def _checkInitialPositions(vehicleID, edge, pos): if vehicleID in vehicleStatus: vehicleStatus[vehicleID].edge = edge @@ -167,17 +188,18 @@ elif edge == "footfairin": stopAt(vehicleID, "footmainout") elif "foot" in edge: - traci.vehicle.setStop(vehicleID, "-"+edge) + traci.vehicle.setStop(vehicleID, "-" + edge) parkEdge = edge.replace("foot", "slot") if not parkEdge in persons: persons[parkEdge] = [] persons[parkEdge].append(vehicleID) vehicleStatus[vehicleID].parking = True elif edge.startswith("slot"): - stopAt(vehicleID, edge, SLOT_LENGTH-5.) + stopAt(vehicleID, edge, SLOT_LENGTH - 5.) occupancy[edge] = vehicleID _reroutePersons(edge) + def doStep(): setting.step += 1 if setting.verbose: @@ -185,8 +207,10 @@ traci.simulationStep() moveNodes = [] for veh, subs in traci.vehicle.getSubscriptionResults().iteritems(): - moveNodes.append((veh, subs[tc.VAR_ROAD_ID], subs[tc.VAR_LANEPOSITION])) - departed = traci.simulation.getSubscriptionResults()[tc.VAR_DEPARTED_VEHICLES_IDS] + moveNodes.append( + (veh, subs[tc.VAR_ROAD_ID], subs[tc.VAR_LANEPOSITION])) + departed = traci.simulation.getSubscriptionResults( + )[tc.VAR_DEPARTED_VEHICLES_IDS] for v in departed: traci.vehicle.subscribe(v) subs = traci.vehicle.getSubscriptionResults(v) @@ -200,7 +224,7 @@ target = "footmainout" if edge == "footmainout": row = random.randrange(0, DOUBLE_ROWS) - target = "footmain%sto%s" % (row, row+1) + target = "footmain%sto%s" % (row, row + 1) statistics.personArrived(vehicleID, edge, target, setting.step) setting.manager.personArrived(vehicleID, edge, target) if edge.startswith("cyber"): diff -Nru sumo-0.21.0+dfsg/docs/tutorial/hello/data/hello.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/data/hello.edg.xml --- sumo-0.21.0+dfsg/docs/tutorial/hello/data/hello.edg.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/data/hello.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/hello/data/hello.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/data/hello.netccfg --- sumo-0.21.0+dfsg/docs/tutorial/hello/data/hello.netccfg 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/data/hello.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/hello/data/hello.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/data/hello.net.xml --- sumo-0.21.0+dfsg/docs/tutorial/hello/data/hello.net.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/data/hello.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,17 +1,17 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/hello/data/hello.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/data/hello.nod.xml --- sumo-0.21.0+dfsg/docs/tutorial/hello/data/hello.nod.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/data/hello.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/hello/data/hello.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/data/hello.rou.xml --- sumo-0.21.0+dfsg/docs/tutorial/hello/data/hello.rou.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/data/hello.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/hello/data/hello.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/data/hello.sumocfg --- sumo-0.21.0+dfsg/docs/tutorial/hello/data/hello.sumocfg 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/data/hello.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/hello/runner.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/runner.py --- sumo-0.21.0+dfsg/docs/tutorial/hello/runner.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/hello/runner.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-10-25 -@version $Id: runner.py 16253 2014-04-25 12:09:01Z behrisch $ +@version $Id: runner.py 18096 2015-03-17 09:50:59Z behrisch $ This script is a test runner for the "Hello SUMO" Tutorial. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -19,24 +19,33 @@ """ -import os,subprocess,sys,shutil +import os +import subprocess +import sys +import shutil try: - sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', "tools")) # tutorial in tests - sys.path.append(os.path.join(os.environ.get("SUMO_HOME", os.path.join(os.path.dirname(__file__), "..", "..", "..")), "tools")) # tutorial in docs + sys.path.append(os.path.join(os.path.dirname( + __file__), '..', '..', '..', '..', "tools")) # tutorial in tests + sys.path.append(os.path.join(os.environ.get("SUMO_HOME", os.path.join( + os.path.dirname(__file__), "..", "..", "..")), "tools")) # tutorial in docs from sumolib import checkBinary -except ImportError: - sys.exit("please declare environment variable 'SUMO_HOME' as the root directory of your sumo installation (it should contain folders 'bin', 'tools' and 'docs')") +except ImportError: + sys.exit( + "please declare environment variable 'SUMO_HOME' as the root directory of your sumo installation (it should contain folders 'bin', 'tools' and 'docs')") netconvertBinary = checkBinary('netconvert') sumoBinary = checkBinary('sumo') # build/check network -retcode = subprocess.call([netconvertBinary, "-c", "data/hello.netccfg"], stdout=sys.stdout, stderr=sys.stderr) -try: shutil.copy("data/hello.net.xml", "net.net.xml") -except: print "Missing 'hello.net.xml'" +retcode = subprocess.call( + [netconvertBinary, "-c", "data/hello.netccfg"], stdout=sys.stdout, stderr=sys.stderr) +try: + shutil.copy("data/hello.net.xml", "net.net.xml") +except: + print "Missing 'hello.net.xml'" print ">> Netbuilding closed with status %s" % retcode sys.stdout.flush() # run simulation -retcode = subprocess.call([sumoBinary, "-c", "data/hello.sumocfg","--no-step-log"], stdout=sys.stdout, stderr=sys.stderr) +retcode = subprocess.call( + [sumoBinary, "-c", "data/hello.sumocfg", "--no-step-log"], stdout=sys.stdout, stderr=sys.stderr) print ">> Simulation closed with status %s" % retcode sys.stdout.flush() - diff -Nru sumo-0.21.0+dfsg/docs/tutorial/osm_activitygen/eichstaett.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/osm_activitygen/eichstaett.net.xml --- sumo-0.21.0+dfsg/docs/tutorial/osm_activitygen/eichstaett.net.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/osm_activitygen/eichstaett.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -3,7 +3,7 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/circular.add.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/circular.add.xml --- sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/circular.add.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/circular.add.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/circular.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/circular.edg.xml --- sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/circular.edg.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/circular.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/circular.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/circular.netccfg --- sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/circular.netccfg 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/circular.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/circular.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/circular.nod.xml --- sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/circular.nod.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/circular.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/circular.rou.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/circular.rou.xml --- sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/circular.rou.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/circular.rou.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/circular.typ.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/circular.typ.xml --- sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/circular.typ.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/circular.typ.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/output_file.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/output_file.sumocfg --- sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/output_file.sumocfg 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/output_file.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/output_socket.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/output_socket.sumocfg --- sumo-0.21.0+dfsg/docs/tutorial/output_parsing/data/output_socket.sumocfg 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/data/output_socket.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/output_parsing/runner.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/runner.py --- sumo-0.21.0+dfsg/docs/tutorial/output_parsing/runner.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/output_parsing/runner.py 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ @file runner.py @author Michael Behrisch @date 2012-12-09 -@version $Id: runner.py 16253 2014-04-25 12:09:01Z behrisch $ +@version $Id: runner.py 18096 2015-03-17 09:50:59Z behrisch $ This script is a test runner for the output_parsing tutorial. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -18,22 +18,31 @@ """ -import os,subprocess,sys,time +import os +import subprocess +import sys +import time import shutil -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', "tools")) -sys.path.append(os.path.join(os.environ.get("SUMO_HOME", os.path.join(os.path.dirname(__file__), "..", "..", "..")), "tools")) +sys.path.append( + os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', "tools")) +sys.path.append(os.path.join(os.environ.get("SUMO_HOME", os.path.join( + os.path.dirname(__file__), "..", "..", "..")), "tools")) from sumolib import checkBinary netconvertBinary = checkBinary('netconvert') sumoBinary = checkBinary('sumo') # build/check network -retcode = subprocess.call([netconvertBinary, "-c", "data/circular.netccfg"], stdout=sys.stdout, stderr=sys.stderr) -try: shutil.copy("data/circular.net.xml", "net.net.xml") -except: print "Missing 'circular.net.xml'" +retcode = subprocess.call( + [netconvertBinary, "-c", "data/circular.netccfg"], stdout=sys.stdout, stderr=sys.stderr) +try: + shutil.copy("data/circular.net.xml", "net.net.xml") +except: + print "Missing 'circular.net.xml'" print ">> Netbuilding closed with status %s" % retcode sys.stdout.flush() # run simulation -retcode = subprocess.call([sumoBinary, "-c", "data/output_file.sumocfg","--no-step-log"], stdout=sys.stdout, stderr=sys.stderr) +retcode = subprocess.call( + [sumoBinary, "-c", "data/output_file.sumocfg", "--no-step-log"], stdout=sys.stdout, stderr=sys.stderr) print ">> Simulation closed with status %s" % retcode sys.stdout.flush() diff -Nru sumo-0.21.0+dfsg/docs/tutorial/quickstart/data/quickstart.con.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/data/quickstart.con.xml --- sumo-0.21.0+dfsg/docs/tutorial/quickstart/data/quickstart.con.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/data/quickstart.con.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/quickstart/data/quickstart.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/data/quickstart.edg.xml --- sumo-0.21.0+dfsg/docs/tutorial/quickstart/data/quickstart.edg.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/data/quickstart.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/quickstart/data/quickstart.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/data/quickstart.netccfg --- sumo-0.21.0+dfsg/docs/tutorial/quickstart/data/quickstart.netccfg 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/data/quickstart.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/quickstart/data/quickstart.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/data/quickstart.net.xml --- sumo-0.21.0+dfsg/docs/tutorial/quickstart/data/quickstart.net.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/data/quickstart.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,19 +1,19 @@ - - + @@ -55,7 +55,7 @@ - + @@ -74,18 +74,18 @@ - - - + + + - + - + - + @@ -113,14 +113,14 @@ - - + + - + - + @@ -397,11 +397,11 @@ - - - - - + + + + + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/quickstart/data/quickstart.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/data/quickstart.nod.xml --- sumo-0.21.0+dfsg/docs/tutorial/quickstart/data/quickstart.nod.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/data/quickstart.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/quickstart/data/quickstart.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/data/quickstart.sumocfg --- sumo-0.21.0+dfsg/docs/tutorial/quickstart/data/quickstart.sumocfg 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/data/quickstart.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/quickstart/runner.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/runner.py --- sumo-0.21.0+dfsg/docs/tutorial/quickstart/runner.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/quickstart/runner.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2011-09-25 -@version $Id: runner.py 16253 2014-04-25 12:09:01Z behrisch $ +@version $Id: runner.py 18096 2015-03-17 09:50:59Z behrisch $ This script is a test runner for the quickstart tutorial. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -19,23 +19,31 @@ """ -import os,subprocess,sys,time +import os +import subprocess +import sys +import time import shutil -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', "tools")) -sys.path.append(os.path.join(os.environ.get("SUMO_HOME", os.path.join(os.path.dirname(__file__), "..", "..", "..")), "tools")) +sys.path.append( + os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', "tools")) +sys.path.append(os.path.join(os.environ.get("SUMO_HOME", os.path.join( + os.path.dirname(__file__), "..", "..", "..")), "tools")) from sumolib import checkBinary netconvertBinary = checkBinary('netconvert') sumoBinary = checkBinary('sumo') # build/check network -retcode = subprocess.call([netconvertBinary, "-c", "data/quickstart.netccfg"], stdout=sys.stdout, stderr=sys.stderr) -try: shutil.copy("data/quickstart.net.xml", "net.net.xml") -except: print "Missing 'quickstart.net.xml'" +retcode = subprocess.call( + [netconvertBinary, "-c", "data/quickstart.netccfg"], stdout=sys.stdout, stderr=sys.stderr) +try: + shutil.copy("data/quickstart.net.xml", "net.net.xml") +except: + print "Missing 'quickstart.net.xml'" print ">> Netbuilding closed with status %s" % retcode sys.stdout.flush() # run simulation -retcode = subprocess.call([sumoBinary, "-c", "data/quickstart.sumocfg","--no-step-log"], stdout=sys.stdout, stderr=sys.stderr) +retcode = subprocess.call( + [sumoBinary, "-c", "data/quickstart.sumocfg", "--no-step-log"], stdout=sys.stdout, stderr=sys.stderr) print ">> Simulation closed with status %s" % retcode sys.stdout.flush() - diff -Nru sumo-0.21.0+dfsg/docs/tutorial/san_pablo_dam/data/analyzeData.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/san_pablo_dam/data/analyzeData.py --- sumo-0.21.0+dfsg/docs/tutorial/san_pablo_dam/data/analyzeData.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/san_pablo_dam/data/analyzeData.py 2015-04-17 05:44:20.000000000 +0000 @@ -3,11 +3,11 @@ @author Daniel Krajzewicz @author Laura Bieker @date 2011-09-30 -@version $Id: analyzeData.py 15959 2014-03-17 16:58:35Z cschmidt87 $ +@version $Id: analyzeData.py 18096 2015-03-17 09:50:59Z behrisch $ -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -21,14 +21,18 @@ import math import numpy as np + def getAttr(line, which): beg = line.find(which) beg = line.find('"', beg) - end = line.find('"', beg+1) - return line[beg+1:end] + end = line.find('"', beg + 1) + return line[beg + 1:end] # this is from here: http://code.activestate.com/recipes/389639 + + class Ddict(dict): + def __init__(self, default=None): self.default = default @@ -41,104 +45,104 @@ # os.getcwd() # os.chdir() -f = open(sys.argv[1],'r') +f = open(sys.argv[1], 'r') data = f.readlines() f.close() -dd = Ddict( lambda: Ddict( lambda: 0)) +dd = Ddict(lambda: Ddict(lambda: 0)) # f1 = open('raw-results.txt','w') -f1 = open('tmp.txt','w') +f1 = open('tmp.txt', 'w') -for i in range(1,len(data)): - if data[i].find('0: - print >> f1,tt,lane,nn,ll[9],ll[11],ll[13],ll[15] - dd[itt][lane] = nn +for i in range(1, len(data)): + if data[i].find(' 0: + print >> f1, tt, lane, nn, ll[9], ll[11], ll[13], ll[15] + dd[itt][lane] = nn f1.close() maxLanes = 0 dt2OneHour = 6.0 for t in dd.iterkeys(): - if len(dd[t])>maxLanes: - maxLanes = len(dd[t]) - -tVec = np.zeros( len(dd), dtype=int) -QVec = np.zeros( len(dd), dtype=int) -xVec = np.zeros( (len(dd), maxLanes), dtype=float) -qVec = np.zeros( (len(dd), maxLanes), dtype=float) + if len(dd[t]) > maxLanes: + maxLanes = len(dd[t]) + +tVec = np.zeros(len(dd), dtype=int) +QVec = np.zeros(len(dd), dtype=int) +xVec = np.zeros((len(dd), maxLanes), dtype=float) +qVec = np.zeros((len(dd), maxLanes), dtype=float) vecIndx = 0 -f = open('lane-shares.txt','w') -#for t,v in dd.items(): +f = open('lane-shares.txt', 'w') +# for t,v in dd.items(): for t in sorted(dd.iterkeys()): -# qTot = math.fsum(dd[t]) - qTot = sum(dd[t].values()) - nrm = 0.0 - if qTot: - nrm = 1.0/qTot - s = repr(t) + ' ' + repr(qTot) + ' ' - tVec[vecIndx] = t - QVec[vecIndx] = dt2OneHour*qTot - for lane in range(maxLanes): - share = 0.0 - if dd[t].has_key(lane): - share = nrm*dd[t][lane] - s = s + repr(share) + ' ' - xVec[vecIndx,lane] = share - qVec[vecIndx,lane] = dt2OneHour*dd[t][lane] + # qTot = math.fsum(dd[t]) + qTot = sum(dd[t].values()) + nrm = 0.0 + if qTot: + nrm = 1.0 / qTot + s = repr(t) + ' ' + repr(qTot) + ' ' + tVec[vecIndx] = t + QVec[vecIndx] = dt2OneHour * qTot + for lane in range(maxLanes): + share = 0.0 + if dd[t].has_key(lane): + share = nrm * dd[t][lane] + s = s + repr(share) + ' ' + xVec[vecIndx, lane] = share + qVec[vecIndx, lane] = dt2OneHour * dd[t][lane] # print >> f,t,qTot,lane,share - vecIndx += 1 - print >> f, s + vecIndx += 1 + print >> f, s f.close() try: - import matplotlib.pyplot as plt - plt.rcParams['xtick.direction'] = 'out' - plt.rcParams['ytick.direction'] = 'out' -# y = - n = len(qVec) - for lane in range(maxLanes): - desc = 'lane: ' + repr(lane) - plt.plot(tVec, qVec[range(n),lane], label=desc) + import matplotlib.pyplot as plt + plt.rcParams['xtick.direction'] = 'out' + plt.rcParams['ytick.direction'] = 'out' +# y = + n = len(qVec) + for lane in range(maxLanes): + desc = 'lane: ' + repr(lane) + plt.plot(tVec, qVec[range(n), lane], label=desc) # plt.plot(tVec, qVec[range(n),0], 'r-',tVec, qVec[range(n),1], 'g-',tVec, qVec[range(n),2], 'b-') # plt.plot(tVec, QVec, 'r-') - plt.ylabel('lane flows') - plt.xlabel('time [s]') - plt.legend() - bname = 'flows-over-time-' + repr(maxLanes) - plt.savefig(bname+'.eps') - plt.savefig(bname+'.pdf') - plt.savefig(bname+'.png') - plt.savefig(bname+'.svg') + plt.ylabel('lane flows') + plt.xlabel('time [s]') + plt.legend() + bname = 'flows-over-time-' + repr(maxLanes) + plt.savefig(bname + '.eps') + plt.savefig(bname + '.pdf') + plt.savefig(bname + '.png') + plt.savefig(bname + '.svg') # try: # import pyemf # plt.savefig('shares-over-time.emf') # except : -# print '# no emf support' +# print '# no emf support' # plt.show() - plt.close() -# ## next plot: - for lane in range(maxLanes): - desc = 'lane: ' + repr(lane) - plt.plot(QVec, xVec[range(n),lane], 'o', markersize=10, label=desc) + plt.close() +# next plot: + for lane in range(maxLanes): + desc = 'lane: ' + repr(lane) + plt.plot(QVec, xVec[range(n), lane], 'o', markersize=10, label=desc) # plt.plot(tVec, qVec[range(n),0], 'r-',tVec, qVec[range(n),1], 'g-',tVec, qVec[range(n),2], 'b-') # plt.plot(tVec, QVec, 'r-') - plt.ylabel('lane shares') - plt.xlabel('total flow [veh/h]') - plt.legend() - bname = 'shares-vs-flow-' + repr(maxLanes) - plt.savefig(bname+'.eps') - plt.savefig(bname+'.pdf') - plt.savefig(bname+'.png') - plt.savefig(bname+'.svg') + plt.ylabel('lane shares') + plt.xlabel('total flow [veh/h]') + plt.legend() + bname = 'shares-vs-flow-' + repr(maxLanes) + plt.savefig(bname + '.eps') + plt.savefig(bname + '.pdf') + plt.savefig(bname + '.png') + plt.savefig(bname + '.svg') # plt.show() - plt.close() + plt.close() except ImportError: - print 'no matplotlib, falling back to gnuplot' - os.system('gnuplot do-some-plots.gnu') + print 'no matplotlib, falling back to gnuplot' + os.system('gnuplot do-some-plots.gnu') diff -Nru sumo-0.21.0+dfsg/docs/tutorial/san_pablo_dam/data/input_det.add.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/san_pablo_dam/data/input_det.add.xml --- sumo-0.21.0+dfsg/docs/tutorial/san_pablo_dam/data/input_det.add.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/san_pablo_dam/data/input_det.add.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/san_pablo_dam/data/input_vss.add.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/san_pablo_dam/data/input_vss.add.xml --- sumo-0.21.0+dfsg/docs/tutorial/san_pablo_dam/data/input_vss.add.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/san_pablo_dam/data/input_vss.add.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,3 +1,3 @@ - + \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/docs/tutorial/san_pablo_dam/data/spd-road.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/san_pablo_dam/data/spd-road.sumocfg --- sumo-0.21.0+dfsg/docs/tutorial/san_pablo_dam/data/spd-road.sumocfg 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/san_pablo_dam/data/spd-road.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,4 +1,4 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/san_pablo_dam/runner.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/san_pablo_dam/runner.py --- sumo-0.21.0+dfsg/docs/tutorial/san_pablo_dam/runner.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/san_pablo_dam/runner.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-10-25 -@version $Id: runner.py 16253 2014-04-25 12:09:01Z behrisch $ +@version $Id: runner.py 18096 2015-03-17 09:50:59Z behrisch $ This script is a test runner for the San Pablo Dam scenario. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -18,14 +18,18 @@ (at your option) any later version. """ -import os,subprocess,sys +import os +import subprocess +import sys import shutil from scipy.optimize import fmin_cobyla -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', "tools")) +sys.path.append( + os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', "tools")) from sumolib import checkBinary import validate + def buildVSS(obs7file, obs8file, vss): t7Times = validate.readTimes(obs7file) t8Times = validate.readTimes(obs8file) @@ -35,33 +39,38 @@ lObs8 = 337.5 print >> fp, '' for i, t7 in enumerate(t7Times): - v = lObs8/(t8Times[i] - t7) - if i != len(t7Times)-1 and t7 != t7Times[i+1]: + v = lObs8 / (t8Times[i] - t7) + if i != len(t7Times) - 1 and t7 != t7Times[i + 1]: print >> fp, ' ' % (t7, v) print >> fp, '' fp.close() + def genDemand(inputFile, outputFile): t1Times = validate.readTimes(inputFile) fRou = open(outputFile, 'w') fRou.write('\n') fRou.write(' \n') for vehID, t in enumerate(t1Times): - print >> fRou, ' ' % (t, vehID) + print >> fRou, ' ' % ( + t, vehID) print >> fRou, '' fRou.close() -# definition of gof() function to be given to fmin_cobyla() or fmin() +# definition of gof() function to be given to fmin_cobyla() or fmin() + + def gof(p): - para = {'vMax': p[0], 'aMax': p[1], 'bMax': p[2], 'lCar': p[3], 'sigA': p[4], 'tTau': p[5]} + para = {'vMax': p[0], 'aMax': p[1], 'bMax': p[2], + 'lCar': p[3], 'sigA': p[4], 'tTau': p[5]} print '# simulation with:', for k, v in para.items(): - print "%s:%.3f" % (k,v), + print "%s:%.3f" % (k, v), print fType = open('data/input_types.add.xml', 'w') fType.write(('\n \n') % para) + ' length="%(lCar)s" minGap="2.5" maxSpeed="%(vMax)s"' + + ' sigma="%(sigA)s" tau="%(tTau)s" />\n') % para) fType.close() result = validate.validate(checkBinary('sumo')) print '#### yields rmse: %.4f' % result @@ -70,31 +79,41 @@ return result # defining all the constraints -def conVmax(params): # vMax < 25 + + +def conVmax(params): # vMax < 25 return 25.0 - params[0] -def conTtau(params): # tTau > 1.1 + +def conTtau(params): # tTau > 1.1 return params[5] - 1.1 -def conSigA(params): # sigA > 0.1 + +def conSigA(params): # sigA > 0.1 return params[4] - 0.1 -def conSigA2(params): # sigA < 1.0 + +def conSigA2(params): # sigA < 1.0 return 1.0 - params[4] -def conAmax(params): # aMax > 0.1 + +def conAmax(params): # aMax > 0.1 return params[1] - 0.1 netconvertBinary = checkBinary('netconvert') # build/check network -retcode = subprocess.call([netconvertBinary, "-n", "data/spd-road.nod.xml", "-e", "data/spd-road.edg.xml", "-o", "data/spd-road.net.xml","-v"], stdout=sys.stdout, stderr=sys.stderr) -try: shutil.copy("data/spd-road.net.xml", "net.net.xml") -except: print "Missing 'spd-road.net.xml'" +retcode = subprocess.call([netconvertBinary, "-n", "data/spd-road.nod.xml", "-e", + "data/spd-road.edg.xml", "-o", "data/spd-road.net.xml", "-v"], stdout=sys.stdout, stderr=sys.stderr) +try: + shutil.copy("data/spd-road.net.xml", "net.net.xml") +except: + print "Missing 'spd-road.net.xml'" print ">> Netbuilding closed with status %s" % retcode sys.stdout.flush() # build/check vss -buildVSS('data/obstimes_1_7.txt', 'data/obstimes_1_8.txt', 'data/spd-road.vss.xml') +buildVSS('data/obstimes_1_7.txt', + 'data/obstimes_1_8.txt', 'data/spd-road.vss.xml') shutil.copy("data/spd-road.vss.xml", "vss.xml") sys.stdout.flush() genDemand('data/obstimes_1_1.txt', 'data/spd-road.rou.xml') @@ -102,9 +121,10 @@ # perform calibration fpLog = open('results.csv', 'w') params = [22.0, 2.0, 2.0, 5.0, 0.5, 1.5] -# call to (unconstrained) Nelder Mead; does not work correctly, because +# 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. # fmin(gof, params) -fmin_cobyla(gof, params, [conVmax, conAmax, conTtau, conSigA, conSigA2], rhoend=1.0e-4) +fmin_cobyla( + gof, params, [conVmax, conAmax, conTtau, conSigA, conSigA2], rhoend=1.0e-4) fpLog.close() diff -Nru sumo-0.21.0+dfsg/docs/tutorial/san_pablo_dam/validate.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/san_pablo_dam/validate.py --- sumo-0.21.0+dfsg/docs/tutorial/san_pablo_dam/validate.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/san_pablo_dam/validate.py 2015-04-17 05:44:20.000000000 +0000 @@ -2,11 +2,11 @@ @file validate.py @author Michael Behrisch @date 2012-01-21 -@version $Id: validate.py 15959 2014-03-17 16:58:35Z cschmidt87 $ +@version $Id: validate.py 18096 2015-03-17 09:50:59Z behrisch $ -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -15,64 +15,72 @@ (at your option) any later version. """ -import sys, math, subprocess +import sys +import math +import subprocess dDay = 1 obsTimes = {} verbose = False - + + def readTimes(obsfile): times = [] for line in open(obsfile): ll = line.split(':') if ll: - times.append(3600*int(ll[0]) + 60*int(ll[1]) + int(float(ll[2]))) + times.append( + 3600 * int(ll[0]) + 60 * int(ll[1]) + int(float(ll[2]))) return times + def parseObsTimes(): - for i in range (0,9): - obsTimes[i] = [] - for i in range(1,8): - if dDay==1 and i==5: + for i in range(0, 9): + obsTimes[i] = [] + for i in range(1, 8): + if dDay == 1 and i == 5: continue - if dDay==2 and i==6: + if dDay == 2 and i == 6: continue obsTimes[i] = readTimes('data/obstimes_%s_%s.txt' % (dDay, i)) # convert obsTimes[][] into travel-times: - for i in range(1,8): + for i in range(1, 8): ni = len(obsTimes[i]) - if ni == len(obsTimes[i+1]) and ni > 100: + if ni == len(obsTimes[i + 1]) and ni > 100: for j in range(ni): - obsTimes[i][j] = obsTimes[i+1][j] - obsTimes[i][j] + obsTimes[i][j] = obsTimes[i + 1][j] - obsTimes[i][j] + def validate(sumoBinary): - retcode = subprocess.call([sumoBinary, "-c", "data/spd-road.sumocfg"], stdout=sys.stdout, stderr=sys.stderr) + retcode = subprocess.call( + [sumoBinary, "-c", "data/spd-road.sumocfg"], stdout=sys.stdout, stderr=sys.stderr) sys.stdout.flush() sys.stderr.flush() # analyzing the results... # read the empirical times simTimes = {} - for i in range (0,9): - simTimes[i] = [] + for i in range(0, 9): + simTimes[i] = [] # read the simulated times - obs2Nr = {'obs1': 1, 'obs2': 2, 'obs3': 3, 'obs4': 4, 'obs5': 5, 'obs6': 6, 'obs7': 7} + obs2Nr = {'obs1': 1, 'obs2': 2, 'obs3': 3, + 'obs4': 4, 'obs5': 5, 'obs6': 6, 'obs7': 7} for line in open('data/detector.xml'): - if line.find(' 0: simTimes[iObs].append(float(ll[1])) # convert simTimes[][] into travel-times: - for i in range(1,8): + for i in range(1, 8): ni = len(simTimes[i]) - if ni == len(simTimes[i+1]) and ni>100: + if ni == len(simTimes[i + 1]) and ni > 100: for j in range(ni): - simTimes[i][j] = simTimes[i+1][j] - simTimes[i][j] + simTimes[i][j] = simTimes[i + 1][j] - simTimes[i][j] # compute final statistics err = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] @@ -80,18 +88,18 @@ errAll = 0.0 cntAll = 0 if verbose: - f = open('data/sumo-obs-error.txt','w') - for i in range(1,7): - if len(obsTimes[i])<=100 or len(obsTimes[i+1])<=100: + f = open('data/sumo-obs-error.txt', 'w') + for i in range(1, 7): + if len(obsTimes[i]) <= 100 or len(obsTimes[i + 1]) <= 100: continue if len(obsTimes[i]) == len(simTimes[i]): tmp = 0.0 for o, s in zip(obsTimes[i], simTimes[i]): d = o - s - tmp += d*d - err[i] = math.sqrt(tmp/len(obsTimes[i])) + tmp += d * d + err[i] = math.sqrt(tmp / len(obsTimes[i])) if verbose: - print >> f, "%s %s" %(i, err[i]) + print >> f, "%s %s" % (i, err[i]) errAll += err[i] cntAll += 1 if verbose: @@ -104,19 +112,19 @@ if verbose: c = open('data/compare-tt.csv', 'w') c.write('# indx;') - for i in range(1,7): - if len(obsTimes[i])>100 and len(obsTimes[i+1])>100: - c.write('obs%s;sim%s;' % (i,i)) + for i in range(1, 7): + if len(obsTimes[i]) > 100 and len(obsTimes[i + 1]) > 100: + c.write('obs%s;sim%s;' % (i, i)) c.write('\n') # then the data, of course on the ones which are useable for line in range(len(simTimes[1])): - c.write(repr(line)+';') - for i in range(1,7): - if len(obsTimes[i])>100 and len(obsTimes[i+1])>100: + c.write(repr(line) + ';') + for i in range(1, 7): + if len(obsTimes[i]) > 100 and len(obsTimes[i + 1]) > 100: ttObs = int(obsTimes[i][line]) ttSim = int(simTimes[i][line]) - c.write(repr(ttObs)+';'+repr(ttSim)+';') + c.write(repr(ttObs) + ';' + repr(ttSim) + ';') c.write('\n') c.close() - return errAll/cntAll + return errAll / cntAll diff -Nru sumo-0.21.0+dfsg/docs/tutorial/traci_tls/data/cross.con.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/data/cross.con.xml --- sumo-0.21.0+dfsg/docs/tutorial/traci_tls/data/cross.con.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/data/cross.con.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/traci_tls/data/cross.edg.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/data/cross.edg.xml --- sumo-0.21.0+dfsg/docs/tutorial/traci_tls/data/cross.edg.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/data/cross.edg.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/traci_tls/data/cross.netccfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/data/cross.netccfg --- sumo-0.21.0+dfsg/docs/tutorial/traci_tls/data/cross.netccfg 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/data/cross.netccfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/traci_tls/data/cross.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/data/cross.net.xml --- sumo-0.21.0+dfsg/docs/tutorial/traci_tls/data/cross.net.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/data/cross.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,18 +1,18 @@ - - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/traci_tls/data/cross.nod.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/data/cross.nod.xml --- sumo-0.21.0+dfsg/docs/tutorial/traci_tls/data/cross.nod.xml 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/data/cross.nod.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/traci_tls/data/cross.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/data/cross.sumocfg --- sumo-0.21.0+dfsg/docs/tutorial/traci_tls/data/cross.sumocfg 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/data/cross.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ - + diff -Nru sumo-0.21.0+dfsg/docs/tutorial/traci_tls/embedded.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/embedded.py --- sumo-0.21.0+dfsg/docs/tutorial/traci_tls/embedded.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/embedded.py 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ @author Michael Behrisch @author Jakob Erdmann @date 2009-03-26 -@version $Id: embedded.py 16379 2014-05-14 09:28:38Z behrisch $ +@version $Id: embedded.py 18096 2015-03-17 09:50:59Z behrisch $ Tutorial for traffic light control via the TraCI interface. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2009-2014 DLR/TS, Germany +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2009-2015 DLR/TS, Germany This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -20,8 +20,11 @@ (at your option) any later version. """ -import os, sys, subprocess -# the embedded python does not add the current dir to the python path, so we need to do it +import os +import sys +import subprocess +# the embedded python does not add the current dir to the python path, so +# we need to do it sys.path.append(os.path.dirname(__file__)) import runner diff -Nru sumo-0.21.0+dfsg/docs/tutorial/traci_tls/runner.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/runner.py --- sumo-0.21.0+dfsg/docs/tutorial/traci_tls/runner.py 2014-06-11 22:20:47.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/docs/tutorial/traci_tls/runner.py 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ @author Michael Behrisch @author Jakob Erdmann @date 2009-03-26 -@version $Id: runner.py 16379 2014-05-14 09:28:38Z behrisch $ +@version $Id: runner.py 18096 2015-03-17 09:50:59Z behrisch $ Tutorial for traffic light control via the TraCI interface. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2009-2014 DLR/TS, Germany +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2009-2015 DLR/TS, Germany This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -20,37 +20,43 @@ (at your option) any later version. """ -import os, sys +import os +import sys import optparse import subprocess import random # we need to import python modules from the $SUMO_HOME/tools directory try: - sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', "tools")) # tutorial in tests - sys.path.append(os.path.join(os.environ.get("SUMO_HOME", os.path.join(os.path.dirname(__file__), "..", "..", "..")), "tools")) # tutorial in docs + sys.path.append(os.path.join(os.path.dirname( + __file__), '..', '..', '..', '..', "tools")) # tutorial in tests + sys.path.append(os.path.join(os.environ.get("SUMO_HOME", os.path.join( + os.path.dirname(__file__), "..", "..", "..")), "tools")) # tutorial in docs from sumolib import checkBinary except ImportError: - sys.exit("please declare environment variable 'SUMO_HOME' as the root directory of your sumo installation (it should contain folders 'bin', 'tools' and 'docs')") + sys.exit( + "please declare environment variable 'SUMO_HOME' as the root directory of your sumo installation (it should contain folders 'bin', 'tools' and 'docs')") import traci # the port used for communicating with your sumo instance PORT = 8873 -NSGREEN = "GrGr" +NSGREEN = "GrGr" NSYELLOW = "yryr" -WEGREEN = "rGrG" +WEGREEN = "rGrG" WEYELLOW = "ryry" -PROGRAM = [WEYELLOW,WEYELLOW,WEYELLOW,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSYELLOW,NSYELLOW,WEGREEN] +PROGRAM = [WEYELLOW, WEYELLOW, WEYELLOW, NSGREEN, NSGREEN, NSGREEN, + NSGREEN, NSGREEN, NSGREEN, NSGREEN, NSGREEN, NSYELLOW, NSYELLOW, WEGREEN] + def generate_routefile(): - random.seed(42) # make tests reproducible - N = 3600 # number of time steps + random.seed(42) # make tests reproducible + N = 3600 # number of time steps # demand per second from different directions - pWE = 1./10 - pEW = 1./11 - pNS = 1./30 + pWE = 1. / 10 + pEW = 1. / 11 + pNS = 1. / 30 with open("data/cross.rou.xml", "w") as routes: print >> routes, """ @@ -62,32 +68,37 @@ lastVeh = 0 vehNr = 0 for i in range(N): - if random.uniform(0,1) < pWE: - print >> routes, ' ' % (vehNr, i) + if random.uniform(0, 1) < pWE: + print >> routes, ' ' % ( + vehNr, i) vehNr += 1 lastVeh = i - if random.uniform(0,1) < pEW: - print >> routes, ' ' % (vehNr, i) + if random.uniform(0, 1) < pEW: + print >> routes, ' ' % ( + vehNr, i) vehNr += 1 lastVeh = i - if random.uniform(0,1) < pNS: - print >> routes, ' ' % (vehNr, i) + if random.uniform(0, 1) < pNS: + print >> routes, ' ' % ( + vehNr, i) vehNr += 1 lastVeh = i print >> routes, "" + def run(): """execute the TraCI control loop""" traci.init(PORT) - programPointer = len(PROGRAM)-1 + programPointer = len(PROGRAM) - 1 step = 0 while traci.simulation.getMinExpectedNumber() > 0: traci.simulationStep() - programPointer = min(programPointer+1, len(PROGRAM)-1) + programPointer = min(programPointer + 1, len(PROGRAM) - 1) numPriorityVehicles = traci.inductionloop.getLastStepVehicleNumber("0") if numPriorityVehicles > 0: - if programPointer == len(PROGRAM)-1: - # we are in the WEGREEN phase. start the priority phase sequence + if programPointer == len(PROGRAM) - 1: + # we are in the WEGREEN phase. start the priority phase + # sequence programPointer = 0 elif PROGRAM[programPointer] != WEYELLOW: # horizontal traffic is already stopped. restart priority phase @@ -96,14 +107,17 @@ else: # we are in the WEYELLOW phase. continue sequence pass - traci.trafficlights.setRedYellowGreenState("0", PROGRAM[programPointer]) + traci.trafficlights.setRedYellowGreenState( + "0", PROGRAM[programPointer]) step += 1 traci.close() sys.stdout.flush() + def get_options(): optParser = optparse.OptionParser() - optParser.add_option("--nogui", action="store_true", default=False, help="run the commandline version of sumo") + optParser.add_option("--nogui", action="store_true", + default=False, help="run the commandline version of sumo") options, args = optParser.parse_args() return options @@ -124,6 +138,7 @@ # this is the normal way of using traci. sumo is started as a # subprocess and then the python script connects and runs - sumoProcess = subprocess.Popen([sumoBinary, "-c", "data/cross.sumocfg", "--tripinfo-output", "tripinfo.xml", "--remote-port", str(PORT)], stdout=sys.stdout, stderr=sys.stderr) + sumoProcess = subprocess.Popen([sumoBinary, "-c", "data/cross.sumocfg", "--tripinfo-output", + "tripinfo.xml", "--remote-port", str(PORT)], stdout=sys.stdout, stderr=sys.stderr) run() sumoProcess.wait() diff -Nru sumo-0.21.0+dfsg/INSTALL sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/INSTALL --- sumo-0.21.0+dfsg/INSTALL 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/INSTALL 2015-04-17 05:44:20.000000000 +0000 @@ -1,8 +1,8 @@ Installation Instructions ************************* -Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, -Inc. +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright @@ -226,11 +226,6 @@ and if that doesn't work, install pre-built binaries of GCC for HP-UX. - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended @@ -309,10 +304,9 @@ overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf limitation. Until the limitation is lifted, you can use -this workaround: +an Autoconf bug. Until the bug is fixed you can use this workaround: - CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== @@ -368,3 +362,4 @@ `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. + diff -Nru sumo-0.21.0+dfsg/install-sh sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/install-sh --- sumo-0.21.0+dfsg/install-sh 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/install-sh 2015-04-17 05:44:20.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it +# `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,10 +156,6 @@ -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac shift;; -T) no_target_directory=true;; @@ -190,10 +186,6 @@ fi shift # arg dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac done fi @@ -202,17 +194,13 @@ echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call 'install-sh -d' without argument. + # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 + trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -240,9 +228,9 @@ for src do - # Protect names problematic for 'test' and other utilities. + # Protect names starting with `-'. case $src in - -* | [=\(\)!]) src=./$src;; + -*) src=./$src;; esac if test -n "$dir_arg"; then @@ -264,7 +252,12 @@ echo "$0: no destination specified." >&2 exit 1 fi + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -354,7 +347,7 @@ if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. + # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in @@ -392,7 +385,7 @@ case $dstdir in /*) prefix='/';; - [-=\(\)!]*) prefix='./';; + -*) prefix='./';; *) prefix='';; esac @@ -410,7 +403,7 @@ for d do - test X"$d" = X && continue + test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then diff -Nru sumo-0.21.0+dfsg/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/Makefile.am --- sumo-0.21.0+dfsg/Makefile.am 2014-06-05 22:02:18.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -18,7 +18,7 @@ doxygen sumo.doxyconf &> doxygen.log userdoc: - tools/docs/buildHTMLDocs.py -o docs/userdoc -i docs/wiki/index.html -r $(VERSION) && cp docs/wiki/*.png docs/wiki/*.css docs/userdoc + tools/build/buildHTMLDocs.py -o docs/userdoc -i docs/wiki/index.html -r $(VERSION) && cp docs/wiki/*.png docs/wiki/*.css docs/userdoc man: rm -rf docs/man @@ -44,7 +44,7 @@ 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) ; \ + find build -regex ".*\.\(vcxproj\|vcxproj\.filters\|props\|sln\|spec\)" -print0 | xargs -0 cp --parents --target-directory $(abs_distdir) ; \ find data -regex ".*\.\(xsd\|xml\|csv\|veh\)" -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 ; \ diff -Nru sumo-0.21.0+dfsg/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/Makefile.in --- sumo-0.21.0+dfsg/Makefile.in 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -82,7 +82,7 @@ DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) COPYING \ - config.guess config.sub install-sh missing ltmain.sh + config.guess config.sub depcomp install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -228,6 +228,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -238,7 +240,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -811,7 +812,7 @@ doxygen sumo.doxyconf &> doxygen.log userdoc: - tools/docs/buildHTMLDocs.py -o docs/userdoc -i docs/wiki/index.html -r $(VERSION) && cp docs/wiki/*.png docs/wiki/*.css docs/userdoc + tools/build/buildHTMLDocs.py -o docs/userdoc -i docs/wiki/index.html -r $(VERSION) && cp docs/wiki/*.png docs/wiki/*.css docs/userdoc man: rm -rf docs/man @@ -837,7 +838,7 @@ 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) ; \ + find build -regex ".*\.\(vcxproj\|vcxproj\.filters\|props\|sln\|spec\)" -print0 | xargs -0 cp --parents --target-directory $(abs_distdir) ; \ find data -regex ".*\.\(xsd\|xml\|csv\|veh\)" -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 ; \ diff -Nru sumo-0.21.0+dfsg/missing sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/missing --- sumo-0.21.0+dfsg/missing 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/missing 2015-04-17 05:44:20.000000000 +0000 @@ -1,10 +1,11 @@ #! /bin/sh -# Common wrapper for a few potentially missing GNU programs. +# Common stub for a few missing GNU programs while installing. -scriptversion=2012-06-26.16; # UTC +scriptversion=2009-04-28.21; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard , 1996. +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. # 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 @@ -25,40 +26,69 @@ # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" + echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi -case $1 in +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; +msg="missing on your system" - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. Send bug reports to ." exit $? @@ -70,141 +100,272 @@ ;; -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac -# Run the given program, remember its exit status. -"$@"; st=$? +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; -# If it succeeded, we are done. -test $st -eq 0 && exit 0 + tar*) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar*) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st +exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff -Nru sumo-0.21.0+dfsg/src/activitygen/activities/AGActivities.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGActivities.cpp --- sumo-0.21.0+dfsg/src/activitygen/activities/AGActivities.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGActivities.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,13 +5,13 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGActivities.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGActivities.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Main class that manages activities taken in account and generates the // inhabitants' trip list. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/activities/AGActivities.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGActivities.h --- sumo-0.21.0+dfsg/src/activitygen/activities/AGActivities.h 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGActivities.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,13 +4,13 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivities.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGActivities.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Main class that manages activities taken in account and generates the // inhabitants' trip list. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/activities/AGActivity.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGActivity.cpp --- sumo-0.21.0+dfsg/src/activitygen/activities/AGActivity.cpp 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGActivity.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,13 +4,13 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivity.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGActivity.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Parent object for all activities. Derived classes generate trips for each // household. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/activities/AGActivity.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGActivity.h --- sumo-0.21.0+dfsg/src/activitygen/activities/AGActivity.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGActivity.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,13 +5,13 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGActivity.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGActivity.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Parent object for all activities. Derived classes generate trips for each // household. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/activities/AGFreeTime.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGFreeTime.cpp --- sumo-0.21.0+dfsg/src/activitygen/activities/AGFreeTime.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGFreeTime.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,13 +5,13 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGFreeTime.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGFreeTime.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Generates trips related to after-work activities // like visiting the family or party. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/activities/AGFreeTime.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGFreeTime.h --- sumo-0.21.0+dfsg/src/activitygen/activities/AGFreeTime.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGFreeTime.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,13 +5,13 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGFreeTime.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGFreeTime.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Generates trips related to after-work activities // like visiting the family or party. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/activities/AGTrip.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGTrip.cpp --- sumo-0.21.0+dfsg/src/activitygen/activities/AGTrip.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGTrip.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGTrip.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGTrip.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Class containing all information of a given trip (car, bus) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -53,7 +53,7 @@ } void -AGTrip::print() { +AGTrip::print() const { std::cout << "Trip: " << std::endl; std::cout << "\t-From= "; myFrom.print(); @@ -86,8 +86,8 @@ } } -std::list* -AGTrip::getPassed() { +const std::list* +AGTrip::getPassed() const { return &myPassBy; } @@ -117,17 +117,17 @@ } int -AGTrip::getTimeTrip(SUMOReal secPerKm) { +AGTrip::getTimeTrip(SUMOReal secPerKm) const { SUMOReal dist = 0; std::list positions; positions.push_back(myFrom); - std::list::iterator it; + std::list::const_iterator it; for (it = myPassBy.begin(); it != myPassBy.end(); ++it) { positions.push_back(*it); } positions.push_back(myTo); - AGPosition* temp = &positions.front(); + const AGPosition* temp = &positions.front(); for (it = positions.begin(), ++it; it != positions.end(); ++it) { dist += temp->distanceTo(*it); temp = &*it; @@ -136,12 +136,12 @@ } int -AGTrip::getArrTime(SUMOReal secPerKm) { +AGTrip::getArrTime(SUMOReal secPerKm) const { return myDepTime + getTimeTrip(secPerKm); } int -AGTrip::getRideBackArrTime(SUMOReal secPerKm) { +AGTrip::getRideBackArrTime(SUMOReal secPerKm) const { return getArrTime(secPerKm) + (int)(secPerKm * myTo.distanceTo(myFrom) / 1000.0); } @@ -151,7 +151,7 @@ } int -AGTrip::estimateDepTime(int arrTime, SUMOReal secPerKm) { +AGTrip::estimateDepTime(int arrTime, SUMOReal secPerKm) const { return arrTime - getTimeTrip(secPerKm); } diff -Nru sumo-0.21.0+dfsg/src/activitygen/activities/AGTrip.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGTrip.h --- sumo-0.21.0+dfsg/src/activitygen/activities/AGTrip.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGTrip.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGTrip.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGTrip.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Class containing all information of a given trip (car, bus) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -81,7 +81,7 @@ myVehicle(v), myType("default"), myDay(day) {}; - void print(); + void print() const; bool operator<(const AGTrip& trip) const; void addLayOver(AGPosition by); @@ -100,30 +100,30 @@ void setDay(int day); const std::string& getType() const; void setType(std::string type); - std::list* getPassed(); + const std::list* getPassed() const; /** * returns the time regarding the departure time * going through the different points and coming back to the initial position * given the time to make one kilometer */ - int getRideBackArrTime(SUMOReal secPerKm); + int getRideBackArrTime(SUMOReal secPerKm) const; /** * returns the estimated arrival time * given the time to make one kilometer */ - int getArrTime(SUMOReal secPerKm); + int getArrTime(SUMOReal secPerKm) const; /** * gives the time in seconds for the trip * given a speed in seconds per kilometer (in city, not car speed * but time needed to make a distance in the city) */ - int getTimeTrip(SUMOReal secPerKm); + int getTimeTrip(SUMOReal secPerKm) const; /** * estimate the departure time needed for a given arrival time * and a speed in seconds per kilometer */ - int estimateDepTime(int arrTime, SUMOReal secPerKm); + int estimateDepTime(int arrTime, SUMOReal secPerKm) const; /** * returns whether this is a daily trip or a one day trip */ diff -Nru sumo-0.21.0+dfsg/src/activitygen/activities/AGWorkAndSchool.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGWorkAndSchool.cpp --- sumo-0.21.0+dfsg/src/activitygen/activities/AGWorkAndSchool.cpp 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGWorkAndSchool.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGWorkAndSchool.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGWorkAndSchool.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Generates trips to work and to school /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -154,6 +154,10 @@ bool AGWorkAndSchool::carsToTrips() { + // check if the starting edge allows cars + if (!myHousehold->getPosition().getStreet().allows(SVC_PASSENGER)) { + return false; + } std::list::const_iterator itDriA; std::list::const_iterator itCar = myHousehold->getCars().begin(); for (itDriA = personsDrivingCars.begin(); itDriA != personsDrivingCars.end(); ++itDriA) { @@ -161,6 +165,10 @@ if (itCar == myHousehold->getCars().end()) { return false; } + // check if the destination edge allows cars + if (!itDriA->getWorkPosition().getPosition().getStreet().allows(SVC_PASSENGER)) { + return false; + } AGTrip trip(myHousehold->getPosition(), itDriA->getWorkPosition().getPosition(), *itCar, depHour(myHousehold->getPosition(), itDriA->getWorkPosition().getPosition(), itDriA->getWorkPosition().getOpening())); ++itCar; tempTrip.push_back(trip); @@ -280,8 +288,8 @@ if (itAccT->getRideBackArrTime(this->timePerKm) < itDriT->getTime()) { //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(myHousehold->getPosition()); //final destination of the whole trip: home + itAccT->addLayOver(itAccT->getArr());//final destination is the last accompaniment stop: not the destination of the course + itAccT->setArr(myHousehold->getPosition());//final destination of the whole trip: home myPartialActivityTrips.push_back(*itAccT); alreadyDone = true; } else { diff -Nru sumo-0.21.0+dfsg/src/activitygen/activities/AGWorkAndSchool.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGWorkAndSchool.h --- sumo-0.21.0+dfsg/src/activitygen/activities/AGWorkAndSchool.h 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/AGWorkAndSchool.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGWorkAndSchool.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGWorkAndSchool.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Generates trips to work and to school /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/activities/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/Makefile.in --- sumo-0.21.0+dfsg/src/activitygen/activities/Makefile.in 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activities/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -222,6 +222,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -232,7 +234,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/activitygen/activitygen_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activitygen_main.cpp --- sumo-0.21.0+dfsg/src/activitygen/activitygen_main.cpp 2014-04-29 22:02:43.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/activitygen_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Jul 2010 -/// @version $Id: activitygen_main.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: activitygen_main.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Main object of the ActivityGen application /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -98,8 +98,13 @@ int main(int argc, char* argv[]) { - int ret = 0; OptionsCont& oc = OptionsCont::getOptions(); + // give some application descriptions + oc.setApplicationDescription( + "Generates routes of persons throughout a day for the microscopic road traffic simulation SUMO."); + oc.setApplicationName("activitygen", "SUMO activitygen Version " + getBuildName(VERSION_STRING)); + oc.addCopyrightNotice("Copyright (C) 2010-2012 Technische Universitaet Muenchen"); + int ret = 0; RONet* net = 0; try { // Initialise subsystems and process options @@ -116,9 +121,9 @@ // Load network net = new RONet(); - RODUAEdgeBuilder builder(oc.getBool("weights.expand"), oc.getBool("weights.interpolate")); + AGStreet::Builder builder; loadNet(*net, builder); - WRITE_MESSAGE("Loaded " + toString(net->getEdgeNoWithoutInternal()) + " edges."); + WRITE_MESSAGE("Loaded " + toString(net->getEdgeNo()) + " edges."); if (oc.getBool("debug")) { WRITE_MESSAGE("\n\t ---- begin AcitivtyGen ----\n"); } diff -Nru sumo-0.21.0+dfsg/src/activitygen/AGActivityGen.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGActivityGen.cpp --- sumo-0.21.0+dfsg/src/activitygen/AGActivityGen.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGActivityGen.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGActivityGen.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGActivityGen.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Main class that handles City, Activities and Trips /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -99,7 +99,7 @@ } bool -AGActivityGen::timeTripValidation(AGTrip trip) { +AGActivityGen::timeTripValidation(const AGTrip& trip) const { if (trip.getDay() > durationInDays + 1) { return false; } @@ -123,7 +123,7 @@ } void -AGActivityGen::varDepTime(AGTrip& trip) { +AGActivityGen::varDepTime(AGTrip& trip) const { if (trip.getType() != "default") { return; } @@ -220,7 +220,7 @@ expTrips.push_back(tr); } //else - // std::cout << "trop tard 1 pour " << tr.getVehicleName() << " " << tr.getTime() << " day: " << tr.getDay() << std::endl; + //std::cout << "trop tard 1 pour " << tr.getVehicleName() << " " << tr.getTime() << " day: " << tr.getDay() << std::endl; } } else { AGTrip tr(it->getDep(), it->getArr(), it->getVehicleName(), it->getTime(), it->getDay()); @@ -239,7 +239,7 @@ expTrips.push_back(tr); } //else - // std::cout << "trop tard 2 pour " << tr.getVehicleName() << " " << tr.getTime() << " day: " << tr.getDay() << std::endl; + //std::cout << "trop tard 2 pour " << tr.getVehicleName() << " " << tr.getTime() << " day: " << tr.getDay() << std::endl; } } diff -Nru sumo-0.21.0+dfsg/src/activitygen/AGActivityGen.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGActivityGen.h --- sumo-0.21.0+dfsg/src/activitygen/AGActivityGen.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGActivityGen.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGActivityGen.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGActivityGen.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Main class that handles City, Activities and Trips /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -29,15 +29,21 @@ // =========================================================================== // included modules // =========================================================================== -#include -#include -#include -#include +#ifdef _MSC_VER +#include +#else +#include +#endif + #include "city/AGCity.h" -#include "activities/AGTrip.h" -#include "activities/AGActivities.h" -#include "city/AGStreet.h" -#include "city/AGPosition.h" + + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; +class RONet; +class AGTrip; // =========================================================================== @@ -105,7 +111,7 @@ * @returns whether the trip is compatible with the time boundaries or not. * for this begin, end and duration of the simulation must be defined */ - bool timeTripValidation(AGTrip); + bool timeTripValidation(const AGTrip& trip) const; /** * @brief generate the output file (trips or routes) using a trip list * @@ -117,7 +123,7 @@ * * @param[in] trip on which a random (normally distributed) variation will be tried */ - void varDepTime(AGTrip& trip); + void varDepTime(AGTrip& trip) const; private: /// @brief invalidated assignment operator diff -Nru sumo-0.21.0+dfsg/src/activitygen/AGActivityGenHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGActivityGenHandler.cpp --- sumo-0.21.0+dfsg/src/activitygen/AGActivityGenHandler.cpp 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGActivityGenHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivityGenHandler.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGActivityGenHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The handler for parsing the statistics file. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -157,7 +157,7 @@ void AGActivityGenHandler::parseParameters(const SUMOSAXAttributes& attrs) { - try { + try { bool ok; myCity.statData.carPreference = attrs.getOpt(AGEN_ATTR_CARPREF, 0, ok, 0.0); myCity.statData.speedTimePerKm = attrs.getOpt(AGEN_ATTR_CITYSPEED, 0, ok, 360.0); @@ -185,15 +185,14 @@ work = attrs.getFloat(AGEN_ATTR_OUT_WORKPOSITION); } std::string eid = attrs.getString(SUMO_ATTR_EDGE); - ROEdge* e = net->getEdge(eid); - if (e == 0) { + AGStreet* street = dynamic_cast(net->getEdge(eid)); + if (street == 0) { WRITE_ERROR("Edge '" + eid + "' is not known."); return; } - - AGStreet str(e, pop, work); - myCity.streets.push_back(str); - + street->setPopulation(pop * street->getLength()); + street->setWorkplaceNumber(work * street->getLength()); + myCity.streets.push_back(street); } catch (const std::exception& e) { WRITE_ERROR("Error while parsing the element " + SUMOXMLDefinitions::Tags.getString(AGEN_TAG_STREET) + ": " + diff -Nru sumo-0.21.0+dfsg/src/activitygen/AGActivityGenHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGActivityGenHandler.h --- sumo-0.21.0+dfsg/src/activitygen/AGActivityGenHandler.h 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGActivityGenHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivityGenHandler.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGActivityGenHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The handler for parsing the statistics file. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/AGActivityTripWriter.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGActivityTripWriter.cpp --- sumo-0.21.0+dfsg/src/activitygen/AGActivityTripWriter.cpp 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGActivityTripWriter.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGActivityTripWriter.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGActivityTripWriter.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Class for writing Trip objects in a SUMO-route file. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -32,6 +32,9 @@ #include #endif +#include +#include +#include "activities/AGTrip.h" #include "city/AGStreet.h" #include "AGActivityTripWriter.h" @@ -39,48 +42,48 @@ // =========================================================================== // method definitions // =========================================================================== -void -AGActivityTripWriter::initialize() { - vtypes(); +AGActivityTripWriter::AGActivityTripWriter(OutputDevice& file) : myTripOutput(file) { + myTripOutput.openTag(SUMO_TAG_VTYPE) + .writeAttr(SUMO_ATTR_ID, "default") + .writeAttr(SUMO_ATTR_VCLASS, "passenger") + .writeAttr(SUMO_ATTR_COLOR, RGBColor::RED).closeTag(); + myTripOutput.openTag(SUMO_TAG_VTYPE) + .writeAttr(SUMO_ATTR_ID, "random") + .writeAttr(SUMO_ATTR_VCLASS, "passenger") + .writeAttr(SUMO_ATTR_COLOR, RGBColor::BLUE).closeTag(); + myTripOutput.openTag(SUMO_TAG_VTYPE) + .writeAttr(SUMO_ATTR_ID, "bus") + .writeAttr(SUMO_ATTR_VCLASS, "bus") + .writeAttr(SUMO_ATTR_COLOR, RGBColor::GREEN).closeTag(); + myTripOutput.lf(); } -void -AGActivityTripWriter::vtypes() { - routes << " \n"; - routes << " \n"; - routes << " \n\n"; - - colors["default"] = "1,0,0"; - colors["bus"] = "0,1,0"; - colors["random"] = "0,0,1"; -} void -AGActivityTripWriter::addTrip(AGTrip trip) { - std::list::iterator it; +AGActivityTripWriter::addTrip(const AGTrip& trip) { int time = (trip.getDay() - 1) * 86400 + trip.getTime(); - //the vehicle: - routes << " \n"; - - //the route - routes << " begin(); it != trip.getPassed()->end(); ++it) { - routes << " " << it->getStreet().getName(); + myTripOutput.openTag(SUMO_TAG_TRIP) + .writeAttr(SUMO_ATTR_ID, trip.getVehicleName()) + .writeAttr(SUMO_ATTR_TYPE, trip.getType()) + .writeAttr(SUMO_ATTR_DEPART, time) + .writeAttr(SUMO_ATTR_DEPARTPOS, trip.getDep().getPosition()) + .writeAttr(SUMO_ATTR_ARRIVALPOS, trip.getArr().getPosition()) + .writeAttr(SUMO_ATTR_ARRIVALSPEED, 0.) + .writeAttr(SUMO_ATTR_FROM, trip.getDep().getStreet().getID()); + + if (!trip.getPassed()->empty()) { + std::ostringstream oss; + for (std::list::const_iterator it = trip.getPassed()->begin(); it != trip.getPassed()->end(); ++it) { + if (it != trip.getPassed()->begin()) { + oss << " "; + } + oss << it->getStreet().getID(); + } + myTripOutput.writeAttr(SUMO_ATTR_VIA, oss.str()); } - routes << " " << trip.getArr().getStreet().getName(); - routes << "\"/>\n"; - - routes << " \n"; + myTripOutput.writeAttr(SUMO_ATTR_TO, trip.getArr().getStreet().getID()); + myTripOutput.closeTag(); } diff -Nru sumo-0.21.0+dfsg/src/activitygen/AGActivityTripWriter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGActivityTripWriter.h --- sumo-0.21.0+dfsg/src/activitygen/AGActivityTripWriter.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGActivityTripWriter.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGActivityTripWriter.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGActivityTripWriter.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Class for writing Trip objects in a SUMO-route file. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -35,11 +35,11 @@ #include #endif -#include "activities/AGTrip.h" -#include -#include -#include -#include +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; +class AGTrip; // =========================================================================== @@ -47,19 +47,12 @@ // =========================================================================== class AGActivityTripWriter { public: - AGActivityTripWriter(OutputDevice& file) : - routes(file) { - initialize(); - } + AGActivityTripWriter(OutputDevice& file); - void initialize(); - void addTrip(AGTrip trip); + void addTrip(const AGTrip& trip); private: - OutputDevice& routes; - std::map colors; - - void vtypes(); + OutputDevice& myTripOutput; private: /// @brief Invalidated copy constructor. diff -Nru sumo-0.21.0+dfsg/src/activitygen/AGFrame.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGFrame.cpp --- sumo-0.21.0+dfsg/src/activitygen/AGFrame.cpp 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGFrame.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mo, 13 Sept 2010 -/// @version $Id: AGFrame.cpp 15693 2014-02-22 09:29:55Z behrisch $ +/// @version $Id: AGFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Configuration of the options of ActivityGen /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -38,6 +38,7 @@ #endif #include "AGFrame.h" +#include #include #include #include @@ -50,16 +51,11 @@ // =========================================================================== void AGFrame::fillOptions() { OptionsCont& oc = OptionsCont::getOptions(); - // give some application descriptions - oc.setApplicationDescription( - "Generates routes of persons throughout a day for the microscopic road traffic simulation SUMO."); - oc.setApplicationName("activitygen", "SUMO activitygen Version " + (std::string)VERSION_STRING); - oc.addCopyrightNotice("Copyright (C) 2010-2012 Technische Universitaet Muenchen"); // Options handling oc.addCallExample("--net-file .net.xml --stat-file .stat.xml --output .rou.xml --rand", - "generate a route file from a stats file on a given net using arbitrary random seed"); + "generate a trips file from a stats file on a given net using arbitrary random seed"); oc.addCallExample("--net-file .net.xml --stat-file .stat.xml --output .rou.xml --duration-d ", - "generate a route file from a stats file on a given net for numerous days (with fixed random seed)"); + "generate a trips file from a stats file on a given net for numerous days (with fixed random seed)"); // Add categories and insert the standard options SystemFrame::addConfigurationOptions(oc); @@ -73,14 +69,14 @@ // Insert options oc.doRegister("net-file", 'n', new Option_FileName()); oc.addSynonyme("net-file", "net"); - oc.addDescription("net-file", "Input", "Use FILE as SUMO-network to route on"); + oc.addDescription("net-file", "Input", "Use FILE as SUMO-network to create trips for"); oc.doRegister("stat-file", 's', new Option_FileName()); oc.addDescription("stat-file", "Input", "Loads the SUMO-statistics FILE"); oc.doRegister("output-file", 'o', new Option_FileName()); oc.addSynonyme("output-file", "output", true); - oc.addDescription("output-file", "Output", "Write generated routes to FILE"); + oc.addDescription("output-file", "Output", "Write generated trips to FILE"); oc.doRegister("debug", new Option_Bool(false)); oc.addDescription("debug", "Report", @@ -96,15 +92,6 @@ oc.doRegister("duration-d", new Option_Integer()); oc.addDescription("duration-d", "Time", "Sets the duration of the simulation in days"); - - // Options needed by the router - oc.doRegister("weights.interpolate", new Option_Bool(false)); - oc.addSynonyme("weights.interpolate", "interpolate", true); - oc.addDescription("weights.interpolate", "Processing", "Interpolate edge weights at interval boundaries"); - - oc.doRegister("weights.expand", new Option_Bool(false)); - oc.addSynonyme("weights.expand", "expand-weights", true); - oc.addDescription("weights.expand", "Processing", "Expand weights behind the simulation's end"); } diff -Nru sumo-0.21.0+dfsg/src/activitygen/AGFrame.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGFrame.h --- sumo-0.21.0+dfsg/src/activitygen/AGFrame.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/AGFrame.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Walter Bamberger /// @author Daniel Krajzewicz /// @date Mon, 13 Sept 2010 -/// @version $Id: AGFrame.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGFrame.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Configuration of the options of ActivityGen /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGAdult.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGAdult.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGAdult.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGAdult.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGAdult.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGAdult.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Person in working age: can be linked to a work position. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGAdult.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGAdult.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGAdult.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGAdult.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGAdult.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGAdult.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Person in working age: can be linked to a work position. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGBus.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGBus.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGBus.cpp 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGBus.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGBus.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGBus.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A bus driving in the city /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -55,7 +55,7 @@ } void -AGBus::print() { +AGBus::print() const { std::cout << "- Bus:" << " name=" << name << " depTime=" << departureTime << std::endl; } diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGBus.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGBus.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGBus.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGBus.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGBus.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGBus.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A bus driving in the city /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -50,7 +50,7 @@ void setName(std::string name); int getDeparture(); std::string getName(); - void print(); + void print() const; private: std::string name; diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGBusLine.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGBusLine.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGBusLine.cpp 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGBusLine.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGBusLine.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGBusLine.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Bus line of the city: contains all the buses of this line /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -45,7 +45,7 @@ #include "AGTime.h" #include -#define PAUSE_TIME 15 //time (in minutes) a bus waits before going in the opposite direction. +#define PAUSE_TIME 15 //time (in minutes) a bus waits before going in the opposite direction. // =========================================================================== @@ -59,10 +59,10 @@ void AGBusLine::setBusNames() { busNbr = 0; - std::list::iterator it1 = buses.begin(); //iterator on buses in the first direction - std::list::iterator it2 = revBuses.begin(); //iterator on buses in the second direction + std::list::iterator it1 = buses.begin(); //iterator on buses in the first direction + std::list::iterator it2 = revBuses.begin(); //iterator on buses in the second direction - std::list > drivingBuses1, drivingBuses2; //buses on the road or in the parking of the corresponding end: int: the time of availability + std::list > drivingBuses1, drivingBuses2; //buses on the road or in the parking of the corresponding end: int: the time of availability while (it1 != buses.end() && it2 != revBuses.end()) { if (it1->getDeparture() > it2->getDeparture()) { diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGBusLine.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGBusLine.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGBusLine.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGBusLine.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGBusLine.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGBusLine.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Bus line of the city: contains all the buses of this line /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGCar.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGCar.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGCar.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGCar.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGCar.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGCar.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Cars owned by people of the city: included in households. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGCar.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGCar.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGCar.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGCar.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGCar.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGCar.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Cars owned by people of the city: included in households. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGChild.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGChild.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGChild.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGChild.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGChild.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGChild.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Person in age to go to school: linked to a school object /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -45,7 +45,7 @@ // method definitions // =========================================================================== void -AGChild::print() { +AGChild::print() const { std::cout << "- Child: Age=" << age << " School=" << school << std::endl; } diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGChild.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGChild.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGChild.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGChild.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGChild.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGChild.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Person in age to go to school: linked to a school object /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -50,7 +50,7 @@ AGChild(int age) : AGPerson(age), school(NULL) {}; - void print(); + void print() const; bool setSchool(AGSchool* school); /** * @param schools: school vector from City object diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGCity.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGCity.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGCity.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGCity.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,13 +6,13 @@ /// @author Walter Bamberger /// @author Jakob Erdmann /// @date July 2010 -/// @version $Id: AGCity.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: AGCity.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // City class that contains all other objects of the city: in particular // streets, households, bus lines, work positions and school /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -61,11 +61,11 @@ } SUMOReal pop = 0, work = 0; - std::vector::iterator it; + std::vector::iterator it; for (it = streets.begin(); it != streets.end(); ++it) { - pop += it->getPopulation(); - work += it->getWorkplaceNumber(); + pop += (*it)->getPopulation(); + work += (*it)->getWorkplaceNumber(); } statData.factorInhabitants = (SUMOReal)statData.inhabitants / pop; //can be improved with other input data @@ -79,38 +79,38 @@ statData.factorWorkPositions = neededWorkPositionsInCity / (SUMOReal) work; for (it = streets.begin(); it != streets.end(); ++it) { - it->setPopulation(it->getPopulation() * statData.factorInhabitants); - it->setWorkplaceNumber(it->getWorkplaceNumber() * statData.factorWorkPositions); + (*it)->setPopulation((*it)->getPopulation() * statData.factorInhabitants); + (*it)->setWorkplaceNumber((*it)->getWorkplaceNumber() * statData.factorWorkPositions); //it->print(); } //completing streets from edges of the network not handled/present in STAT file (no population no work position) std::map::const_iterator itE; - std::vector::iterator itS; + std::vector::iterator 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()) { + if (*itS == itE->second) { break; } } //if this edge isn't represented by a street if (itS == streets.end() && itE->second->getType() != ROEdge::ET_INTERNAL) { - streets.push_back(AGStreet(itE->second)); + streets.push_back(static_cast(itE->second)); } } } void AGCity::generateWorkPositions() { - std::vector::iterator it; + std::vector::iterator it; int workPositionCounter = 0; try { 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(&statData, *it)); + for (int i = 0; i < (*it)->getWorkplaceNumber(); ++i) { + workPositions.push_back(AGWorkPosition(&statData, **it)); ++workPositionCounter; } } @@ -167,7 +167,7 @@ void AGCity::generatePopulation() { - std::vector::iterator it; + std::vector::iterator it; SUMOReal people = 0; nbrCars = 0; unsigned int idHouseholds = 0; @@ -196,11 +196,11 @@ } } for (it = streets.begin(); it != streets.end(); ++it) { - people += it->getPopulation(); + 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.push_back(AGHousehold(*it, this, idHouseholds)); households.back().generatePeople(abs(numAdults[i]), numChilds[i], numAdults[i] < 0); //&statData //households.back().generateCars(statData.carRate); people -= households.back().getPeopleNbr(); @@ -277,11 +277,11 @@ /*ofstream fichier("test.txt", ios::app); // ouverture en écriture avec effacement du fichier ouvert if(fichier) { - fichier << "===> WARNING: Not enough school places in the city for all children..." << std::endl; - fichier.close(); + fichier << "===> WARNING: Not enough school places in the city for all children..." << std::endl; + fichier.close(); } else - cerr << "Impossible d'ouvrir le fichier !" << std::endl;*/ + cerr << "Impossible d'ouvrir le fichier !" << std::endl;*/ //std::cout << "===> WARNING: Not enough school places in the city for all children..." << std::endl; } @@ -404,10 +404,10 @@ std::cout << "first completed in getStreet() of City: Consolidation of data not needed in ActivityGen any more" << std::endl; } //rest of the function - std::vector::iterator it = streets.begin(); + std::vector::iterator it = streets.begin(); while (it != streets.end()) { - if (it->getName() == edge) { - return *it; + if ((*it)->getID() == edge) { + return **it; } ++it; } @@ -420,7 +420,7 @@ if (streets.empty()) { throw(std::runtime_error("No street found in this city")); } - return streets[RandHelper::rand(streets.size())]; + return *streets[RandHelper::rand(streets.size())]; } /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGCity.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGCity.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGCity.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGCity.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,13 +5,13 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGCity.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGCity.h 18095 2015-03-17 09:39:00Z behrisch $ /// // City class that contains all other objects of the city: in particular // streets, households, bus lines, work positions and schools /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -86,7 +86,7 @@ const AGStreet& getRandomStreet(); AGDataAndStatistics& statData; - std::vector streets; + std::vector streets; std::vector workPositions; std::list schools; std::list busLines; diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGDataAndStatistics.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGDataAndStatistics.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGDataAndStatistics.cpp 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGDataAndStatistics.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,13 +5,13 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGDataAndStatistics.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGDataAndStatistics.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Contains various data, statistical values and functions from input used // by various objects /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGDataAndStatistics.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGDataAndStatistics.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGDataAndStatistics.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGDataAndStatistics.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,13 +5,13 @@ /// @author Jakob Erdmann /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGDataAndStatistics.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGDataAndStatistics.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Contains various data, statistical values and functions from input used // by various objects /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -50,8 +50,8 @@ /** * parameters */ - SUMOReal speedTimePerKm; //number of seconds for one km - SUMOReal carPreference; //prob. to choose the car (compared to the bus) + SUMOReal speedTimePerKm; //number of seconds for one km + SUMOReal carPreference; //prob. to choose the car (compared to the bus) /** * from General element from XML file. @@ -70,12 +70,12 @@ SUMOReal uniformRandomTrafficRate; SUMOReal departureVariation; - std::map beginWorkHours; // (number only used in term of PROPORTION: it should be normalized) - std::map endWorkHours; // (number only used in term of PROPORTION: it should be normalized) - std::map busStations; // + std::map beginWorkHours; // (number only used in term of PROPORTION: it should be normalized) + std::map endWorkHours; // (number only used in term of PROPORTION: it should be normalized) + std::map busStations; // //std::map schoolCapacity; - std::map population; // (number only used in term of PROPORTION: it should be normalized) - //std::map childrenAccompagniment; // + std::map population; // (number only used in term of PROPORTION: it should be normalized) + //std::map childrenAccompagniment; // /** * number of incoming or outgoing people through the given city gates * PROPORTION: it should be normalized diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGHousehold.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGHousehold.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGHousehold.cpp 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGHousehold.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,13 +5,13 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGHousehold.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGHousehold.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A household contains the people and cars of the city: roughly represents // families with their address, cars, adults and possibly children /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGHousehold.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGHousehold.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGHousehold.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGHousehold.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,13 +5,13 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGHousehold.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGHousehold.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A household contains the people and cars of the city: roughly represents // families with their address, cars, adults and possibly children /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -123,7 +123,6 @@ private: AGCity* myCity; AGPosition myLocation; - int myNumberOfCars; int myId; private: diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGPerson.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGPerson.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGPerson.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGPerson.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGPerson.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGPerson.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Parent object of every person, contains age and any natural characteristic /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGPerson.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGPerson.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGPerson.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGPerson.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Walter Bamberger /// @author Daniel Krajzewicz /// @date July 2010 -/// @version $Id: AGPerson.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGPerson.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Parent object of every person, contains age and any natural characteristic /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGPosition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGPosition.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGPosition.cpp 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGPosition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGPosition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGPosition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // References a street of the city and defines a position in this street /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -125,8 +125,8 @@ Position AGPosition::compute2dPosition() const { // P = From + pos*(To - From) = pos*To + (1-pos)*From - Position From = street->edge->getFromNode()->getPosition(); - Position To = street->edge->getToNode()->getPosition(); + Position From = street->getFromNode()->getPosition(); + Position To = street->getToNode()->getPosition(); Position position2d(To); position2d.sub(From); diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGPosition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGPosition.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGPosition.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGPosition.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGPosition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGPosition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // References a street of the city and defines a position in this street /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGSchool.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGSchool.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGSchool.cpp 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGSchool.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGSchool.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGSchool.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Correspond to given ages and referenced by children. Has a precise location. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -42,7 +42,7 @@ // method definitions // =========================================================================== void -AGSchool::print() { +AGSchool::print() const { std::cout << "- school: " << " placeNbr=" << capacity << " hours=[" << opening << ";" << closing << "] ages=[" << beginAge << ";" << endAge << "]" << std::endl; } diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGSchool.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGSchool.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGSchool.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGSchool.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGSchool.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGSchool.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Correspond to given ages and referenced by children. Has a precise location. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -51,7 +51,7 @@ location(pos), opening(open), closing(close) {}; - void print(); + void print() const; int getPlaces(); bool addNewChild(); bool removeChild(); diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGStreet.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGStreet.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGStreet.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGStreet.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGStreet.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGStreet.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Represents a SUMO edge and contains people and work densities /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -41,52 +41,45 @@ // =========================================================================== // method definitions // =========================================================================== -AGStreet::AGStreet(const ROEdge* edge, SUMOReal popDensity, SUMOReal workDensity) : - edge(edge) { - pop = popDensity * edge->getLength(); - work = workDensity * edge->getLength(); +AGStreet::AGStreet(const std::string& id, RONode* from, RONode* to, unsigned int index, const int priority) : + ROEdge(id, from, to, index, priority), myPopulation(0.), myNumWorkplaces(0.) { } 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(); + std::cout << "- AGStreet: Name=" << getID() << " Length=" << getLength() << " pop=" << myPopulation << " work=" << myNumWorkplaces << std::endl; } SUMOReal AGStreet::getPopulation() const { - return pop; + return myPopulation; } void AGStreet::setPopulation(const SUMOReal population) { - pop = population; + myPopulation = population; } SUMOReal AGStreet::getWorkplaceNumber() const { - return work; + return myNumWorkplaces; } void AGStreet::setWorkplaceNumber(const SUMOReal workPositions) { - work = workPositions; + myNumWorkplaces = workPositions; } + +bool +AGStreet::allows(const SUMOVehicleClass vclass) const { + return (getPermissions() & vclass) == vclass; +} + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGStreet.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGStreet.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGStreet.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGStreet.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGStreet.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGStreet.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Represents a SUMO edge and contains people and work densities /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ @@ -36,12 +36,14 @@ #endif #include +#include +#include +#include // =========================================================================== // class declarations // =========================================================================== -class ROEdge; class AGPosition; @@ -55,21 +57,24 @@ * AGStreet represents a street in the city. It contains all model relevant * properties and is associated with a ROEdge of the routing network. */ -class AGStreet { +class AGStreet : public ROEdge { public: - AGStreet(const ROEdge* edge, SUMOReal popD = 0, SUMOReal workD = 0); + class Builder : public ROAbstractEdgeBuilder { + public: + /** @brief Builds an edge with the given name + * + * @param[in] name The name of the edge + * @param[in] from The node the edge begins at + * @param[in] to The node the edge ends at + * @param[in] priority The edge priority (road class) + * @return A proper instance of the named edge + */ + ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to, const int priority) { + return new AGStreet(name, from, to, getNextIndex(), priority); + } + }; - /** @brief Provides the length of this edge. - * - * @return the length of this edge - */ - SUMOReal getLength() const; - - /** @brief Provides the id of this edge. - * - * @return the id of this edge - */ - const std::string& getName() const; + AGStreet(const std::string& id, RONode* from, RONode* to, unsigned int index, const int priority); /** @brief Provides the number of persons living in this street. * @@ -100,12 +105,16 @@ */ void print() const; -private: - friend class AGPosition; + /** @brief Returns whether the given vehicle class is allowed on this street. + * + * @param[in] vclass the class (passenger or bus) in question + * @return whether it is allowed on any of the lanes + */ + bool allows(const SUMOVehicleClass vclass) const; - const ROEdge* edge; - SUMOReal pop; - SUMOReal work; +private: + SUMOReal myPopulation; + SUMOReal myNumWorkplaces; }; #endif diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGTime.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGTime.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGTime.cpp 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGTime.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGTime.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGTime.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Time manager: able to manipulate the time using Sumo's format (seconds) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGTime.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGTime.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGTime.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGTime.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date July 2010 -/// @version $Id: AGTime.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGTime.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Time manager: able to manipulate the time using Sumo's format (seconds) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGWorkPosition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGWorkPosition.cpp --- sumo-0.21.0+dfsg/src/activitygen/city/AGWorkPosition.cpp 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGWorkPosition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGWorkPosition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AGWorkPosition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Location and schedules of a work position: linked with one adult /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/AGWorkPosition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGWorkPosition.h --- sumo-0.21.0+dfsg/src/activitygen/city/AGWorkPosition.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/AGWorkPosition.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Walter Bamberger /// @author Michael Behrisch /// @date July 2010 -/// @version $Id: AGWorkPosition.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: AGWorkPosition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Location and schedules of a work position: linked with one adult /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/activitygen/city/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/Makefile.in --- sumo-0.21.0+dfsg/src/activitygen/city/Makefile.in 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/city/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -225,6 +225,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -235,7 +237,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/activitygen/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/Makefile.am --- sumo-0.21.0+dfsg/src/activitygen/Makefile.am 2014-02-24 23:02:17.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -8,6 +8,7 @@ COMMON_LIBS = ../utils/options/liboptions.a \ ../utils/xml/libxml.a \ +../utils/vehicle/libvehicle.a \ ../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ @@ -31,4 +32,4 @@ ../duarouter/RODUAEdgeBuilder.o \ ../duarouter/RODUAFrame.o \ ../router/librouter.a \ -$(COMMON_LIBS) +$(COMMON_LIBS) $(FOX_LDFLAGS) diff -Nru sumo-0.21.0+dfsg/src/activitygen/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/Makefile.in --- sumo-0.21.0+dfsg/src/activitygen/Makefile.in 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/activitygen/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -99,15 +99,15 @@ activitygen_OBJECTS = $(am_activitygen_OBJECTS) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = ../utils/options/liboptions.a \ - ../utils/xml/libxml.a ../utils/common/libcommon.a \ - ../utils/importio/libimportio.a \ + ../utils/xml/libxml.a ../utils/vehicle/libvehicle.a \ + ../utils/common/libcommon.a ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a ../utils/geom/libgeom.a \ ../utils/emissions/libemissions.a ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) $(am__DEPENDENCIES_1) activitygen_DEPENDENCIES = ./activities/libagactivities.a \ ./city/libagcity.a ../duarouter/RODUAEdgeBuilder.o \ ../duarouter/RODUAFrame.o ../router/librouter.a \ - $(am__DEPENDENCIES_2) + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -273,6 +273,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -283,7 +285,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -381,6 +382,7 @@ @CHECK_MEMORY_LEAKS_TRUE@MEM_LIBS = ../foreign/nvwa/libnvwa.a COMMON_LIBS = ../utils/options/liboptions.a \ ../utils/xml/libxml.a \ +../utils/vehicle/libvehicle.a \ ../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ @@ -402,7 +404,7 @@ ../duarouter/RODUAEdgeBuilder.o \ ../duarouter/RODUAFrame.o \ ../router/librouter.a \ -$(COMMON_LIBS) +$(COMMON_LIBS) $(FOX_LDFLAGS) all: all-recursive diff -Nru sumo-0.21.0+dfsg/src/config.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/config.h --- sumo-0.21.0+dfsg/src/config.h 2014-06-11 22:04:06.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/config.h 2015-04-17 05:44:20.000000000 +0000 @@ -32,7 +32,10 @@ #define HAVE_FLOAT_H 1 /* Define to 1 if you have the `floor' function. */ -/* #undef HAVE_FLOOR */ +#define HAVE_FLOOR 1 + +/* defined if FOX is available */ +#define HAVE_FOX 1 /* defined if GDAL is available */ #define HAVE_GDAL 1 @@ -72,13 +75,13 @@ /* #undef HAVE_OSG */ /* Define to 1 if you have the `pow' function. */ -/* #undef HAVE_POW */ +#define HAVE_POW 1 /* defined if PROJ is available */ #define HAVE_PROJ 1 /* defined if python is available */ -/* #undef HAVE_PYTHON */ +#define HAVE_PYTHON 1 /* Define to 1 if you have the `select' function. */ #define HAVE_SELECT 1 @@ -87,7 +90,7 @@ #define HAVE_SOCKET 1 /* Define to 1 if you have the `sqrt' function. */ -/* #undef HAVE_SQRT */ +#define HAVE_SQRT 1 /* Define to 1 if `stat' has the bug that it succeeds when given the zero-length file name argument. */ @@ -139,7 +142,7 @@ #define HAVE_WCHAR_H 1 /* Define to 1 if the system has the type `_Bool'. */ -#define HAVE__BOOL 1 +/* #undef HAVE__BOOL */ /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ @@ -171,7 +174,7 @@ #define PACKAGE_NAME "sumo" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "sumo 0.21.0" +#define PACKAGE_STRING "sumo 0.23.0" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "sumo" @@ -180,7 +183,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.21.0" +#define PACKAGE_VERSION "0.23.0" /* defines the epsilon to use on position comparison */ #define POSITION_EPS (SUMOReal)0.1 @@ -206,7 +209,7 @@ /* #undef STACK_DIRECTION */ /* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 +/* #undef STDC_HEADERS */ /* defines the type for very long integers */ #define SUMOLong long long int @@ -221,7 +224,7 @@ /* #undef TM_IN_SYS_TIME */ /* Version number of package */ -#define VERSION "0.21.0" +#define VERSION "0.23.0" /* Defined if auto-generated version.h is unavailable. */ /* #undef VERSION_STRING */ diff -Nru sumo-0.21.0+dfsg/src/config.h.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/config.h.in --- sumo-0.21.0+dfsg/src/config.h.in 2014-06-11 22:03:54.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/config.h.in 2015-04-17 05:44:20.000000000 +0000 @@ -33,6 +33,9 @@ /* Define to 1 if you have the `floor' function. */ #undef HAVE_FLOOR +/* defined if FOX is available */ +#undef HAVE_FOX + /* defined if GDAL is available */ #undef HAVE_GDAL diff -Nru sumo-0.21.0+dfsg/src/dfrouter/dfrouter_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/dfrouter_main.cpp --- sumo-0.21.0+dfsg/src/dfrouter/dfrouter_main.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/dfrouter_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Thu, 16.03.2006 -/// @version $Id: dfrouter_main.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: dfrouter_main.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Main for the DFROUTER /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -264,7 +264,7 @@ OptionsCont& oc = OptionsCont::getOptions(); // give some application descriptions oc.setApplicationDescription("Builds vehicle routes for SUMO using detector values."); - oc.setApplicationName("dfrouter", "SUMO dfrouter Version " + (std::string)VERSION_STRING); + oc.setApplicationName("dfrouter", "SUMO dfrouter Version " + getBuildName(VERSION_STRING)); int ret = 0; RODFNet* net = 0; RODFDetectorCon* detectors = 0; diff -Nru sumo-0.21.0+dfsg/src/dfrouter/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/Makefile.am --- sumo-0.21.0+dfsg/src/dfrouter/Makefile.am 2014-02-24 23:02:17.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -17,6 +17,7 @@ dfrouter_LDADD = ../router/librouter.a \ ../utils/options/liboptions.a \ ../utils/xml/libxml.a \ +../utils/vehicle/libvehicle.a \ ../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ @@ -24,4 +25,4 @@ ../utils/emissions/libemissions.a \ ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) \ --l$(LIB_XERCES) +-l$(LIB_XERCES) $(FOX_LDFLAGS) diff -Nru sumo-0.21.0+dfsg/src/dfrouter/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/Makefile.in --- sumo-0.21.0+dfsg/src/dfrouter/Makefile.in 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -100,12 +100,14 @@ RODFEdgeBuilder.$(OBJEXT) RODFEdge.$(OBJEXT) \ RODFFrame.$(OBJEXT) dfrouter_OBJECTS = $(am_dfrouter_OBJECTS) +am__DEPENDENCIES_1 = dfrouter_DEPENDENCIES = ../router/librouter.a \ ../utils/options/liboptions.a ../utils/xml/libxml.a \ - ../utils/common/libcommon.a ../utils/importio/libimportio.a \ + ../utils/vehicle/libvehicle.a ../utils/common/libcommon.a \ + ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a ../utils/geom/libgeom.a \ ../utils/emissions/libemissions.a ../foreign/tcpip/libtcpip.a \ - $(MEM_LIBS) + $(MEM_LIBS) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -229,6 +231,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -239,7 +243,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -346,6 +349,7 @@ dfrouter_LDADD = ../router/librouter.a \ ../utils/options/liboptions.a \ ../utils/xml/libxml.a \ +../utils/vehicle/libvehicle.a \ ../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ @@ -353,7 +357,7 @@ ../utils/emissions/libemissions.a \ ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) \ --l$(LIB_XERCES) +-l$(LIB_XERCES) $(FOX_LDFLAGS) all: all-am diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFDetector.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetector.cpp --- sumo-0.21.0+dfsg/src/dfrouter/RODFDetector.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetector.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -8,12 +8,12 @@ /// @author Laura Bieker /// @author Melanie Knocke /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetector.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: RODFDetector.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Class representing a detector within the DFROUTER /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -91,7 +91,7 @@ RODFDetector::computeDistanceFactor(const RODFRouteDesc& rd) const { SUMOReal distance = rd.edges2Pass[0]->getFromNode()->getPosition().distanceTo(rd.edges2Pass.back()->getToNode()->getPosition()); SUMOReal length = 0; - for (std::vector::const_iterator i = rd.edges2Pass.begin(); i != rd.edges2Pass.end(); ++i) { + for (ROEdgeVector::const_iterator i = rd.edges2Pass.begin(); i != rd.edges2Pass.end(); ++i) { length += (*i)->getLength(); } return (distance / length); @@ -112,7 +112,7 @@ for (std::vector::const_iterator i = routes.begin(); i != routes.end(); ++i) { const RODFRouteDesc& rd = *i; bool hadSplit = false; - for (std::vector::const_iterator j = rd.edges2Pass.begin(); j != rd.edges2Pass.end(); ++j) { + for (ROEdgeVector::const_iterator j = rd.edges2Pass.begin(); j != rd.edges2Pass.end(); ++j) { if (hadSplit && net->hasDetector(*j)) { if (find(nextDetEdges.begin(), nextDetEdges.end(), *j) == nextDetEdges.end()) { nextDetEdges.push_back(static_cast(*j)); @@ -123,7 +123,7 @@ if (!hadSplit) { preSplitEdges.insert(*j); } - if ((*j)->getNoFollowing() > 1) { + if ((*j)->getNumSuccessors() > 1) { hadSplit = true; } } @@ -132,16 +132,15 @@ if (OptionsCont::getOptions().getBool("respect-concurrent-inflows")) { for (std::vector::const_iterator i = nextDetEdges.begin(); i != nextDetEdges.end(); ++i) { std::set seen(preSplitEdges); - std::vector pending; + ROEdgeVector pending; pending.push_back(*i); seen.insert(*i); while (!pending.empty()) { ROEdge* e = pending.back(); pending.pop_back(); - const unsigned int numAppr = e->getNumApproaching(); - for (unsigned int j = 0; j < numAppr; j++) { - ROEdge* e2 = e->getApproaching(j); - if (e2->getNoFollowing() == 1 && seen.count(e2) == 0) { + for (ROEdgeVector::const_iterator it = e->getPredecessors().begin(); it != e->getPredecessors().end(); it++) { + ROEdge* e2 = *it; + if (e2->getNumSuccessors() == 1 && seen.count(e2) == 0) { if (net->hasDetector(e2)) { inFlows[*i] += detectors.getAggFlowFor(e2, 0, 0, flows); } else { @@ -194,7 +193,7 @@ size_t index = 0; for (std::vector::iterator ri = descs.begin(); ri != descs.end(); ++ri, index++) { SUMOReal prob = 1.; - for (std::vector::iterator j = (*ri).edges2Pass.begin(); j != (*ri).edges2Pass.end() && prob > 0;) { + for (ROEdgeVector::iterator j = (*ri).edges2Pass.begin(); j != (*ri).edges2Pass.end() && prob > 0;) { if (!net.hasDetector(*j)) { ++j; continue; @@ -633,7 +632,7 @@ } // OutputDevice& out = OutputDevice::getDevice(file); - out.writeXMLHeader("additional", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/additional_file.xsd\""); + out.writeXMLHeader("additional", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/additional_file.xsd\""); for (std::vector::const_iterator i = myDetectors.begin(); i != myDetectors.end(); ++i) { RODFDetector* det = *i; // get file name for values (emitter/calibrator definition) @@ -675,7 +674,7 @@ RODFDetectorCon::writeEmitterPOIs(const std::string& file, const RODFDetectorFlows& flows) { OutputDevice& out = OutputDevice::getDevice(file); - out.writeXMLHeader("additional", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/additional_file.xsd\""); + out.writeXMLHeader("additional", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/additional_file.xsd\""); for (std::vector::const_iterator i = myDetectors.begin(); i != myDetectors.end(); ++i) { RODFDetector* det = *i; SUMOReal flow = flows.getFlowSumSecure(det->getID()); @@ -754,7 +753,7 @@ SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset) { OutputDevice& out = OutputDevice::getDevice(file); - out.writeXMLHeader("additional", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/additional_file.xsd\""); + out.writeXMLHeader("additional", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/additional_file.xsd\""); for (std::vector::const_iterator i = myDetectors.begin(); i != myDetectors.end(); ++i) { RODFDetector* det = *i; // write the declaration into the file @@ -772,7 +771,7 @@ void RODFDetectorCon::writeEndRerouterDetectors(const std::string& file) { OutputDevice& out = OutputDevice::getDevice(file); - out.writeXMLHeader("additional", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/additional_file.xsd\""); + out.writeXMLHeader("additional", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/additional_file.xsd\""); for (std::vector::const_iterator i = myDetectors.begin(); i != myDetectors.end(); ++i) { RODFDetector* det = *i; // write the declaration into the file diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFDetectorFlow.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetectorFlow.cpp --- sumo-0.21.0+dfsg/src/dfrouter/RODFDetectorFlow.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetectorFlow.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Melanie Knocke /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetectorFlow.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RODFDetectorFlow.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Storage for flows within the DFROUTER /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFDetectorFlow.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetectorFlow.h --- sumo-0.21.0+dfsg/src/dfrouter/RODFDetectorFlow.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetectorFlow.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Eric Nicolay /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetectorFlow.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: RODFDetectorFlow.h 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFDetector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetector.h --- sumo-0.21.0+dfsg/src/dfrouter/RODFDetector.h 2014-03-04 23:02:10.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetector.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Eric Nicolay /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetector.h 15801 2014-03-04 12:28:27Z behrisch $ +/// @version $Id: RODFDetector.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Class representing a detector within the DFROUTER /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFDetectorHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetectorHandler.cpp --- sumo-0.21.0+dfsg/src/dfrouter/RODFDetectorHandler.cpp 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetectorHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetectorHandler.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: RODFDetectorHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A handler for loading detector descriptions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFDetectorHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetectorHandler.h --- sumo-0.21.0+dfsg/src/dfrouter/RODFDetectorHandler.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetectorHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetectorHandler.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: RODFDetectorHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFDetFlowLoader.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetFlowLoader.cpp --- sumo-0.21.0+dfsg/src/dfrouter/RODFDetFlowLoader.cpp 2014-06-05 22:02:18.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetFlowLoader.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetFlowLoader.cpp 16541 2014-06-05 10:48:29Z behrisch $ +/// @version $Id: RODFDetFlowLoader.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A loader for detector flows /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFDetFlowLoader.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetFlowLoader.h --- sumo-0.21.0+dfsg/src/dfrouter/RODFDetFlowLoader.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFDetFlowLoader.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Eric Nicolay /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFDetFlowLoader.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: RODFDetFlowLoader.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A loader for detector flows /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFEdgeBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFEdgeBuilder.cpp --- sumo-0.21.0+dfsg/src/dfrouter/RODFEdgeBuilder.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFEdgeBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Yun-Pang Floetteroed /// @date Thu, 16.03.2006 -/// @version $Id: RODFEdgeBuilder.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RODFEdgeBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Interface for building instances of dfrouter-edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFEdgeBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFEdgeBuilder.h --- sumo-0.21.0+dfsg/src/dfrouter/RODFEdgeBuilder.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFEdgeBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Yun-Pang Floetteroed /// @date Thu, 16.03.2006 -/// @version $Id: RODFEdgeBuilder.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RODFEdgeBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Interface for building instances of dfrouter-edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFEdge.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFEdge.cpp --- sumo-0.21.0+dfsg/src/dfrouter/RODFEdge.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFEdge.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Yun-Pang Floetteroed /// @date Thu, 16.03.2006 -/// @version $Id: RODFEdge.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RODFEdge.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An edge within the DFROUTER /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFEdge.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFEdge.h --- sumo-0.21.0+dfsg/src/dfrouter/RODFEdge.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFEdge.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Yun-Pang Floetteroed /// @date Thu, 16.03.2006 -/// @version $Id: RODFEdge.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RODFEdge.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An edge within the DFROUTER /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFFrame.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFFrame.cpp --- sumo-0.21.0+dfsg/src/dfrouter/RODFFrame.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFFrame.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Melanie Knocke /// @date Thu, 16.03.2006 -/// @version $Id: RODFFrame.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RODFFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for df-routing /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFFrame.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFFrame.h --- sumo-0.21.0+dfsg/src/dfrouter/RODFFrame.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFFrame.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Eric Nicolay /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFFrame.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: RODFFrame.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for df-routing /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFNet.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFNet.cpp --- sumo-0.21.0+dfsg/src/dfrouter/RODFNet.cpp 2014-03-12 23:02:07.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFNet.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFNet.cpp 15913 2014-03-12 13:06:39Z dkrajzew $ +/// @version $Id: RODFNet.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A DFROUTER-network /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -70,10 +70,9 @@ 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; - unsigned int length_size = ce->getNoFollowing(); - for (i = 0; i < length_size; i++) { - ROEdge* help = ce->getFollower(i); + const ROEdgeVector& successors = ce->getSuccessors(); + for (ROEdgeVector::const_iterator it = successors.begin(); it != successors.end(); ++it) { + ROEdge* help = *it; if (find(myDisallowedEdges.begin(), myDisallowedEdges.end(), help->getID()) != myDisallowedEdges.end()) { // edges in sinks will not be used continue; @@ -84,12 +83,12 @@ } // add the connection help->ce to myApproachingEdges if (myApproachingEdges.find(help) == myApproachingEdges.end()) { - myApproachingEdges[help] = std::vector(); + myApproachingEdges[help] = ROEdgeVector(); } myApproachingEdges[help].push_back(ce); // add the connection ce->help to myApproachingEdges if (myApproachedEdges.find(ce) == myApproachedEdges.end()) { - myApproachedEdges[ce] = std::vector(); + myApproachedEdges[ce] = ROEdgeVector(); } myApproachedEdges[ce].push_back(help); } @@ -187,15 +186,15 @@ RODFNet::computeRoutesFor(ROEdge* edge, RODFRouteDesc& base, int /*no*/, bool keepUnfoundEnds, bool keepShortestOnly, - std::vector& /*visited*/, + ROEdgeVector& /*visited*/, const RODFDetector& det, RODFRouteCont& into, const RODFDetectorCon& detectors, int maxFollowingLength, - std::vector& seen) const { + ROEdgeVector& seen) const { std::vector unfoundEnds; std::priority_queue, DFRouteDescByTimeComperator> toSolve; - std::map > dets2Follow; - dets2Follow[edge] = std::vector(); + std::map dets2Follow; + dets2Follow[edge] = ROEdgeVector(); base.passedNo = 0; SUMOReal minDist = OptionsCont::getOptions().getFloat("min-route-length"); toSolve.push(base); @@ -205,9 +204,9 @@ ROEdge* last = *(current.edges2Pass.end() - 1); if (hasDetector(last)) { if (dets2Follow.find(last) == dets2Follow.end()) { - dets2Follow[last] = std::vector(); + dets2Follow[last] = ROEdgeVector(); } - for (std::vector::reverse_iterator i = current.edges2Pass.rbegin() + 1; i != current.edges2Pass.rend(); ++i) { + for (ROEdgeVector::reverse_iterator i = current.edges2Pass.rbegin() + 1; i != current.edges2Pass.rend(); ++i) { if (hasDetector(*i)) { dets2Follow[*i].push_back(last); break; @@ -292,7 +291,7 @@ } } // ... else: loop over the next edges - const std::vector& appr = myApproachedEdges.find(last)->second; + const ROEdgeVector& 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()) { @@ -321,7 +320,7 @@ // if (!keepUnfoundEnds) { std::vector::iterator i; - std::vector lastDetEdges; + ConstROEdgeVector lastDetEdges; for (i = unfoundEnds.begin(); i != unfoundEnds.end(); ++i) { if (find(lastDetEdges.begin(), lastDetEdges.end(), (*i).lastDetectorEdge) == lastDetEdges.end()) { lastDetEdges.push_back((*i).lastDetectorEdge); @@ -357,7 +356,7 @@ (*i)->addRoutes(new RODFRouteCont(*doneEdges[e])); continue; } - std::vector seen; + ROEdgeVector seen; RODFRouteCont* routes = new RODFRouteCont(); doneEdges[e] = routes; RODFRouteDesc rd; @@ -371,7 +370,7 @@ rd.overallProb = 0; - std::vector visited; + ROEdgeVector visited; visited.push_back(e); computeRoutesFor(e, rd, 0, keepUnfoundEnds, keepShortestOnly, visited, **i, *routes, detcont, maxFollowingLength, seen); @@ -387,8 +386,8 @@ SUMOReal duration = mrd.duration_2; SUMOReal distance = mrd.distance; // go through each route's edges - std::vector::const_iterator routeend = mrd.edges2Pass.end(); - for (std::vector::const_iterator k = mrd.edges2Pass.begin(); k != routeend; ++k) { + ROEdgeVector::const_iterator routeend = mrd.edges2Pass.end(); + for (ROEdgeVector::const_iterator k = mrd.edges2Pass.begin(); k != routeend; ++k) { // check whether any detectors lies on the current edge if (myDetectorsOnEdges.find(*k) == myDetectorsOnEdges.end()) { duration -= (*k)->getLength() / (*k)->getSpeed(); @@ -443,7 +442,7 @@ // lets find preceding detectors and rebuild the flows if possible WRITE_WARNING("Detector '" + detector->getID() + "' has no flows.\n Trying to rebuild."); // go back and collect flows - std::vector previous; + ROEdgeVector previous; { std::vector missing; IterationEdge ie; @@ -454,8 +453,8 @@ while (!missing.empty() && !maxDepthReached) { IterationEdge last = missing.back(); missing.pop_back(); - std::vector approaching = myApproachingEdges[last.edge]; - for (std::vector::const_iterator j = approaching.begin(); j != approaching.end(); ++j) { + ROEdgeVector approaching = myApproachingEdges[last.edge]; + for (ROEdgeVector::const_iterator j = approaching.begin(); j != approaching.end(); ++j) { if (hasDetector(*j)) { previous.push_back(*j); } else { @@ -474,10 +473,10 @@ } // Edges with previous detectors are now in "previous"; // compute following - std::vector latter; + ROEdgeVector latter; { std::vector missing; - for (std::vector::const_iterator k = previous.begin(); k != previous.end(); ++k) { + for (ROEdgeVector::const_iterator k = previous.begin(); k != previous.end(); ++k) { IterationEdge ie; ie.depth = 0; ie.edge = *k; @@ -487,8 +486,8 @@ while (!missing.empty() && !maxDepthReached) { IterationEdge last = missing.back(); missing.pop_back(); - std::vector approached = myApproachedEdges[last.edge]; - for (std::vector::const_iterator j = approached.begin(); j != approached.end(); ++j) { + ROEdgeVector approached = myApproachedEdges[last.edge]; + for (ROEdgeVector::const_iterator j = approached.begin(); j != approached.end(); ++j) { if (*j == getDetectorEdge(*detector)) { continue; } @@ -525,7 +524,7 @@ // collect incoming { // !! time difference is missing - for (std::vector::iterator i = previous.begin(); i != previous.end(); ++i) { + for (ROEdgeVector::iterator i = previous.begin(); i != previous.end(); ++i) { const std::vector& flows = static_cast(*i)->getFlows(); if (flows.size() != 0) { const FlowDef& srcFD = flows[index]; @@ -546,7 +545,7 @@ outFlow.vPKW = 0; { // !! time difference is missing - for (std::vector::iterator i = latter.begin(); i != latter.end(); ++i) { + for (ROEdgeVector::iterator i = latter.begin(); i != latter.end(); ++i) { const std::vector& flows = static_cast(*i)->getFlows(); if (flows.size() != 0) { const FlowDef& srcFD = flows[index]; @@ -683,28 +682,28 @@ bool RODFNet::isSource(const RODFDetector& det, const RODFDetectorCon& detectors, bool strict) const { - std::vector seen; + ROEdgeVector seen; return isSource(det, getDetectorEdge(det), seen, detectors, strict); } bool RODFNet::isFalseSource(const RODFDetector& det, const RODFDetectorCon& detectors) const { - std::vector seen; + ROEdgeVector seen; return isFalseSource(det, getDetectorEdge(det), seen, detectors); } bool RODFNet::isDestination(const RODFDetector& det, const RODFDetectorCon& detectors) const { - std::vector seen; + ROEdgeVector seen; return isDestination(det, getDetectorEdge(det), seen, detectors); } bool RODFNet::isSource(const RODFDetector& det, ROEdge* edge, - std::vector& seen, + ROEdgeVector& seen, const RODFDetectorCon& detectors, bool strict) const { if (seen.size() == 1000) { // !!! @@ -746,7 +745,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 ROEdgeVector& appr = myApproachingEdges.find(edge)->second; size_t noOk = 0; size_t noFalse = 0; size_t noSkipped = 0; @@ -780,7 +779,7 @@ } // let's check the edges in front - const std::vector& appr = myApproachingEdges.find(edge)->second; + const ROEdgeVector& appr = myApproachingEdges.find(edge)->second; size_t noOk = 0; size_t noFalse = 0; size_t noSkipped = 0; @@ -806,7 +805,7 @@ bool -RODFNet::isDestination(const RODFDetector& det, ROEdge* edge, std::vector& seen, +RODFNet::isDestination(const RODFDetector& det, ROEdge* edge, ROEdgeVector& 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."); @@ -865,7 +864,7 @@ myDetectorEdges.find(det.getID())->second != edge) { return false; } - const std::vector& appr = myApproachedEdges.find(edge)->second; + const ROEdgeVector& appr = myApproachedEdges.find(edge)->second; bool isall = true; size_t no = 0; seen.push_back(edge); @@ -882,7 +881,7 @@ } bool -RODFNet::isFalseSource(const RODFDetector& det, ROEdge* edge, std::vector& seen, +RODFNet::isFalseSource(const RODFDetector& det, ROEdge* edge, ROEdgeVector& 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."); @@ -915,7 +914,7 @@ return false; } - const std::vector& appr = myApproachedEdges.find(edge)->second; + const ROEdgeVector& 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()); @@ -1027,8 +1026,8 @@ // iterate over the current detector's routes const std::vector& routes = det.getRouteVector(); for (std::vector::const_iterator j = routes.begin(); j != routes.end(); ++j) { - const std::vector& edges2Pass = (*j).edges2Pass; - for (std::vector::const_iterator k = edges2Pass.begin() + 1; k != edges2Pass.end(); ++k) { + const ROEdgeVector& edges2Pass = (*j).edges2Pass; + for (ROEdgeVector::const_iterator k = edges2Pass.begin() + 1; k != edges2Pass.end(); ++k) { if (myDetectorsOnEdges.find(*k) != myDetectorsOnEdges.end()) { const std::vector& detNames = myDetectorsOnEdges.find(*k)->second; // ok, consecutive detector found diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFNet.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFNet.h --- sumo-0.21.0+dfsg/src/dfrouter/RODFNet.h 2014-03-12 23:02:07.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFNet.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Eric Nicolay /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFNet.h 15913 2014-03-12 13:06:39Z dkrajzew $ +/// @version $Id: RODFNet.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A DFROUTER-network /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -104,20 +104,20 @@ ROEdge* getDetectorEdge(const RODFDetector& det) const; bool isSource(const RODFDetector& det, ROEdge* edge, - std::vector& seen, const RODFDetectorCon& detectors, + ROEdgeVector& 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, + ROEdgeVector& seen, const RODFDetectorCon& detectors) const; + bool isDestination(const RODFDetector& det, ROEdge* edge, ROEdgeVector& seen, const RODFDetectorCon& detectors) const; void computeRoutesFor(ROEdge* edge, RODFRouteDesc& base, int no, bool keepUnfoundEnds, bool keepShortestOnly, - std::vector& visited, const RODFDetector& det, + ROEdgeVector& visited, const RODFDetector& det, RODFRouteCont& into, const RODFDetectorCon& detectors, int maxFollowingLength, - std::vector& seen) const; + ROEdgeVector& seen) const; void buildDetectorEdgeDependencies(RODFDetectorCon& dets) const; @@ -158,10 +158,10 @@ }; /// @brief Map of edge name->list of names of this edge approaching edges - std::map > myApproachingEdges; + std::map myApproachingEdges; /// @brief Map of edge name->list of names of edges approached by this edge - std::map > myApproachedEdges; + std::map myApproachedEdges; mutable std::map, idComp> myDetectorsOnEdges; mutable std::map myDetectorEdges; diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFRouteCont.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFRouteCont.cpp --- sumo-0.21.0+dfsg/src/dfrouter/RODFRouteCont.cpp 2014-03-12 23:02:07.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFRouteCont.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFRouteCont.cpp 15913 2014-03-12 13:06:39Z dkrajzew $ +/// @version $Id: RODFRouteCont.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A container for routes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -91,7 +91,7 @@ assert(desc.edges2Pass.size() >= 1); out.openTag(SUMO_TAG_ROUTE).writeAttr(SUMO_ATTR_ID, prependix + desc.routename); out << " edges=\""; - for (std::vector::const_iterator k = desc.edges2Pass.begin(); k != desc.edges2Pass.end(); k++) { + for (ROEdgeVector::const_iterator k = desc.edges2Pass.begin(); k != desc.edges2Pass.end(); k++) { if (k != desc.edges2Pass.begin()) { out << ' '; } @@ -112,13 +112,13 @@ 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; - for (std::vector >::const_iterator j = illegals.begin(); !remove && j != illegals.end(); ++j) { + for (std::vector::const_iterator j = illegals.begin(); !remove && j != illegals.end(); ++j) { int noFound = 0; - for (std::vector::const_iterator k = (*j).begin(); !remove && k != (*j).end(); ++k) { + for (ROEdgeVector::const_iterator k = (*j).begin(); !remove && k != (*j).end(); ++k) { if (find(desc.edges2Pass.begin(), desc.edges2Pass.end(), *k) != desc.edges2Pass.end()) { noFound++; if (noFound > 1) { diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFRouteCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFRouteCont.h --- sumo-0.21.0+dfsg/src/dfrouter/RODFRouteCont.h 2014-03-12 23:02:07.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFRouteCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFRouteCont.h 15913 2014-03-12 13:06:39Z dkrajzew $ +/// @version $Id: RODFRouteCont.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A container for routes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -130,7 +130,7 @@ * @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); protected: diff -Nru sumo-0.21.0+dfsg/src/dfrouter/RODFRouteDesc.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFRouteDesc.h --- sumo-0.21.0+dfsg/src/dfrouter/RODFRouteDesc.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/dfrouter/RODFRouteDesc.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: RODFRouteDesc.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: RODFRouteDesc.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A route within the DFROUTER /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -42,6 +42,7 @@ class ROEdge; class RODFDetector; +typedef std::vector ROEdgeVector; // =========================================================================== // struct definitions @@ -52,7 +53,7 @@ */ struct RODFRouteDesc { /// @brief The edges the route is made of - std::vector edges2Pass; + ROEdgeVector edges2Pass; /// @brief The name of the route std::string routename; SUMOReal duration_2; diff -Nru sumo-0.21.0+dfsg/src/duarouter/duarouter_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/duarouter_main.cpp --- sumo-0.21.0+dfsg/src/duarouter/duarouter_main.cpp 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/duarouter_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 06 Jun 2002 -/// @version $Id: duarouter_main.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: duarouter_main.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Main for DUAROUTER /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -44,10 +44,12 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "RODUAEdgeBuilder.h" #include #include @@ -62,12 +64,6 @@ #include "RODUAFrame.h" #include -#ifdef HAVE_INTERNAL // catchall for internal stuff -#include -#include -#include -#endif // have HAVE_INTERNAL - #ifdef CHECK_MEMORY_LEAKS #include #endif // CHECK_MEMORY_LEAKS @@ -123,46 +119,39 @@ if (measure == "traveltime") { if (routingAlgorithm == "dijkstra") { if (net.hasRestrictions()) { - router = new DijkstraRouterTT_Direct >( - net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTime); + router = new DijkstraRouterTT >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic); } else { - router = new DijkstraRouterTT_Direct >( - net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTime); + router = new DijkstraRouterTT >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic); } } else if (routingAlgorithm == "astar") { if (net.hasRestrictions()) { - router = new AStarRouterTT_Direct >( - net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTime); + router = new AStarRouter >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic); } else { - router = new AStarRouterTT_Direct >( - net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTime); + router = new AStarRouter >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic); } -#ifdef HAVE_INTERNAL // catchall for internal stuff } else if (routingAlgorithm == "bulkstar") { if (net.hasRestrictions()) { - router = new BulkStarRouterTT >( - net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTime, &ROEdge::getMinimumTravelTime); + router = new BulkStarRouter >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, &ROEdge::getMinimumTravelTime); } else { - router = new BulkStarRouterTT >( - net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTime, &ROEdge::getMinimumTravelTime); + router = new BulkStarRouter >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, &ROEdge::getMinimumTravelTime); } - } else if (routingAlgorithm == "CH") { - // defaultVehicle is only in constructor and may be safely deleted - // it is mainly needed for its maximum speed. @todo XXX make this configurable - ROVehicle defaultVehicle(SUMOVehicleParameter(), 0, net.getVehicleTypeSecure(DEFAULT_VTYPE_ID), &net); - const SUMOTime begin = string2time(oc.getString("begin")); 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); + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, true); } else { router = new CHRouter >( - net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTime, &defaultVehicle, begin, weightPeriod, false); + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, false); } - } else if (routingAlgorithm == "CHWrapper") { const SUMOTime begin = string2time(oc.getString("begin")); const SUMOTime weightPeriod = (oc.isSet("weight-files") ? @@ -170,60 +159,51 @@ std::numeric_limits::max()); router = new CHRouterWrapper >( - net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTime, begin, weightPeriod); - -#endif // have HAVE_INTERNAL + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, begin, weightPeriod); } else { throw ProcessError("Unknown routing Algorithm '" + routingAlgorithm + "'!"); } - } else { - DijkstraRouterEffort_Direct >::Operation op; + DijkstraRouterEffort >::Operation op; if (measure == "CO") { - op = &ROEdge::getCOEffort; + op = &ROEdge::getEmissionEffort; } else if (measure == "CO2") { - op = &ROEdge::getCO2Effort; + op = &ROEdge::getEmissionEffort; } else if (measure == "PMx") { - op = &ROEdge::getPMxEffort; + op = &ROEdge::getEmissionEffort; } else if (measure == "HC") { - op = &ROEdge::getHCEffort; + op = &ROEdge::getEmissionEffort; } else if (measure == "NOx") { - op = &ROEdge::getNOxEffort; + op = &ROEdge::getEmissionEffort; } else if (measure == "fuel") { - op = &ROEdge::getFuelEffort; + op = &ROEdge::getEmissionEffort; } else if (measure == "noise") { op = &ROEdge::getNoiseEffort; } else { - net.closeOutput(); throw ProcessError("Unknown measure (weight attribute '" + measure + "')!"); } if (net.hasRestrictions()) { - router = new DijkstraRouterEffort_Direct >( - net.getEdgeNo(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTime); + router = new DijkstraRouterEffort >( + net.getEdgeNo(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic); } else { - router = new DijkstraRouterEffort_Direct >( - net.getEdgeNo(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTime); + router = new DijkstraRouterEffort >( + net.getEdgeNo(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic); } } net.openOutput(filename, altFilename, oc.getString("vtype-output")); // 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 { - loader.processRoutes(string2time(oc.getString("begin")), string2time(oc.getString("end")), net, *router); + loader.processRoutes(string2time(oc.getString("begin")), string2time(oc.getString("end")), + string2time(oc.getString("route-steps")), net, *router); } // end the processing - net.closeOutput(); - delete router; - ROCostCalculator::cleanup(); + net.cleanup(router); } catch (ProcessError&) { - net.closeOutput(); - delete router; - ROCostCalculator::cleanup(); + net.cleanup(router); throw; } } @@ -237,7 +217,7 @@ OptionsCont& oc = OptionsCont::getOptions(); // give some application descriptions oc.setApplicationDescription("Shortest path router and DUE computer for the microscopic road traffic simulation SUMO."); - oc.setApplicationName("duarouter", "SUMO duarouter Version " + (std::string)VERSION_STRING); + oc.setApplicationName("duarouter", "SUMO duarouter Version " + getBuildName(VERSION_STRING)); int ret = 0; RONet* net = 0; try { diff -Nru sumo-0.21.0+dfsg/src/duarouter/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/Makefile.am --- sumo-0.21.0+dfsg/src/duarouter/Makefile.am 2014-02-24 23:02:20.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -13,6 +13,7 @@ duarouter_LDADD = ../router/librouter.a \ ../utils/options/liboptions.a \ ../utils/xml/libxml.a \ +../utils/vehicle/libvehicle.a \ ../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ @@ -20,4 +21,4 @@ ../utils/emissions/libemissions.a \ ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) \ --l$(LIB_XERCES) +-l$(LIB_XERCES) $(FOX_LDFLAGS) diff -Nru sumo-0.21.0+dfsg/src/duarouter/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/Makefile.in --- sumo-0.21.0+dfsg/src/duarouter/Makefile.in 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -96,12 +96,14 @@ am_duarouter_OBJECTS = duarouter_main.$(OBJEXT) \ RODUAEdgeBuilder.$(OBJEXT) RODUAFrame.$(OBJEXT) duarouter_OBJECTS = $(am_duarouter_OBJECTS) +am__DEPENDENCIES_1 = duarouter_DEPENDENCIES = ../router/librouter.a \ ../utils/options/liboptions.a ../utils/xml/libxml.a \ - ../utils/common/libcommon.a ../utils/importio/libimportio.a \ + ../utils/vehicle/libvehicle.a ../utils/common/libcommon.a \ + ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a ../utils/geom/libgeom.a \ ../utils/emissions/libemissions.a ../foreign/tcpip/libtcpip.a \ - $(MEM_LIBS) + $(MEM_LIBS) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -225,6 +227,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -235,7 +239,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -338,6 +341,7 @@ duarouter_LDADD = ../router/librouter.a \ ../utils/options/liboptions.a \ ../utils/xml/libxml.a \ +../utils/vehicle/libvehicle.a \ ../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ @@ -345,7 +349,7 @@ ../utils/emissions/libemissions.a \ ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) \ --l$(LIB_XERCES) +-l$(LIB_XERCES) $(FOX_LDFLAGS) all: all-am diff -Nru sumo-0.21.0+dfsg/src/duarouter/RODUAEdgeBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/RODUAEdgeBuilder.cpp --- sumo-0.21.0+dfsg/src/duarouter/RODUAEdgeBuilder.cpp 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/RODUAEdgeBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Yun-Pang Floetteroed /// @date Tue, 20 Jan 2004 -/// @version $Id: RODUAEdgeBuilder.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RODUAEdgeBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Interface for building instances of duarouter-edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/duarouter/RODUAEdgeBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/RODUAEdgeBuilder.h --- sumo-0.21.0+dfsg/src/duarouter/RODUAEdgeBuilder.h 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/RODUAEdgeBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Yun-Pang Floetteroed /// @date Tue, 20 Jan 2004 -/// @version $Id: RODUAEdgeBuilder.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RODUAEdgeBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Interface for building instances of duarouter-edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/duarouter/RODUAFrame.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/RODUAFrame.cpp --- sumo-0.21.0+dfsg/src/duarouter/RODUAFrame.cpp 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/RODUAFrame.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RODUAFrame.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: RODUAFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for dua-routing /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -42,7 +42,7 @@ #include #include #include -#include +#include #ifdef CHECK_MEMORY_LEAKS #include diff -Nru sumo-0.21.0+dfsg/src/duarouter/RODUAFrame.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/RODUAFrame.h --- sumo-0.21.0+dfsg/src/duarouter/RODUAFrame.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/duarouter/RODUAFrame.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RODUAFrame.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: RODUAFrame.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for dua-routing /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/foreign/eulerspiral/euler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/eulerspiral/euler.h --- sumo-0.21.0+dfsg/src/foreign/eulerspiral/euler.h 2013-05-03 20:25:09.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/eulerspiral/euler.h 2015-04-17 05:44:20.000000000 +0000 @@ -111,7 +111,8 @@ class EulerSpiralLookupTable { private: - int NN; //size of the lookup tables (NNxNN) or number of data points between -pi and pi + // following line commented out to make clang compiler happy, MB 14.06.2014 + //int NN; //size of the lookup tables (NNxNN) or number of data points between -pi and pi double* _theta; //lookup the theta value corresponding to the index NN long double _dt; //delta theta diff -Nru sumo-0.21.0+dfsg/src/foreign/eulerspiral/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/eulerspiral/Makefile.in --- sumo-0.21.0+dfsg/src/foreign/eulerspiral/Makefile.in 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/eulerspiral/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -220,6 +220,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -230,7 +232,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/foreign/gl2ps/gl2ps.c sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/gl2ps/gl2ps.c --- sumo-0.21.0+dfsg/src/foreign/gl2ps/gl2ps.c 2013-12-16 23:02:17.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/gl2ps/gl2ps.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,6136 +0,0 @@ -/* - * GL2PS, an OpenGL to PostScript Printing Library - * Copyright (C) 1999-2012 C. Geuzaine - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of either: - * - * a) the GNU Library General Public License as published by the Free - * Software Foundation, either version 2 of the License, or (at your - * option) any later version; or - * - * b) the GL2PS License as published by Christophe Geuzaine, either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either - * the GNU Library General Public License or the GL2PS License for - * more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library in the file named "COPYING.LGPL"; - * if not, write to the Free Software Foundation, Inc., 51 Franklin - * Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * You should have received a copy of the GL2PS License with this - * library in the file named "COPYING.GL2PS"; if not, I will be glad - * to provide one. - * - * For the latest info about gl2ps and a full list of contributors, - * see http://www.geuz.org/gl2ps/. - * - * Please report all bugs and problems to . - */ - -#include "gl2ps.h" - -#include -#include -#include -#include -#include -#include - -#if defined(GL2PS_HAVE_ZLIB) -#include -#endif - -#if defined(GL2PS_HAVE_LIBPNG) -#include -#endif - -/********************************************************************* - * - * Private definitions, data structures and prototypes - * - *********************************************************************/ - -/* Magic numbers (assuming that the order of magnitude of window - coordinates is 10^3) */ - -#define GL2PS_EPSILON 5.0e-3F -#define GL2PS_ZSCALE 1000.0F -#define GL2PS_ZOFFSET 5.0e-2F -#define GL2PS_ZOFFSET_LARGE 20.0F -#define GL2PS_ZERO(arg) (fabs(arg) < 1.e-20) - -/* Primitive types */ - -#define GL2PS_NO_TYPE -1 -#define GL2PS_TEXT 1 -#define GL2PS_POINT 2 -#define GL2PS_LINE 3 -#define GL2PS_QUADRANGLE 4 -#define GL2PS_TRIANGLE 5 -#define GL2PS_PIXMAP 6 -#define GL2PS_IMAGEMAP 7 -#define GL2PS_IMAGEMAP_WRITTEN 8 -#define GL2PS_IMAGEMAP_VISIBLE 9 -#define GL2PS_SPECIAL 10 - -/* BSP tree primitive comparison */ - -#define GL2PS_COINCIDENT 1 -#define GL2PS_IN_FRONT_OF 2 -#define GL2PS_IN_BACK_OF 3 -#define GL2PS_SPANNING 4 - -/* 2D BSP tree primitive comparison */ - -#define GL2PS_POINT_COINCIDENT 0 -#define GL2PS_POINT_INFRONT 1 -#define GL2PS_POINT_BACK 2 - -/* Internal feedback buffer pass-through tokens */ - -#define GL2PS_BEGIN_OFFSET_TOKEN 1 -#define GL2PS_END_OFFSET_TOKEN 2 -#define GL2PS_BEGIN_BOUNDARY_TOKEN 3 -#define GL2PS_END_BOUNDARY_TOKEN 4 -#define GL2PS_BEGIN_STIPPLE_TOKEN 5 -#define GL2PS_END_STIPPLE_TOKEN 6 -#define GL2PS_POINT_SIZE_TOKEN 7 -#define GL2PS_LINE_WIDTH_TOKEN 8 -#define GL2PS_BEGIN_BLEND_TOKEN 9 -#define GL2PS_END_BLEND_TOKEN 10 -#define GL2PS_SRC_BLEND_TOKEN 11 -#define GL2PS_DST_BLEND_TOKEN 12 -#define GL2PS_IMAGEMAP_TOKEN 13 -#define GL2PS_DRAW_PIXELS_TOKEN 14 -#define GL2PS_TEXT_TOKEN 15 - -typedef enum { - T_UNDEFINED = -1, - T_CONST_COLOR = 1, - T_VAR_COLOR = 1<<1, - T_ALPHA_1 = 1<<2, - T_ALPHA_LESS_1 = 1<<3, - T_VAR_ALPHA = 1<<4 -} GL2PS_TRIANGLE_PROPERTY; - -typedef GLfloat GL2PSxyz[3]; -typedef GLfloat GL2PSplane[4]; - -typedef struct _GL2PSbsptree2d GL2PSbsptree2d; - -struct _GL2PSbsptree2d { - GL2PSplane plane; - GL2PSbsptree2d *front, *back; -}; - -typedef struct { - GLint nmax, size, incr, n; - char *array; -} GL2PSlist; - -typedef struct _GL2PSbsptree GL2PSbsptree; - -struct _GL2PSbsptree { - GL2PSplane plane; - GL2PSlist *primitives; - GL2PSbsptree *front, *back; -}; - -typedef struct { - GL2PSxyz xyz; - GL2PSrgba rgba; -} GL2PSvertex; - -typedef struct { - GL2PSvertex vertex[3]; - int prop; -} GL2PStriangle; - -typedef struct { - GLshort fontsize; - char *str, *fontname; - /* Note: for a 'special' string, 'alignment' holds the format - (PostScript, PDF, etc.) of the special string */ - GLint alignment; - GLfloat angle; -} GL2PSstring; - -typedef struct { - GLsizei width, height; - /* Note: for an imagemap, 'type' indicates if it has already been - written to the file or not, and 'format' indicates if it is - visible or not */ - GLenum format, type; - GLfloat zoom_x, zoom_y; - GLfloat *pixels; -} GL2PSimage; - -typedef struct _GL2PSimagemap GL2PSimagemap; - -struct _GL2PSimagemap { - GL2PSimage *image; - GL2PSimagemap *next; -}; - -typedef struct { - GLshort type, numverts; - GLushort pattern; - char boundary, offset, culled; - GLint factor; - GLfloat width; - GL2PSvertex *verts; - union { - GL2PSstring *text; - GL2PSimage *image; - } data; -} GL2PSprimitive; - -typedef struct { -#if defined(GL2PS_HAVE_ZLIB) - Bytef *dest, *src, *start; - uLongf destLen, srcLen; -#else - int dummy; -#endif -} GL2PScompress; - -typedef struct{ - GL2PSlist* ptrlist; - int gsno, fontno, imno, shno, maskshno, trgroupno; - int gsobjno, fontobjno, imobjno, shobjno, maskshobjno, trgroupobjno; -} GL2PSpdfgroup; - -typedef struct { - /* General */ - GLint format, sort, options, colorsize, colormode, buffersize; - char *title, *producer, *filename; - GLboolean boundary, blending; - GLfloat *feedback, offset[2], lastlinewidth; - GLint viewport[4], blendfunc[2], lastfactor; - GL2PSrgba *colormap, lastrgba, threshold, bgcolor; - GLushort lastpattern; - GL2PSvertex lastvertex; - GL2PSlist *primitives, *auxprimitives; - FILE *stream; - GL2PScompress *compress; - GLboolean header; - - /* BSP-specific */ - GLint maxbestroot; - - /* Occlusion culling-specific */ - GLboolean zerosurfacearea; - GL2PSbsptree2d *imagetree; - GL2PSprimitive *primitivetoadd; - - /* PDF-specific */ - int streamlength; - GL2PSlist *pdfprimlist, *pdfgrouplist; - int *xreflist; - int objects_stack; /* available objects */ - int extgs_stack; /* graphics state object number */ - int font_stack; /* font object number */ - int im_stack; /* image object number */ - int trgroupobjects_stack; /* xobject numbers */ - int shader_stack; /* shader object numbers */ - int mshader_stack; /* mask shader object numbers */ - - /* for image map list */ - GL2PSimagemap *imagemap_head; - GL2PSimagemap *imagemap_tail; -} GL2PScontext; - -typedef struct { - void (*printHeader)(void); - void (*printFooter)(void); - void (*beginViewport)(GLint viewport[4]); - GLint (*endViewport)(void); - void (*printPrimitive)(void *data); - void (*printFinalPrimitive)(void); - const char *file_extension; - const char *description; -} GL2PSbackend; - -/* The gl2ps context. gl2ps is not thread safe (we should create a - local GL2PScontext during gl2psBeginPage) */ - -static GL2PScontext *gl2ps = NULL; - -/* Need to forward-declare this one */ - -static GLint gl2psPrintPrimitives(void); - -/********************************************************************* - * - * Utility routines - * - *********************************************************************/ - -static void gl2psMsg(GLint level, const char *fmt, ...) -{ - va_list args; - - if(!(gl2ps->options & GL2PS_SILENT)){ - switch(level){ - case GL2PS_INFO : fprintf(stderr, "GL2PS info: "); break; - case GL2PS_WARNING : fprintf(stderr, "GL2PS warning: "); break; - case GL2PS_ERROR : fprintf(stderr, "GL2PS error: "); break; - } - va_start(args, fmt); - vfprintf(stderr, fmt, args); - va_end(args); - fprintf(stderr, "\n"); - } - /* if(level == GL2PS_ERROR) exit(1); */ -} - -static void *gl2psMalloc(size_t size) -{ - void *ptr; - - if(!size) return NULL; - ptr = malloc(size); - if(!ptr){ - gl2psMsg(GL2PS_ERROR, "Couldn't allocate requested memory"); - return NULL; - } - return ptr; -} - -static void *gl2psRealloc(void *ptr, size_t size) -{ - void *orig = ptr; - if(!size) return NULL; - ptr = realloc(orig, size); - if(!ptr){ - gl2psMsg(GL2PS_ERROR, "Couldn't reallocate requested memory"); - free(orig); - return NULL; - } - return ptr; -} - -static void gl2psFree(void *ptr) -{ - if(!ptr) return; - free(ptr); -} - -static int gl2psWriteBigEndian(unsigned long data, int bytes) -{ - int i; - int size = sizeof(unsigned long); - for(i = 1; i <= bytes; ++i){ - fputc(0xff & (data >> (size - i) * 8), gl2ps->stream); - } - return bytes; -} - -/* zlib compression helper routines */ - -#if defined(GL2PS_HAVE_ZLIB) - -static void gl2psSetupCompress(void) -{ - gl2ps->compress = (GL2PScompress*)gl2psMalloc(sizeof(GL2PScompress)); - gl2ps->compress->src = NULL; - gl2ps->compress->start = NULL; - gl2ps->compress->dest = NULL; - gl2ps->compress->srcLen = 0; - gl2ps->compress->destLen = 0; -} - -static void gl2psFreeCompress(void) -{ - if(!gl2ps->compress) - return; - gl2psFree(gl2ps->compress->start); - gl2psFree(gl2ps->compress->dest); - gl2ps->compress->src = NULL; - gl2ps->compress->start = NULL; - gl2ps->compress->dest = NULL; - gl2ps->compress->srcLen = 0; - gl2ps->compress->destLen = 0; -} - -static int gl2psAllocCompress(unsigned int srcsize) -{ - gl2psFreeCompress(); - - if(!gl2ps->compress || !srcsize) - return GL2PS_ERROR; - - gl2ps->compress->srcLen = srcsize; - gl2ps->compress->destLen = (int)ceil(1.001 * gl2ps->compress->srcLen + 12); - gl2ps->compress->src = (Bytef*)gl2psMalloc(gl2ps->compress->srcLen); - gl2ps->compress->start = gl2ps->compress->src; - gl2ps->compress->dest = (Bytef*)gl2psMalloc(gl2ps->compress->destLen); - - return GL2PS_SUCCESS; -} - -static void *gl2psReallocCompress(unsigned int srcsize) -{ - if(!gl2ps->compress || !srcsize) - return NULL; - - if(srcsize < gl2ps->compress->srcLen) - return gl2ps->compress->start; - - gl2ps->compress->srcLen = srcsize; - gl2ps->compress->destLen = (int)ceil(1.001 * gl2ps->compress->srcLen + 12); - gl2ps->compress->src = (Bytef*)gl2psRealloc(gl2ps->compress->src, - gl2ps->compress->srcLen); - gl2ps->compress->start = gl2ps->compress->src; - gl2ps->compress->dest = (Bytef*)gl2psRealloc(gl2ps->compress->dest, - gl2ps->compress->destLen); - - return gl2ps->compress->start; -} - -static int gl2psWriteBigEndianCompress(unsigned long data, int bytes) -{ - int i; - int size = sizeof(unsigned long); - for(i = 1; i <= bytes; ++i){ - *gl2ps->compress->src = (Bytef)(0xff & (data >> (size-i) * 8)); - ++gl2ps->compress->src; - } - return bytes; -} - -static int gl2psDeflate(void) -{ - /* For compatibility with older zlib versions, we use compress(...) - instead of compress2(..., Z_BEST_COMPRESSION) */ - return compress(gl2ps->compress->dest, &gl2ps->compress->destLen, - gl2ps->compress->start, gl2ps->compress->srcLen); -} - -#endif - -static int gl2psPrintf(const char* fmt, ...) -{ - int ret; - va_list args; - -#if defined(GL2PS_HAVE_ZLIB) - static char buf[1024]; - char *bufptr = buf; - GLboolean freebuf = GL_FALSE; - unsigned int oldsize = 0; -#if !defined(GL2PS_HAVE_NO_VSNPRINTF) - /* Try writing the string to a 1024 byte buffer. If it is too small to fit, - keep trying larger sizes until it does. */ - size_t bufsize = sizeof(buf); -#endif - if(gl2ps->options & GL2PS_COMPRESS){ - va_start(args, fmt); -#if defined(GL2PS_HAVE_NO_VSNPRINTF) - ret = vsprintf(buf, fmt, args); -#else - ret = vsnprintf(bufptr, bufsize, fmt, args); -#endif - va_end(args); -#if !defined(GL2PS_HAVE_NO_VSNPRINTF) - while(ret >= (bufsize - 1) || ret < 0){ - /* Too big. Allocate a new buffer. */ - bufsize *= 2; - if(freebuf == GL_TRUE) gl2psFree(bufptr); - bufptr = (char *)gl2psMalloc(bufsize); - freebuf = GL_TRUE; - va_start(args, fmt); - ret = vsnprintf(bufptr, bufsize, fmt, args); - va_end(args); - } -#endif - oldsize = gl2ps->compress->srcLen; - gl2ps->compress->start = (Bytef*)gl2psReallocCompress(oldsize + ret); - memcpy(gl2ps->compress->start + oldsize, bufptr, ret); - if(freebuf == GL_TRUE) gl2psFree(bufptr); - ret = 0; - } - else{ -#endif - va_start(args, fmt); - ret = vfprintf(gl2ps->stream, fmt, args); - va_end(args); -#if defined(GL2PS_HAVE_ZLIB) - } -#endif - return ret; -} - -static void gl2psPrintGzipHeader(void) -{ -#if defined(GL2PS_HAVE_ZLIB) - char tmp[10] = {'\x1f', '\x8b', /* magic numbers: 0x1f, 0x8b */ - 8, /* compression method: Z_DEFLATED */ - 0, /* flags */ - 0, 0, 0, 0, /* time */ - 2, /* extra flags: max compression */ - '\x03'}; /* OS code: 0x03 (Unix) */ - - if(gl2ps->options & GL2PS_COMPRESS){ - gl2psSetupCompress(); - /* add the gzip file header */ - fwrite(tmp, 10, 1, gl2ps->stream); - } -#endif -} - -static void gl2psPrintGzipFooter(void) -{ -#if defined(GL2PS_HAVE_ZLIB) - int n; - uLong crc, len; - char tmp[8]; - - if(gl2ps->options & GL2PS_COMPRESS){ - if(Z_OK != gl2psDeflate()){ - gl2psMsg(GL2PS_ERROR, "Zlib deflate error"); - } - else{ - /* determine the length of the header in the zlib stream */ - n = 2; /* CMF+FLG */ - if(gl2ps->compress->dest[1] & (1<<5)){ - n += 4; /* DICTID */ - } - /* write the data, without the zlib header and footer */ - fwrite(gl2ps->compress->dest+n, gl2ps->compress->destLen-(n+4), - 1, gl2ps->stream); - /* add the gzip file footer */ - crc = crc32(0L, gl2ps->compress->start, gl2ps->compress->srcLen); - for(n = 0; n < 4; ++n){ - tmp[n] = (char)(crc & 0xff); - crc >>= 8; - } - len = gl2ps->compress->srcLen; - for(n = 4; n < 8; ++n){ - tmp[n] = (char)(len & 0xff); - len >>= 8; - } - fwrite(tmp, 8, 1, gl2ps->stream); - } - gl2psFreeCompress(); - gl2psFree(gl2ps->compress); - gl2ps->compress = NULL; - } -#endif -} - -/* The list handling routines */ - -static void gl2psListRealloc(GL2PSlist *list, GLint n) -{ - if(!list){ - gl2psMsg(GL2PS_ERROR, "Cannot reallocate NULL list"); - return; - } - if(n <= 0) return; - if(!list->array){ - list->nmax = n; - list->array = (char*)gl2psMalloc(list->nmax * list->size); - } - else{ - if(n > list->nmax){ - list->nmax = ((n - 1) / list->incr + 1) * list->incr; - list->array = (char*)gl2psRealloc(list->array, - list->nmax * list->size); - } - } -} - -static GL2PSlist *gl2psListCreate(GLint n, GLint incr, GLint size) -{ - GL2PSlist *list; - - if(n < 0) n = 0; - if(incr <= 0) incr = 1; - list = (GL2PSlist*)gl2psMalloc(sizeof(GL2PSlist)); - list->nmax = 0; - list->incr = incr; - list->size = size; - list->n = 0; - list->array = NULL; - gl2psListRealloc(list, n); - return list; -} - -static void gl2psListReset(GL2PSlist *list) -{ - if(!list) return; - list->n = 0; -} - -static void gl2psListDelete(GL2PSlist *list) -{ - if(!list) return; - gl2psFree(list->array); - gl2psFree(list); -} - -static void gl2psListAdd(GL2PSlist *list, void *data) -{ - if(!list){ - gl2psMsg(GL2PS_ERROR, "Cannot add into unallocated list"); - return; - } - list->n++; - gl2psListRealloc(list, list->n); - memcpy(&list->array[(list->n - 1) * list->size], data, list->size); -} - -static int gl2psListNbr(GL2PSlist *list) -{ - if(!list) - return 0; - return list->n; -} - -static void *gl2psListPointer(GL2PSlist *list, GLint idx) -{ - if(!list){ - gl2psMsg(GL2PS_ERROR, "Cannot point into unallocated list"); - return NULL; - } - if((idx < 0) || (idx >= list->n)){ - gl2psMsg(GL2PS_ERROR, "Wrong list index in gl2psListPointer"); - return NULL; - } - return &list->array[idx * list->size]; -} - -static void gl2psListSort(GL2PSlist *list, - int (*fcmp)(const void *a, const void *b)) -{ - if(!list) - return; - qsort(list->array, list->n, list->size, fcmp); -} - -static void gl2psListAction(GL2PSlist *list, void (*action)(void *data)) -{ - GLint i; - - for(i = 0; i < gl2psListNbr(list); i++){ - (*action)(gl2psListPointer(list, i)); - } -} - -static void gl2psListActionInverse(GL2PSlist *list, void (*action)(void *data)) -{ - GLint i; - - for(i = gl2psListNbr(list); i > 0; i--){ - (*action)(gl2psListPointer(list, i-1)); - } -} - -#if defined(GL2PS_HAVE_LIBPNG) - -static void gl2psListRead(GL2PSlist *list, int index, void *data) -{ - if((index < 0) || (index >= list->n)) - gl2psMsg(GL2PS_ERROR, "Wrong list index in gl2psListRead"); - memcpy(data, &list->array[index * list->size], list->size); -} - -static void gl2psEncodeBase64Block(unsigned char in[3], unsigned char out[4], int len) -{ - static const char cb64[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - out[0] = cb64[ in[0] >> 2 ]; - out[1] = cb64[ ((in[0] & 0x03) << 4) | ((in[1] & 0xf0) >> 4) ]; - out[2] = (len > 1) ? cb64[ ((in[1] & 0x0f) << 2) | ((in[2] & 0xc0) >> 6) ] : '='; - out[3] = (len > 2) ? cb64[ in[2] & 0x3f ] : '='; -} - -static void gl2psListEncodeBase64(GL2PSlist *list) -{ - unsigned char *buffer, in[3], out[4]; - int i, n, index, len; - - n = list->n * list->size; - buffer = (unsigned char*)gl2psMalloc(n * sizeof(unsigned char)); - memcpy(buffer, list->array, n * sizeof(unsigned char)); - gl2psListReset(list); - - index = 0; - while(index < n) { - len = 0; - for(i = 0; i < 3; i++) { - if(index < n){ - in[i] = buffer[index]; - len++; - } - else{ - in[i] = 0; - } - index++; - } - if(len) { - gl2psEncodeBase64Block(in, out, len); - for(i = 0; i < 4; i++) - gl2psListAdd(list, &out[i]); - } - } - gl2psFree(buffer); -} - -#endif - -/* Helpers for rgba colors */ - -static GLboolean gl2psSameColor(GL2PSrgba rgba1, GL2PSrgba rgba2) -{ - if(!GL2PS_ZERO(rgba1[0] - rgba2[0]) || - !GL2PS_ZERO(rgba1[1] - rgba2[1]) || - !GL2PS_ZERO(rgba1[2] - rgba2[2])) - return GL_FALSE; - return GL_TRUE; -} - -static GLboolean gl2psVertsSameColor(const GL2PSprimitive *prim) -{ - int i; - - for(i = 1; i < prim->numverts; i++){ - if(!gl2psSameColor(prim->verts[0].rgba, prim->verts[i].rgba)){ - return GL_FALSE; - } - } - return GL_TRUE; -} - -static GLboolean gl2psSameColorThreshold(int n, GL2PSrgba rgba[], - GL2PSrgba threshold) -{ - int i; - - if(n < 2) return GL_TRUE; - - for(i = 1; i < n; i++){ - if(fabs(rgba[0][0] - rgba[i][0]) > threshold[0] || - fabs(rgba[0][1] - rgba[i][1]) > threshold[1] || - fabs(rgba[0][2] - rgba[i][2]) > threshold[2]) - return GL_FALSE; - } - - return GL_TRUE; -} - -static void gl2psSetLastColor(GL2PSrgba rgba) -{ - int i; - for(i = 0; i < 3; ++i){ - gl2ps->lastrgba[i] = rgba[i]; - } -} - -static GLfloat gl2psGetRGB(GL2PSimage *im, GLuint x, GLuint y, - GLfloat *red, GLfloat *green, GLfloat *blue) -{ - - GLsizei width = im->width; - GLsizei height = im->height; - GLfloat *pixels = im->pixels; - GLfloat *pimag; - - /* OpenGL image is from down to up, PS image is up to down */ - switch(im->format){ - case GL_RGBA: - pimag = pixels + 4 * (width * (height - 1 - y) + x); - break; - case GL_RGB: - default: - pimag = pixels + 3 * (width * (height - 1 - y) + x); - break; - } - *red = *pimag; pimag++; - *green = *pimag; pimag++; - *blue = *pimag; pimag++; - - return (im->format == GL_RGBA) ? *pimag : 1.0F; -} - -/* Helper routines for pixmaps */ - -static GL2PSimage *gl2psCopyPixmap(GL2PSimage *im) -{ - int size; - GL2PSimage *image = (GL2PSimage*)gl2psMalloc(sizeof(GL2PSimage)); - - image->width = im->width; - image->height = im->height; - image->format = im->format; - image->type = im->type; - image->zoom_x = im->zoom_x; - image->zoom_y = im->zoom_y; - - switch(image->format){ - case GL_RGBA: - size = image->height * image->width * 4 * sizeof(GLfloat); - break; - case GL_RGB: - default: - size = image->height * image->width * 3 * sizeof(GLfloat); - break; - } - - image->pixels = (GLfloat*)gl2psMalloc(size); - memcpy(image->pixels, im->pixels, size); - - return image; -} - -static void gl2psFreePixmap(GL2PSimage *im) -{ - if(!im) - return; - gl2psFree(im->pixels); - gl2psFree(im); -} - -#if defined(GL2PS_HAVE_LIBPNG) - -#if !defined(png_jmpbuf) -# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) -#endif - -static void gl2psUserWritePNG(png_structp png_ptr, png_bytep data, png_size_t length) -{ - unsigned int i; - GL2PSlist *png = (GL2PSlist*)png_get_io_ptr(png_ptr); - for(i = 0; i < length; i++) - gl2psListAdd(png, &data[i]); -} - -static void gl2psUserFlushPNG(png_structp png_ptr) -{ - (void) png_ptr; /* not used */ -} - -static void gl2psConvertPixmapToPNG(GL2PSimage *pixmap, GL2PSlist *png) -{ - png_structp png_ptr; - png_infop info_ptr; - unsigned char *row_data; - GLfloat dr, dg, db; - int row, col; - - if(!(png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL))) - return; - - if(!(info_ptr = png_create_info_struct(png_ptr))){ - png_destroy_write_struct(&png_ptr, NULL); - return; - } - - if(setjmp(png_jmpbuf(png_ptr))) { - png_destroy_write_struct(&png_ptr, &info_ptr); - return; - } - - png_set_write_fn(png_ptr, (void *)png, gl2psUserWritePNG, gl2psUserFlushPNG); - png_set_compression_level(png_ptr, Z_DEFAULT_COMPRESSION); - png_set_IHDR(png_ptr, info_ptr, pixmap->width, pixmap->height, 8, - PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, - PNG_FILTER_TYPE_BASE); - png_write_info(png_ptr, info_ptr); - - row_data = (unsigned char*)gl2psMalloc(3 * pixmap->width * sizeof(unsigned char)); - for(row = 0; row < pixmap->height; row++){ - for(col = 0; col < pixmap->width; col++){ - gl2psGetRGB(pixmap, col, row, &dr, &dg, &db); - row_data[3*col] = (unsigned char)(255. * dr); - row_data[3*col+1] = (unsigned char)(255. * dg); - row_data[3*col+2] = (unsigned char)(255. * db); - } - png_write_row(png_ptr, (png_bytep)row_data); - } - gl2psFree(row_data); - - png_write_end(png_ptr, info_ptr); - png_destroy_write_struct(&png_ptr, &info_ptr); -} - -#endif - -/* Helper routines for text strings */ - -static GLint gl2psAddText(GLint type, const char *str, const char *fontname, - GLshort fontsize, GLint alignment, GLfloat angle, - GL2PSrgba color) -{ - GLfloat pos[4]; - GL2PSprimitive *prim; - GLboolean valid; - - if(!gl2ps || !str || !fontname) return GL2PS_UNINITIALIZED; - - if(gl2ps->options & GL2PS_NO_TEXT) return GL2PS_SUCCESS; - - glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID, &valid); - if(GL_FALSE == valid) return GL2PS_SUCCESS; /* the primitive is culled */ - - glGetFloatv(GL_CURRENT_RASTER_POSITION, pos); - - prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - prim->type = (GLshort)type; - prim->boundary = 0; - prim->numverts = 1; - prim->verts = (GL2PSvertex*)gl2psMalloc(sizeof(GL2PSvertex)); - prim->verts[0].xyz[0] = pos[0]; - prim->verts[0].xyz[1] = pos[1]; - prim->verts[0].xyz[2] = pos[2]; - prim->culled = 0; - prim->offset = 0; - prim->pattern = 0; - prim->factor = 0; - prim->width = 1; - if (color) - memcpy(prim->verts[0].rgba, color, 4 * sizeof(float)); - else - glGetFloatv(GL_CURRENT_RASTER_COLOR, prim->verts[0].rgba); - prim->data.text = (GL2PSstring*)gl2psMalloc(sizeof(GL2PSstring)); - prim->data.text->str = (char*)gl2psMalloc((strlen(str)+1)*sizeof(char)); - strcpy(prim->data.text->str, str); - prim->data.text->fontname = (char*)gl2psMalloc((strlen(fontname)+1)*sizeof(char)); - strcpy(prim->data.text->fontname, fontname); - prim->data.text->fontsize = fontsize; - prim->data.text->alignment = alignment; - prim->data.text->angle = angle; - - gl2psListAdd(gl2ps->auxprimitives, &prim); - glPassThrough(GL2PS_TEXT_TOKEN); - - return GL2PS_SUCCESS; -} - -static GL2PSstring *gl2psCopyText(GL2PSstring *t) -{ - GL2PSstring *text = (GL2PSstring*)gl2psMalloc(sizeof(GL2PSstring)); - text->str = (char*)gl2psMalloc((strlen(t->str)+1)*sizeof(char)); - strcpy(text->str, t->str); - text->fontname = (char*)gl2psMalloc((strlen(t->fontname)+1)*sizeof(char)); - strcpy(text->fontname, t->fontname); - text->fontsize = t->fontsize; - text->alignment = t->alignment; - text->angle = t->angle; - - return text; -} - -static void gl2psFreeText(GL2PSstring *text) -{ - if(!text) - return; - gl2psFree(text->str); - gl2psFree(text->fontname); - gl2psFree(text); -} - -/* Helpers for blending modes */ - -static GLboolean gl2psSupportedBlendMode(GLenum sfactor, GLenum dfactor) -{ - /* returns TRUE if gl2ps supports the argument combination: only two - blending modes have been implemented so far */ - - if( (sfactor == GL_SRC_ALPHA && dfactor == GL_ONE_MINUS_SRC_ALPHA) || - (sfactor == GL_ONE && dfactor == GL_ZERO) ) - return GL_TRUE; - return GL_FALSE; -} - -static void gl2psAdaptVertexForBlending(GL2PSvertex *v) -{ - /* Transforms vertex depending on the actual blending function - - currently the vertex v is considered as source vertex and his - alpha value is changed to 1.0 if source blending GL_ONE is - active. This might be extended in the future */ - - if(!v || !gl2ps) - return; - - if(gl2ps->options & GL2PS_NO_BLENDING || !gl2ps->blending){ - v->rgba[3] = 1.0F; - return; - } - - switch(gl2ps->blendfunc[0]){ - case GL_ONE: - v->rgba[3] = 1.0F; - break; - default: - break; - } -} - -static void gl2psAssignTriangleProperties(GL2PStriangle *t) -{ - /* int i; */ - - t->prop = T_VAR_COLOR; - - /* Uncommenting the following lines activates an even more fine - grained distinction between triangle types - please don't delete, - a remarkable amount of PDF handling code inside this file depends - on it if activated */ - /* - t->prop = T_CONST_COLOR; - for(i = 0; i < 3; ++i){ - if(!GL2PS_ZERO(t->vertex[0].rgba[i] - t->vertex[1].rgba[i]) || - !GL2PS_ZERO(t->vertex[1].rgba[i] - t->vertex[2].rgba[i])){ - t->prop = T_VAR_COLOR; - break; - } - } - */ - - if(!GL2PS_ZERO(t->vertex[0].rgba[3] - t->vertex[1].rgba[3]) || - !GL2PS_ZERO(t->vertex[1].rgba[3] - t->vertex[2].rgba[3])){ - t->prop |= T_VAR_ALPHA; - } - else{ - if(t->vertex[0].rgba[3] < 1) - t->prop |= T_ALPHA_LESS_1; - else - t->prop |= T_ALPHA_1; - } -} - -static void gl2psFillTriangleFromPrimitive(GL2PStriangle *t, GL2PSprimitive *p, - GLboolean assignprops) -{ - t->vertex[0] = p->verts[0]; - t->vertex[1] = p->verts[1]; - t->vertex[2] = p->verts[2]; - if(GL_TRUE == assignprops) - gl2psAssignTriangleProperties(t); -} - -static void gl2psInitTriangle(GL2PStriangle *t) -{ - int i; - GL2PSvertex vertex = { {-1.0F, -1.0F, -1.0F}, {-1.0F, -1.0F, -1.0F, -1.0F} }; - for(i = 0; i < 3; i++) - t->vertex[i] = vertex; - t->prop = T_UNDEFINED; -} - -/* Miscellaneous helper routines */ - -static GL2PSprimitive *gl2psCopyPrimitive(GL2PSprimitive *p) -{ - GL2PSprimitive *prim; - - if(!p){ - gl2psMsg(GL2PS_ERROR, "Trying to copy an empty primitive"); - return NULL; - } - - prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - - prim->type = p->type; - prim->numverts = p->numverts; - prim->boundary = p->boundary; - prim->offset = p->offset; - prim->pattern = p->pattern; - prim->factor = p->factor; - prim->culled = p->culled; - prim->width = p->width; - prim->verts = (GL2PSvertex*)gl2psMalloc(p->numverts*sizeof(GL2PSvertex)); - memcpy(prim->verts, p->verts, p->numverts * sizeof(GL2PSvertex)); - - switch(prim->type){ - case GL2PS_PIXMAP : - prim->data.image = gl2psCopyPixmap(p->data.image); - break; - case GL2PS_TEXT : - case GL2PS_SPECIAL : - prim->data.text = gl2psCopyText(p->data.text); - break; - default: - break; - } - - return prim; -} - -static GLboolean gl2psSamePosition(GL2PSxyz p1, GL2PSxyz p2) -{ - if(!GL2PS_ZERO(p1[0] - p2[0]) || - !GL2PS_ZERO(p1[1] - p2[1]) || - !GL2PS_ZERO(p1[2] - p2[2])) - return GL_FALSE; - return GL_TRUE; -} - -/********************************************************************* - * - * 3D sorting routines - * - *********************************************************************/ - -static GLfloat gl2psComparePointPlane(GL2PSxyz point, GL2PSplane plane) -{ - return (plane[0] * point[0] + - plane[1] * point[1] + - plane[2] * point[2] + - plane[3]); -} - -static GLfloat gl2psPsca(GLfloat *a, GLfloat *b) -{ - return (a[0]*b[0] + a[1]*b[1] + a[2]*b[2]); -} - -static void gl2psPvec(GLfloat *a, GLfloat *b, GLfloat *c) -{ - c[0] = a[1]*b[2] - a[2]*b[1]; - c[1] = a[2]*b[0] - a[0]*b[2]; - c[2] = a[0]*b[1] - a[1]*b[0]; -} - -static GLfloat gl2psNorm(GLfloat *a) -{ - return (GLfloat)sqrt(a[0]*a[0] + a[1]*a[1] + a[2]*a[2]); -} - -static void gl2psGetNormal(GLfloat *a, GLfloat *b, GLfloat *c) -{ - GLfloat norm; - - gl2psPvec(a, b, c); - if(!GL2PS_ZERO(norm = gl2psNorm(c))){ - c[0] = c[0] / norm; - c[1] = c[1] / norm; - c[2] = c[2] / norm; - } - else{ - /* The plane is still wrong despite our tests in gl2psGetPlane. - Let's return a dummy value for now (this is a hack: we should - do more intelligent tests in GetPlane) */ - c[0] = c[1] = 0.0F; - c[2] = 1.0F; - } -} - -static void gl2psGetPlane(GL2PSprimitive *prim, GL2PSplane plane) -{ - GL2PSxyz v = {0.0F, 0.0F, 0.0F}, w = {0.0F, 0.0F, 0.0F}; - - switch(prim->type){ - case GL2PS_TRIANGLE : - case GL2PS_QUADRANGLE : - v[0] = prim->verts[1].xyz[0] - prim->verts[0].xyz[0]; - v[1] = prim->verts[1].xyz[1] - prim->verts[0].xyz[1]; - v[2] = prim->verts[1].xyz[2] - prim->verts[0].xyz[2]; - w[0] = prim->verts[2].xyz[0] - prim->verts[0].xyz[0]; - w[1] = prim->verts[2].xyz[1] - prim->verts[0].xyz[1]; - w[2] = prim->verts[2].xyz[2] - prim->verts[0].xyz[2]; - if((GL2PS_ZERO(v[0]) && GL2PS_ZERO(v[1]) && GL2PS_ZERO(v[2])) || - (GL2PS_ZERO(w[0]) && GL2PS_ZERO(w[1]) && GL2PS_ZERO(w[2]))){ - plane[0] = plane[1] = 0.0F; - plane[2] = 1.0F; - plane[3] = -prim->verts[0].xyz[2]; - } - else{ - gl2psGetNormal(v, w, plane); - plane[3] = - - plane[0] * prim->verts[0].xyz[0] - - plane[1] * prim->verts[0].xyz[1] - - plane[2] * prim->verts[0].xyz[2]; - } - break; - case GL2PS_LINE : - v[0] = prim->verts[1].xyz[0] - prim->verts[0].xyz[0]; - v[1] = prim->verts[1].xyz[1] - prim->verts[0].xyz[1]; - v[2] = prim->verts[1].xyz[2] - prim->verts[0].xyz[2]; - if(GL2PS_ZERO(v[0]) && GL2PS_ZERO(v[1]) && GL2PS_ZERO(v[2])){ - plane[0] = plane[1] = 0.0F; - plane[2] = 1.0F; - plane[3] = -prim->verts[0].xyz[2]; - } - else{ - if(GL2PS_ZERO(v[0])) w[0] = 1.0F; - else if(GL2PS_ZERO(v[1])) w[1] = 1.0F; - else w[2] = 1.0F; - gl2psGetNormal(v, w, plane); - plane[3] = - - plane[0] * prim->verts[0].xyz[0] - - plane[1] * prim->verts[0].xyz[1] - - plane[2] * prim->verts[0].xyz[2]; - } - break; - case GL2PS_POINT : - case GL2PS_PIXMAP : - case GL2PS_TEXT : - case GL2PS_SPECIAL : - case GL2PS_IMAGEMAP: - plane[0] = plane[1] = 0.0F; - plane[2] = 1.0F; - plane[3] = -prim->verts[0].xyz[2]; - break; - default : - gl2psMsg(GL2PS_ERROR, "Unknown primitive type in BSP tree"); - plane[0] = plane[1] = plane[3] = 0.0F; - plane[2] = 1.0F; - break; - } -} - -static void gl2psCutEdge(GL2PSvertex *a, GL2PSvertex *b, GL2PSplane plane, - GL2PSvertex *c) -{ - GL2PSxyz v; - GLfloat sect, psca; - - v[0] = b->xyz[0] - a->xyz[0]; - v[1] = b->xyz[1] - a->xyz[1]; - v[2] = b->xyz[2] - a->xyz[2]; - - if(!GL2PS_ZERO(psca = gl2psPsca(plane, v))) - sect = -gl2psComparePointPlane(a->xyz, plane) / psca; - else - sect = 0.0F; - - c->xyz[0] = a->xyz[0] + v[0] * sect; - c->xyz[1] = a->xyz[1] + v[1] * sect; - c->xyz[2] = a->xyz[2] + v[2] * sect; - - c->rgba[0] = (1 - sect) * a->rgba[0] + sect * b->rgba[0]; - c->rgba[1] = (1 - sect) * a->rgba[1] + sect * b->rgba[1]; - c->rgba[2] = (1 - sect) * a->rgba[2] + sect * b->rgba[2]; - c->rgba[3] = (1 - sect) * a->rgba[3] + sect * b->rgba[3]; -} - -static void gl2psCreateSplitPrimitive(GL2PSprimitive *parent, GL2PSplane plane, - GL2PSprimitive *child, GLshort numverts, - GLshort *index0, GLshort *index1) -{ - GLshort i; - - if(parent->type == GL2PS_IMAGEMAP){ - child->type = GL2PS_IMAGEMAP; - child->data.image = parent->data.image; - } - else{ - if(numverts > 4){ - gl2psMsg(GL2PS_WARNING, "%d vertices in polygon", numverts); - numverts = 4; - } - switch(numverts){ - case 1 : child->type = GL2PS_POINT; break; - case 2 : child->type = GL2PS_LINE; break; - case 3 : child->type = GL2PS_TRIANGLE; break; - case 4 : child->type = GL2PS_QUADRANGLE; break; - default: child->type = GL2PS_NO_TYPE; break; - } - } - - child->boundary = 0; /* FIXME: not done! */ - child->culled = parent->culled; - child->offset = parent->offset; - child->pattern = parent->pattern; - child->factor = parent->factor; - child->width = parent->width; - child->numverts = numverts; - child->verts = (GL2PSvertex*)gl2psMalloc(numverts * sizeof(GL2PSvertex)); - - for(i = 0; i < numverts; i++){ - if(index1[i] < 0){ - child->verts[i] = parent->verts[index0[i]]; - } - else{ - gl2psCutEdge(&parent->verts[index0[i]], &parent->verts[index1[i]], - plane, &child->verts[i]); - } - } -} - -static void gl2psAddIndex(GLshort *index0, GLshort *index1, GLshort *nb, - GLshort i, GLshort j) -{ - GLint k; - - for(k = 0; k < *nb; k++){ - if((index0[k] == i && index1[k] == j) || - (index1[k] == i && index0[k] == j)) return; - } - index0[*nb] = i; - index1[*nb] = j; - (*nb)++; -} - -static GLshort gl2psGetIndex(GLshort i, GLshort num) -{ - return (i < num - 1) ? i + 1 : 0; -} - -static GLint gl2psTestSplitPrimitive(GL2PSprimitive *prim, GL2PSplane plane) -{ - GLint type = GL2PS_COINCIDENT; - GLshort i, j; - GLfloat d[5]; - - for(i = 0; i < prim->numverts; i++){ - d[i] = gl2psComparePointPlane(prim->verts[i].xyz, plane); - } - - if(prim->numverts < 2){ - return 0; - } - else{ - for(i = 0; i < prim->numverts; i++){ - j = gl2psGetIndex(i, prim->numverts); - if(d[j] > GL2PS_EPSILON){ - if(type == GL2PS_COINCIDENT) type = GL2PS_IN_BACK_OF; - else if(type != GL2PS_IN_BACK_OF) return 1; - if(d[i] < -GL2PS_EPSILON) return 1; - } - else if(d[j] < -GL2PS_EPSILON){ - if(type == GL2PS_COINCIDENT) type = GL2PS_IN_FRONT_OF; - else if(type != GL2PS_IN_FRONT_OF) return 1; - if(d[i] > GL2PS_EPSILON) return 1; - } - } - } - return 0; -} - -static GLint gl2psSplitPrimitive(GL2PSprimitive *prim, GL2PSplane plane, - GL2PSprimitive **front, GL2PSprimitive **back) -{ - GLshort i, j, in = 0, out = 0, in0[5], in1[5], out0[5], out1[5]; - GLint type; - GLfloat d[5]; - - type = GL2PS_COINCIDENT; - - for(i = 0; i < prim->numverts; i++){ - d[i] = gl2psComparePointPlane(prim->verts[i].xyz, plane); - } - - switch(prim->type){ - case GL2PS_POINT : - if(d[0] > GL2PS_EPSILON) type = GL2PS_IN_BACK_OF; - else if(d[0] < -GL2PS_EPSILON) type = GL2PS_IN_FRONT_OF; - else type = GL2PS_COINCIDENT; - break; - default : - for(i = 0; i < prim->numverts; i++){ - j = gl2psGetIndex(i, prim->numverts); - if(d[j] > GL2PS_EPSILON){ - if(type == GL2PS_COINCIDENT) type = GL2PS_IN_BACK_OF; - else if(type != GL2PS_IN_BACK_OF) type = GL2PS_SPANNING; - if(d[i] < -GL2PS_EPSILON){ - gl2psAddIndex(in0, in1, &in, i, j); - gl2psAddIndex(out0, out1, &out, i, j); - type = GL2PS_SPANNING; - } - gl2psAddIndex(out0, out1, &out, j, -1); - } - else if(d[j] < -GL2PS_EPSILON){ - if(type == GL2PS_COINCIDENT) type = GL2PS_IN_FRONT_OF; - else if(type != GL2PS_IN_FRONT_OF) type = GL2PS_SPANNING; - if(d[i] > GL2PS_EPSILON){ - gl2psAddIndex(in0, in1, &in, i, j); - gl2psAddIndex(out0, out1, &out, i, j); - type = GL2PS_SPANNING; - } - gl2psAddIndex(in0, in1, &in, j, -1); - } - else{ - gl2psAddIndex(in0, in1, &in, j, -1); - gl2psAddIndex(out0, out1, &out, j, -1); - } - } - break; - } - - if(type == GL2PS_SPANNING){ - *back = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - *front = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - gl2psCreateSplitPrimitive(prim, plane, *back, out, out0, out1); - gl2psCreateSplitPrimitive(prim, plane, *front, in, in0, in1); - } - - return type; -} - -static void gl2psDivideQuad(GL2PSprimitive *quad, - GL2PSprimitive **t1, GL2PSprimitive **t2) -{ - *t1 = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - *t2 = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - (*t1)->type = (*t2)->type = GL2PS_TRIANGLE; - (*t1)->numverts = (*t2)->numverts = 3; - (*t1)->culled = (*t2)->culled = quad->culled; - (*t1)->offset = (*t2)->offset = quad->offset; - (*t1)->pattern = (*t2)->pattern = quad->pattern; - (*t1)->factor = (*t2)->factor = quad->factor; - (*t1)->width = (*t2)->width = quad->width; - (*t1)->verts = (GL2PSvertex*)gl2psMalloc(3 * sizeof(GL2PSvertex)); - (*t2)->verts = (GL2PSvertex*)gl2psMalloc(3 * sizeof(GL2PSvertex)); - (*t1)->verts[0] = quad->verts[0]; - (*t1)->verts[1] = quad->verts[1]; - (*t1)->verts[2] = quad->verts[2]; - (*t1)->boundary = ((quad->boundary & 1) ? 1 : 0) | ((quad->boundary & 2) ? 2 : 0); - (*t2)->verts[0] = quad->verts[0]; - (*t2)->verts[1] = quad->verts[2]; - (*t2)->verts[2] = quad->verts[3]; - (*t2)->boundary = ((quad->boundary & 4) ? 2 : 0) | ((quad->boundary & 8) ? 4 : 0); -} - -static int gl2psCompareDepth(const void *a, const void *b) -{ - const GL2PSprimitive *q, *w; - GLfloat dq = 0.0F, dw = 0.0F, diff; - int i; - - q = *(const GL2PSprimitive* const*)a; - w = *(const GL2PSprimitive* const*)b; - - for(i = 0; i < q->numverts; i++){ - dq += q->verts[i].xyz[2]; - } - dq /= (GLfloat)q->numverts; - - for(i = 0; i < w->numverts; i++){ - dw += w->verts[i].xyz[2]; - } - dw /= (GLfloat)w->numverts; - - diff = dq - dw; - if(diff > 0.){ - return -1; - } - else if(diff < 0.){ - return 1; - } - else{ - return 0; - } -} - -static int gl2psTrianglesFirst(const void *a, const void *b) -{ - const GL2PSprimitive *q, *w; - - q = *(const GL2PSprimitive* const*)a; - w = *(const GL2PSprimitive* const*)b; - return (q->type < w->type ? 1 : -1); -} - -static GLint gl2psFindRoot(GL2PSlist *primitives, GL2PSprimitive **root) -{ - GLint i, j, count, best = 1000000, idx = 0; - GL2PSprimitive *prim1, *prim2; - GL2PSplane plane; - GLint maxp; - - if(!gl2psListNbr(primitives)){ - gl2psMsg(GL2PS_ERROR, "Cannot fint root in empty primitive list"); - return 0; - } - - *root = *(GL2PSprimitive**)gl2psListPointer(primitives, 0); - - if(gl2ps->options & GL2PS_BEST_ROOT){ - maxp = gl2psListNbr(primitives); - if(maxp > gl2ps->maxbestroot){ - maxp = gl2ps->maxbestroot; - } - for(i = 0; i < maxp; i++){ - prim1 = *(GL2PSprimitive**)gl2psListPointer(primitives, i); - gl2psGetPlane(prim1, plane); - count = 0; - for(j = 0; j < gl2psListNbr(primitives); j++){ - if(j != i){ - prim2 = *(GL2PSprimitive**)gl2psListPointer(primitives, j); - count += gl2psTestSplitPrimitive(prim2, plane); - } - if(count > best) break; - } - if(count < best){ - best = count; - idx = i; - *root = prim1; - if(!count) return idx; - } - } - /* if(index) gl2psMsg(GL2PS_INFO, "GL2PS_BEST_ROOT was worth it: %d", index); */ - return idx; - } - else{ - return 0; - } -} - -static void gl2psFreeImagemap(GL2PSimagemap *list) -{ - GL2PSimagemap *next; - while(list != NULL){ - next = list->next; - gl2psFree(list->image->pixels); - gl2psFree(list->image); - gl2psFree(list); - list = next; - } -} - -static void gl2psFreePrimitive(void *data) -{ - GL2PSprimitive *q; - - q = *(GL2PSprimitive**)data; - gl2psFree(q->verts); - if(q->type == GL2PS_TEXT || q->type == GL2PS_SPECIAL){ - gl2psFreeText(q->data.text); - } - else if(q->type == GL2PS_PIXMAP){ - gl2psFreePixmap(q->data.image); - } - gl2psFree(q); -} - -static void gl2psAddPrimitiveInList(GL2PSprimitive *prim, GL2PSlist *list) -{ - GL2PSprimitive *t1, *t2; - - if(prim->type != GL2PS_QUADRANGLE){ - gl2psListAdd(list, &prim); - } - else{ - gl2psDivideQuad(prim, &t1, &t2); - gl2psListAdd(list, &t1); - gl2psListAdd(list, &t2); - gl2psFreePrimitive(&prim); - } - -} - -static void gl2psFreeBspTree(GL2PSbsptree **tree) -{ - if(*tree){ - if((*tree)->back) gl2psFreeBspTree(&(*tree)->back); - if((*tree)->primitives){ - gl2psListAction((*tree)->primitives, gl2psFreePrimitive); - gl2psListDelete((*tree)->primitives); - } - if((*tree)->front) gl2psFreeBspTree(&(*tree)->front); - gl2psFree(*tree); - *tree = NULL; - } -} - -static GLboolean gl2psGreater(GLfloat f1, GLfloat f2) -{ - if(f1 > f2) return GL_TRUE; - else return GL_FALSE; -} - -static GLboolean gl2psLess(GLfloat f1, GLfloat f2) -{ - if(f1 < f2) return GL_TRUE; - else return GL_FALSE; -} - -static void gl2psBuildBspTree(GL2PSbsptree *tree, GL2PSlist *primitives) -{ - GL2PSprimitive *prim, *frontprim = NULL, *backprim = NULL; - GL2PSlist *frontlist, *backlist; - GLint i, idx; - - tree->front = NULL; - tree->back = NULL; - tree->primitives = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - idx = gl2psFindRoot(primitives, &prim); - gl2psGetPlane(prim, tree->plane); - gl2psAddPrimitiveInList(prim, tree->primitives); - - frontlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - backlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - - for(i = 0; i < gl2psListNbr(primitives); i++){ - if(i != idx){ - prim = *(GL2PSprimitive**)gl2psListPointer(primitives,i); - switch(gl2psSplitPrimitive(prim, tree->plane, &frontprim, &backprim)){ - case GL2PS_COINCIDENT: - gl2psAddPrimitiveInList(prim, tree->primitives); - break; - case GL2PS_IN_BACK_OF: - gl2psAddPrimitiveInList(prim, backlist); - break; - case GL2PS_IN_FRONT_OF: - gl2psAddPrimitiveInList(prim, frontlist); - break; - case GL2PS_SPANNING: - gl2psAddPrimitiveInList(backprim, backlist); - gl2psAddPrimitiveInList(frontprim, frontlist); - gl2psFreePrimitive(&prim); - break; - } - } - } - - if(gl2psListNbr(tree->primitives)){ - gl2psListSort(tree->primitives, gl2psTrianglesFirst); - } - - if(gl2psListNbr(frontlist)){ - gl2psListSort(frontlist, gl2psTrianglesFirst); - tree->front = (GL2PSbsptree*)gl2psMalloc(sizeof(GL2PSbsptree)); - gl2psBuildBspTree(tree->front, frontlist); - } - else{ - gl2psListDelete(frontlist); - } - - if(gl2psListNbr(backlist)){ - gl2psListSort(backlist, gl2psTrianglesFirst); - tree->back = (GL2PSbsptree*)gl2psMalloc(sizeof(GL2PSbsptree)); - gl2psBuildBspTree(tree->back, backlist); - } - else{ - gl2psListDelete(backlist); - } - - gl2psListDelete(primitives); -} - -static void gl2psTraverseBspTree(GL2PSbsptree *tree, GL2PSxyz eye, GLfloat epsilon, - GLboolean (*compare)(GLfloat f1, GLfloat f2), - void (*action)(void *data), int inverse) -{ - GLfloat result; - - if(!tree) return; - - result = gl2psComparePointPlane(eye, tree->plane); - - if(GL_TRUE == compare(result, epsilon)){ - gl2psTraverseBspTree(tree->back, eye, epsilon, compare, action, inverse); - if(inverse){ - gl2psListActionInverse(tree->primitives, action); - } - else{ - gl2psListAction(tree->primitives, action); - } - gl2psTraverseBspTree(tree->front, eye, epsilon, compare, action, inverse); - } - else if(GL_TRUE == compare(-epsilon, result)){ - gl2psTraverseBspTree(tree->front, eye, epsilon, compare, action, inverse); - if(inverse){ - gl2psListActionInverse(tree->primitives, action); - } - else{ - gl2psListAction(tree->primitives, action); - } - gl2psTraverseBspTree(tree->back, eye, epsilon, compare, action, inverse); - } - else{ - gl2psTraverseBspTree(tree->front, eye, epsilon, compare, action, inverse); - gl2psTraverseBspTree(tree->back, eye, epsilon, compare, action, inverse); - } -} - -static void gl2psRescaleAndOffset(void) -{ - GL2PSprimitive *prim; - GLfloat minZ, maxZ, rangeZ, scaleZ; - GLfloat factor, units, area, dZ, dZdX, dZdY, maxdZ; - int i, j; - - if(!gl2psListNbr(gl2ps->primitives)) - return; - - /* get z-buffer range */ - prim = *(GL2PSprimitive**)gl2psListPointer(gl2ps->primitives, 0); - minZ = maxZ = prim->verts[0].xyz[2]; - for(i = 1; i < prim->numverts; i++){ - if(prim->verts[i].xyz[2] < minZ) minZ = prim->verts[i].xyz[2]; - if(prim->verts[i].xyz[2] > maxZ) maxZ = prim->verts[i].xyz[2]; - } - for(i = 1; i < gl2psListNbr(gl2ps->primitives); i++){ - prim = *(GL2PSprimitive**)gl2psListPointer(gl2ps->primitives, i); - for(j = 0; j < prim->numverts; j++){ - if(prim->verts[j].xyz[2] < minZ) minZ = prim->verts[j].xyz[2]; - if(prim->verts[j].xyz[2] > maxZ) maxZ = prim->verts[j].xyz[2]; - } - } - rangeZ = (maxZ - minZ); - - /* rescale z-buffer coordinate in [0,GL2PS_ZSCALE], to make it of - the same order of magnitude as the x and y coordinates */ - scaleZ = GL2PS_ZERO(rangeZ) ? GL2PS_ZSCALE : (GL2PS_ZSCALE / rangeZ); - /* avoid precision loss (we use floats!) */ - if(scaleZ > 100000.F) scaleZ = 100000.F; - - /* apply offsets */ - for(i = 0; i < gl2psListNbr(gl2ps->primitives); i++){ - prim = *(GL2PSprimitive**)gl2psListPointer(gl2ps->primitives, i); - for(j = 0; j < prim->numverts; j++){ - prim->verts[j].xyz[2] = (prim->verts[j].xyz[2] - minZ) * scaleZ; - } - if((gl2ps->options & GL2PS_SIMPLE_LINE_OFFSET) && - (prim->type == GL2PS_LINE)){ - if(gl2ps->sort == GL2PS_SIMPLE_SORT){ - prim->verts[0].xyz[2] -= GL2PS_ZOFFSET_LARGE; - prim->verts[1].xyz[2] -= GL2PS_ZOFFSET_LARGE; - } - else{ - prim->verts[0].xyz[2] -= GL2PS_ZOFFSET; - prim->verts[1].xyz[2] -= GL2PS_ZOFFSET; - } - } - else if(prim->offset && (prim->type == GL2PS_TRIANGLE)){ - factor = gl2ps->offset[0]; - units = gl2ps->offset[1]; - area = - (prim->verts[1].xyz[0] - prim->verts[0].xyz[0]) * - (prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) - - (prim->verts[2].xyz[0] - prim->verts[1].xyz[0]) * - (prim->verts[1].xyz[1] - prim->verts[0].xyz[1]); - if(!GL2PS_ZERO(area)){ - dZdX = - ((prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) * - (prim->verts[1].xyz[2] - prim->verts[0].xyz[2]) - - (prim->verts[1].xyz[1] - prim->verts[0].xyz[1]) * - (prim->verts[2].xyz[2] - prim->verts[1].xyz[2])) / area; - dZdY = - ((prim->verts[1].xyz[0] - prim->verts[0].xyz[0]) * - (prim->verts[2].xyz[2] - prim->verts[1].xyz[2]) - - (prim->verts[2].xyz[0] - prim->verts[1].xyz[0]) * - (prim->verts[1].xyz[2] - prim->verts[0].xyz[2])) / area; - maxdZ = (GLfloat)sqrt(dZdX * dZdX + dZdY * dZdY); - } - else{ - maxdZ = 0.0F; - } - dZ = factor * maxdZ + units; - prim->verts[0].xyz[2] += dZ; - prim->verts[1].xyz[2] += dZ; - prim->verts[2].xyz[2] += dZ; - } - } -} - -/********************************************************************* - * - * 2D sorting routines (for occlusion culling) - * - *********************************************************************/ - -static GLint gl2psGetPlaneFromPoints(GL2PSxyz a, GL2PSxyz b, GL2PSplane plane) -{ - GLfloat n; - - plane[0] = b[1] - a[1]; - plane[1] = a[0] - b[0]; - n = (GLfloat)sqrt(plane[0]*plane[0] + plane[1]*plane[1]); - plane[2] = 0.0F; - if(!GL2PS_ZERO(n)){ - plane[0] /= n; - plane[1] /= n; - plane[3] = -plane[0]*a[0]-plane[1]*a[1]; - return 1; - } - else{ - plane[0] = -1.0F; - plane[1] = 0.0F; - plane[3] = a[0]; - return 0; - } -} - -static void gl2psFreeBspImageTree(GL2PSbsptree2d **tree) -{ - if(*tree){ - if((*tree)->back) gl2psFreeBspImageTree(&(*tree)->back); - if((*tree)->front) gl2psFreeBspImageTree(&(*tree)->front); - gl2psFree(*tree); - *tree = NULL; - } -} - -static GLint gl2psCheckPoint(GL2PSxyz point, GL2PSplane plane) -{ - GLfloat pt_dis; - - pt_dis = gl2psComparePointPlane(point, plane); - if(pt_dis > GL2PS_EPSILON) return GL2PS_POINT_INFRONT; - else if(pt_dis < -GL2PS_EPSILON) return GL2PS_POINT_BACK; - else return GL2PS_POINT_COINCIDENT; -} - -static void gl2psAddPlanesInBspTreeImage(GL2PSprimitive *prim, - GL2PSbsptree2d **tree) -{ - GLint ret = 0; - GLint i; - GLint offset = 0; - GL2PSbsptree2d *head = NULL, *cur = NULL; - - if((*tree == NULL) && (prim->numverts > 2)){ - /* don't cull if transparent - for(i = 0; i < prim->numverts - 1; i++) - if(prim->verts[i].rgba[3] < 1.0F) return; - */ - head = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); - for(i = 0; i < prim->numverts-1; i++){ - if(!gl2psGetPlaneFromPoints(prim->verts[i].xyz, - prim->verts[i+1].xyz, - head->plane)){ - if(prim->numverts-i > 3){ - offset++; - } - else{ - gl2psFree(head); - return; - } - } - else{ - break; - } - } - head->back = NULL; - head->front = NULL; - for(i = 2+offset; i < prim->numverts; i++){ - ret = gl2psCheckPoint(prim->verts[i].xyz, head->plane); - if(ret != GL2PS_POINT_COINCIDENT) break; - } - switch(ret){ - case GL2PS_POINT_INFRONT : - cur = head; - for(i = 1+offset; i < prim->numverts-1; i++){ - if(cur->front == NULL){ - cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); - } - if(gl2psGetPlaneFromPoints(prim->verts[i].xyz, - prim->verts[i+1].xyz, - cur->front->plane)){ - cur = cur->front; - cur->front = NULL; - cur->back = NULL; - } - } - if(cur->front == NULL){ - cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); - } - if(gl2psGetPlaneFromPoints(prim->verts[i].xyz, - prim->verts[offset].xyz, - cur->front->plane)){ - cur->front->front = NULL; - cur->front->back = NULL; - } - else{ - gl2psFree(cur->front); - cur->front = NULL; - } - break; - case GL2PS_POINT_BACK : - for(i = 0; i < 4; i++){ - head->plane[i] = -head->plane[i]; - } - cur = head; - for(i = 1+offset; i < prim->numverts-1; i++){ - if(cur->front == NULL){ - cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); - } - if(gl2psGetPlaneFromPoints(prim->verts[i+1].xyz, - prim->verts[i].xyz, - cur->front->plane)){ - cur = cur->front; - cur->front = NULL; - cur->back = NULL; - } - } - if(cur->front == NULL){ - cur->front = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); - } - if(gl2psGetPlaneFromPoints(prim->verts[offset].xyz, - prim->verts[i].xyz, - cur->front->plane)){ - cur->front->front = NULL; - cur->front->back = NULL; - } - else{ - gl2psFree(cur->front); - cur->front = NULL; - } - break; - default: - gl2psFree(head); - return; - } - (*tree) = head; - } -} - -static GLint gl2psCheckPrimitive(GL2PSprimitive *prim, GL2PSplane plane) -{ - GLint i; - GLint pos; - - pos = gl2psCheckPoint(prim->verts[0].xyz, plane); - for(i = 1; i < prim->numverts; i++){ - pos |= gl2psCheckPoint(prim->verts[i].xyz, plane); - if(pos == (GL2PS_POINT_INFRONT | GL2PS_POINT_BACK)) return GL2PS_SPANNING; - } - if(pos & GL2PS_POINT_INFRONT) return GL2PS_IN_FRONT_OF; - else if(pos & GL2PS_POINT_BACK) return GL2PS_IN_BACK_OF; - else return GL2PS_COINCIDENT; -} - -static GL2PSprimitive *gl2psCreateSplitPrimitive2D(GL2PSprimitive *parent, - GLshort numverts, - GL2PSvertex *vertx) -{ - GLint i; - GL2PSprimitive *child = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - - if(parent->type == GL2PS_IMAGEMAP){ - child->type = GL2PS_IMAGEMAP; - child->data.image = parent->data.image; - } - else { - switch(numverts){ - case 1 : child->type = GL2PS_POINT; break; - case 2 : child->type = GL2PS_LINE; break; - case 3 : child->type = GL2PS_TRIANGLE; break; - case 4 : child->type = GL2PS_QUADRANGLE; break; - default: child->type = GL2PS_NO_TYPE; break; /* FIXME */ - } - } - child->boundary = 0; /* FIXME: not done! */ - child->culled = parent->culled; - child->offset = parent->offset; - child->pattern = parent->pattern; - child->factor = parent->factor; - child->width = parent->width; - child->numverts = numverts; - child->verts = (GL2PSvertex*)gl2psMalloc(numverts * sizeof(GL2PSvertex)); - for(i = 0; i < numverts; i++){ - child->verts[i] = vertx[i]; - } - return child; -} - -static void gl2psSplitPrimitive2D(GL2PSprimitive *prim, - GL2PSplane plane, - GL2PSprimitive **front, - GL2PSprimitive **back) -{ - /* cur will hold the position of the current vertex - prev will hold the position of the previous vertex - prev0 will hold the position of the vertex number 0 - v1 and v2 represent the current and previous vertices, respectively - flag is set if the current vertex should be checked against the plane */ - GLint cur = -1, prev = -1, i, v1 = 0, v2 = 0, flag = 1, prev0 = -1; - - /* list of vertices that will go in front and back primitive */ - GL2PSvertex *front_list = NULL, *back_list = NULL; - - /* number of vertices in front and back list */ - GLshort front_count = 0, back_count = 0; - - for(i = 0; i <= prim->numverts; i++){ - v1 = i; - if(v1 == prim->numverts){ - if(prim->numverts < 3) break; - v1 = 0; - v2 = prim->numverts - 1; - cur = prev0; - } - else if(flag){ - cur = gl2psCheckPoint(prim->verts[v1].xyz, plane); - if(i == 0){ - prev0 = cur; - } - } - if(((prev == -1) || (prev == cur) || (prev == 0) || (cur == 0)) && - (i < prim->numverts)){ - if(cur == GL2PS_POINT_INFRONT){ - front_count++; - front_list = (GL2PSvertex*)gl2psRealloc(front_list, - sizeof(GL2PSvertex)*front_count); - front_list[front_count-1] = prim->verts[v1]; - } - else if(cur == GL2PS_POINT_BACK){ - back_count++; - back_list = (GL2PSvertex*)gl2psRealloc(back_list, - sizeof(GL2PSvertex)*back_count); - back_list[back_count-1] = prim->verts[v1]; - } - else{ - front_count++; - front_list = (GL2PSvertex*)gl2psRealloc(front_list, - sizeof(GL2PSvertex)*front_count); - front_list[front_count-1] = prim->verts[v1]; - back_count++; - back_list = (GL2PSvertex*)gl2psRealloc(back_list, - sizeof(GL2PSvertex)*back_count); - back_list[back_count-1] = prim->verts[v1]; - } - flag = 1; - } - else if((prev != cur) && (cur != 0) && (prev != 0)){ - if(v1 != 0){ - v2 = v1-1; - i--; - } - front_count++; - front_list = (GL2PSvertex*)gl2psRealloc(front_list, - sizeof(GL2PSvertex)*front_count); - gl2psCutEdge(&prim->verts[v2], &prim->verts[v1], - plane, &front_list[front_count-1]); - back_count++; - back_list = (GL2PSvertex*)gl2psRealloc(back_list, - sizeof(GL2PSvertex)*back_count); - back_list[back_count-1] = front_list[front_count-1]; - flag = 0; - } - prev = cur; - } - *front = gl2psCreateSplitPrimitive2D(prim, front_count, front_list); - *back = gl2psCreateSplitPrimitive2D(prim, back_count, back_list); - gl2psFree(front_list); - gl2psFree(back_list); -} - -static GLint gl2psAddInBspImageTree(GL2PSprimitive *prim, GL2PSbsptree2d **tree) -{ - GLint ret = 0; - GL2PSprimitive *frontprim = NULL, *backprim = NULL; - - /* FIXME: until we consider the actual extent of text strings and - pixmaps, never cull them. Otherwise the whole string/pixmap gets - culled as soon as the reference point is hidden */ - if(prim->type == GL2PS_PIXMAP || - prim->type == GL2PS_TEXT || - prim->type == GL2PS_SPECIAL){ - return 1; - } - - if(*tree == NULL){ - if((prim->type != GL2PS_IMAGEMAP) && (GL_FALSE == gl2ps->zerosurfacearea)){ - gl2psAddPlanesInBspTreeImage(gl2ps->primitivetoadd, tree); - } - return 1; - } - else{ - switch(gl2psCheckPrimitive(prim, (*tree)->plane)){ - case GL2PS_IN_BACK_OF: return gl2psAddInBspImageTree(prim, &(*tree)->back); - case GL2PS_IN_FRONT_OF: - if((*tree)->front != NULL) return gl2psAddInBspImageTree(prim, &(*tree)->front); - else return 0; - case GL2PS_SPANNING: - gl2psSplitPrimitive2D(prim, (*tree)->plane, &frontprim, &backprim); - ret = gl2psAddInBspImageTree(backprim, &(*tree)->back); - if((*tree)->front != NULL){ - if(gl2psAddInBspImageTree(frontprim, &(*tree)->front)){ - ret = 1; - } - } - gl2psFree(frontprim->verts); - gl2psFree(frontprim); - gl2psFree(backprim->verts); - gl2psFree(backprim); - return ret; - case GL2PS_COINCIDENT: - if((*tree)->back != NULL){ - gl2ps->zerosurfacearea = GL_TRUE; - ret = gl2psAddInBspImageTree(prim, &(*tree)->back); - gl2ps->zerosurfacearea = GL_FALSE; - if(ret) return ret; - } - if((*tree)->front != NULL){ - gl2ps->zerosurfacearea = GL_TRUE; - ret = gl2psAddInBspImageTree(prim, &(*tree)->front); - gl2ps->zerosurfacearea = GL_FALSE; - if(ret) return ret; - } - if(prim->type == GL2PS_LINE) return 1; - else return 0; - } - } - return 0; -} - -static void gl2psAddInImageTree(void *data) -{ - GL2PSprimitive *prim = *(GL2PSprimitive **)data; - gl2ps->primitivetoadd = prim; - if(prim->type == GL2PS_IMAGEMAP && prim->data.image->format == GL2PS_IMAGEMAP_VISIBLE){ - prim->culled = 1; - } - else if(!gl2psAddInBspImageTree(prim, &gl2ps->imagetree)){ - prim->culled = 1; - } - else if(prim->type == GL2PS_IMAGEMAP){ - prim->data.image->format = GL2PS_IMAGEMAP_VISIBLE; - } -} - -/* Boundary construction */ - -static void gl2psAddBoundaryInList(GL2PSprimitive *prim, GL2PSlist *list) -{ - GL2PSprimitive *b; - GLshort i; - GL2PSxyz c; - - c[0] = c[1] = c[2] = 0.0F; - for(i = 0; i < prim->numverts; i++){ - c[0] += prim->verts[i].xyz[0]; - c[1] += prim->verts[i].xyz[1]; - } - c[0] /= prim->numverts; - c[1] /= prim->numverts; - - for(i = 0; i < prim->numverts; i++){ - if(prim->boundary & (GLint)pow(2., i)){ - b = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - b->type = GL2PS_LINE; - b->offset = prim->offset; - b->pattern = prim->pattern; - b->factor = prim->factor; - b->culled = prim->culled; - b->width = prim->width; - b->boundary = 0; - b->numverts = 2; - b->verts = (GL2PSvertex*)gl2psMalloc(2 * sizeof(GL2PSvertex)); - -#if 0 /* FIXME: need to work on boundary offset... */ - v[0] = c[0] - prim->verts[i].xyz[0]; - v[1] = c[1] - prim->verts[i].xyz[1]; - v[2] = 0.0F; - norm = gl2psNorm(v); - v[0] /= norm; - v[1] /= norm; - b->verts[0].xyz[0] = prim->verts[i].xyz[0] +0.1*v[0]; - b->verts[0].xyz[1] = prim->verts[i].xyz[1] +0.1*v[1]; - b->verts[0].xyz[2] = prim->verts[i].xyz[2]; - v[0] = c[0] - prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[0]; - v[1] = c[1] - prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[1]; - norm = gl2psNorm(v); - v[0] /= norm; - v[1] /= norm; - b->verts[1].xyz[0] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[0] +0.1*v[0]; - b->verts[1].xyz[1] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[1] +0.1*v[1]; - b->verts[1].xyz[2] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[2]; -#else - b->verts[0].xyz[0] = prim->verts[i].xyz[0]; - b->verts[0].xyz[1] = prim->verts[i].xyz[1]; - b->verts[0].xyz[2] = prim->verts[i].xyz[2]; - b->verts[1].xyz[0] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[0]; - b->verts[1].xyz[1] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[1]; - b->verts[1].xyz[2] = prim->verts[gl2psGetIndex(i, prim->numverts)].xyz[2]; -#endif - - b->verts[0].rgba[0] = 0.0F; - b->verts[0].rgba[1] = 0.0F; - b->verts[0].rgba[2] = 0.0F; - b->verts[0].rgba[3] = 0.0F; - b->verts[1].rgba[0] = 0.0F; - b->verts[1].rgba[1] = 0.0F; - b->verts[1].rgba[2] = 0.0F; - b->verts[1].rgba[3] = 0.0F; - gl2psListAdd(list, &b); - } - } - -} - -static void gl2psBuildPolygonBoundary(GL2PSbsptree *tree) -{ - GLint i; - GL2PSprimitive *prim; - - if(!tree) return; - gl2psBuildPolygonBoundary(tree->back); - for(i = 0; i < gl2psListNbr(tree->primitives); i++){ - prim = *(GL2PSprimitive**)gl2psListPointer(tree->primitives, i); - if(prim->boundary) gl2psAddBoundaryInList(prim, tree->primitives); - } - gl2psBuildPolygonBoundary(tree->front); -} - -/********************************************************************* - * - * Feedback buffer parser - * - *********************************************************************/ - -static void gl2psAddPolyPrimitive(GLshort type, GLshort numverts, - GL2PSvertex *verts, GLint offset, - GLushort pattern, GLint factor, - GLfloat width, char boundary) -{ - GL2PSprimitive *prim; - - prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - prim->type = type; - prim->numverts = numverts; - prim->verts = (GL2PSvertex*)gl2psMalloc(numverts * sizeof(GL2PSvertex)); - memcpy(prim->verts, verts, numverts * sizeof(GL2PSvertex)); - prim->boundary = boundary; - prim->offset = (char)offset; - prim->pattern = pattern; - prim->factor = factor; - prim->width = width; - prim->culled = 0; - - /* FIXME: here we should have an option to split stretched - tris/quads to enhance SIMPLE_SORT */ - - gl2psListAdd(gl2ps->primitives, &prim); -} - -static GLint gl2psGetVertex(GL2PSvertex *v, GLfloat *p) -{ - GLint i; - - v->xyz[0] = p[0]; - v->xyz[1] = p[1]; - v->xyz[2] = p[2]; - - if(gl2ps->colormode == GL_COLOR_INDEX && gl2ps->colorsize > 0){ - i = (GLint)(p[3] + 0.5); - v->rgba[0] = gl2ps->colormap[i][0]; - v->rgba[1] = gl2ps->colormap[i][1]; - v->rgba[2] = gl2ps->colormap[i][2]; - v->rgba[3] = gl2ps->colormap[i][3]; - return 4; - } - else{ - v->rgba[0] = p[3]; - v->rgba[1] = p[4]; - v->rgba[2] = p[5]; - v->rgba[3] = p[6]; - return 7; - } -} - -static void gl2psParseFeedbackBuffer(GLint used) -{ - char flag; - GLushort pattern = 0; - GLboolean boundary; - GLint i, sizeoffloat, count, v, vtot, offset = 0, factor = 0, auxindex = 0; - GLfloat lwidth = 1.0F, psize = 1.0F; - GLfloat *current; - GL2PSvertex vertices[3]; - GL2PSprimitive *prim; - GL2PSimagemap *node; - - current = gl2ps->feedback; - boundary = gl2ps->boundary = GL_FALSE; - - while(used > 0){ - - if(GL_TRUE == boundary) gl2ps->boundary = GL_TRUE; - - switch((GLint)*current){ - case GL_POINT_TOKEN : - current ++; - used --; - i = gl2psGetVertex(&vertices[0], current); - current += i; - used -= i; - gl2psAddPolyPrimitive(GL2PS_POINT, 1, vertices, 0, - pattern, factor, psize, 0); - break; - case GL_LINE_TOKEN : - case GL_LINE_RESET_TOKEN : - current ++; - used --; - i = gl2psGetVertex(&vertices[0], current); - current += i; - used -= i; - i = gl2psGetVertex(&vertices[1], current); - current += i; - used -= i; - gl2psAddPolyPrimitive(GL2PS_LINE, 2, vertices, 0, - pattern, factor, lwidth, 0); - break; - case GL_POLYGON_TOKEN : - count = (GLint)current[1]; - current += 2; - used -= 2; - v = vtot = 0; - while(count > 0 && used > 0){ - i = gl2psGetVertex(&vertices[v], current); - gl2psAdaptVertexForBlending(&vertices[v]); - current += i; - used -= i; - count --; - vtot++; - if(v == 2){ - if(GL_TRUE == boundary){ - if(!count && vtot == 2) flag = 1|2|4; - else if(!count) flag = 2|4; - else if(vtot == 2) flag = 1|2; - else flag = 2; - } - else - flag = 0; - gl2psAddPolyPrimitive(GL2PS_TRIANGLE, 3, vertices, offset, - pattern, factor, 1, flag); - vertices[1] = vertices[2]; - } - else - v ++; - } - break; - case GL_BITMAP_TOKEN : - case GL_DRAW_PIXEL_TOKEN : - case GL_COPY_PIXEL_TOKEN : - current ++; - used --; - i = gl2psGetVertex(&vertices[0], current); - current += i; - used -= i; - break; - case GL_PASS_THROUGH_TOKEN : - switch((GLint)current[1]){ - case GL2PS_BEGIN_OFFSET_TOKEN : offset = 1; break; - case GL2PS_END_OFFSET_TOKEN : offset = 0; break; - case GL2PS_BEGIN_BOUNDARY_TOKEN : boundary = GL_TRUE; break; - case GL2PS_END_BOUNDARY_TOKEN : boundary = GL_FALSE; break; - case GL2PS_END_STIPPLE_TOKEN : pattern = 0; factor = 0; break; - case GL2PS_BEGIN_BLEND_TOKEN : gl2ps->blending = GL_TRUE; break; - case GL2PS_END_BLEND_TOKEN : gl2ps->blending = GL_FALSE; break; - case GL2PS_BEGIN_STIPPLE_TOKEN : - current += 2; - used -= 2; - pattern = (GLushort)current[1]; - current += 2; - used -= 2; - factor = (GLint)current[1]; - break; - case GL2PS_SRC_BLEND_TOKEN : - current += 2; - used -= 2; - gl2ps->blendfunc[0] = (GLint)current[1]; - break; - case GL2PS_DST_BLEND_TOKEN : - current += 2; - used -= 2; - gl2ps->blendfunc[1] = (GLint)current[1]; - break; - case GL2PS_POINT_SIZE_TOKEN : - current += 2; - used -= 2; - psize = current[1]; - break; - case GL2PS_LINE_WIDTH_TOKEN : - current += 2; - used -= 2; - lwidth = current[1]; - break; - case GL2PS_IMAGEMAP_TOKEN : - prim = (GL2PSprimitive *)gl2psMalloc(sizeof(GL2PSprimitive)); - prim->type = GL2PS_IMAGEMAP; - prim->boundary = 0; - prim->numverts = 4; - prim->verts = (GL2PSvertex *)gl2psMalloc(4 * sizeof(GL2PSvertex)); - prim->culled = 0; - prim->offset = 0; - prim->pattern = 0; - prim->factor = 0; - prim->width = 1; - - node = (GL2PSimagemap*)gl2psMalloc(sizeof(GL2PSimagemap)); - node->image = (GL2PSimage*)gl2psMalloc(sizeof(GL2PSimage)); - node->image->type = 0; - node->image->format = 0; - node->image->zoom_x = 1.0F; - node->image->zoom_y = 1.0F; - node->next = NULL; - - if(gl2ps->imagemap_head == NULL) - gl2ps->imagemap_head = node; - else - gl2ps->imagemap_tail->next = node; - gl2ps->imagemap_tail = node; - prim->data.image = node->image; - - current += 2; used -= 2; - i = gl2psGetVertex(&prim->verts[0], ¤t[1]); - current += i; used -= i; - - node->image->width = (GLint)current[2]; - current += 2; used -= 2; - node->image->height = (GLint)current[2]; - prim->verts[0].xyz[0] = prim->verts[0].xyz[0] - (int)(node->image->width / 2) + 0.5F; - prim->verts[0].xyz[1] = prim->verts[0].xyz[1] - (int)(node->image->height / 2) + 0.5F; - for(i = 1; i < 4; i++){ - for(v = 0; v < 3; v++){ - prim->verts[i].xyz[v] = prim->verts[0].xyz[v]; - prim->verts[i].rgba[v] = prim->verts[0].rgba[v]; - } - prim->verts[i].rgba[v] = prim->verts[0].rgba[v]; - } - prim->verts[1].xyz[0] = prim->verts[1].xyz[0] + node->image->width; - prim->verts[2].xyz[0] = prim->verts[1].xyz[0]; - prim->verts[2].xyz[1] = prim->verts[2].xyz[1] + node->image->height; - prim->verts[3].xyz[1] = prim->verts[2].xyz[1]; - - sizeoffloat = sizeof(GLfloat); - v = 2 * sizeoffloat; - vtot = node->image->height + node->image->height * - ((node->image->width - 1) / 8); - node->image->pixels = (GLfloat*)gl2psMalloc(v + vtot); - node->image->pixels[0] = prim->verts[0].xyz[0]; - node->image->pixels[1] = prim->verts[0].xyz[1]; - - for(i = 0; i < vtot; i += sizeoffloat){ - current += 2; used -= 2; - if((vtot - i) >= 4) - memcpy(&(((char*)(node->image->pixels))[i + v]), &(current[2]), sizeoffloat); - else - memcpy(&(((char*)(node->image->pixels))[i + v]), &(current[2]), vtot - i); - } - current++; used--; - gl2psListAdd(gl2ps->primitives, &prim); - break; - case GL2PS_DRAW_PIXELS_TOKEN : - case GL2PS_TEXT_TOKEN : - if(auxindex < gl2psListNbr(gl2ps->auxprimitives)) - gl2psListAdd(gl2ps->primitives, - gl2psListPointer(gl2ps->auxprimitives, auxindex++)); - else - gl2psMsg(GL2PS_ERROR, "Wrong number of auxiliary tokens in buffer"); - break; - } - current += 2; - used -= 2; - break; - default : - gl2psMsg(GL2PS_WARNING, "Unknown token in buffer"); - current ++; - used --; - break; - } - } - - gl2psListReset(gl2ps->auxprimitives); -} - -/********************************************************************* - * - * PostScript routines - * - *********************************************************************/ - -static void gl2psWriteByte(unsigned char byte) -{ - unsigned char h = byte / 16; - unsigned char l = byte % 16; - gl2psPrintf("%x%x", h, l); -} - -static void gl2psPrintPostScriptPixmap(GLfloat x, GLfloat y, GL2PSimage *im) -{ - GLuint nbhex, nbyte, nrgb, nbits; - GLuint row, col, ibyte, icase; - GLfloat dr = 0., dg = 0., db = 0., fgrey; - unsigned char red = 0, green = 0, blue = 0, b, grey; - GLuint width = (GLuint)im->width; - GLuint height = (GLuint)im->height; - - /* FIXME: should we define an option for these? Or just keep the - 8-bit per component case? */ - int greyscale = 0; /* set to 1 to output greyscale image */ - int nbit = 8; /* number of bits per color compoment (2, 4 or 8) */ - - if((width <= 0) || (height <= 0)) return; - - gl2psPrintf("gsave\n"); - gl2psPrintf("%.2f %.2f translate\n", x, y); - gl2psPrintf("%.2f %.2f scale\n", width * im->zoom_x, height * im->zoom_y); - - if(greyscale){ /* greyscale */ - gl2psPrintf("/picstr %d string def\n", width); - gl2psPrintf("%d %d %d\n", width, height, 8); - gl2psPrintf("[ %d 0 0 -%d 0 %d ]\n", width, height, height); - gl2psPrintf("{ currentfile picstr readhexstring pop }\n"); - gl2psPrintf("image\n"); - for(row = 0; row < height; row++){ - for(col = 0; col < width; col++){ - gl2psGetRGB(im, col, row, &dr, &dg, &db); - fgrey = (0.30F * dr + 0.59F * dg + 0.11F * db); - grey = (unsigned char)(255. * fgrey); - gl2psWriteByte(grey); - } - gl2psPrintf("\n"); - } - nbhex = width * height * 2; - gl2psPrintf("%%%% nbhex digit :%d\n", nbhex); - } - else if(nbit == 2){ /* color, 2 bits for r and g and b; rgbs following each other */ - nrgb = width * 3; - nbits = nrgb * nbit; - nbyte = nbits / 8; - if((nbyte * 8) != nbits) nbyte++; - gl2psPrintf("/rgbstr %d string def\n", nbyte); - gl2psPrintf("%d %d %d\n", width, height, nbit); - gl2psPrintf("[ %d 0 0 -%d 0 %d ]\n", width, height, height); - gl2psPrintf("{ currentfile rgbstr readhexstring pop }\n"); - gl2psPrintf("false 3\n"); - gl2psPrintf("colorimage\n"); - for(row = 0; row < height; row++){ - icase = 1; - col = 0; - b = 0; - for(ibyte = 0; ibyte < nbyte; ibyte++){ - if(icase == 1) { - if(col < width) { - gl2psGetRGB(im, col, row, &dr, &dg, &db); - } - else { - dr = dg = db = 0; - } - col++; - red = (unsigned char)(3. * dr); - green = (unsigned char)(3. * dg); - blue = (unsigned char)(3. * db); - b = red; - b = (b<<2) + green; - b = (b<<2) + blue; - if(col < width) { - gl2psGetRGB(im, col, row, &dr, &dg, &db); - } - else { - dr = dg = db = 0; - } - col++; - red = (unsigned char)(3. * dr); - green = (unsigned char)(3. * dg); - blue = (unsigned char)(3. * db); - b = (b<<2) + red; - gl2psWriteByte(b); - b = 0; - icase++; - } - else if(icase == 2) { - b = green; - b = (b<<2) + blue; - if(col < width) { - gl2psGetRGB(im, col, row, &dr, &dg, &db); - } - else { - dr = dg = db = 0; - } - col++; - red = (unsigned char)(3. * dr); - green = (unsigned char)(3. * dg); - blue = (unsigned char)(3. * db); - b = (b<<2) + red; - b = (b<<2) + green; - gl2psWriteByte(b); - b = 0; - icase++; - } - else if(icase == 3) { - b = blue; - if(col < width) { - gl2psGetRGB(im, col, row, &dr, &dg, &db); - } - else { - dr = dg = db = 0; - } - col++; - red = (unsigned char)(3. * dr); - green = (unsigned char)(3. * dg); - blue = (unsigned char)(3. * db); - b = (b<<2) + red; - b = (b<<2) + green; - b = (b<<2) + blue; - gl2psWriteByte(b); - b = 0; - icase = 1; - } - } - gl2psPrintf("\n"); - } - } - else if(nbit == 4){ /* color, 4 bits for r and g and b; rgbs following each other */ - nrgb = width * 3; - nbits = nrgb * nbit; - nbyte = nbits / 8; - if((nbyte * 8) != nbits) nbyte++; - gl2psPrintf("/rgbstr %d string def\n", nbyte); - gl2psPrintf("%d %d %d\n", width, height, nbit); - gl2psPrintf("[ %d 0 0 -%d 0 %d ]\n", width, height, height); - gl2psPrintf("{ currentfile rgbstr readhexstring pop }\n"); - gl2psPrintf("false 3\n"); - gl2psPrintf("colorimage\n"); - for(row = 0; row < height; row++){ - col = 0; - icase = 1; - for(ibyte = 0; ibyte < nbyte; ibyte++){ - if(icase == 1) { - if(col < width) { - gl2psGetRGB(im, col, row, &dr, &dg, &db); - } - else { - dr = dg = db = 0; - } - col++; - red = (unsigned char)(15. * dr); - green = (unsigned char)(15. * dg); - gl2psPrintf("%x%x", red, green); - icase++; - } - else if(icase == 2) { - blue = (unsigned char)(15. * db); - if(col < width) { - gl2psGetRGB(im, col, row, &dr, &dg, &db); - } - else { - dr = dg = db = 0; - } - col++; - red = (unsigned char)(15. * dr); - gl2psPrintf("%x%x", blue, red); - icase++; - } - else if(icase == 3) { - green = (unsigned char)(15. * dg); - blue = (unsigned char)(15. * db); - gl2psPrintf("%x%x", green, blue); - icase = 1; - } - } - gl2psPrintf("\n"); - } - } - else{ /* 8 bit for r and g and b */ - nbyte = width * 3; - gl2psPrintf("/rgbstr %d string def\n", nbyte); - gl2psPrintf("%d %d %d\n", width, height, 8); - gl2psPrintf("[ %d 0 0 -%d 0 %d ]\n", width, height, height); - gl2psPrintf("{ currentfile rgbstr readhexstring pop }\n"); - gl2psPrintf("false 3\n"); - gl2psPrintf("colorimage\n"); - for(row = 0; row < height; row++){ - for(col = 0; col < width; col++){ - gl2psGetRGB(im, col, row, &dr, &dg, &db); - red = (unsigned char)(255. * dr); - gl2psWriteByte(red); - green = (unsigned char)(255. * dg); - gl2psWriteByte(green); - blue = (unsigned char)(255. * db); - gl2psWriteByte(blue); - } - gl2psPrintf("\n"); - } - } - - gl2psPrintf("grestore\n"); -} - -static void gl2psPrintPostScriptImagemap(GLfloat x, GLfloat y, - GLsizei width, GLsizei height, - const unsigned char *imagemap){ - int i, size; - - if((width <= 0) || (height <= 0)) return; - - size = height + height * (width - 1) / 8; - - gl2psPrintf("gsave\n"); - gl2psPrintf("%.2f %.2f translate\n", x, y); - gl2psPrintf("%d %d scale\n%d %d\ntrue\n", width, height,width, height); - gl2psPrintf("[ %d 0 0 -%d 0 %d ] {<", width, height); - for(i = 0; i < size; i++){ - gl2psWriteByte(*imagemap); - imagemap++; - } - gl2psPrintf(">} imagemask\ngrestore\n"); -} - -static void gl2psPrintPostScriptHeader(void) -{ - time_t now; - - /* Since compression is not part of the PostScript standard, - compressed PostScript files are just gzipped PostScript files - ("ps.gz" or "eps.gz") */ - gl2psPrintGzipHeader(); - - time(&now); - - if(gl2ps->format == GL2PS_PS){ - gl2psPrintf("%%!PS-Adobe-3.0\n"); - } - else{ - gl2psPrintf("%%!PS-Adobe-3.0 EPSF-3.0\n"); - } - - gl2psPrintf("%%%%Title: %s\n" - "%%%%Creator: GL2PS %d.%d.%d%s, %s\n" - "%%%%For: %s\n" - "%%%%CreationDate: %s" - "%%%%LanguageLevel: 3\n" - "%%%%DocumentData: Clean7Bit\n" - "%%%%Pages: 1\n", - gl2ps->title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, - GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, - gl2ps->producer, ctime(&now)); - - if(gl2ps->format == GL2PS_PS){ - gl2psPrintf("%%%%Orientation: %s\n" - "%%%%DocumentMedia: Default %d %d 0 () ()\n", - (gl2ps->options & GL2PS_LANDSCAPE) ? "Landscape" : "Portrait", - (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[3] : - (int)gl2ps->viewport[2], - (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[2] : - (int)gl2ps->viewport[3]); - } - - gl2psPrintf("%%%%BoundingBox: %d %d %d %d\n" - "%%%%EndComments\n", - (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[1] : - (int)gl2ps->viewport[0], - (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[0] : - (int)gl2ps->viewport[1], - (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[3] : - (int)gl2ps->viewport[2], - (gl2ps->options & GL2PS_LANDSCAPE) ? (int)gl2ps->viewport[2] : - (int)gl2ps->viewport[3]); - - /* RGB color: r g b C (replace C by G in output to change from rgb to gray) - Grayscale: r g b G - Font choose: size fontname FC - Text string: (string) x y size fontname S?? - Rotated text string: (string) angle x y size fontname S??R - Point primitive: x y size P - Line width: width W - Line start: x y LS - Line joining last point: x y L - Line end: x y LE - Flat-shaded triangle: x3 y3 x2 y2 x1 y1 T - Smooth-shaded triangle: x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 ST */ - - gl2psPrintf("%%%%BeginProlog\n" - "/gl2psdict 64 dict def gl2psdict begin\n" - "0 setlinecap 0 setlinejoin\n" - "/tryPS3shading %s def %% set to false to force subdivision\n" - "/rThreshold %g def %% red component subdivision threshold\n" - "/gThreshold %g def %% green component subdivision threshold\n" - "/bThreshold %g def %% blue component subdivision threshold\n", - (gl2ps->options & GL2PS_NO_PS3_SHADING) ? "false" : "true", - gl2ps->threshold[0], gl2ps->threshold[1], gl2ps->threshold[2]); - - gl2psPrintf("/BD { bind def } bind def\n" - "/C { setrgbcolor } BD\n" - "/G { 0.082 mul exch 0.6094 mul add exch 0.3086 mul add neg 1.0 add setgray } BD\n" - "/W { setlinewidth } BD\n"); - - gl2psPrintf("/FC { findfont exch /SH exch def SH scalefont setfont } BD\n" - "/SW { dup stringwidth pop } BD\n" - "/S { FC moveto show } BD\n" - "/SBC{ FC moveto SW -2 div 0 rmoveto show } BD\n" - "/SBR{ FC moveto SW neg 0 rmoveto show } BD\n" - "/SCL{ FC moveto 0 SH -2 div rmoveto show } BD\n" - "/SCC{ FC moveto SW -2 div SH -2 div rmoveto show } BD\n" - "/SCR{ FC moveto SW neg SH -2 div rmoveto show } BD\n" - "/STL{ FC moveto 0 SH neg rmoveto show } BD\n" - "/STC{ FC moveto SW -2 div SH neg rmoveto show } BD\n" - "/STR{ FC moveto SW neg SH neg rmoveto show } BD\n"); - - /* rotated text routines: same nameanem with R appended */ - - gl2psPrintf("/FCT { FC translate 0 0 } BD\n" - "/SR { gsave FCT moveto rotate show grestore } BD\n" - "/SBCR{ gsave FCT moveto rotate SW -2 div 0 rmoveto show grestore } BD\n" - "/SBRR{ gsave FCT moveto rotate SW neg 0 rmoveto show grestore } BD\n" - "/SCLR{ gsave FCT moveto rotate 0 SH -2 div rmoveto show grestore} BD\n"); - gl2psPrintf("/SCCR{ gsave FCT moveto rotate SW -2 div SH -2 div rmoveto show grestore} BD\n" - "/SCRR{ gsave FCT moveto rotate SW neg SH -2 div rmoveto show grestore} BD\n" - "/STLR{ gsave FCT moveto rotate 0 SH neg rmoveto show grestore } BD\n" - "/STCR{ gsave FCT moveto rotate SW -2 div SH neg rmoveto show grestore } BD\n" - "/STRR{ gsave FCT moveto rotate SW neg SH neg rmoveto show grestore } BD\n"); - - gl2psPrintf("/P { newpath 0.0 360.0 arc closepath fill } BD\n" - "/LS { newpath moveto } BD\n" - "/L { lineto } BD\n" - "/LE { lineto stroke } BD\n" - "/T { newpath moveto lineto lineto closepath fill } BD\n"); - - /* Smooth-shaded triangle with PostScript level 3 shfill operator: - x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 STshfill */ - - gl2psPrintf("/STshfill {\n" - " /b1 exch def /g1 exch def /r1 exch def /y1 exch def /x1 exch def\n" - " /b2 exch def /g2 exch def /r2 exch def /y2 exch def /x2 exch def\n" - " /b3 exch def /g3 exch def /r3 exch def /y3 exch def /x3 exch def\n" - " gsave << /ShadingType 4 /ColorSpace [/DeviceRGB]\n" - " /DataSource [ 0 x1 y1 r1 g1 b1 0 x2 y2 r2 g2 b2 0 x3 y3 r3 g3 b3 ] >>\n" - " shfill grestore } BD\n"); - - /* Flat-shaded triangle with middle color: - x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 Tm */ - - gl2psPrintf(/* stack : x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 */ - "/Tm { 3 -1 roll 8 -1 roll 13 -1 roll add add 3 div\n" /* r = (r1+r2+r3)/3 */ - /* stack : x3 y3 g3 b3 x2 y2 g2 b2 x1 y1 g1 b1 r */ - " 3 -1 roll 7 -1 roll 11 -1 roll add add 3 div\n" /* g = (g1+g2+g3)/3 */ - /* stack : x3 y3 b3 x2 y2 b2 x1 y1 b1 r g b */ - " 3 -1 roll 6 -1 roll 9 -1 roll add add 3 div" /* b = (b1+b2+b3)/3 */ - /* stack : x3 y3 x2 y2 x1 y1 r g b */ - " C T } BD\n"); - - /* Split triangle in four sub-triangles (at sides middle points) and call the - STnoshfill procedure on each, interpolating the colors in RGB space: - x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 STsplit - (in procedure comments key: (Vi) = xi yi ri gi bi) */ - - gl2psPrintf("/STsplit {\n" - " 4 index 15 index add 0.5 mul\n" /* x13 = (x1+x3)/2 */ - " 4 index 15 index add 0.5 mul\n" /* y13 = (y1+y3)/2 */ - " 4 index 15 index add 0.5 mul\n" /* r13 = (r1+r3)/2 */ - " 4 index 15 index add 0.5 mul\n" /* g13 = (g1+g3)/2 */ - " 4 index 15 index add 0.5 mul\n" /* b13 = (b1+b3)/2 */ - " 5 copy 5 copy 25 15 roll\n"); - - /* at his point, stack = (V3) (V13) (V13) (V13) (V2) (V1) */ - - gl2psPrintf(" 9 index 30 index add 0.5 mul\n" /* x23 = (x2+x3)/2 */ - " 9 index 30 index add 0.5 mul\n" /* y23 = (y2+y3)/2 */ - " 9 index 30 index add 0.5 mul\n" /* r23 = (r2+r3)/2 */ - " 9 index 30 index add 0.5 mul\n" /* g23 = (g2+g3)/2 */ - " 9 index 30 index add 0.5 mul\n" /* b23 = (b2+b3)/2 */ - " 5 copy 5 copy 35 5 roll 25 5 roll 15 5 roll\n"); - - /* stack = (V3) (V13) (V23) (V13) (V23) (V13) (V23) (V2) (V1) */ - - gl2psPrintf(" 4 index 10 index add 0.5 mul\n" /* x12 = (x1+x2)/2 */ - " 4 index 10 index add 0.5 mul\n" /* y12 = (y1+y2)/2 */ - " 4 index 10 index add 0.5 mul\n" /* r12 = (r1+r2)/2 */ - " 4 index 10 index add 0.5 mul\n" /* g12 = (g1+g2)/2 */ - " 4 index 10 index add 0.5 mul\n" /* b12 = (b1+b2)/2 */ - " 5 copy 5 copy 40 5 roll 25 5 roll 15 5 roll 25 5 roll\n"); - - /* stack = (V3) (V13) (V23) (V13) (V12) (V23) (V13) (V1) (V12) (V23) (V12) (V2) */ - - gl2psPrintf(" STnoshfill STnoshfill STnoshfill STnoshfill } BD\n"); - - /* Gouraud shaded triangle using recursive subdivision until the difference - between corner colors does not exceed the thresholds: - x3 y3 r3 g3 b3 x2 y2 r2 g2 b2 x1 y1 r1 g1 b1 STnoshfill */ - - gl2psPrintf("/STnoshfill {\n" - " 2 index 8 index sub abs rThreshold gt\n" /* |r1-r2|>rth */ - " { STsplit }\n" - " { 1 index 7 index sub abs gThreshold gt\n" /* |g1-g2|>gth */ - " { STsplit }\n" - " { dup 6 index sub abs bThreshold gt\n" /* |b1-b2|>bth */ - " { STsplit }\n" - " { 2 index 13 index sub abs rThreshold gt\n" /* |r1-r3|>rht */ - " { STsplit }\n" - " { 1 index 12 index sub abs gThreshold gt\n" /* |g1-g3|>gth */ - " { STsplit }\n" - " { dup 11 index sub abs bThreshold gt\n" /* |b1-b3|>bth */ - " { STsplit }\n" - " { 7 index 13 index sub abs rThreshold gt\n"); /* |r2-r3|>rht */ - gl2psPrintf(" { STsplit }\n" - " { 6 index 12 index sub abs gThreshold gt\n" /* |g2-g3|>gth */ - " { STsplit }\n" - " { 5 index 11 index sub abs bThreshold gt\n" /* |b2-b3|>bth */ - " { STsplit }\n" - " { Tm }\n" /* all colors sufficiently similar */ - " ifelse }\n" - " ifelse }\n" - " ifelse }\n" - " ifelse }\n" - " ifelse }\n" - " ifelse }\n" - " ifelse }\n" - " ifelse }\n" - " ifelse } BD\n"); - - gl2psPrintf("tryPS3shading\n" - "{ /shfill where\n" - " { /ST { STshfill } BD }\n" - " { /ST { STnoshfill } BD }\n" - " ifelse }\n" - "{ /ST { STnoshfill } BD }\n" - "ifelse\n"); - - gl2psPrintf("end\n" - "%%%%EndProlog\n" - "%%%%BeginSetup\n" - "/DeviceRGB setcolorspace\n" - "gl2psdict begin\n" - "%%%%EndSetup\n" - "%%%%Page: 1 1\n" - "%%%%BeginPageSetup\n"); - - if(gl2ps->options & GL2PS_LANDSCAPE){ - gl2psPrintf("%d 0 translate 90 rotate\n", - (int)gl2ps->viewport[3]); - } - - gl2psPrintf("%%%%EndPageSetup\n" - "mark\n" - "gsave\n" - "1.0 1.0 scale\n"); - - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - gl2psPrintf("%g %g %g C\n" - "newpath %d %d moveto %d %d lineto %d %d lineto %d %d lineto\n" - "closepath fill\n", - gl2ps->bgcolor[0], gl2ps->bgcolor[1], gl2ps->bgcolor[2], - (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], (int)gl2ps->viewport[2], - (int)gl2ps->viewport[1], (int)gl2ps->viewport[2], (int)gl2ps->viewport[3], - (int)gl2ps->viewport[0], (int)gl2ps->viewport[3]); - } -} - -static void gl2psPrintPostScriptColor(GL2PSrgba rgba) -{ - if(!gl2psSameColor(gl2ps->lastrgba, rgba)){ - gl2psSetLastColor(rgba); - gl2psPrintf("%g %g %g C\n", rgba[0], rgba[1], rgba[2]); - } -} - -static void gl2psResetPostScriptColor(void) -{ - gl2ps->lastrgba[0] = gl2ps->lastrgba[1] = gl2ps->lastrgba[2] = -1.; -} - -static void gl2psEndPostScriptLine(void) -{ - int i; - if(gl2ps->lastvertex.rgba[0] >= 0.){ - gl2psPrintf("%g %g LE\n", gl2ps->lastvertex.xyz[0], gl2ps->lastvertex.xyz[1]); - for(i = 0; i < 3; i++) - gl2ps->lastvertex.xyz[i] = -1.; - for(i = 0; i < 4; i++) - gl2ps->lastvertex.rgba[i] = -1.; - } -} - -static void gl2psParseStipplePattern(GLushort pattern, GLint factor, - int *nb, int array[10]) -{ - int i, n; - int on[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - int off[8] = {0, 0, 0, 0, 0, 0, 0, 0}; - char tmp[16]; - - /* extract the 16 bits from the OpenGL stipple pattern */ - for(n = 15; n >= 0; n--){ - tmp[n] = (char)(pattern & 0x01); - pattern >>= 1; - } - /* compute the on/off pixel sequence */ - n = 0; - for(i = 0; i < 8; i++){ - while(n < 16 && !tmp[n]){ off[i]++; n++; } - while(n < 16 && tmp[n]){ on[i]++; n++; } - if(n >= 15){ i++; break; } - } - - /* store the on/off array from right to left, starting with off - pixels. The PostScript specification allows for at most 11 - elements in the on/off array, so we limit ourselves to 5 on/off - couples (our longest possible array is thus [on4 off4 on3 off3 - on2 off2 on1 off1 on0 off0]) */ - *nb = 0; - for(n = i - 1; n >= 0; n--){ - array[(*nb)++] = factor * on[n]; - array[(*nb)++] = factor * off[n]; - if(*nb == 10) break; - } -} - -static int gl2psPrintPostScriptDash(GLushort pattern, GLint factor, const char *str) -{ - int len = 0, i, n, array[10]; - - if(pattern == gl2ps->lastpattern && factor == gl2ps->lastfactor) - return 0; - - gl2ps->lastpattern = pattern; - gl2ps->lastfactor = factor; - - if(!pattern || !factor){ - /* solid line */ - len += gl2psPrintf("[] 0 %s\n", str); - } - else{ - gl2psParseStipplePattern(pattern, factor, &n, array); - len += gl2psPrintf("["); - for(i = 0; i < n; i++){ - if(i) len += gl2psPrintf(" "); - len += gl2psPrintf("%d", array[i]); - } - len += gl2psPrintf("] 0 %s\n", str); - } - - return len; -} - -static void gl2psPrintPostScriptPrimitive(void *data) -{ - int newline; - GL2PSprimitive *prim; - - prim = *(GL2PSprimitive**)data; - - if((gl2ps->options & GL2PS_OCCLUSION_CULL) && prim->culled) return; - - /* Every effort is made to draw lines as connected segments (i.e., - using a single PostScript path): this is the only way to get nice - line joins and to not restart the stippling for every line - segment. So if the primitive to print is not a line we must first - finish the current line (if any): */ - if(prim->type != GL2PS_LINE) gl2psEndPostScriptLine(); - - switch(prim->type){ - case GL2PS_POINT : - gl2psPrintPostScriptColor(prim->verts[0].rgba); - gl2psPrintf("%g %g %g P\n", - prim->verts[0].xyz[0], prim->verts[0].xyz[1], 0.5 * prim->width); - break; - case GL2PS_LINE : - if(!gl2psSamePosition(gl2ps->lastvertex.xyz, prim->verts[0].xyz) || - !gl2psSameColor(gl2ps->lastrgba, prim->verts[0].rgba) || - gl2ps->lastlinewidth != prim->width || - gl2ps->lastpattern != prim->pattern || - gl2ps->lastfactor != prim->factor){ - /* End the current line if the new segment does not start where - the last one ended, or if the color, the width or the - stippling have changed (multi-stroking lines with changing - colors is necessary until we use /shfill for lines; - unfortunately this means that at the moment we can screw up - line stippling for smooth-shaded lines) */ - gl2psEndPostScriptLine(); - newline = 1; - } - else{ - newline = 0; - } - if(gl2ps->lastlinewidth != prim->width){ - gl2ps->lastlinewidth = prim->width; - gl2psPrintf("%g W\n", gl2ps->lastlinewidth); - } - gl2psPrintPostScriptDash(prim->pattern, prim->factor, "setdash"); - gl2psPrintPostScriptColor(prim->verts[0].rgba); - gl2psPrintf("%g %g %s\n", prim->verts[0].xyz[0], prim->verts[0].xyz[1], - newline ? "LS" : "L"); - gl2ps->lastvertex = prim->verts[1]; - break; - case GL2PS_TRIANGLE : - if(!gl2psVertsSameColor(prim)){ - gl2psResetPostScriptColor(); - gl2psPrintf("%g %g %g %g %g %g %g %g %g %g %g %g %g %g %g ST\n", - prim->verts[2].xyz[0], prim->verts[2].xyz[1], - prim->verts[2].rgba[0], prim->verts[2].rgba[1], - prim->verts[2].rgba[2], prim->verts[1].xyz[0], - prim->verts[1].xyz[1], prim->verts[1].rgba[0], - prim->verts[1].rgba[1], prim->verts[1].rgba[2], - prim->verts[0].xyz[0], prim->verts[0].xyz[1], - prim->verts[0].rgba[0], prim->verts[0].rgba[1], - prim->verts[0].rgba[2]); - } - else{ - gl2psPrintPostScriptColor(prim->verts[0].rgba); - gl2psPrintf("%g %g %g %g %g %g T\n", - prim->verts[2].xyz[0], prim->verts[2].xyz[1], - prim->verts[1].xyz[0], prim->verts[1].xyz[1], - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - } - break; - case GL2PS_QUADRANGLE : - gl2psMsg(GL2PS_WARNING, "There should not be any quad left to print"); - break; - case GL2PS_PIXMAP : - gl2psPrintPostScriptPixmap(prim->verts[0].xyz[0], prim->verts[0].xyz[1], - prim->data.image); - break; - case GL2PS_IMAGEMAP : - if(prim->data.image->type != GL2PS_IMAGEMAP_WRITTEN){ - gl2psPrintPostScriptColor(prim->verts[0].rgba); - gl2psPrintPostScriptImagemap(prim->data.image->pixels[0], - prim->data.image->pixels[1], - prim->data.image->width, prim->data.image->height, - (const unsigned char*)(&(prim->data.image->pixels[2]))); - prim->data.image->type = GL2PS_IMAGEMAP_WRITTEN; - } - break; - case GL2PS_TEXT : - gl2psPrintPostScriptColor(prim->verts[0].rgba); - gl2psPrintf("(%s) ", prim->data.text->str); - if(prim->data.text->angle) - gl2psPrintf("%g ", prim->data.text->angle); - gl2psPrintf("%g %g %d /%s ", - prim->verts[0].xyz[0], prim->verts[0].xyz[1], - prim->data.text->fontsize, prim->data.text->fontname); - switch(prim->data.text->alignment){ - case GL2PS_TEXT_C: - gl2psPrintf(prim->data.text->angle ? "SCCR\n" : "SCC\n"); - break; - case GL2PS_TEXT_CL: - gl2psPrintf(prim->data.text->angle ? "SCLR\n" : "SCL\n"); - break; - case GL2PS_TEXT_CR: - gl2psPrintf(prim->data.text->angle ? "SCRR\n" : "SCR\n"); - break; - case GL2PS_TEXT_B: - gl2psPrintf(prim->data.text->angle ? "SBCR\n" : "SBC\n"); - break; - case GL2PS_TEXT_BR: - gl2psPrintf(prim->data.text->angle ? "SBRR\n" : "SBR\n"); - break; - case GL2PS_TEXT_T: - gl2psPrintf(prim->data.text->angle ? "STCR\n" : "STC\n"); - break; - case GL2PS_TEXT_TL: - gl2psPrintf(prim->data.text->angle ? "STLR\n" : "STL\n"); - break; - case GL2PS_TEXT_TR: - gl2psPrintf(prim->data.text->angle ? "STRR\n" : "STR\n"); - break; - case GL2PS_TEXT_BL: - default: - gl2psPrintf(prim->data.text->angle ? "SR\n" : "S\n"); - break; - } - break; - case GL2PS_SPECIAL : - /* alignment contains the format for which the special output text - is intended */ - if(prim->data.text->alignment == GL2PS_PS || - prim->data.text->alignment == GL2PS_EPS) - gl2psPrintf("%s\n", prim->data.text->str); - break; - default : - break; - } -} - -static void gl2psPrintPostScriptFooter(void) -{ - gl2psPrintf("grestore\n" - "showpage\n" - "cleartomark\n" - "%%%%PageTrailer\n" - "%%%%Trailer\n" - "end\n" - "%%%%EOF\n"); - - gl2psPrintGzipFooter(); -} - -static void gl2psPrintPostScriptBeginViewport(GLint viewport[4]) -{ - GLint idx; - GLfloat rgba[4]; - int x = viewport[0], y = viewport[1], w = viewport[2], h = viewport[3]; - - glRenderMode(GL_FEEDBACK); - - if(gl2ps->header){ - gl2psPrintPostScriptHeader(); - gl2ps->header = GL_FALSE; - } - - gl2psPrintf("gsave\n" - "1.0 1.0 scale\n"); - - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - if(gl2ps->colormode == GL_RGBA || gl2ps->colorsize == 0){ - glGetFloatv(GL_COLOR_CLEAR_VALUE, rgba); - } - else{ - glGetIntegerv(GL_INDEX_CLEAR_VALUE, &idx); - rgba[0] = gl2ps->colormap[idx][0]; - rgba[1] = gl2ps->colormap[idx][1]; - rgba[2] = gl2ps->colormap[idx][2]; - rgba[3] = 1.0F; - } - gl2psPrintf("%g %g %g C\n" - "newpath %d %d moveto %d %d lineto %d %d lineto %d %d lineto\n" - "closepath fill\n", - rgba[0], rgba[1], rgba[2], - x, y, x+w, y, x+w, y+h, x, y+h); - } - - gl2psPrintf("newpath %d %d moveto %d %d lineto %d %d lineto %d %d lineto\n" - "closepath clip\n", - x, y, x+w, y, x+w, y+h, x, y+h); - -} - -static GLint gl2psPrintPostScriptEndViewport(void) -{ - GLint res; - - res = gl2psPrintPrimitives(); - gl2psPrintf("grestore\n"); - return res; -} - -static void gl2psPrintPostScriptFinalPrimitive(void) -{ - /* End any remaining line, if any */ - gl2psEndPostScriptLine(); -} - -/* definition of the PostScript and Encapsulated PostScript backends */ - -static GL2PSbackend gl2psPS = { - gl2psPrintPostScriptHeader, - gl2psPrintPostScriptFooter, - gl2psPrintPostScriptBeginViewport, - gl2psPrintPostScriptEndViewport, - gl2psPrintPostScriptPrimitive, - gl2psPrintPostScriptFinalPrimitive, - "ps", - "Postscript" -}; - -static GL2PSbackend gl2psEPS = { - gl2psPrintPostScriptHeader, - gl2psPrintPostScriptFooter, - gl2psPrintPostScriptBeginViewport, - gl2psPrintPostScriptEndViewport, - gl2psPrintPostScriptPrimitive, - gl2psPrintPostScriptFinalPrimitive, - "eps", - "Encapsulated Postscript" -}; - -/********************************************************************* - * - * LaTeX routines - * - *********************************************************************/ - -static void gl2psPrintTeXHeader(void) -{ - char name[256]; - time_t now; - int i; - - if(gl2ps->filename && strlen(gl2ps->filename) < 256){ - for(i = (int)strlen(gl2ps->filename) - 1; i >= 0; i--){ - if(gl2ps->filename[i] == '.'){ - strncpy(name, gl2ps->filename, i); - name[i] = '\0'; - break; - } - } - if(i <= 0) strcpy(name, gl2ps->filename); - } - else{ - strcpy(name, "untitled"); - } - - time(&now); - - fprintf(gl2ps->stream, - "%% Title: %s\n" - "%% Creator: GL2PS %d.%d.%d%s, %s\n" - "%% For: %s\n" - "%% CreationDate: %s", - gl2ps->title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, - GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, - gl2ps->producer, ctime(&now)); - - fprintf(gl2ps->stream, - "\\setlength{\\unitlength}{1pt}\n" - "\\begin{picture}(0,0)\n" - "\\includegraphics{%s}\n" - "\\end{picture}%%\n" - "%s\\begin{picture}(%d,%d)(0,0)\n", - name, (gl2ps->options & GL2PS_LANDSCAPE) ? "\\rotatebox{90}{" : "", - (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); -} - -static void gl2psPrintTeXPrimitive(void *data) -{ - GL2PSprimitive *prim; - - prim = *(GL2PSprimitive**)data; - - switch(prim->type){ - case GL2PS_TEXT : - fprintf(gl2ps->stream, "\\fontsize{%d}{0}\n\\selectfont", - prim->data.text->fontsize); - fprintf(gl2ps->stream, "\\put(%g,%g)", - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - if(prim->data.text->angle) - fprintf(gl2ps->stream, "{\\rotatebox{%g}", prim->data.text->angle); - fprintf(gl2ps->stream, "{\\makebox(0,0)"); - switch(prim->data.text->alignment){ - case GL2PS_TEXT_C: - fprintf(gl2ps->stream, "{"); - break; - case GL2PS_TEXT_CL: - fprintf(gl2ps->stream, "[l]{"); - break; - case GL2PS_TEXT_CR: - fprintf(gl2ps->stream, "[r]{"); - break; - case GL2PS_TEXT_B: - fprintf(gl2ps->stream, "[b]{"); - break; - case GL2PS_TEXT_BR: - fprintf(gl2ps->stream, "[br]{"); - break; - case GL2PS_TEXT_T: - fprintf(gl2ps->stream, "[t]{"); - break; - case GL2PS_TEXT_TL: - fprintf(gl2ps->stream, "[tl]{"); - break; - case GL2PS_TEXT_TR: - fprintf(gl2ps->stream, "[tr]{"); - break; - case GL2PS_TEXT_BL: - default: - fprintf(gl2ps->stream, "[bl]{"); - break; - } - fprintf(gl2ps->stream, "\\textcolor[rgb]{%g,%g,%g}{{%s}}", - prim->verts[0].rgba[0], prim->verts[0].rgba[1], prim->verts[0].rgba[2], - prim->data.text->str); - if(prim->data.text->angle) - fprintf(gl2ps->stream, "}"); - fprintf(gl2ps->stream, "}}\n"); - break; - case GL2PS_SPECIAL : - /* alignment contains the format for which the special output text - is intended */ - if (prim->data.text->alignment == GL2PS_TEX) - fprintf(gl2ps->stream, "%s\n", prim->data.text->str); - break; - default : - break; - } -} - -static void gl2psPrintTeXFooter(void) -{ - fprintf(gl2ps->stream, "\\end{picture}%s\n", - (gl2ps->options & GL2PS_LANDSCAPE) ? "}" : ""); -} - -static void gl2psPrintTeXBeginViewport(GLint viewport[4]) -{ - (void) viewport; /* not used */ - glRenderMode(GL_FEEDBACK); - - if(gl2ps->header){ - gl2psPrintTeXHeader(); - gl2ps->header = GL_FALSE; - } -} - -static GLint gl2psPrintTeXEndViewport(void) -{ - return gl2psPrintPrimitives(); -} - -static void gl2psPrintTeXFinalPrimitive(void) -{ -} - -/* definition of the LaTeX backend */ - -static GL2PSbackend gl2psTEX = { - gl2psPrintTeXHeader, - gl2psPrintTeXFooter, - gl2psPrintTeXBeginViewport, - gl2psPrintTeXEndViewport, - gl2psPrintTeXPrimitive, - gl2psPrintTeXFinalPrimitive, - "tex", - "LaTeX text" -}; - -/********************************************************************* - * - * PDF routines - * - *********************************************************************/ - -static int gl2psPrintPDFCompressorType(void) -{ -#if defined(GL2PS_HAVE_ZLIB) - if(gl2ps->options & GL2PS_COMPRESS){ - return fprintf(gl2ps->stream, "/Filter [/FlateDecode]\n"); - } -#endif - return 0; -} - -static int gl2psPrintPDFStrokeColor(GL2PSrgba rgba) -{ - int i, offs = 0; - - gl2psSetLastColor(rgba); - for(i = 0; i < 3; ++i){ - if(GL2PS_ZERO(rgba[i])) - offs += gl2psPrintf("%.0f ", 0.); - else if(rgba[i] < 1e-4 || rgba[i] > 1e6) /* avoid %e formatting */ - offs += gl2psPrintf("%f ", rgba[i]); - else - offs += gl2psPrintf("%g ", rgba[i]); - } - offs += gl2psPrintf("RG\n"); - return offs; -} - -static int gl2psPrintPDFFillColor(GL2PSrgba rgba) -{ - int i, offs = 0; - - for(i = 0; i < 3; ++i){ - if(GL2PS_ZERO(rgba[i])) - offs += gl2psPrintf("%.0f ", 0.); - else if(rgba[i] < 1e-4 || rgba[i] > 1e6) /* avoid %e formatting */ - offs += gl2psPrintf("%f ", rgba[i]); - else - offs += gl2psPrintf("%g ", rgba[i]); - } - offs += gl2psPrintf("rg\n"); - return offs; -} - -static int gl2psPrintPDFLineWidth(GLfloat lw) -{ - if(GL2PS_ZERO(lw)) - return gl2psPrintf("%.0f w\n", 0.); - else if(lw < 1e-4 || lw > 1e6) /* avoid %e formatting */ - return gl2psPrintf("%f w\n", lw); - else - return gl2psPrintf("%g w\n", lw); -} - -static void gl2psPutPDFText(GL2PSstring *text, int cnt, GLfloat x, GLfloat y) -{ - GLfloat rad, crad, srad; - - if(text->angle == 0.0F){ - gl2ps->streamlength += gl2psPrintf - ("BT\n" - "/F%d %d Tf\n" - "%f %f Td\n" - "(%s) Tj\n" - "ET\n", - cnt, text->fontsize, x, y, text->str); - } - else{ - rad = (GLfloat)(3.141593F * text->angle / 180.0F); - srad = (GLfloat)sin(rad); - crad = (GLfloat)cos(rad); - gl2ps->streamlength += gl2psPrintf - ("BT\n" - "/F%d %d Tf\n" - "%f %f %f %f %f %f Tm\n" - "(%s) Tj\n" - "ET\n", - cnt, text->fontsize, crad, srad, -srad, crad, x, y, text->str); - } -} - -static void gl2psPutPDFSpecial(GL2PSstring *text) -{ - gl2ps->streamlength += gl2psPrintf("%s\n", text->str); -} - -static void gl2psPutPDFImage(GL2PSimage *image, int cnt, GLfloat x, GLfloat y) -{ - gl2ps->streamlength += gl2psPrintf - ("q\n" - "%d 0 0 %d %f %f cm\n" - "/Im%d Do\n" - "Q\n", - (int)image->width, (int)image->height, x, y, cnt); -} - -static void gl2psPDFstacksInit(void) -{ - gl2ps->objects_stack = 7 /* FIXED_XREF_ENTRIES */ + 1; - gl2ps->extgs_stack = 0; - gl2ps->font_stack = 0; - gl2ps->im_stack = 0; - gl2ps->trgroupobjects_stack = 0; - gl2ps->shader_stack = 0; - gl2ps->mshader_stack = 0; -} - -static void gl2psPDFgroupObjectInit(GL2PSpdfgroup *gro) -{ - if(!gro) - return; - - gro->ptrlist = NULL; - gro->fontno = gro->gsno = gro->imno = gro->maskshno = gro->shno - = gro->trgroupno = gro->fontobjno = gro->imobjno = gro->shobjno - = gro->maskshobjno = gro->gsobjno = gro->trgroupobjno = -1; -} - -/* Build up group objects and assign name and object numbers */ - -static void gl2psPDFgroupListInit(void) -{ - int i; - GL2PSprimitive *p = NULL; - GL2PSpdfgroup gro; - int lasttype = GL2PS_NO_TYPE; - GL2PSrgba lastrgba = {-1.0F, -1.0F, -1.0F, -1.0F}; - GLushort lastpattern = 0; - GLint lastfactor = 0; - GLfloat lastwidth = 1; - GL2PStriangle lastt, tmpt; - int lastTriangleWasNotSimpleWithSameColor = 0; - - if(!gl2ps->pdfprimlist) - return; - - gl2ps->pdfgrouplist = gl2psListCreate(500, 500, sizeof(GL2PSpdfgroup)); - gl2psInitTriangle(&lastt); - - for(i = 0; i < gl2psListNbr(gl2ps->pdfprimlist); ++i){ - p = *(GL2PSprimitive**)gl2psListPointer(gl2ps->pdfprimlist, i); - switch(p->type){ - case GL2PS_PIXMAP: - gl2psPDFgroupObjectInit(&gro); - gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - gro.imno = gl2ps->im_stack++; - gl2psListAdd(gro.ptrlist, &p); - gl2psListAdd(gl2ps->pdfgrouplist, &gro); - break; - case GL2PS_TEXT: - gl2psPDFgroupObjectInit(&gro); - gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - gro.fontno = gl2ps->font_stack++; - gl2psListAdd(gro.ptrlist, &p); - gl2psListAdd(gl2ps->pdfgrouplist, &gro); - break; - case GL2PS_LINE: - if(lasttype != p->type || lastwidth != p->width || - lastpattern != p->pattern || lastfactor != p->factor || - !gl2psSameColor(p->verts[0].rgba, lastrgba)){ - gl2psPDFgroupObjectInit(&gro); - gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - gl2psListAdd(gro.ptrlist, &p); - gl2psListAdd(gl2ps->pdfgrouplist, &gro); - } - else{ - gl2psListAdd(gro.ptrlist, &p); - } - lastpattern = p->pattern; - lastfactor = p->factor; - lastwidth = p->width; - lastrgba[0] = p->verts[0].rgba[0]; - lastrgba[1] = p->verts[0].rgba[1]; - lastrgba[2] = p->verts[0].rgba[2]; - break; - case GL2PS_POINT: - if(lasttype != p->type || lastwidth != p->width || - !gl2psSameColor(p->verts[0].rgba, lastrgba)){ - gl2psPDFgroupObjectInit(&gro); - gro.ptrlist = gl2psListCreate(1,2,sizeof(GL2PSprimitive*)); - gl2psListAdd(gro.ptrlist, &p); - gl2psListAdd(gl2ps->pdfgrouplist, &gro); - } - else{ - gl2psListAdd(gro.ptrlist, &p); - } - lastwidth = p->width; - lastrgba[0] = p->verts[0].rgba[0]; - lastrgba[1] = p->verts[0].rgba[1]; - lastrgba[2] = p->verts[0].rgba[2]; - break; - case GL2PS_TRIANGLE: - gl2psFillTriangleFromPrimitive(&tmpt, p, GL_TRUE); - lastTriangleWasNotSimpleWithSameColor = - !(tmpt.prop & T_CONST_COLOR && tmpt.prop & T_ALPHA_1) || - !gl2psSameColor(tmpt.vertex[0].rgba, lastt.vertex[0].rgba); - if(lasttype == p->type && tmpt.prop == lastt.prop && - lastTriangleWasNotSimpleWithSameColor){ - /* TODO Check here for last alpha */ - gl2psListAdd(gro.ptrlist, &p); - } - else{ - gl2psPDFgroupObjectInit(&gro); - gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - gl2psListAdd(gro.ptrlist, &p); - gl2psListAdd(gl2ps->pdfgrouplist, &gro); - } - lastt = tmpt; - break; - case GL2PS_SPECIAL: - gl2psPDFgroupObjectInit(&gro); - gro.ptrlist = gl2psListCreate(1, 2, sizeof(GL2PSprimitive*)); - gl2psListAdd(gro.ptrlist, &p); - gl2psListAdd(gl2ps->pdfgrouplist, &gro); - break; - default: - break; - } - lasttype = p->type; - } -} - -static void gl2psSortOutTrianglePDFgroup(GL2PSpdfgroup *gro) -{ - GL2PStriangle t; - GL2PSprimitive *prim = NULL; - - if(!gro) - return; - - if(!gl2psListNbr(gro->ptrlist)) - return; - - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, 0); - - if(prim->type != GL2PS_TRIANGLE) - return; - - gl2psFillTriangleFromPrimitive(&t, prim, GL_TRUE); - - if(t.prop & T_CONST_COLOR && t.prop & T_ALPHA_LESS_1){ - gro->gsno = gl2ps->extgs_stack++; - gro->gsobjno = gl2ps->objects_stack ++; - } - else if(t.prop & T_CONST_COLOR && t.prop & T_VAR_ALPHA){ - gro->gsno = gl2ps->extgs_stack++; - gro->gsobjno = gl2ps->objects_stack++; - gro->trgroupno = gl2ps->trgroupobjects_stack++; - gro->trgroupobjno = gl2ps->objects_stack++; - gro->maskshno = gl2ps->mshader_stack++; - gro->maskshobjno = gl2ps->objects_stack++; - } - else if(t.prop & T_VAR_COLOR && t.prop & T_ALPHA_1){ - gro->shno = gl2ps->shader_stack++; - gro->shobjno = gl2ps->objects_stack++; - } - else if(t.prop & T_VAR_COLOR && t.prop & T_ALPHA_LESS_1){ - gro->gsno = gl2ps->extgs_stack++; - gro->gsobjno = gl2ps->objects_stack++; - gro->shno = gl2ps->shader_stack++; - gro->shobjno = gl2ps->objects_stack++; - } - else if(t.prop & T_VAR_COLOR && t.prop & T_VAR_ALPHA){ - gro->gsno = gl2ps->extgs_stack++; - gro->gsobjno = gl2ps->objects_stack++; - gro->shno = gl2ps->shader_stack++; - gro->shobjno = gl2ps->objects_stack++; - gro->trgroupno = gl2ps->trgroupobjects_stack++; - gro->trgroupobjno = gl2ps->objects_stack++; - gro->maskshno = gl2ps->mshader_stack++; - gro->maskshobjno = gl2ps->objects_stack++; - } -} - -/* Main stream data */ - -static void gl2psPDFgroupListWriteMainStream(void) -{ - int i, j, lastel; - GL2PSprimitive *prim = NULL, *prev = NULL; - GL2PSpdfgroup *gro; - GL2PStriangle t; - - if(!gl2ps->pdfgrouplist) - return; - - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); - - lastel = gl2psListNbr(gro->ptrlist) - 1; - if(lastel < 0) - continue; - - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, 0); - - switch(prim->type){ - case GL2PS_POINT: - gl2ps->streamlength += gl2psPrintf("1 J\n"); - gl2ps->streamlength += gl2psPrintPDFLineWidth(prim->width); - gl2ps->streamlength += gl2psPrintPDFStrokeColor(prim->verts[0].rgba); - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2ps->streamlength += - gl2psPrintf("%f %f m %f %f l\n", - prim->verts[0].xyz[0], prim->verts[0].xyz[1], - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - } - gl2ps->streamlength += gl2psPrintf("S\n"); - gl2ps->streamlength += gl2psPrintf("0 J\n"); - break; - case GL2PS_LINE: - /* We try to use as few paths as possible to draw lines, in - order to get nice stippling even when the individual segments - are smaller than the stipple */ - gl2ps->streamlength += gl2psPrintPDFLineWidth(prim->width); - gl2ps->streamlength += gl2psPrintPDFStrokeColor(prim->verts[0].rgba); - gl2ps->streamlength += gl2psPrintPostScriptDash(prim->pattern, prim->factor, "d"); - /* start new path */ - gl2ps->streamlength += - gl2psPrintf("%f %f m\n", - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - - for(j = 1; j <= lastel; ++j){ - prev = prim; - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - if(!gl2psSamePosition(prim->verts[0].xyz, prev->verts[1].xyz)){ - /* the starting point of the new segment does not match the - end point of the previous line, so we end the current - path and start a new one */ - gl2ps->streamlength += - gl2psPrintf("%f %f l\n", - prev->verts[1].xyz[0], prev->verts[1].xyz[1]); - gl2ps->streamlength += - gl2psPrintf("%f %f m\n", - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - } - else{ - /* the two segements are connected, so we just append to the - current path */ - gl2ps->streamlength += - gl2psPrintf("%f %f l\n", - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - } - } - /* end last path */ - gl2ps->streamlength += - gl2psPrintf("%f %f l\n", - prim->verts[1].xyz[0], prim->verts[1].xyz[1]); - gl2ps->streamlength += gl2psPrintf("S\n"); - break; - case GL2PS_TRIANGLE: - gl2psFillTriangleFromPrimitive(&t, prim, GL_TRUE); - gl2psSortOutTrianglePDFgroup(gro); - - /* No alpha and const color: Simple PDF draw orders */ - if(t.prop & T_CONST_COLOR && t.prop & T_ALPHA_1){ - gl2ps->streamlength += gl2psPrintPDFFillColor(t.vertex[0].rgba); - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2psFillTriangleFromPrimitive(&t, prim, GL_FALSE); - gl2ps->streamlength - += gl2psPrintf("%f %f m\n" - "%f %f l\n" - "%f %f l\n" - "h f\n", - t.vertex[0].xyz[0], t.vertex[0].xyz[1], - t.vertex[1].xyz[0], t.vertex[1].xyz[1], - t.vertex[2].xyz[0], t.vertex[2].xyz[1]); - } - } - /* Const alpha < 1 and const color: Simple PDF draw orders - and an extra extended Graphics State for the alpha const */ - else if(t.prop & T_CONST_COLOR && t.prop & T_ALPHA_LESS_1){ - gl2ps->streamlength += gl2psPrintf("q\n" - "/GS%d gs\n", - gro->gsno); - gl2ps->streamlength += gl2psPrintPDFFillColor(prim->verts[0].rgba); - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2psFillTriangleFromPrimitive(&t, prim, GL_FALSE); - gl2ps->streamlength - += gl2psPrintf("%f %f m\n" - "%f %f l\n" - "%f %f l\n" - "h f\n", - t.vertex[0].xyz[0], t.vertex[0].xyz[1], - t.vertex[1].xyz[0], t.vertex[1].xyz[1], - t.vertex[2].xyz[0], t.vertex[2].xyz[1]); - } - gl2ps->streamlength += gl2psPrintf("Q\n"); - } - /* Variable alpha and const color: Simple PDF draw orders - and an extra extended Graphics State + Xobject + Shader - object for the alpha mask */ - else if(t.prop & T_CONST_COLOR && t.prop & T_VAR_ALPHA){ - gl2ps->streamlength += gl2psPrintf("q\n" - "/GS%d gs\n" - "/TrG%d Do\n", - gro->gsno, gro->trgroupno); - gl2ps->streamlength += gl2psPrintPDFFillColor(prim->verts[0].rgba); - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2psFillTriangleFromPrimitive(&t, prim, GL_FALSE); - gl2ps->streamlength - += gl2psPrintf("%f %f m\n" - "%f %f l\n" - "%f %f l\n" - "h f\n", - t.vertex[0].xyz[0], t.vertex[0].xyz[1], - t.vertex[1].xyz[0], t.vertex[1].xyz[1], - t.vertex[2].xyz[0], t.vertex[2].xyz[1]); - } - gl2ps->streamlength += gl2psPrintf("Q\n"); - } - /* Variable color and no alpha: Shader Object for the colored - triangle(s) */ - else if(t.prop & T_VAR_COLOR && t.prop & T_ALPHA_1){ - gl2ps->streamlength += gl2psPrintf("/Sh%d sh\n", gro->shno); - } - /* Variable color and const alpha < 1: Shader Object for the - colored triangle(s) and an extra extended Graphics State - for the alpha const */ - else if(t.prop & T_VAR_COLOR && t.prop & T_ALPHA_LESS_1){ - gl2ps->streamlength += gl2psPrintf("q\n" - "/GS%d gs\n" - "/Sh%d sh\n" - "Q\n", - gro->gsno, gro->shno); - } - /* Variable alpha and color: Shader Object for the colored - triangle(s) and an extra extended Graphics State - + Xobject + Shader object for the alpha mask */ - else if(t.prop & T_VAR_COLOR && t.prop & T_VAR_ALPHA){ - gl2ps->streamlength += gl2psPrintf("q\n" - "/GS%d gs\n" - "/TrG%d Do\n" - "/Sh%d sh\n" - "Q\n", - gro->gsno, gro->trgroupno, gro->shno); - } - break; - case GL2PS_PIXMAP: - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2psPutPDFImage(prim->data.image, gro->imno, prim->verts[0].xyz[0], - prim->verts[0].xyz[1]); - } - break; - case GL2PS_TEXT: - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2ps->streamlength += gl2psPrintPDFFillColor(prim->verts[0].rgba); - gl2psPutPDFText(prim->data.text, gro->fontno, prim->verts[0].xyz[0], - prim->verts[0].xyz[1]); - } - break; - case GL2PS_SPECIAL: - for(j = 0; j <= lastel; ++j){ - prim = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2psPutPDFSpecial(prim->data.text); - } - default: - break; - } - } -} - -/* Graphics State names */ - -static int gl2psPDFgroupListWriteGStateResources(void) -{ - GL2PSpdfgroup *gro; - int offs = 0; - int i; - - offs += fprintf(gl2ps->stream, - "/ExtGState\n" - "<<\n" - "/GSa 7 0 R\n"); - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); - if(gro->gsno >= 0) - offs += fprintf(gl2ps->stream, "/GS%d %d 0 R\n", gro->gsno, gro->gsobjno); - } - offs += fprintf(gl2ps->stream, ">>\n"); - return offs; -} - -/* Main Shader names */ - -static int gl2psPDFgroupListWriteShaderResources(void) -{ - GL2PSpdfgroup *gro; - int offs = 0; - int i; - - offs += fprintf(gl2ps->stream, - "/Shading\n" - "<<\n"); - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); - if(gro->shno >= 0) - offs += fprintf(gl2ps->stream, "/Sh%d %d 0 R\n", gro->shno, gro->shobjno); - if(gro->maskshno >= 0) - offs += fprintf(gl2ps->stream, "/TrSh%d %d 0 R\n", gro->maskshno, gro->maskshobjno); - } - offs += fprintf(gl2ps->stream,">>\n"); - return offs; -} - -/* Images & Mask Shader XObject names */ - -static int gl2psPDFgroupListWriteXObjectResources(void) -{ - int i; - GL2PSprimitive *p = NULL; - GL2PSpdfgroup *gro; - int offs = 0; - - offs += fprintf(gl2ps->stream, - "/XObject\n" - "<<\n"); - - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); - if(!gl2psListNbr(gro->ptrlist)) - continue; - p = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, 0); - switch(p->type){ - case GL2PS_PIXMAP: - gro->imobjno = gl2ps->objects_stack++; - if(GL_RGBA == p->data.image->format) /* reserve one object for image mask */ - gl2ps->objects_stack++; - offs += fprintf(gl2ps->stream, "/Im%d %d 0 R\n", gro->imno, gro->imobjno); - case GL2PS_TRIANGLE: - if(gro->trgroupno >=0) - offs += fprintf(gl2ps->stream, "/TrG%d %d 0 R\n", gro->trgroupno, gro->trgroupobjno); - break; - default: - break; - } - } - offs += fprintf(gl2ps->stream,">>\n"); - return offs; -} - -/* Font names */ - -static int gl2psPDFgroupListWriteFontResources(void) -{ - int i; - GL2PSpdfgroup *gro; - int offs = 0; - - offs += fprintf(gl2ps->stream, "/Font\n<<\n"); - - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); - if(gro->fontno < 0) - continue; - gro->fontobjno = gl2ps->objects_stack++; - offs += fprintf(gl2ps->stream, "/F%d %d 0 R\n", gro->fontno, gro->fontobjno); - } - offs += fprintf(gl2ps->stream, ">>\n"); - - return offs; -} - -static void gl2psPDFgroupListDelete(void) -{ - int i; - GL2PSpdfgroup *gro = NULL; - - if(!gl2ps->pdfgrouplist) - return; - - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist,i); - gl2psListDelete(gro->ptrlist); - } - - gl2psListDelete(gl2ps->pdfgrouplist); - gl2ps->pdfgrouplist = NULL; -} - -/* Print 1st PDF object - file info */ - -static int gl2psPrintPDFInfo(void) -{ - int offs; - time_t now; - struct tm *newtime; - - time(&now); - newtime = gmtime(&now); - - offs = fprintf(gl2ps->stream, - "1 0 obj\n" - "<<\n" - "/Title (%s)\n" - "/Creator (GL2PS %d.%d.%d%s, %s)\n" - "/Producer (%s)\n", - gl2ps->title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, - GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, - gl2ps->producer); - - if(!newtime){ - offs += fprintf(gl2ps->stream, - ">>\n" - "endobj\n"); - return offs; - } - - offs += fprintf(gl2ps->stream, - "/CreationDate (D:%d%02d%02d%02d%02d%02d)\n" - ">>\n" - "endobj\n", - newtime->tm_year+1900, - newtime->tm_mon+1, - newtime->tm_mday, - newtime->tm_hour, - newtime->tm_min, - newtime->tm_sec); - return offs; -} - -/* Create catalog and page structure - 2nd and 3th PDF object */ - -static int gl2psPrintPDFCatalog(void) -{ - return fprintf(gl2ps->stream, - "2 0 obj\n" - "<<\n" - "/Type /Catalog\n" - "/Pages 3 0 R\n" - ">>\n" - "endobj\n"); -} - -static int gl2psPrintPDFPages(void) -{ - return fprintf(gl2ps->stream, - "3 0 obj\n" - "<<\n" - "/Type /Pages\n" - "/Kids [6 0 R]\n" - "/Count 1\n" - ">>\n" - "endobj\n"); -} - -/* Open stream for data - graphical objects, fonts etc. PDF object 4 */ - -static int gl2psOpenPDFDataStream(void) -{ - int offs = 0; - - offs += fprintf(gl2ps->stream, - "4 0 obj\n" - "<<\n" - "/Length 5 0 R\n" ); - offs += gl2psPrintPDFCompressorType(); - offs += fprintf(gl2ps->stream, - ">>\n" - "stream\n"); - return offs; -} - -/* Stream setup - Graphics state, fill background if allowed */ - -static int gl2psOpenPDFDataStreamWritePreface(void) -{ - int offs; - - offs = gl2psPrintf("/GSa gs\n"); - - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - offs += gl2psPrintPDFFillColor(gl2ps->bgcolor); - offs += gl2psPrintf("%d %d %d %d re\n", - (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], - (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); - offs += gl2psPrintf("f\n"); - } - return offs; -} - -/* Use the functions above to create the first part of the PDF*/ - -static void gl2psPrintPDFHeader(void) -{ - int offs = 0; - gl2ps->pdfprimlist = gl2psListCreate(500, 500, sizeof(GL2PSprimitive*)); - gl2psPDFstacksInit(); - - gl2ps->xreflist = (int*)gl2psMalloc(sizeof(int) * gl2ps->objects_stack); - -#if defined(GL2PS_HAVE_ZLIB) - if(gl2ps->options & GL2PS_COMPRESS){ - gl2psSetupCompress(); - } -#endif - gl2ps->xreflist[0] = 0; - offs += fprintf(gl2ps->stream, "%%PDF-1.4\n"); - gl2ps->xreflist[1] = offs; - - offs += gl2psPrintPDFInfo(); - gl2ps->xreflist[2] = offs; - - offs += gl2psPrintPDFCatalog(); - gl2ps->xreflist[3] = offs; - - offs += gl2psPrintPDFPages(); - gl2ps->xreflist[4] = offs; - - offs += gl2psOpenPDFDataStream(); - gl2ps->xreflist[5] = offs; /* finished in gl2psPrintPDFFooter */ - gl2ps->streamlength = gl2psOpenPDFDataStreamWritePreface(); -} - -/* The central primitive drawing */ - -static void gl2psPrintPDFPrimitive(void *data) -{ - GL2PSprimitive *prim = *(GL2PSprimitive**)data; - - if((gl2ps->options & GL2PS_OCCLUSION_CULL) && prim->culled) - return; - - prim = gl2psCopyPrimitive(prim); /* deep copy */ - gl2psListAdd(gl2ps->pdfprimlist, &prim); -} - -/* close stream and ... */ - -static int gl2psClosePDFDataStream(void) -{ - int offs = 0; - -#if defined(GL2PS_HAVE_ZLIB) - if(gl2ps->options & GL2PS_COMPRESS){ - if(Z_OK != gl2psDeflate()) - gl2psMsg(GL2PS_ERROR, "Zlib deflate error"); - else - fwrite(gl2ps->compress->dest, gl2ps->compress->destLen, 1, gl2ps->stream); - gl2ps->streamlength += gl2ps->compress->destLen; - - offs += gl2ps->streamlength; - gl2psFreeCompress(); - } -#endif - - offs += fprintf(gl2ps->stream, - "endstream\n" - "endobj\n"); - return offs; -} - -/* ... write the now known length object */ - -static int gl2psPrintPDFDataStreamLength(int val) -{ - return fprintf(gl2ps->stream, - "5 0 obj\n" - "%d\n" - "endobj\n", val); -} - -/* Put the info created before in PDF objects */ - -static int gl2psPrintPDFOpenPage(void) -{ - int offs; - - /* Write fixed part */ - - offs = fprintf(gl2ps->stream, - "6 0 obj\n" - "<<\n" - "/Type /Page\n" - "/Parent 3 0 R\n" - "/MediaBox [%d %d %d %d]\n", - (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], - (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); - - if(gl2ps->options & GL2PS_LANDSCAPE) - offs += fprintf(gl2ps->stream, "/Rotate -90\n"); - - offs += fprintf(gl2ps->stream, - "/Contents 4 0 R\n" - "/Resources\n" - "<<\n" - "/ProcSet [/PDF /Text /ImageB /ImageC] %%/ImageI\n"); - - return offs; - - /* End fixed part, proceeds in gl2psPDFgroupListWriteVariableResources() */ -} - -static int gl2psPDFgroupListWriteVariableResources(void) -{ - int offs = 0; - - /* a) Graphics States for shader alpha masks*/ - offs += gl2psPDFgroupListWriteGStateResources(); - - /* b) Shader and shader masks */ - offs += gl2psPDFgroupListWriteShaderResources(); - - /* c) XObjects (Images & Shader Masks) */ - offs += gl2psPDFgroupListWriteXObjectResources(); - - /* d) Fonts */ - offs += gl2psPDFgroupListWriteFontResources(); - - /* End resources and page */ - offs += fprintf(gl2ps->stream, - ">>\n" - ">>\n" - "endobj\n"); - return offs; -} - -/* Standard Graphics State */ - -static int gl2psPrintPDFGSObject(void) -{ - return fprintf(gl2ps->stream, - "7 0 obj\n" - "<<\n" - "/Type /ExtGState\n" - "/SA false\n" - "/SM 0.02\n" - "/OP false\n" - "/op false\n" - "/OPM 0\n" - "/BG2 /Default\n" - "/UCR2 /Default\n" - "/TR2 /Default\n" - ">>\n" - "endobj\n"); -} - -/* Put vertex' edge flag (8bit) and coordinates (32bit) in shader stream */ - -static int gl2psPrintPDFShaderStreamDataCoord(GL2PSvertex *vertex, - int (*action)(unsigned long data, int size), - GLfloat dx, GLfloat dy, - GLfloat xmin, GLfloat ymin) -{ - int offs = 0; - unsigned long imap; - GLfloat diff; - double dmax = ~1UL; - char edgeflag = 0; - - /* FIXME: temp bux fix for 64 bit archs: */ - if(sizeof(unsigned long) == 8) dmax = dmax - 2048.; - - offs += (*action)(edgeflag, 1); - - /* The Shader stream in PDF requires to be in a 'big-endian' - order */ - - if(GL2PS_ZERO(dx * dy)){ - offs += (*action)(0, 4); - offs += (*action)(0, 4); - } - else{ - diff = (vertex->xyz[0] - xmin) / dx; - if(diff > 1) - diff = 1.0F; - else if(diff < 0) - diff = 0.0F; - imap = (unsigned long)(diff * dmax); - offs += (*action)(imap, 4); - - diff = (vertex->xyz[1] - ymin) / dy; - if(diff > 1) - diff = 1.0F; - else if(diff < 0) - diff = 0.0F; - imap = (unsigned long)(diff * dmax); - offs += (*action)(imap, 4); - } - - return offs; -} - -/* Put vertex' rgb value (8bit for every component) in shader stream */ - -static int gl2psPrintPDFShaderStreamDataRGB(GL2PSvertex *vertex, - int (*action)(unsigned long data, int size)) -{ - int offs = 0; - unsigned long imap; - double dmax = ~1UL; - - /* FIXME: temp bux fix for 64 bit archs: */ - if(sizeof(unsigned long) == 8) dmax = dmax - 2048.; - - imap = (unsigned long)((vertex->rgba[0]) * dmax); - offs += (*action)(imap, 1); - - imap = (unsigned long)((vertex->rgba[1]) * dmax); - offs += (*action)(imap, 1); - - imap = (unsigned long)((vertex->rgba[2]) * dmax); - offs += (*action)(imap, 1); - - return offs; -} - -/* Put vertex' alpha (8/16bit) in shader stream */ - -static int gl2psPrintPDFShaderStreamDataAlpha(GL2PSvertex *vertex, - int (*action)(unsigned long data, int size), - int sigbyte) -{ - int offs = 0; - unsigned long imap; - double dmax = ~1UL; - - /* FIXME: temp bux fix for 64 bit archs: */ - if(sizeof(unsigned long) == 8) dmax = dmax - 2048.; - - if(sigbyte != 8 && sigbyte != 16) - sigbyte = 8; - - sigbyte /= 8; - - imap = (unsigned long)((vertex->rgba[3]) * dmax); - - offs += (*action)(imap, sigbyte); - - return offs; -} - -/* Put a triangles raw data in shader stream */ - -static int gl2psPrintPDFShaderStreamData(GL2PStriangle *triangle, - GLfloat dx, GLfloat dy, - GLfloat xmin, GLfloat ymin, - int (*action)(unsigned long data, int size), - int gray) -{ - int i, offs = 0; - GL2PSvertex v; - - if(gray && gray != 8 && gray != 16) - gray = 8; - - for(i = 0; i < 3; ++i){ - offs += gl2psPrintPDFShaderStreamDataCoord(&triangle->vertex[i], action, - dx, dy, xmin, ymin); - if(gray){ - v = triangle->vertex[i]; - offs += gl2psPrintPDFShaderStreamDataAlpha(&v, action, gray); - } - else{ - offs += gl2psPrintPDFShaderStreamDataRGB(&triangle->vertex[i], action); - } - } - - return offs; -} - -static void gl2psPDFRectHull(GLfloat *xmin, GLfloat *xmax, - GLfloat *ymin, GLfloat *ymax, - GL2PStriangle *triangles, int cnt) -{ - int i, j; - - *xmin = triangles[0].vertex[0].xyz[0]; - *xmax = triangles[0].vertex[0].xyz[0]; - *ymin = triangles[0].vertex[0].xyz[1]; - *ymax = triangles[0].vertex[0].xyz[1]; - - for(i = 0; i < cnt; ++i){ - for(j = 0; j < 3; ++j){ - if(*xmin > triangles[i].vertex[j].xyz[0]) - *xmin = triangles[i].vertex[j].xyz[0]; - if(*xmax < triangles[i].vertex[j].xyz[0]) - *xmax = triangles[i].vertex[j].xyz[0]; - if(*ymin > triangles[i].vertex[j].xyz[1]) - *ymin = triangles[i].vertex[j].xyz[1]; - if(*ymax < triangles[i].vertex[j].xyz[1]) - *ymax = triangles[i].vertex[j].xyz[1]; - } - } -} - -/* Writes shaded triangle - gray == 0 means write RGB triangles - gray == 8 8bit-grayscale (for alpha masks) - gray == 16 16bit-grayscale (for alpha masks) */ - -static int gl2psPrintPDFShader(int obj, GL2PStriangle *triangles, - int size, int gray) -{ - int i, offs = 0, vertexbytes, done = 0; - GLfloat xmin, xmax, ymin, ymax; - - switch(gray){ - case 0: - vertexbytes = 1+4+4+1+1+1; - break; - case 8: - vertexbytes = 1+4+4+1; - break; - case 16: - vertexbytes = 1+4+4+2; - break; - default: - gray = 8; - vertexbytes = 1+4+4+1; - break; - } - - gl2psPDFRectHull(&xmin, &xmax, &ymin, &ymax, triangles, size); - - offs += fprintf(gl2ps->stream, - "%d 0 obj\n" - "<< " - "/ShadingType 4 " - "/ColorSpace %s " - "/BitsPerCoordinate 32 " - "/BitsPerComponent %d " - "/BitsPerFlag 8 " - "/Decode [%f %f %f %f 0 1 %s] ", - obj, - (gray) ? "/DeviceGray" : "/DeviceRGB", - (gray) ? gray : 8, - xmin, xmax, ymin, ymax, - (gray) ? "" : "0 1 0 1"); - -#if defined(GL2PS_HAVE_ZLIB) - if(gl2ps->options & GL2PS_COMPRESS){ - gl2psAllocCompress(vertexbytes * size * 3); - - for(i = 0; i < size; ++i) - gl2psPrintPDFShaderStreamData(&triangles[i], - xmax-xmin, ymax-ymin, xmin, ymin, - gl2psWriteBigEndianCompress, gray); - - if(Z_OK == gl2psDeflate() && 23 + gl2ps->compress->destLen < gl2ps->compress->srcLen){ - offs += gl2psPrintPDFCompressorType(); - offs += fprintf(gl2ps->stream, - "/Length %d " - ">>\n" - "stream\n", - (int)gl2ps->compress->destLen); - offs += gl2ps->compress->destLen * fwrite(gl2ps->compress->dest, - gl2ps->compress->destLen, - 1, gl2ps->stream); - done = 1; - } - gl2psFreeCompress(); - } -#endif - - if(!done){ - /* no compression, or too long after compression, or compress error - -> write non-compressed entry */ - offs += fprintf(gl2ps->stream, - "/Length %d " - ">>\n" - "stream\n", - vertexbytes * 3 * size); - for(i = 0; i < size; ++i) - offs += gl2psPrintPDFShaderStreamData(&triangles[i], - xmax-xmin, ymax-ymin, xmin, ymin, - gl2psWriteBigEndian, gray); - } - - offs += fprintf(gl2ps->stream, - "\nendstream\n" - "endobj\n"); - - return offs; -} - -/* Writes a XObject for a shaded triangle mask */ - -static int gl2psPrintPDFShaderMask(int obj, int childobj) -{ - int offs = 0, len; - - offs += fprintf(gl2ps->stream, - "%d 0 obj\n" - "<<\n" - "/Type /XObject\n" - "/Subtype /Form\n" - "/BBox [ %d %d %d %d ]\n" - "/Group \n<<\n/S /Transparency /CS /DeviceRGB\n" - ">>\n", - obj, - (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], - (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); - - len = (childobj>0) - ? (int)strlen("/TrSh sh\n") + (int)log10((double)childobj)+1 - : (int)strlen("/TrSh0 sh\n"); - - offs += fprintf(gl2ps->stream, - "/Length %d\n" - ">>\n" - "stream\n", - len); - offs += fprintf(gl2ps->stream, - "/TrSh%d sh\n", - childobj); - offs += fprintf(gl2ps->stream, - "endstream\n" - "endobj\n"); - - return offs; -} - -/* Writes a Extended graphics state for a shaded triangle mask if - simplealpha ist true the childobj argument is ignored and a /ca - statement will be written instead */ - -static int gl2psPrintPDFShaderExtGS(int obj, int childobj) -{ - int offs = 0; - - offs += fprintf(gl2ps->stream, - "%d 0 obj\n" - "<<\n", - obj); - - offs += fprintf(gl2ps->stream, - "/SMask << /S /Alpha /G %d 0 R >> ", - childobj); - - offs += fprintf(gl2ps->stream, - ">>\n" - "endobj\n"); - return offs; -} - -/* a simple graphics state */ - -static int gl2psPrintPDFShaderSimpleExtGS(int obj, GLfloat alpha) -{ - int offs = 0; - - offs += fprintf(gl2ps->stream, - "%d 0 obj\n" - "<<\n" - "/ca %g" - ">>\n" - "endobj\n", - obj, alpha); - return offs; -} - -/* Similar groups of functions for pixmaps and text */ - -static int gl2psPrintPDFPixmapStreamData(GL2PSimage *im, - int (*action)(unsigned long data, int size), - int gray) -{ - int x, y, shift; - GLfloat r, g, b, a; - - if(im->format != GL_RGBA && gray) - return 0; - - if(gray && gray != 8 && gray != 16) - gray = 8; - - gray /= 8; - - shift = (sizeof(unsigned long) - 1) * 8; - - for(y = 0; y < im->height; ++y){ - for(x = 0; x < im->width; ++x){ - a = gl2psGetRGB(im, x, y, &r, &g, &b); - if(im->format == GL_RGBA && gray){ - (*action)((unsigned long)(a * 255) << shift, gray); - } - else{ - (*action)((unsigned long)(r * 255) << shift, 1); - (*action)((unsigned long)(g * 255) << shift, 1); - (*action)((unsigned long)(b * 255) << shift, 1); - } - } - } - - switch(gray){ - case 0: return 3 * im->width * im->height; - case 1: return im->width * im->height; - case 2: return 2 * im->width * im->height; - default: return 3 * im->width * im->height; - } -} - -static int gl2psPrintPDFPixmap(int obj, int childobj, GL2PSimage *im, int gray) -{ - int offs = 0, done = 0, sigbytes = 3; - - if(gray && gray !=8 && gray != 16) - gray = 8; - - if(gray) - sigbytes = gray / 8; - - offs += fprintf(gl2ps->stream, - "%d 0 obj\n" - "<<\n" - "/Type /XObject\n" - "/Subtype /Image\n" - "/Width %d\n" - "/Height %d\n" - "/ColorSpace %s \n" - "/BitsPerComponent 8\n", - obj, - (int)im->width, (int)im->height, - (gray) ? "/DeviceGray" : "/DeviceRGB" ); - if(GL_RGBA == im->format && gray == 0){ - offs += fprintf(gl2ps->stream, - "/SMask %d 0 R\n", - childobj); - } - -#if defined(GL2PS_HAVE_ZLIB) - if(gl2ps->options & GL2PS_COMPRESS){ - gl2psAllocCompress((int)(im->width * im->height * sigbytes)); - - gl2psPrintPDFPixmapStreamData(im, gl2psWriteBigEndianCompress, gray); - - if(Z_OK == gl2psDeflate() && 23 + gl2ps->compress->destLen < gl2ps->compress->srcLen){ - offs += gl2psPrintPDFCompressorType(); - offs += fprintf(gl2ps->stream, - "/Length %d " - ">>\n" - "stream\n", - (int)gl2ps->compress->destLen); - offs += gl2ps->compress->destLen * fwrite(gl2ps->compress->dest, gl2ps->compress->destLen, - 1, gl2ps->stream); - done = 1; - } - gl2psFreeCompress(); - } -#endif - - if(!done){ - /* no compression, or too long after compression, or compress error - -> write non-compressed entry */ - offs += fprintf(gl2ps->stream, - "/Length %d " - ">>\n" - "stream\n", - (int)(im->width * im->height * sigbytes)); - offs += gl2psPrintPDFPixmapStreamData(im, gl2psWriteBigEndian, gray); - } - - offs += fprintf(gl2ps->stream, - "\nendstream\n" - "endobj\n"); - - return offs; -} - -static int gl2psPrintPDFText(int obj, GL2PSstring *s, int fontnumber) -{ - int offs = 0; - - offs += fprintf(gl2ps->stream, - "%d 0 obj\n" - "<<\n" - "/Type /Font\n" - "/Subtype /Type1\n" - "/Name /F%d\n" - "/BaseFont /%s\n" - "/Encoding /MacRomanEncoding\n" - ">>\n" - "endobj\n", - obj, fontnumber, s->fontname); - return offs; -} - -/* Write the physical objects */ - -static int gl2psPDFgroupListWriteObjects(int entryoffs) -{ - int i,j; - GL2PSprimitive *p = NULL; - GL2PSpdfgroup *gro; - int offs = entryoffs; - GL2PStriangle *triangles; - int size = 0; - - if(!gl2ps->pdfgrouplist) - return offs; - - for(i = 0; i < gl2psListNbr(gl2ps->pdfgrouplist); ++i){ - gro = (GL2PSpdfgroup*)gl2psListPointer(gl2ps->pdfgrouplist, i); - if(!gl2psListNbr(gro->ptrlist)) - continue; - p = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, 0); - switch(p->type){ - case GL2PS_POINT: - break; - case GL2PS_LINE: - break; - case GL2PS_TRIANGLE: - size = gl2psListNbr(gro->ptrlist); - triangles = (GL2PStriangle*)gl2psMalloc(sizeof(GL2PStriangle) * size); - for(j = 0; j < size; ++j){ - p = *(GL2PSprimitive**)gl2psListPointer(gro->ptrlist, j); - gl2psFillTriangleFromPrimitive(&triangles[j], p, GL_TRUE); - } - if(triangles[0].prop & T_VAR_COLOR){ - gl2ps->xreflist[gro->shobjno] = offs; - offs += gl2psPrintPDFShader(gro->shobjno, triangles, size, 0); - } - if(triangles[0].prop & T_ALPHA_LESS_1){ - gl2ps->xreflist[gro->gsobjno] = offs; - offs += gl2psPrintPDFShaderSimpleExtGS(gro->gsobjno, triangles[0].vertex[0].rgba[3]); - } - if(triangles[0].prop & T_VAR_ALPHA){ - gl2ps->xreflist[gro->gsobjno] = offs; - offs += gl2psPrintPDFShaderExtGS(gro->gsobjno, gro->trgroupobjno); - gl2ps->xreflist[gro->trgroupobjno] = offs; - offs += gl2psPrintPDFShaderMask(gro->trgroupobjno, gro->maskshno); - gl2ps->xreflist[gro->maskshobjno] = offs; - offs += gl2psPrintPDFShader(gro->maskshobjno, triangles, size, 8); - } - gl2psFree(triangles); - break; - case GL2PS_PIXMAP: - gl2ps->xreflist[gro->imobjno] = offs; - offs += gl2psPrintPDFPixmap(gro->imobjno, gro->imobjno+1, p->data.image, 0); - if(p->data.image->format == GL_RGBA){ - gl2ps->xreflist[gro->imobjno+1] = offs; - offs += gl2psPrintPDFPixmap(gro->imobjno+1, -1, p->data.image, 8); - } - break; - case GL2PS_TEXT: - gl2ps->xreflist[gro->fontobjno] = offs; - offs += gl2psPrintPDFText(gro->fontobjno,p->data.text,gro->fontno); - break; - case GL2PS_SPECIAL : - /* alignment contains the format for which the special output text - is intended */ - if(p->data.text->alignment == GL2PS_PDF) - offs += fprintf(gl2ps->stream, "%s\n", p->data.text->str); - break; - default: - break; - } - } - return offs; -} - -/* All variable data has been written at this point and all required - functioninality has been gathered, so we can write now file footer - with cross reference table and trailer */ - -static void gl2psPrintPDFFooter(void) -{ - int i, offs; - - gl2psPDFgroupListInit(); - gl2psPDFgroupListWriteMainStream(); - - offs = gl2ps->xreflist[5] + gl2ps->streamlength; - offs += gl2psClosePDFDataStream(); - gl2ps->xreflist[5] = offs; - - offs += gl2psPrintPDFDataStreamLength(gl2ps->streamlength); - gl2ps->xreflist[6] = offs; - gl2ps->streamlength = 0; - - offs += gl2psPrintPDFOpenPage(); - offs += gl2psPDFgroupListWriteVariableResources(); - gl2ps->xreflist = (int*)gl2psRealloc(gl2ps->xreflist, - sizeof(int) * (gl2ps->objects_stack + 1)); - gl2ps->xreflist[7] = offs; - - offs += gl2psPrintPDFGSObject(); - gl2ps->xreflist[8] = offs; - - gl2ps->xreflist[gl2ps->objects_stack] = - gl2psPDFgroupListWriteObjects(gl2ps->xreflist[8]); - - /* Start cross reference table. The file has to been opened in - binary mode to preserve the 20 digit string length! */ - fprintf(gl2ps->stream, - "xref\n" - "0 %d\n" - "%010d 65535 f \n", gl2ps->objects_stack, 0); - - for(i = 1; i < gl2ps->objects_stack; ++i) - fprintf(gl2ps->stream, "%010d 00000 n \n", gl2ps->xreflist[i]); - - fprintf(gl2ps->stream, - "trailer\n" - "<<\n" - "/Size %d\n" - "/Info 1 0 R\n" - "/Root 2 0 R\n" - ">>\n" - "startxref\n%d\n" - "%%%%EOF\n", - gl2ps->objects_stack, gl2ps->xreflist[gl2ps->objects_stack]); - - /* Free auxiliary lists and arrays */ - gl2psFree(gl2ps->xreflist); - gl2psListAction(gl2ps->pdfprimlist, gl2psFreePrimitive); - gl2psListDelete(gl2ps->pdfprimlist); - gl2psPDFgroupListDelete(); - -#if defined(GL2PS_HAVE_ZLIB) - if(gl2ps->options & GL2PS_COMPRESS){ - gl2psFreeCompress(); - gl2psFree(gl2ps->compress); - gl2ps->compress = NULL; - } -#endif -} - -/* PDF begin viewport */ - -static void gl2psPrintPDFBeginViewport(GLint viewport[4]) -{ - int offs = 0; - GLint idx; - GLfloat rgba[4]; - int x = viewport[0], y = viewport[1], w = viewport[2], h = viewport[3]; - - glRenderMode(GL_FEEDBACK); - - if(gl2ps->header){ - gl2psPrintPDFHeader(); - gl2ps->header = GL_FALSE; - } - - offs += gl2psPrintf("q\n"); - - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - if(gl2ps->colormode == GL_RGBA || gl2ps->colorsize == 0){ - glGetFloatv(GL_COLOR_CLEAR_VALUE, rgba); - } - else{ - glGetIntegerv(GL_INDEX_CLEAR_VALUE, &idx); - rgba[0] = gl2ps->colormap[idx][0]; - rgba[1] = gl2ps->colormap[idx][1]; - rgba[2] = gl2ps->colormap[idx][2]; - rgba[3] = 1.0F; - } - offs += gl2psPrintPDFFillColor(rgba); - offs += gl2psPrintf("%d %d %d %d re\n" - "W\n" - "f\n", - x, y, w, h); - } - else{ - offs += gl2psPrintf("%d %d %d %d re\n" - "W\n" - "n\n", - x, y, w, h); - } - - gl2ps->streamlength += offs; -} - -static GLint gl2psPrintPDFEndViewport(void) -{ - GLint res; - - res = gl2psPrintPrimitives(); - gl2ps->streamlength += gl2psPrintf("Q\n"); - return res; -} - -static void gl2psPrintPDFFinalPrimitive(void) -{ -} - -/* definition of the PDF backend */ - -static GL2PSbackend gl2psPDF = { - gl2psPrintPDFHeader, - gl2psPrintPDFFooter, - gl2psPrintPDFBeginViewport, - gl2psPrintPDFEndViewport, - gl2psPrintPDFPrimitive, - gl2psPrintPDFFinalPrimitive, - "pdf", - "Portable Document Format" -}; - -/********************************************************************* - * - * SVG routines - * - *********************************************************************/ - -static void gl2psSVGGetCoordsAndColors(int n, GL2PSvertex *verts, - GL2PSxyz *xyz, GL2PSrgba *rgba) -{ - int i, j; - - for(i = 0; i < n; i++){ - xyz[i][0] = verts[i].xyz[0]; - xyz[i][1] = gl2ps->viewport[3] - verts[i].xyz[1]; - xyz[i][2] = 0.0F; - for(j = 0; j < 4; j++) - rgba[i][j] = verts[i].rgba[j]; - } -} - -static void gl2psSVGGetColorString(GL2PSrgba rgba, char str[32]) -{ - int r = (int)(255. * rgba[0]); - int g = (int)(255. * rgba[1]); - int b = (int)(255. * rgba[2]); - int rc = (r < 0) ? 0 : (r > 255) ? 255 : r; - int gc = (g < 0) ? 0 : (g > 255) ? 255 : g; - int bc = (b < 0) ? 0 : (b > 255) ? 255 : b; - sprintf(str, "#%2.2x%2.2x%2.2x", rc, gc, bc); -} - -static void gl2psPrintSVGHeader(void) -{ - int x, y, width, height; - char col[32]; - time_t now; - - time(&now); - - if (gl2ps->options & GL2PS_LANDSCAPE){ - x = (int)gl2ps->viewport[1]; - y = (int)gl2ps->viewport[0]; - width = (int)gl2ps->viewport[3]; - height = (int)gl2ps->viewport[2]; - } - else{ - x = (int)gl2ps->viewport[0]; - y = (int)gl2ps->viewport[1]; - width = (int)gl2ps->viewport[2]; - height = (int)gl2ps->viewport[3]; - } - - /* Compressed SVG files (.svgz) are simply gzipped SVG files */ - gl2psPrintGzipHeader(); - - gl2psPrintf("\n"); - gl2psPrintf("\n", - width, height, x, y, width, height); - gl2psPrintf("%s\n", gl2ps->title); - gl2psPrintf("\n"); - gl2psPrintf("Creator: GL2PS %d.%d.%d%s, %s\n" - "For: %s\n" - "CreationDate: %s", - GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, GL2PS_PATCH_VERSION, - GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, gl2ps->producer, ctime(&now)); - gl2psPrintf("\n"); - gl2psPrintf("\n"); - gl2psPrintf("\n"); - - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - gl2psSVGGetColorString(gl2ps->bgcolor, col); - gl2psPrintf("\n", col, - (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], - (int)gl2ps->viewport[2], (int)gl2ps->viewport[1], - (int)gl2ps->viewport[2], (int)gl2ps->viewport[3], - (int)gl2ps->viewport[0], (int)gl2ps->viewport[3]); - } - - /* group all the primitives and disable antialiasing */ - gl2psPrintf("\n"); -} - -static void gl2psPrintSVGSmoothTriangle(GL2PSxyz xyz[3], GL2PSrgba rgba[3]) -{ - int i; - GL2PSxyz xyz2[3]; - GL2PSrgba rgba2[3]; - char col[32]; - - /* Apparently there is no easy way to do Gouraud shading in SVG - without explicitly pre-defining gradients, so for now we just do - recursive subdivision */ - - if(gl2psSameColorThreshold(3, rgba, gl2ps->threshold)){ - gl2psSVGGetColorString(rgba[0], col); - gl2psPrintf("\n", xyz[0][0], xyz[0][1], - xyz[1][0], xyz[1][1], xyz[2][0], xyz[2][1]); - } - else{ - /* subdivide into 4 subtriangles */ - for(i = 0; i < 3; i++){ - xyz2[0][i] = xyz[0][i]; - xyz2[1][i] = 0.5F * (xyz[0][i] + xyz[1][i]); - xyz2[2][i] = 0.5F * (xyz[0][i] + xyz[2][i]); - } - for(i = 0; i < 4; i++){ - rgba2[0][i] = rgba[0][i]; - rgba2[1][i] = 0.5F * (rgba[0][i] + rgba[1][i]); - rgba2[2][i] = 0.5F * (rgba[0][i] + rgba[2][i]); - } - gl2psPrintSVGSmoothTriangle(xyz2, rgba2); - for(i = 0; i < 3; i++){ - xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[1][i]); - xyz2[1][i] = xyz[1][i]; - xyz2[2][i] = 0.5F * (xyz[1][i] + xyz[2][i]); - } - for(i = 0; i < 4; i++){ - rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[1][i]); - rgba2[1][i] = rgba[1][i]; - rgba2[2][i] = 0.5F * (rgba[1][i] + rgba[2][i]); - } - gl2psPrintSVGSmoothTriangle(xyz2, rgba2); - for(i = 0; i < 3; i++){ - xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[2][i]); - xyz2[1][i] = xyz[2][i]; - xyz2[2][i] = 0.5F * (xyz[1][i] + xyz[2][i]); - } - for(i = 0; i < 4; i++){ - rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[2][i]); - rgba2[1][i] = rgba[2][i]; - rgba2[2][i] = 0.5F * (rgba[1][i] + rgba[2][i]); - } - gl2psPrintSVGSmoothTriangle(xyz2, rgba2); - for(i = 0; i < 3; i++){ - xyz2[0][i] = 0.5F * (xyz[0][i] + xyz[1][i]); - xyz2[1][i] = 0.5F * (xyz[1][i] + xyz[2][i]); - xyz2[2][i] = 0.5F * (xyz[0][i] + xyz[2][i]); - } - for(i = 0; i < 4; i++){ - rgba2[0][i] = 0.5F * (rgba[0][i] + rgba[1][i]); - rgba2[1][i] = 0.5F * (rgba[1][i] + rgba[2][i]); - rgba2[2][i] = 0.5F * (rgba[0][i] + rgba[2][i]); - } - gl2psPrintSVGSmoothTriangle(xyz2, rgba2); - } -} - -static void gl2psPrintSVGDash(GLushort pattern, GLint factor) -{ - int i, n, array[10]; - - if(!pattern || !factor) return; /* solid line */ - - gl2psParseStipplePattern(pattern, factor, &n, array); - gl2psPrintf("stroke-dasharray=\""); - for(i = 0; i < n; i++){ - if(i) gl2psPrintf(","); - gl2psPrintf("%d", array[i]); - } - gl2psPrintf("\" "); -} - -static void gl2psEndSVGLine(void) -{ - int i; - if(gl2ps->lastvertex.rgba[0] >= 0.){ - gl2psPrintf("%g,%g\"/>\n", gl2ps->lastvertex.xyz[0], - gl2ps->viewport[3] - gl2ps->lastvertex.xyz[1]); - for(i = 0; i < 3; i++) - gl2ps->lastvertex.xyz[i] = -1.; - for(i = 0; i < 4; i++) - gl2ps->lastvertex.rgba[i] = -1.; - } -} - -static void gl2psPrintSVGPixmap(GLfloat x, GLfloat y, GL2PSimage *pixmap) -{ -#if defined(GL2PS_HAVE_LIBPNG) - GL2PSlist *png; - unsigned char c; - int i; - - /* The only image types supported by the SVG standard are JPEG, PNG - and SVG. Here we choose PNG, and since we want to embed the image - directly in the SVG stream (and not link to an external image - file), we need to encode the pixmap into PNG in memory, then - encode it into base64. */ - - png = gl2psListCreate(pixmap->width * pixmap->height * 3, 1000, - sizeof(unsigned char)); - gl2psConvertPixmapToPNG(pixmap, png); - gl2psListEncodeBase64(png); - gl2psPrintf("height, pixmap->width, pixmap->height); - gl2psPrintf("xlink:href=\"data:image/png;base64,"); - for(i = 0; i < gl2psListNbr(png); i++){ - gl2psListRead(png, i, &c); - gl2psPrintf("%c", c); - } - gl2psPrintf("\"/>\n"); - gl2psListDelete(png); -#else - (void) x; (void) y; (void) pixmap; /* not used */ - gl2psMsg(GL2PS_WARNING, "GL2PS must be compiled with PNG support in " - "order to embed images in SVG streams"); -#endif -} - -static void gl2psPrintSVGPrimitive(void *data) -{ - GL2PSprimitive *prim; - GL2PSxyz xyz[4]; - GL2PSrgba rgba[4]; - char col[32]; - int newline; - - prim = *(GL2PSprimitive**)data; - - if((gl2ps->options & GL2PS_OCCLUSION_CULL) && prim->culled) return; - - /* We try to draw connected lines as a single path to get nice line - joins and correct stippling. So if the primitive to print is not - a line we must first finish the current line (if any): */ - if(prim->type != GL2PS_LINE) gl2psEndSVGLine(); - - gl2psSVGGetCoordsAndColors(prim->numverts, prim->verts, xyz, rgba); - - switch(prim->type){ - case GL2PS_POINT : - gl2psSVGGetColorString(rgba[0], col); - gl2psPrintf("\n", - xyz[0][0], xyz[0][1], 0.5 * prim->width); - break; - case GL2PS_LINE : - if(!gl2psSamePosition(gl2ps->lastvertex.xyz, prim->verts[0].xyz) || - !gl2psSameColor(gl2ps->lastrgba, prim->verts[0].rgba) || - gl2ps->lastlinewidth != prim->width || - gl2ps->lastpattern != prim->pattern || - gl2ps->lastfactor != prim->factor){ - /* End the current line if the new segment does not start where - the last one ended, or if the color, the width or the - stippling have changed (we will need to use multi-point - gradients for smooth-shaded lines) */ - gl2psEndSVGLine(); - newline = 1; - } - else{ - newline = 0; - } - gl2ps->lastvertex = prim->verts[1]; - gl2psSetLastColor(prim->verts[0].rgba); - gl2ps->lastlinewidth = prim->width; - gl2ps->lastpattern = prim->pattern; - gl2ps->lastfactor = prim->factor; - if(newline){ - gl2psSVGGetColorString(rgba[0], col); - gl2psPrintf("width); - if(rgba[0][3] < 1.0F) gl2psPrintf("stroke-opacity=\"%g\" ", rgba[0][3]); - gl2psPrintSVGDash(prim->pattern, prim->factor); - gl2psPrintf("points=\"%g,%g ", xyz[0][0], xyz[0][1]); - } - else{ - gl2psPrintf("%g,%g ", xyz[0][0], xyz[0][1]); - } - break; - case GL2PS_TRIANGLE : - gl2psPrintSVGSmoothTriangle(xyz, rgba); - break; - case GL2PS_QUADRANGLE : - gl2psMsg(GL2PS_WARNING, "There should not be any quad left to print"); - break; - case GL2PS_PIXMAP : - gl2psPrintSVGPixmap(xyz[0][0], xyz[0][1], prim->data.image); - break; - case GL2PS_TEXT : - gl2psSVGGetColorString(prim->verts[0].rgba, col); - gl2psPrintf("data.text->fontsize); - if(prim->data.text->angle) - gl2psPrintf("transform=\"rotate(%g, %g, %g)\" ", - -prim->data.text->angle, xyz[0][0], xyz[0][1]); - switch(prim->data.text->alignment){ - case GL2PS_TEXT_C: - gl2psPrintf("text-anchor=\"middle\" baseline-shift=\"%d\" ", - -prim->data.text->fontsize / 2); - break; - case GL2PS_TEXT_CL: - gl2psPrintf("text-anchor=\"start\" baseline-shift=\"%d\" ", - -prim->data.text->fontsize / 2); - break; - case GL2PS_TEXT_CR: - gl2psPrintf("text-anchor=\"end\" baseline-shift=\"%d\" ", - -prim->data.text->fontsize / 2); - break; - case GL2PS_TEXT_B: - gl2psPrintf("text-anchor=\"middle\" baseline-shift=\"0\" "); - break; - case GL2PS_TEXT_BR: - gl2psPrintf("text-anchor=\"end\" baseline-shift=\"0\" "); - break; - case GL2PS_TEXT_T: - gl2psPrintf("text-anchor=\"middle\" baseline-shift=\"%d\" ", - -prim->data.text->fontsize); - break; - case GL2PS_TEXT_TL: - gl2psPrintf("text-anchor=\"start\" baseline-shift=\"%d\" ", - -prim->data.text->fontsize); - break; - case GL2PS_TEXT_TR: - gl2psPrintf("text-anchor=\"end\" baseline-shift=\"%d\" ", - -prim->data.text->fontsize); - break; - case GL2PS_TEXT_BL: - default: /* same as GL2PS_TEXT_BL */ - gl2psPrintf("text-anchor=\"start\" baseline-shift=\"0\" "); - break; - } - if(!strcmp(prim->data.text->fontname, "Times-Roman")) - gl2psPrintf("font-family=\"Times\">"); - else if(!strcmp(prim->data.text->fontname, "Times-Bold")) - gl2psPrintf("font-family=\"Times\" font-weight=\"bold\">"); - else if(!strcmp(prim->data.text->fontname, "Times-Italic")) - gl2psPrintf("font-family=\"Times\" font-style=\"italic\">"); - else if(!strcmp(prim->data.text->fontname, "Times-BoldItalic")) - gl2psPrintf("font-family=\"Times\" font-style=\"italic\" font-weight=\"bold\">"); - else if(!strcmp(prim->data.text->fontname, "Helvetica-Bold")) - gl2psPrintf("font-family=\"Helvetica\" font-weight=\"bold\">"); - else if(!strcmp(prim->data.text->fontname, "Helvetica-Oblique")) - gl2psPrintf("font-family=\"Helvetica\" font-style=\"oblique\">"); - else if(!strcmp(prim->data.text->fontname, "Helvetica-BoldOblique")) - gl2psPrintf("font-family=\"Helvetica\" font-style=\"oblique\" font-weight=\"bold\">"); - else if(!strcmp(prim->data.text->fontname, "Courier-Bold")) - gl2psPrintf("font-family=\"Courier\" font-weight=\"bold\">"); - else if(!strcmp(prim->data.text->fontname, "Courier-Oblique")) - gl2psPrintf("font-family=\"Courier\" font-style=\"oblique\">"); - else if(!strcmp(prim->data.text->fontname, "Courier-BoldOblique")) - gl2psPrintf("font-family=\"Courier\" font-style=\"oblique\" font-weight=\"bold\">"); - else - gl2psPrintf("font-family=\"%s\">", prim->data.text->fontname); - gl2psPrintf("%s\n", prim->data.text->str); - break; - case GL2PS_SPECIAL : - /* alignment contains the format for which the special output text - is intended */ - if(prim->data.text->alignment == GL2PS_SVG) - gl2psPrintf("%s\n", prim->data.text->str); - break; - default : - break; - } -} - -static void gl2psPrintSVGFooter(void) -{ - gl2psPrintf("\n"); - gl2psPrintf("\n"); - - gl2psPrintGzipFooter(); -} - -static void gl2psPrintSVGBeginViewport(GLint viewport[4]) -{ - GLint idx; - char col[32]; - GLfloat rgba[4]; - int x = viewport[0], y = viewport[1], w = viewport[2], h = viewport[3]; - - glRenderMode(GL_FEEDBACK); - - if(gl2ps->header){ - gl2psPrintSVGHeader(); - gl2ps->header = GL_FALSE; - } - - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - if(gl2ps->colormode == GL_RGBA || gl2ps->colorsize == 0){ - glGetFloatv(GL_COLOR_CLEAR_VALUE, rgba); - } - else{ - glGetIntegerv(GL_INDEX_CLEAR_VALUE, &idx); - rgba[0] = gl2ps->colormap[idx][0]; - rgba[1] = gl2ps->colormap[idx][1]; - rgba[2] = gl2ps->colormap[idx][2]; - rgba[3] = 1.0F; - } - gl2psSVGGetColorString(rgba, col); - gl2psPrintf("\n", col, - x, gl2ps->viewport[3] - y, - x + w, gl2ps->viewport[3] - y, - x + w, gl2ps->viewport[3] - (y + h), - x, gl2ps->viewport[3] - (y + h)); - } - - gl2psPrintf("\n", x, y, w, h); - gl2psPrintf(" \n", - x, gl2ps->viewport[3] - y, - x + w, gl2ps->viewport[3] - y, - x + w, gl2ps->viewport[3] - (y + h), - x, gl2ps->viewport[3] - (y + h)); - gl2psPrintf("\n"); - gl2psPrintf("\n", x, y, w, h); -} - -static GLint gl2psPrintSVGEndViewport(void) -{ - GLint res; - - res = gl2psPrintPrimitives(); - gl2psPrintf("\n"); - return res; -} - -static void gl2psPrintSVGFinalPrimitive(void) -{ - /* End any remaining line, if any */ - gl2psEndSVGLine(); -} - -/* definition of the SVG backend */ - -static GL2PSbackend gl2psSVG = { - gl2psPrintSVGHeader, - gl2psPrintSVGFooter, - gl2psPrintSVGBeginViewport, - gl2psPrintSVGEndViewport, - gl2psPrintSVGPrimitive, - gl2psPrintSVGFinalPrimitive, - "svg", - "Scalable Vector Graphics" -}; - -/********************************************************************* - * - * PGF routines - * - *********************************************************************/ - -static void gl2psPrintPGFColor(GL2PSrgba rgba) -{ - if(!gl2psSameColor(gl2ps->lastrgba, rgba)){ - gl2psSetLastColor(rgba); - fprintf(gl2ps->stream, "\\color[rgb]{%f,%f,%f}\n", rgba[0], rgba[1], rgba[2]); - } -} - -static void gl2psPrintPGFHeader(void) -{ - time_t now; - - time(&now); - - fprintf(gl2ps->stream, - "%% Title: %s\n" - "%% Creator: GL2PS %d.%d.%d%s, %s\n" - "%% For: %s\n" - "%% CreationDate: %s", - gl2ps->title, GL2PS_MAJOR_VERSION, GL2PS_MINOR_VERSION, - GL2PS_PATCH_VERSION, GL2PS_EXTRA_VERSION, GL2PS_COPYRIGHT, - gl2ps->producer, ctime(&now)); - - fprintf(gl2ps->stream, "\\begin{pgfpicture}\n"); - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - gl2psPrintPGFColor(gl2ps->bgcolor); - fprintf(gl2ps->stream, - "\\pgfpathrectanglecorners{" - "\\pgfpoint{%dpt}{%dpt}}{\\pgfpoint{%dpt}{%dpt}}\n" - "\\pgfusepath{fill}\n", - (int)gl2ps->viewport[0], (int)gl2ps->viewport[1], - (int)gl2ps->viewport[2], (int)gl2ps->viewport[3]); - } -} - -static void gl2psPrintPGFDash(GLushort pattern, GLint factor) -{ - int i, n, array[10]; - - if(pattern == gl2ps->lastpattern && factor == gl2ps->lastfactor) - return; - - gl2ps->lastpattern = pattern; - gl2ps->lastfactor = factor; - - if(!pattern || !factor){ - /* solid line */ - fprintf(gl2ps->stream, "\\pgfsetdash{}{0pt}\n"); - } - else{ - gl2psParseStipplePattern(pattern, factor, &n, array); - fprintf(gl2ps->stream, "\\pgfsetdash{"); - for(i = 0; i < n; i++) fprintf(gl2ps->stream, "{%dpt}", array[i]); - fprintf(gl2ps->stream, "}{0pt}\n"); - } -} - -static const char *gl2psPGFTextAlignment(int align) -{ - switch(align){ - case GL2PS_TEXT_C : return "center"; - case GL2PS_TEXT_CL : return "west"; - case GL2PS_TEXT_CR : return "east"; - case GL2PS_TEXT_B : return "south"; - case GL2PS_TEXT_BR : return "south east"; - case GL2PS_TEXT_T : return "north"; - case GL2PS_TEXT_TL : return "north west"; - case GL2PS_TEXT_TR : return "north east"; - case GL2PS_TEXT_BL : - default : return "south west"; - } -} - -static void gl2psPrintPGFPrimitive(void *data) -{ - GL2PSprimitive *prim; - - prim = *(GL2PSprimitive**)data; - - switch(prim->type){ - case GL2PS_POINT : - /* Points in openGL are rectangular */ - gl2psPrintPGFColor(prim->verts[0].rgba); - fprintf(gl2ps->stream, - "\\pgfpathrectangle{\\pgfpoint{%fpt}{%fpt}}" - "{\\pgfpoint{%fpt}{%fpt}}\n\\pgfusepath{fill}\n", - prim->verts[0].xyz[0]-0.5*prim->width, - prim->verts[0].xyz[1]-0.5*prim->width, - prim->width,prim->width); - break; - case GL2PS_LINE : - gl2psPrintPGFColor(prim->verts[0].rgba); - if(gl2ps->lastlinewidth != prim->width){ - gl2ps->lastlinewidth = prim->width; - fprintf(gl2ps->stream, "\\pgfsetlinewidth{%fpt}\n", gl2ps->lastlinewidth); - } - gl2psPrintPGFDash(prim->pattern, prim->factor); - fprintf(gl2ps->stream, - "\\pgfpathmoveto{\\pgfpoint{%fpt}{%fpt}}\n" - "\\pgflineto{\\pgfpoint{%fpt}{%fpt}}\n" - "\\pgfusepath{stroke}\n", - prim->verts[1].xyz[0], prim->verts[1].xyz[1], - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - break; - case GL2PS_TRIANGLE : - if(gl2ps->lastlinewidth != 0){ - gl2ps->lastlinewidth = 0; - fprintf(gl2ps->stream, "\\pgfsetlinewidth{0.01pt}\n"); - } - gl2psPrintPGFColor(prim->verts[0].rgba); - fprintf(gl2ps->stream, - "\\pgfpathmoveto{\\pgfpoint{%fpt}{%fpt}}\n" - "\\pgflineto{\\pgfpoint{%fpt}{%fpt}}\n" - "\\pgflineto{\\pgfpoint{%fpt}{%fpt}}\n" - "\\pgfpathclose\n" - "\\pgfusepath{fill,stroke}\n", - prim->verts[2].xyz[0], prim->verts[2].xyz[1], - prim->verts[1].xyz[0], prim->verts[1].xyz[1], - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - break; - case GL2PS_TEXT : - fprintf(gl2ps->stream, "{\n\\pgftransformshift{\\pgfpoint{%fpt}{%fpt}}\n", - prim->verts[0].xyz[0], prim->verts[0].xyz[1]); - - if(prim->data.text->angle) - fprintf(gl2ps->stream, "\\pgftransformrotate{%f}{", prim->data.text->angle); - - fprintf(gl2ps->stream, "\\pgfnode{rectangle}{%s}{\\fontsize{%d}{0}\\selectfont", - gl2psPGFTextAlignment(prim->data.text->alignment), - prim->data.text->fontsize); - - fprintf(gl2ps->stream, "\\textcolor[rgb]{%g,%g,%g}{{%s}}", - prim->verts[0].rgba[0], prim->verts[0].rgba[1], - prim->verts[0].rgba[2], prim->data.text->str); - - fprintf(gl2ps->stream, "}{}{\\pgfusepath{discard}}}\n"); - break; - case GL2PS_SPECIAL : - /* alignment contains the format for which the special output text - is intended */ - if (prim->data.text->alignment == GL2PS_PGF) - fprintf(gl2ps->stream, "%s\n", prim->data.text->str); - break; - default : - break; - } -} - -static void gl2psPrintPGFFooter(void) -{ - fprintf(gl2ps->stream, "\\end{pgfpicture}\n"); -} - -static void gl2psPrintPGFBeginViewport(GLint viewport[4]) -{ - GLint idx; - GLfloat rgba[4]; - int x = viewport[0], y = viewport[1], w = viewport[2], h = viewport[3]; - - glRenderMode(GL_FEEDBACK); - - if(gl2ps->header){ - gl2psPrintPGFHeader(); - gl2ps->header = GL_FALSE; - } - - fprintf(gl2ps->stream, "\\begin{pgfscope}\n"); - if(gl2ps->options & GL2PS_DRAW_BACKGROUND){ - if(gl2ps->colormode == GL_RGBA || gl2ps->colorsize == 0){ - glGetFloatv(GL_COLOR_CLEAR_VALUE, rgba); - } - else{ - glGetIntegerv(GL_INDEX_CLEAR_VALUE, &idx); - rgba[0] = gl2ps->colormap[idx][0]; - rgba[1] = gl2ps->colormap[idx][1]; - rgba[2] = gl2ps->colormap[idx][2]; - rgba[3] = 1.0F; - } - gl2psPrintPGFColor(rgba); - fprintf(gl2ps->stream, - "\\pgfpathrectangle{\\pgfpoint{%dpt}{%dpt}}" - "{\\pgfpoint{%dpt}{%dpt}}\n" - "\\pgfusepath{fill}\n", - x, y, w, h); - } - - fprintf(gl2ps->stream, - "\\pgfpathrectangle{\\pgfpoint{%dpt}{%dpt}}" - "{\\pgfpoint{%dpt}{%dpt}}\n" - "\\pgfusepath{clip}\n", - x, y, w, h); -} - -static GLint gl2psPrintPGFEndViewport(void) -{ - GLint res; - res = gl2psPrintPrimitives(); - fprintf(gl2ps->stream, "\\end{pgfscope}\n"); - return res; -} - -static void gl2psPrintPGFFinalPrimitive(void) -{ -} - -/* definition of the PGF backend */ - -static GL2PSbackend gl2psPGF = { - gl2psPrintPGFHeader, - gl2psPrintPGFFooter, - gl2psPrintPGFBeginViewport, - gl2psPrintPGFEndViewport, - gl2psPrintPGFPrimitive, - gl2psPrintPGFFinalPrimitive, - "tex", - "PGF Latex Graphics" -}; - -/********************************************************************* - * - * General primitive printing routine - * - *********************************************************************/ - -/* Warning: the ordering of the backends must match the format - #defines in gl2ps.h */ - -static GL2PSbackend *gl2psbackends[] = { - &gl2psPS, /* 0 */ - &gl2psEPS, /* 1 */ - &gl2psTEX, /* 2 */ - &gl2psPDF, /* 3 */ - &gl2psSVG, /* 4 */ - &gl2psPGF /* 5 */ -}; - -static void gl2psComputeTightBoundingBox(void *data) -{ - GL2PSprimitive *prim; - int i; - - prim = *(GL2PSprimitive**)data; - - for(i = 0; i < prim->numverts; i++){ - if(prim->verts[i].xyz[0] < gl2ps->viewport[0]) - gl2ps->viewport[0] = (GLint)prim->verts[i].xyz[0]; - if(prim->verts[i].xyz[0] > gl2ps->viewport[2]) - gl2ps->viewport[2] = (GLint)(prim->verts[i].xyz[0] + 0.5F); - if(prim->verts[i].xyz[1] < gl2ps->viewport[1]) - gl2ps->viewport[1] = (GLint)prim->verts[i].xyz[1]; - if(prim->verts[i].xyz[1] > gl2ps->viewport[3]) - gl2ps->viewport[3] = (GLint)(prim->verts[i].xyz[1] + 0.5F); - } -} - -static GLint gl2psPrintPrimitives(void) -{ - GL2PSbsptree *root; - GL2PSxyz eye = {0.0F, 0.0F, 100.0F * GL2PS_ZSCALE}; - GLint used; - - used = glRenderMode(GL_RENDER); - - if(used < 0){ - gl2psMsg(GL2PS_INFO, "OpenGL feedback buffer overflow"); - return GL2PS_OVERFLOW; - } - - if(used > 0) - gl2psParseFeedbackBuffer(used); - - gl2psRescaleAndOffset(); - - if(gl2ps->header){ - if(gl2psListNbr(gl2ps->primitives) && - (gl2ps->options & GL2PS_TIGHT_BOUNDING_BOX)){ - gl2ps->viewport[0] = gl2ps->viewport[1] = 100000; - gl2ps->viewport[2] = gl2ps->viewport[3] = -100000; - gl2psListAction(gl2ps->primitives, gl2psComputeTightBoundingBox); - } - (gl2psbackends[gl2ps->format]->printHeader)(); - gl2ps->header = GL_FALSE; - } - - if(!gl2psListNbr(gl2ps->primitives)){ - /* empty feedback buffer and/or nothing else to print */ - return GL2PS_NO_FEEDBACK; - } - - switch(gl2ps->sort){ - case GL2PS_NO_SORT : - gl2psListAction(gl2ps->primitives, gl2psbackends[gl2ps->format]->printPrimitive); - gl2psListAction(gl2ps->primitives, gl2psFreePrimitive); - /* reset the primitive list, waiting for the next viewport */ - gl2psListReset(gl2ps->primitives); - break; - case GL2PS_SIMPLE_SORT : - gl2psListSort(gl2ps->primitives, gl2psCompareDepth); - if(gl2ps->options & GL2PS_OCCLUSION_CULL){ - gl2psListActionInverse(gl2ps->primitives, gl2psAddInImageTree); - gl2psFreeBspImageTree(&gl2ps->imagetree); - } - gl2psListAction(gl2ps->primitives, gl2psbackends[gl2ps->format]->printPrimitive); - gl2psListAction(gl2ps->primitives, gl2psFreePrimitive); - /* reset the primitive list, waiting for the next viewport */ - gl2psListReset(gl2ps->primitives); - break; - case GL2PS_BSP_SORT : - root = (GL2PSbsptree*)gl2psMalloc(sizeof(GL2PSbsptree)); - gl2psBuildBspTree(root, gl2ps->primitives); - if(GL_TRUE == gl2ps->boundary) gl2psBuildPolygonBoundary(root); - if(gl2ps->options & GL2PS_OCCLUSION_CULL){ - gl2psTraverseBspTree(root, eye, -GL2PS_EPSILON, gl2psLess, - gl2psAddInImageTree, 1); - gl2psFreeBspImageTree(&gl2ps->imagetree); - } - gl2psTraverseBspTree(root, eye, GL2PS_EPSILON, gl2psGreater, - gl2psbackends[gl2ps->format]->printPrimitive, 0); - gl2psFreeBspTree(&root); - /* reallocate the primitive list (it's been deleted by - gl2psBuildBspTree) in case there is another viewport */ - gl2ps->primitives = gl2psListCreate(500, 500, sizeof(GL2PSprimitive*)); - break; - } - gl2psbackends[gl2ps->format]->printFinalPrimitive(); - - return GL2PS_SUCCESS; -} - -/********************************************************************* - * - * Public routines - * - *********************************************************************/ - -GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, - GLint viewport[4], GLint format, GLint sort, - GLint options, GLint colormode, - GLint colorsize, GL2PSrgba *colormap, - GLint nr, GLint ng, GLint nb, GLint buffersize, - FILE *stream, const char *filename) -{ - GLint idx; - int i; - - if(gl2ps){ - gl2psMsg(GL2PS_ERROR, "gl2psBeginPage called in wrong program state"); - return GL2PS_ERROR; - } - - gl2ps = (GL2PScontext*)gl2psMalloc(sizeof(GL2PScontext)); - - if(format >= 0 && format < (GLint)(sizeof(gl2psbackends) / sizeof(gl2psbackends[0]))){ - gl2ps->format = format; - } - else { - gl2psMsg(GL2PS_ERROR, "Unknown output format: %d", format); - gl2psFree(gl2ps); - gl2ps = NULL; - return GL2PS_ERROR; - } - - switch(sort){ - case GL2PS_NO_SORT : - case GL2PS_SIMPLE_SORT : - case GL2PS_BSP_SORT : - gl2ps->sort = sort; - break; - default : - gl2psMsg(GL2PS_ERROR, "Unknown sorting algorithm: %d", sort); - gl2psFree(gl2ps); - gl2ps = NULL; - return GL2PS_ERROR; - } - - if(stream){ - gl2ps->stream = stream; - } - else{ - gl2psMsg(GL2PS_ERROR, "Bad file pointer"); - gl2psFree(gl2ps); - gl2ps = NULL; - return GL2PS_ERROR; - } - - gl2ps->header = GL_TRUE; - gl2ps->maxbestroot = 10; - gl2ps->options = options; - gl2ps->compress = NULL; - gl2ps->imagemap_head = NULL; - gl2ps->imagemap_tail = NULL; - - if(gl2ps->options & GL2PS_USE_CURRENT_VIEWPORT){ - glGetIntegerv(GL_VIEWPORT, gl2ps->viewport); - } - else{ - for(i = 0; i < 4; i++){ - gl2ps->viewport[i] = viewport[i]; - } - } - - if(!gl2ps->viewport[2] || !gl2ps->viewport[3]){ - gl2psMsg(GL2PS_ERROR, "Incorrect viewport (x=%d, y=%d, width=%d, height=%d)", - gl2ps->viewport[0], gl2ps->viewport[1], - gl2ps->viewport[2], gl2ps->viewport[3]); - gl2psFree(gl2ps); - gl2ps = NULL; - return GL2PS_ERROR; - } - - gl2ps->threshold[0] = nr ? 1.0F / (GLfloat)nr : 0.064F; - gl2ps->threshold[1] = ng ? 1.0F / (GLfloat)ng : 0.034F; - gl2ps->threshold[2] = nb ? 1.0F / (GLfloat)nb : 0.100F; - gl2ps->colormode = colormode; - gl2ps->buffersize = buffersize > 0 ? buffersize : 2048 * 2048; - for(i = 0; i < 3; i++){ - gl2ps->lastvertex.xyz[i] = -1.0F; - } - for(i = 0; i < 4; i++){ - gl2ps->lastvertex.rgba[i] = -1.0F; - gl2ps->lastrgba[i] = -1.0F; - } - gl2ps->lastlinewidth = -1.0F; - gl2ps->lastpattern = 0; - gl2ps->lastfactor = 0; - gl2ps->imagetree = NULL; - gl2ps->primitivetoadd = NULL; - gl2ps->zerosurfacearea = GL_FALSE; - gl2ps->pdfprimlist = NULL; - gl2ps->pdfgrouplist = NULL; - gl2ps->xreflist = NULL; - - /* get default blending mode from current OpenGL state (enabled by - default for SVG) */ - gl2ps->blending = (gl2ps->format == GL2PS_SVG) ? GL_TRUE : glIsEnabled(GL_BLEND); - glGetIntegerv(GL_BLEND_SRC, &gl2ps->blendfunc[0]); - glGetIntegerv(GL_BLEND_DST, &gl2ps->blendfunc[1]); - - if(gl2ps->colormode == GL_RGBA){ - gl2ps->colorsize = 0; - gl2ps->colormap = NULL; - glGetFloatv(GL_COLOR_CLEAR_VALUE, gl2ps->bgcolor); - } - else if(gl2ps->colormode == GL_COLOR_INDEX){ - if(!colorsize || !colormap){ - gl2psMsg(GL2PS_ERROR, "Missing colormap for GL_COLOR_INDEX rendering"); - gl2psFree(gl2ps); - gl2ps = NULL; - return GL2PS_ERROR; - } - gl2ps->colorsize = colorsize; - gl2ps->colormap = (GL2PSrgba*)gl2psMalloc(gl2ps->colorsize * sizeof(GL2PSrgba)); - memcpy(gl2ps->colormap, colormap, gl2ps->colorsize * sizeof(GL2PSrgba)); - glGetIntegerv(GL_INDEX_CLEAR_VALUE, &idx); - gl2ps->bgcolor[0] = gl2ps->colormap[idx][0]; - gl2ps->bgcolor[1] = gl2ps->colormap[idx][1]; - gl2ps->bgcolor[2] = gl2ps->colormap[idx][2]; - gl2ps->bgcolor[3] = 1.0F; - } - else{ - gl2psMsg(GL2PS_ERROR, "Unknown color mode in gl2psBeginPage"); - gl2psFree(gl2ps); - gl2ps = NULL; - return GL2PS_ERROR; - } - - if(!title){ - gl2ps->title = (char*)gl2psMalloc(sizeof(char)); - gl2ps->title[0] = '\0'; - } - else{ - gl2ps->title = (char*)gl2psMalloc((strlen(title)+1)*sizeof(char)); - strcpy(gl2ps->title, title); - } - - if(!producer){ - gl2ps->producer = (char*)gl2psMalloc(sizeof(char)); - gl2ps->producer[0] = '\0'; - } - else{ - gl2ps->producer = (char*)gl2psMalloc((strlen(producer)+1)*sizeof(char)); - strcpy(gl2ps->producer, producer); - } - - if(!filename){ - gl2ps->filename = (char*)gl2psMalloc(sizeof(char)); - gl2ps->filename[0] = '\0'; - } - else{ - gl2ps->filename = (char*)gl2psMalloc((strlen(filename)+1)*sizeof(char)); - strcpy(gl2ps->filename, filename); - } - - gl2ps->primitives = gl2psListCreate(500, 500, sizeof(GL2PSprimitive*)); - gl2ps->auxprimitives = gl2psListCreate(100, 100, sizeof(GL2PSprimitive*)); - gl2ps->feedback = (GLfloat*)gl2psMalloc(gl2ps->buffersize * sizeof(GLfloat)); - glFeedbackBuffer(gl2ps->buffersize, GL_3D_COLOR, gl2ps->feedback); - glRenderMode(GL_FEEDBACK); - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psEndPage(void) -{ - GLint res; - - if(!gl2ps) return GL2PS_UNINITIALIZED; - - res = gl2psPrintPrimitives(); - - if(res != GL2PS_OVERFLOW) - (gl2psbackends[gl2ps->format]->printFooter)(); - - fflush(gl2ps->stream); - - gl2psListDelete(gl2ps->primitives); - gl2psListDelete(gl2ps->auxprimitives); - gl2psFreeImagemap(gl2ps->imagemap_head); - gl2psFree(gl2ps->colormap); - gl2psFree(gl2ps->title); - gl2psFree(gl2ps->producer); - gl2psFree(gl2ps->filename); - gl2psFree(gl2ps->feedback); - gl2psFree(gl2ps); - gl2ps = NULL; - - return res; -} - -GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]) -{ - if(!gl2ps) return GL2PS_UNINITIALIZED; - - (gl2psbackends[gl2ps->format]->beginViewport)(viewport); - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psEndViewport(void) -{ - GLint res; - - if(!gl2ps) return GL2PS_UNINITIALIZED; - - res = (gl2psbackends[gl2ps->format]->endViewport)(); - - /* reset last used colors, line widths */ - gl2ps->lastlinewidth = -1.0F; - - return res; -} - -GL2PSDLL_API GLint gl2psTextOptColor(const char *str, const char *fontname, - GLshort fontsize, GLint alignment, GLfloat angle, - GL2PSrgba color) -{ - return gl2psAddText(GL2PS_TEXT, str, fontname, fontsize, alignment, angle, - color); -} - -GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname, - GLshort fontsize, GLint alignment, GLfloat angle) -{ - return gl2psAddText(GL2PS_TEXT, str, fontname, fontsize, alignment, angle, NULL); -} - -GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname, GLshort fontsize) -{ - return gl2psAddText(GL2PS_TEXT, str, fontname, fontsize, GL2PS_TEXT_BL, 0.0F, - NULL); -} - -GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str) -{ - return gl2psAddText(GL2PS_SPECIAL, str, "", 0, format, 0.0F, NULL); -} - -GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height, - GLint xorig, GLint yorig, - GLenum format, GLenum type, - const void *pixels) -{ - int size, i; - const GLfloat *piv; - GLfloat pos[4], zoom_x, zoom_y; - GL2PSprimitive *prim; - GLboolean valid; - - if(!gl2ps || !pixels) return GL2PS_UNINITIALIZED; - - if((width <= 0) || (height <= 0)) return GL2PS_ERROR; - - if(gl2ps->options & GL2PS_NO_PIXMAP) return GL2PS_SUCCESS; - - if((format != GL_RGB && format != GL_RGBA) || type != GL_FLOAT){ - gl2psMsg(GL2PS_ERROR, "gl2psDrawPixels only implemented for " - "GL_RGB/GL_RGBA, GL_FLOAT pixels"); - return GL2PS_ERROR; - } - - glGetBooleanv(GL_CURRENT_RASTER_POSITION_VALID, &valid); - if(GL_FALSE == valid) return GL2PS_SUCCESS; /* the primitive is culled */ - - glGetFloatv(GL_CURRENT_RASTER_POSITION, pos); - glGetFloatv(GL_ZOOM_X, &zoom_x); - glGetFloatv(GL_ZOOM_Y, &zoom_y); - - prim = (GL2PSprimitive*)gl2psMalloc(sizeof(GL2PSprimitive)); - prim->type = GL2PS_PIXMAP; - prim->boundary = 0; - prim->numverts = 1; - prim->verts = (GL2PSvertex*)gl2psMalloc(sizeof(GL2PSvertex)); - prim->verts[0].xyz[0] = pos[0] + xorig; - prim->verts[0].xyz[1] = pos[1] + yorig; - prim->verts[0].xyz[2] = pos[2]; - prim->culled = 0; - prim->offset = 0; - prim->pattern = 0; - prim->factor = 0; - prim->width = 1; - glGetFloatv(GL_CURRENT_RASTER_COLOR, prim->verts[0].rgba); - prim->data.image = (GL2PSimage*)gl2psMalloc(sizeof(GL2PSimage)); - prim->data.image->width = width; - prim->data.image->height = height; - prim->data.image->zoom_x = zoom_x; - prim->data.image->zoom_y = zoom_y; - prim->data.image->format = format; - prim->data.image->type = type; - - switch(format){ - case GL_RGBA: - if(gl2ps->options & GL2PS_NO_BLENDING || !gl2ps->blending){ - /* special case: blending turned off */ - prim->data.image->format = GL_RGB; - size = height * width * 3; - prim->data.image->pixels = (GLfloat*)gl2psMalloc(size * sizeof(GLfloat)); - piv = (const GLfloat*)pixels; - for(i = 0; i < size; ++i, ++piv){ - prim->data.image->pixels[i] = *piv; - if(!((i + 1) % 3)) - ++piv; - } - } - else{ - size = height * width * 4; - prim->data.image->pixels = (GLfloat*)gl2psMalloc(size * sizeof(GLfloat)); - memcpy(prim->data.image->pixels, pixels, size * sizeof(GLfloat)); - } - break; - case GL_RGB: - default: - size = height * width * 3; - prim->data.image->pixels = (GLfloat*)gl2psMalloc(size * sizeof(GLfloat)); - memcpy(prim->data.image->pixels, pixels, size * sizeof(GLfloat)); - break; - } - - gl2psListAdd(gl2ps->auxprimitives, &prim); - glPassThrough(GL2PS_DRAW_PIXELS_TOKEN); - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height, - const GLfloat position[3], - const unsigned char *imagemap){ - int size, i; - int sizeoffloat = sizeof(GLfloat); - - if(!gl2ps || !imagemap) return GL2PS_UNINITIALIZED; - - if((width <= 0) || (height <= 0)) return GL2PS_ERROR; - - size = height + height * ((width - 1) / 8); - glPassThrough(GL2PS_IMAGEMAP_TOKEN); - glBegin(GL_POINTS); - glVertex3f(position[0], position[1],position[2]); - glEnd(); - glPassThrough((GLfloat)width); - glPassThrough((GLfloat)height); - for(i = 0; i < size; i += sizeoffloat){ - const float *value = (const float*)imagemap; - glPassThrough(*value); - imagemap += sizeoffloat; - } - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psEnable(GLint mode) -{ - GLint tmp; - - if(!gl2ps) return GL2PS_UNINITIALIZED; - - switch(mode){ - case GL2PS_POLYGON_OFFSET_FILL : - glPassThrough(GL2PS_BEGIN_OFFSET_TOKEN); - glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &gl2ps->offset[0]); - glGetFloatv(GL_POLYGON_OFFSET_UNITS, &gl2ps->offset[1]); - break; - case GL2PS_POLYGON_BOUNDARY : - glPassThrough(GL2PS_BEGIN_BOUNDARY_TOKEN); - break; - case GL2PS_LINE_STIPPLE : - glPassThrough(GL2PS_BEGIN_STIPPLE_TOKEN); - glGetIntegerv(GL_LINE_STIPPLE_PATTERN, &tmp); - glPassThrough((GLfloat)tmp); - glGetIntegerv(GL_LINE_STIPPLE_REPEAT, &tmp); - glPassThrough((GLfloat)tmp); - break; - case GL2PS_BLEND : - glPassThrough(GL2PS_BEGIN_BLEND_TOKEN); - break; - default : - gl2psMsg(GL2PS_WARNING, "Unknown mode in gl2psEnable: %d", mode); - return GL2PS_WARNING; - } - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psDisable(GLint mode) -{ - if(!gl2ps) return GL2PS_UNINITIALIZED; - - switch(mode){ - case GL2PS_POLYGON_OFFSET_FILL : - glPassThrough(GL2PS_END_OFFSET_TOKEN); - break; - case GL2PS_POLYGON_BOUNDARY : - glPassThrough(GL2PS_END_BOUNDARY_TOKEN); - break; - case GL2PS_LINE_STIPPLE : - glPassThrough(GL2PS_END_STIPPLE_TOKEN); - break; - case GL2PS_BLEND : - glPassThrough(GL2PS_END_BLEND_TOKEN); - break; - default : - gl2psMsg(GL2PS_WARNING, "Unknown mode in gl2psDisable: %d", mode); - return GL2PS_WARNING; - } - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psPointSize(GLfloat value) -{ - if(!gl2ps) return GL2PS_UNINITIALIZED; - - glPassThrough(GL2PS_POINT_SIZE_TOKEN); - glPassThrough(value); - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psLineWidth(GLfloat value) -{ - if(!gl2ps) return GL2PS_UNINITIALIZED; - - glPassThrough(GL2PS_LINE_WIDTH_TOKEN); - glPassThrough(value); - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psBlendFunc(GLenum sfactor, GLenum dfactor) -{ - if(!gl2ps) return GL2PS_UNINITIALIZED; - - if(GL_FALSE == gl2psSupportedBlendMode(sfactor, dfactor)) - return GL2PS_WARNING; - - glPassThrough(GL2PS_SRC_BLEND_TOKEN); - glPassThrough((GLfloat)sfactor); - glPassThrough(GL2PS_DST_BLEND_TOKEN); - glPassThrough((GLfloat)dfactor); - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psSetOptions(GLint options) -{ - if(!gl2ps) return GL2PS_UNINITIALIZED; - - gl2ps->options = options; - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API GLint gl2psGetOptions(GLint *options) -{ - if(!gl2ps) { - *options = 0; - return GL2PS_UNINITIALIZED; - } - - *options = gl2ps->options; - - return GL2PS_SUCCESS; -} - -GL2PSDLL_API const char *gl2psGetFileExtension(GLint format) -{ - if(format >= 0 && format < (GLint)(sizeof(gl2psbackends) / sizeof(gl2psbackends[0]))) - return gl2psbackends[format]->file_extension; - else - return "Unknown format"; -} - -GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format) -{ - if(format >= 0 && format < (GLint)(sizeof(gl2psbackends) / sizeof(gl2psbackends[0]))) - return gl2psbackends[format]->description; - else - return "Unknown format"; -} - -GL2PSDLL_API GLint gl2psGetFileFormat() -{ - return gl2ps->format; -} diff -Nru sumo-0.21.0+dfsg/src/foreign/gl2ps/gl2ps.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/gl2ps/gl2ps.h --- sumo-0.21.0+dfsg/src/foreign/gl2ps/gl2ps.h 2013-12-16 23:02:17.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/gl2ps/gl2ps.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,209 +0,0 @@ -/* - * GL2PS, an OpenGL to PostScript Printing Library - * Copyright (C) 1999-2012 C. Geuzaine - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of either: - * - * a) the GNU Library General Public License as published by the Free - * Software Foundation, either version 2 of the License, or (at your - * option) any later version; or - * - * b) the GL2PS License as published by Christophe Geuzaine, either - * version 2 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either - * the GNU Library General Public License or the GL2PS License for - * more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library in the file named "COPYING.LGPL"; - * if not, write to the Free Software Foundation, Inc., 51 Franklin - * Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * You should have received a copy of the GL2PS License with this - * library in the file named "COPYING.GL2PS"; if not, I will be glad - * to provide one. - * - * For the latest info about gl2ps and a full list of contributors, - * see http://www.geuz.org/gl2ps/. - * - * Please report all bugs and problems to . - */ - -#ifndef __GL2PS_H__ -#define __GL2PS_H__ - -#include -#include - -/* Define GL2PSDLL at compile time to build a Windows DLL */ - -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) -# if defined(_MSC_VER) -# 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) -# else -# define GL2PSDLL_API __declspec(dllimport) -# endif -# else -# define GL2PSDLL_API -# endif -#else -# define GL2PSDLL_API -#endif - -#if defined(__APPLE__) || defined(HAVE_OPENGL_GL_H) -# include -#else -# include -#endif - -/* Support for compressed PostScript/PDF/SVG and for embedded PNG - images in SVG */ - -#if defined(HAVE_ZLIB) || defined(HAVE_LIBZ) -# define GL2PS_HAVE_ZLIB -# if defined(HAVE_LIBPNG) || defined(HAVE_PNG) -# define GL2PS_HAVE_LIBPNG -# endif -#endif - -#if defined(HAVE_NO_VSNPRINTF) -# define GL2PS_HAVE_NO_VSNPRINTF -#endif - -/* Version number */ - -#define GL2PS_MAJOR_VERSION 1 -#define GL2PS_MINOR_VERSION 3 -#define GL2PS_PATCH_VERSION 8 -#define GL2PS_EXTRA_VERSION "" - -#define GL2PS_VERSION (GL2PS_MAJOR_VERSION + \ - 0.01 * GL2PS_MINOR_VERSION + \ - 0.0001 * GL2PS_PATCH_VERSION) - -#define GL2PS_COPYRIGHT "(C) 1999-2012 C. Geuzaine" - -/* Output file formats (the values and the ordering are important!) */ - -#define GL2PS_PS 0 -#define GL2PS_EPS 1 -#define GL2PS_TEX 2 -#define GL2PS_PDF 3 -#define GL2PS_SVG 4 -#define GL2PS_PGF 5 - -/* Sorting algorithms */ - -#define GL2PS_NO_SORT 1 -#define GL2PS_SIMPLE_SORT 2 -#define GL2PS_BSP_SORT 3 - -/* Message levels and error codes */ - -#define GL2PS_SUCCESS 0 -#define GL2PS_INFO 1 -#define GL2PS_WARNING 2 -#define GL2PS_ERROR 3 -#define GL2PS_NO_FEEDBACK 4 -#define GL2PS_OVERFLOW 5 -#define GL2PS_UNINITIALIZED 6 - -/* Options for gl2psBeginPage */ - -#define GL2PS_NONE 0 -#define GL2PS_DRAW_BACKGROUND (1<<0) -#define GL2PS_SIMPLE_LINE_OFFSET (1<<1) -#define GL2PS_SILENT (1<<2) -#define GL2PS_BEST_ROOT (1<<3) -#define GL2PS_OCCLUSION_CULL (1<<4) -#define GL2PS_NO_TEXT (1<<5) -#define GL2PS_LANDSCAPE (1<<6) -#define GL2PS_NO_PS3_SHADING (1<<7) -#define GL2PS_NO_PIXMAP (1<<8) -#define GL2PS_USE_CURRENT_VIEWPORT (1<<9) -#define GL2PS_COMPRESS (1<<10) -#define GL2PS_NO_BLENDING (1<<11) -#define GL2PS_TIGHT_BOUNDING_BOX (1<<12) - -/* Arguments for gl2psEnable/gl2psDisable */ - -#define GL2PS_POLYGON_OFFSET_FILL 1 -#define GL2PS_POLYGON_BOUNDARY 2 -#define GL2PS_LINE_STIPPLE 3 -#define GL2PS_BLEND 4 - -/* Text alignment (o=raster position; default mode is BL): - +---+ +---+ +---+ +---+ +---+ +---+ +-o-+ o---+ +---o - | o | o | | o | | | | | | | | | | | | - +---+ +---+ +---+ +-o-+ o---+ +---o +---+ +---+ +---+ - C CL CR B BL BR T TL TR */ - -#define GL2PS_TEXT_C 1 -#define GL2PS_TEXT_CL 2 -#define GL2PS_TEXT_CR 3 -#define GL2PS_TEXT_B 4 -#define GL2PS_TEXT_BL 5 -#define GL2PS_TEXT_BR 6 -#define GL2PS_TEXT_T 7 -#define GL2PS_TEXT_TL 8 -#define GL2PS_TEXT_TR 9 - -typedef GLfloat GL2PSrgba[4]; - -#if defined(__cplusplus) -extern "C" { -#endif - -GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, - GLint viewport[4], GLint format, GLint sort, - GLint options, GLint colormode, - GLint colorsize, GL2PSrgba *colormap, - GLint nr, GLint ng, GLint nb, GLint buffersize, - FILE *stream, const char *filename); -GL2PSDLL_API GLint gl2psEndPage(void); -GL2PSDLL_API GLint gl2psSetOptions(GLint options); -GL2PSDLL_API GLint gl2psGetOptions(GLint *options); -GL2PSDLL_API GLint gl2psBeginViewport(GLint viewport[4]); -GL2PSDLL_API GLint gl2psEndViewport(void); -GL2PSDLL_API GLint gl2psText(const char *str, const char *fontname, - GLshort fontsize); -GL2PSDLL_API GLint gl2psTextOpt(const char *str, const char *fontname, - GLshort fontsize, GLint align, GLfloat angle); -GL2PSDLL_API GLint gl2psTextOptColor(const char *str, const char *fontname, - GLshort fontsize, GLint align, GLfloat angle, - GL2PSrgba color); -GL2PSDLL_API GLint gl2psSpecial(GLint format, const char *str); -GL2PSDLL_API GLint gl2psDrawPixels(GLsizei width, GLsizei height, - GLint xorig, GLint yorig, - GLenum format, GLenum type, const void *pixels); -GL2PSDLL_API GLint gl2psEnable(GLint mode); -GL2PSDLL_API GLint gl2psDisable(GLint mode); -GL2PSDLL_API GLint gl2psPointSize(GLfloat value); -GL2PSDLL_API GLint gl2psLineWidth(GLfloat value); -GL2PSDLL_API GLint gl2psBlendFunc(GLenum sfactor, GLenum dfactor); - -/* undocumented */ -GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height, - const GLfloat position[3], - const unsigned char *imagemap); -GL2PSDLL_API const char *gl2psGetFileExtension(GLint format); -GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format); -GL2PSDLL_API GLint gl2psGetFileFormat(); - -#if defined(__cplusplus) -} -#endif - -#endif /* __GL2PS_H__ */ diff -Nru sumo-0.21.0+dfsg/src/foreign/gl2ps/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/gl2ps/Makefile.am --- sumo-0.21.0+dfsg/src/foreign/gl2ps/Makefile.am 2013-05-03 20:25:10.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/gl2ps/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -noinst_LIBRARIES = libgl2ps.a - -libgl2ps_a_SOURCES = \ -gl2ps.h gl2ps.c diff -Nru sumo-0.21.0+dfsg/src/foreign/gl2ps/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/gl2ps/Makefile.in --- sumo-0.21.0+dfsg/src/foreign/gl2ps/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/gl2ps/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,597 +0,0 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 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@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -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/foreign/gl2ps -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp -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 -AM_V_AR = $(am__v_AR_@AM_V@) -am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) -am__v_AR_0 = @echo " AR " $@; -am__v_AR_1 = -libgl2ps_a_AR = $(AR) $(ARFLAGS) -libgl2ps_a_LIBADD = -am_libgl2ps_a_OBJECTS = gl2ps.$(OBJEXT) -libgl2ps_a_OBJECTS = $(am_libgl2ps_a_OBJECTS) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libgl2ps_a_SOURCES) -DIST_SOURCES = $(libgl2ps_a_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -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@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -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_CONFIG = @FOX_CONFIG@ -FOX_LDFLAGS = @FOX_LDFLAGS@ -GDAL_CONFIG = @GDAL_CONFIG@ -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_GTEST = @LIB_GTEST@ -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 = libgl2ps.a -libgl2ps_a_SOURCES = \ -gl2ps.h gl2ps.c - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .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/foreign/gl2ps/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/foreign/gl2ps/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) - -libgl2ps.a: $(libgl2ps_a_OBJECTS) $(libgl2ps_a_DEPENDENCIES) $(EXTRA_libgl2ps_a_DEPENDENCIES) - $(AM_V_at)-rm -f libgl2ps.a - $(AM_V_AR)$(libgl2ps_a_AR) libgl2ps.a $(libgl2ps_a_OBJECTS) $(libgl2ps_a_LIBADD) - $(AM_V_at)$(RANLIB) libgl2ps.a - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl2ps.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - 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-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - 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" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -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: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -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 TAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \ - ctags-am 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 tags-am 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.21.0+dfsg/src/foreign/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/Makefile.am --- sumo-0.21.0+dfsg/src/foreign/Makefile.am 2013-05-03 20:25:10.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/Makefile.am 2015-04-17 05:44:23.000000000 +0000 @@ -3,7 +3,7 @@ endif if WITH_GUI -GUIDIRS = gl2ps polyfonts rtree +GUIDIRS = polyfonts rtree endif diff -Nru sumo-0.21.0+dfsg/src/foreign/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/Makefile.in --- sumo-0.21.0+dfsg/src/foreign/Makefile.in 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/Makefile.in 2015-04-17 05:44:23.000000000 +0000 @@ -142,7 +142,7 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = eulerspiral mersenne tcpip nvwa gl2ps polyfonts rtree +DIST_SUBDIRS = eulerspiral mersenne tcpip nvwa polyfonts rtree DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -206,6 +206,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -216,7 +218,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -311,7 +312,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @CHECK_MEMORY_LEAKS_TRUE@MEMDIRS = nvwa -@WITH_GUI_TRUE@GUIDIRS = gl2ps polyfonts rtree +@WITH_GUI_TRUE@GUIDIRS = polyfonts rtree EXTRA_DIST = additional.txt SUBDIRS = eulerspiral mersenne tcpip $(MEMDIRS) $(GUIDIRS) all: all-recursive diff -Nru sumo-0.21.0+dfsg/src/foreign/mersenne/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/mersenne/Makefile.in --- sumo-0.21.0+dfsg/src/foreign/mersenne/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/mersenne/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -146,6 +146,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -156,7 +158,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/foreign/nvwa/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/nvwa/Makefile.in --- sumo-0.21.0+dfsg/src/foreign/nvwa/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/nvwa/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -220,6 +220,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -230,7 +232,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/foreign/polyfonts/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/polyfonts/Makefile.in --- sumo-0.21.0+dfsg/src/foreign/polyfonts/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/polyfonts/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -203,6 +203,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -213,7 +215,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/foreign/rtree/LayeredRTree.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/rtree/LayeredRTree.h --- sumo-0.21.0+dfsg/src/foreign/rtree/LayeredRTree.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/rtree/LayeredRTree.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,7 +2,7 @@ /// @file LayeredRTree.h /// @author Jakob Erdmann /// @date 16.10.2012 -/// @version $Id: LayeredRTree.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: LayeredRTree.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A wrapper around RT-trees for for efficient storing of SUMO's GL-objects and // accessing them ordered by their layer @@ -12,8 +12,8 @@ // 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-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -76,7 +76,7 @@ * @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) { + void Insert(const float a_min[2], const float a_max[2], GUIGlObject* const & a_dataId) { myLayers[selectLayer(a_dataId)]->Insert(a_min, a_max, a_dataId); } @@ -86,7 +86,7 @@ * @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) { + void Remove(const float a_min[2], const float a_max[2], GUIGlObject* const & a_dataId) { myLayers[selectLayer(a_dataId)]->Remove(a_min, a_max, a_dataId); } diff -Nru sumo-0.21.0+dfsg/src/foreign/rtree/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/rtree/Makefile.in --- sumo-0.21.0+dfsg/src/foreign/rtree/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/rtree/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -146,6 +146,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -156,7 +158,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/foreign/rtree/SUMORTree.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/rtree/SUMORTree.h --- sumo-0.21.0+dfsg/src/foreign/rtree/SUMORTree.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/rtree/SUMORTree.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file SUMORTree.h /// @author Daniel Krajzewicz /// @date 27.10.2008 -/// @version $Id: SUMORTree.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: SUMORTree.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A RT-tree for efficient storing of SUMO's GL-objects /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -90,7 +90,7 @@ * @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) { + virtual void Insert(const float a_min[2], const float a_max[2], GUIGlObject* const & a_dataId) { AbstractMutex::ScopedLocker locker(myLock); GUI_RTREE_QUAL::Insert(a_min, a_max, a_dataId); } @@ -102,7 +102,7 @@ * @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) { + virtual void Remove(const float a_min[2], const float a_max[2], GUIGlObject* const & a_dataId) { AbstractMutex::ScopedLocker locker(myLock); GUI_RTREE_QUAL::Remove(a_min, a_max, a_dataId); } diff -Nru sumo-0.21.0+dfsg/src/foreign/tcpip/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/tcpip/Makefile.in --- sumo-0.21.0+dfsg/src/foreign/tcpip/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/tcpip/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -220,6 +220,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -230,7 +232,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/foreign/tcpip/socket.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/tcpip/socket.cpp --- sumo-0.21.0+dfsg/src/foreign/tcpip/socket.cpp 2013-05-03 20:33:40.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/tcpip/socket.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -615,7 +615,7 @@ /*----------------------------------------------------------------------- * Source $Source: $ * Version $Revision: 645 $ -* Date $Date: 2012-04-27 14:03:33 +0200 (Fr, 27. Apr 2012) $ +* Date $Date: 2012-04-27 14:03:33 +0200 (Fri, 27 Apr 2012) $ *----------------------------------------------------------------------- * $Log: $ *-----------------------------------------------------------------------*/ diff -Nru sumo-0.21.0+dfsg/src/foreign/tcpip/socket.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/tcpip/socket.h --- sumo-0.21.0+dfsg/src/foreign/tcpip/socket.h 2013-05-03 20:33:40.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/tcpip/socket.h 2015-04-17 05:44:20.000000000 +0000 @@ -153,7 +153,7 @@ /*----------------------------------------------------------------------- * Source $Source: $ * Version $Revision: 612 $ -* Date $Date: 2011-06-14 15:16:52 +0200 (Di, 14. Jun 2011) $ +* Date $Date: 2011-06-14 15:16:52 +0200 (Tue, 14 Jun 2011) $ *----------------------------------------------------------------------- * $Log:$ *-----------------------------------------------------------------------*/ diff -Nru sumo-0.21.0+dfsg/src/foreign/tcpip/storage.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/tcpip/storage.cpp --- sumo-0.21.0+dfsg/src/foreign/tcpip/storage.cpp 2013-05-03 20:33:40.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/tcpip/storage.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -438,7 +438,7 @@ /*----------------------------------------------------------------------- * Source $Source: $ * Version $Revision: 620 $ - * Date $Date: 2011-07-08 17:39:10 +0200 (Fr, 08. Jul 2011) $ + * Date $Date: 2011-07-08 17:39:10 +0200 (Fri, 08 Jul 2011) $ *----------------------------------------------------------------------- * $Log: $ *-----------------------------------------------------------------------*/ diff -Nru sumo-0.21.0+dfsg/src/foreign/tcpip/storage.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/tcpip/storage.h --- sumo-0.21.0+dfsg/src/foreign/tcpip/storage.h 2013-05-03 20:33:40.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/foreign/tcpip/storage.h 2015-04-17 05:44:20.000000000 +0000 @@ -127,7 +127,7 @@ /*----------------------------------------------------------------------- * Source $Source: $ * Version $Revision: 620 $ - * Date $Date: 2011-07-08 17:39:10 +0200 (Fr, 08. Jul 2011) $ + * Date $Date: 2011-07-08 17:39:10 +0200 (Fri, 08 Jul 2011) $ *----------------------------------------------------------------------- * $Log: $ *-----------------------------------------------------------------------*/ diff -Nru sumo-0.21.0+dfsg/src/gui/dialogs/GUIDialog_AboutSUMO.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/GUIDialog_AboutSUMO.cpp --- sumo-0.21.0+dfsg/src/gui/dialogs/GUIDialog_AboutSUMO.cpp 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/GUIDialog_AboutSUMO.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 08.03.2004 -/// @version $Id: GUIDialog_AboutSUMO.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDialog_AboutSUMO.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The application's "About" - dialog /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,6 +35,7 @@ #include "GUIDialog_AboutSUMO.h" #include +#include #include #ifdef CHECK_MEMORY_LEAKS @@ -108,7 +109,7 @@ // "SUMO " FXVerticalFrame* f4 = new FXVerticalFrame(f2, FRAME_NONE, 0, 0, 0, 0, 20, 0, 0, 0); myHeadlineFont = new FXFont(getApp(), "Arial", 18, FXFont::Bold); - FXLabel* l = new FXLabel(f4, (FXString)"SUMO " + VERSION_STRING, 0, LAYOUT_CENTER_Y | LAYOUT_CENTER_X | JUSTIFY_CENTER_X | LABEL_NORMAL, 0, 0, 0, 0, 0, 0, 0, 0); + FXLabel* l = new FXLabel(f4, ("SUMO " + getBuildName(VERSION_STRING)).c_str(), 0, LAYOUT_CENTER_Y | LAYOUT_CENTER_X | JUSTIFY_CENTER_X | LABEL_NORMAL, 0, 0, 0, 0, 0, 0, 0, 0); l->setFont(myHeadlineFont); new FXLabel(f4, "Simulation of Urban MObility", 0, LAYOUT_CENTER_Y | LAYOUT_CENTER_X | JUSTIFY_CENTER_X | LABEL_NORMAL, 0, 0, 0, 0, 0, 0, 0, 0); // @@ -117,10 +118,10 @@ // copyright notice new FXLabel(f3, "A microscopic, multi-modal, open source", 0, LABEL_NORMAL, 0, 0, 0, 0, 0, 0, 0, 0); new FXLabel(f3, "road traffic simulation.", 0, LABEL_NORMAL, 0, 0, 0, 0, 0, 0, 0, 0); - new FXLabel(f3, "Copyright (C) 2001-2014 DLR / Institute of Transportation Systems", 0, LAYOUT_CENTER_X | JUSTIFY_CENTER_X | LABEL_NORMAL, 0, 0, 0, 0, 0, 0, 0, 0); + new FXLabel(f3, "Copyright (C) 2001-2015 DLR / Institute of Transportation Systems", 0, LAYOUT_CENTER_X | JUSTIFY_CENTER_X | LABEL_NORMAL, 0, 0, 0, 0, 0, 0, 0, 0); - FXLinkLabel* link = new FXLinkLabel(f3, "http://sumo-sim.org", 0, LAYOUT_CENTER_X | JUSTIFY_CENTER_X | LABEL_NORMAL, 0, 0, 0, 0, 5, 5, 5, 5); - link->setTipText("http://sumo-sim.org"); + FXLinkLabel* link = new FXLinkLabel(f3, "http://sumo.dlr.de", 0, LAYOUT_CENTER_X | JUSTIFY_CENTER_X | LABEL_NORMAL, 0, 0, 0, 0, 5, 5, 5, 5); + link->setTipText("http://sumo.dlr.de"); // ok-button new FXButton(f1, "OK\t\t", 0, this, ID_ACCEPT, LAYOUT_FIX_WIDTH | LAYOUT_CENTER_X | JUSTIFY_CENTER_X | FRAME_THICK | FRAME_RAISED, 0, 0, 50, 30); setIcon(GUIIconSubSys::getIcon(ICON_APP)); diff -Nru sumo-0.21.0+dfsg/src/gui/dialogs/GUIDialog_AboutSUMO.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/GUIDialog_AboutSUMO.h --- sumo-0.21.0+dfsg/src/gui/dialogs/GUIDialog_AboutSUMO.h 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/GUIDialog_AboutSUMO.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: GUIDialog_AboutSUMO.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDialog_AboutSUMO.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The application's "About" - dialog /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/dialogs/GUIDialog_AppSettings.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/GUIDialog_AppSettings.cpp --- sumo-0.21.0+dfsg/src/gui/dialogs/GUIDialog_AppSettings.cpp 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/GUIDialog_AppSettings.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 08.03.2004 -/// @version $Id: GUIDialog_AppSettings.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDialog_AppSettings.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The application-settings dialog /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/dialogs/GUIDialog_AppSettings.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/GUIDialog_AppSettings.h --- sumo-0.21.0+dfsg/src/gui/dialogs/GUIDialog_AppSettings.h 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/GUIDialog_AppSettings.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 08.03.2004 -/// @version $Id: GUIDialog_AppSettings.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDialog_AppSettings.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The application-settings dialog /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/dialogs/GUIDialog_Breakpoints.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/GUIDialog_Breakpoints.cpp --- sumo-0.21.0+dfsg/src/gui/dialogs/GUIDialog_Breakpoints.cpp 2014-04-23 22:02:20.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/GUIDialog_Breakpoints.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 17 Jun 2004 -/// @version $Id: GUIDialog_Breakpoints.cpp 16231 2014-04-23 09:33:59Z behrisch $ +/// @version $Id: GUIDialog_Breakpoints.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Editor for simulation breakpoints /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/dialogs/GUIDialog_Breakpoints.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/GUIDialog_Breakpoints.h --- sumo-0.21.0+dfsg/src/gui/dialogs/GUIDialog_Breakpoints.h 2014-04-23 22:02:20.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/GUIDialog_Breakpoints.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Thu, 17 Jun 2004 -/// @version $Id: GUIDialog_Breakpoints.h 16231 2014-04-23 09:33:59Z behrisch $ +/// @version $Id: GUIDialog_Breakpoints.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Editor for simulation breakpoints /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/dialogs/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/Makefile.in --- sumo-0.21.0+dfsg/src/gui/dialogs/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/dialogs/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -222,6 +222,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -232,7 +234,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/gui/GUIApplicationWindow.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIApplicationWindow.cpp --- sumo-0.21.0+dfsg/src/gui/GUIApplicationWindow.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIApplicationWindow.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Andreas Gaubatz /// @date Sept 2002 -/// @version $Id: GUIApplicationWindow.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: GUIApplicationWindow.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The main window of the SUMO-gui. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,6 +41,8 @@ #include #include +#include +#include #include #include @@ -58,6 +60,7 @@ #include #include +#include #include #include #include @@ -93,6 +96,7 @@ FXMAPFUNC(SEL_COMMAND, MID_OPEN_CONFIG, GUIApplicationWindow::onCmdOpenConfiguration), FXMAPFUNC(SEL_COMMAND, MID_OPEN_NETWORK, GUIApplicationWindow::onCmdOpenNetwork), + FXMAPFUNC(SEL_COMMAND, MID_OPEN_SHAPES, GUIApplicationWindow::onCmdOpenShapes), FXMAPFUNC(SEL_COMMAND, MID_RECENTFILE, GUIApplicationWindow::onCmdOpenRecent), FXMAPFUNC(SEL_COMMAND, MID_RELOAD, GUIApplicationWindow::onCmdReload), FXMAPFUNC(SEL_COMMAND, MID_CLOSE, GUIApplicationWindow::onCmdClose), @@ -101,6 +105,7 @@ FXMAPFUNC(SEL_COMMAND, MID_APPSETTINGS, GUIApplicationWindow::onCmdAppSettings), FXMAPFUNC(SEL_COMMAND, MID_GAMING, GUIApplicationWindow::onCmdGaming), + FXMAPFUNC(SEL_COMMAND, MID_FULLSCREEN, GUIApplicationWindow::onCmdFullScreen), FXMAPFUNC(SEL_COMMAND, MID_LISTINTERNAL, GUIApplicationWindow::onCmdListInternal), FXMAPFUNC(SEL_COMMAND, MID_ABOUT, GUIApplicationWindow::onCmdAbout), FXMAPFUNC(SEL_COMMAND, MID_NEW_MICROVIEW, GUIApplicationWindow::onCmdNewView), @@ -116,6 +121,8 @@ FXMAPFUNC(SEL_UPDATE, MID_OPEN_CONFIG, GUIApplicationWindow::onUpdOpen), FXMAPFUNC(SEL_UPDATE, MID_OPEN_NETWORK, GUIApplicationWindow::onUpdOpen), + FXMAPFUNC(SEL_UPDATE, MID_OPEN_NETWORK, GUIApplicationWindow::onUpdOpen), + FXMAPFUNC(SEL_UPDATE, MID_OPEN_SHAPES, GUIApplicationWindow::onUpdReload), FXMAPFUNC(SEL_UPDATE, MID_RELOAD, GUIApplicationWindow::onUpdReload), FXMAPFUNC(SEL_UPDATE, MID_RECENTFILE, GUIApplicationWindow::onUpdOpenRecent), FXMAPFUNC(SEL_UPDATE, MID_NEW_MICROVIEW, GUIApplicationWindow::onUpdAddView), @@ -132,6 +139,7 @@ FXMAPFUNC(SEL_COMMAND, MID_LOCATEJUNCTION, GUIApplicationWindow::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_LOCATEEDGE, GUIApplicationWindow::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_LOCATEVEHICLE, GUIApplicationWindow::onCmdLocate), + FXMAPFUNC(SEL_COMMAND, MID_LOCATEPERSON, GUIApplicationWindow::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_LOCATETLS, GUIApplicationWindow::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_LOCATEADD, GUIApplicationWindow::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOI, GUIApplicationWindow::onCmdLocate), @@ -139,6 +147,7 @@ FXMAPFUNC(SEL_UPDATE, MID_LOCATEJUNCTION, GUIApplicationWindow::onUpdNeedsSimulation), FXMAPFUNC(SEL_UPDATE, MID_LOCATEEDGE, GUIApplicationWindow::onUpdNeedsSimulation), FXMAPFUNC(SEL_UPDATE, MID_LOCATEVEHICLE, GUIApplicationWindow::onUpdNeedsSimulation), + FXMAPFUNC(SEL_UPDATE, MID_LOCATEPERSON, GUIApplicationWindow::onUpdNeedsSimulation), FXMAPFUNC(SEL_UPDATE, MID_LOCATETLS, GUIApplicationWindow::onUpdNeedsSimulation), FXMAPFUNC(SEL_UPDATE, MID_LOCATEADD, GUIApplicationWindow::onUpdNeedsSimulation), FXMAPFUNC(SEL_UPDATE, MID_LOCATEPOI, GUIApplicationWindow::onUpdNeedsSimulation), @@ -172,6 +181,8 @@ myRecentNets(a, "nets"), myConfigPattern(configPattern), hadDependentBuild(false), myShowTimeAsHMS(false), + myAmFullScreen(false), + myHaveNotifiedAboutSimEnd(false), // game specific myJamSoundTime(60), myWaitingTime(0), @@ -249,7 +260,7 @@ // set the status bar myStatusbar->getStatusLine()->setText("Ready."); // set the caption - setTitle(MFXUtils::getTitleText(("SUMO " + std::string(VERSION_STRING)).c_str())); + setTitle(MFXUtils::getTitleText(("SUMO " + getBuildName(VERSION_STRING)).c_str())); // start the simulation-thread (it will loop until the application ends deciding by itself whether to perform a step or not) myRunThread->start(); @@ -321,7 +332,7 @@ while (!myEvents.empty()) { // get the next event - GUIEvent* e = static_cast(myEvents.top()); + GUIEvent* e = myEvents.top(); myEvents.pop(); delete e; } @@ -348,6 +359,9 @@ "Open &Network...\tCtl-N\tOpen a network.", GUIIconSubSys::getIcon(ICON_OPEN_NET), this, MID_OPEN_NETWORK); new FXMenuCommand(myFileMenu, + "Open Shapes \tCtl-P\tLoad POIs and Polygons for visualization.", + GUIIconSubSys::getIcon(ICON_OPEN_SHAPES), this, MID_OPEN_SHAPES); + new FXMenuCommand(myFileMenu, "&Reload\tCtl-R\tReloads the simulation / the network.", GUIIconSubSys::getIcon(ICON_RELOAD), this, MID_RELOAD); new FXMenuSeparator(myFileMenu); @@ -422,6 +436,9 @@ new FXMenuCheck(mySettingsMenu, "Gaming Mode\tCtl-G\tToggle gaming mode on/off.", this, MID_GAMING); + new FXMenuCheck(mySettingsMenu, + "Full Screen Mode\tCtl-F\tToggle full screen mode on/off.", + this, MID_FULLSCREEN); // build Locate menu myLocatorMenu = new FXMenuPane(this); new FXMenuTitle(myMenuBar, "&Locate", NULL, myLocatorMenu); @@ -437,16 +454,19 @@ GUIIconSubSys::getIcon(ICON_LOCATEVEHICLE), this, MID_LOCATEVEHICLE); } new FXMenuCommand(myLocatorMenu, + "Locate &Persons\t\tOpen a Dialog for Locating a Person.", + GUIIconSubSys::getIcon(ICON_LOCATEPERSON), this, MID_LOCATEPERSON); + new FXMenuCommand(myLocatorMenu, "Locate &TLS\t\tOpen a Dialog for Locating a Traffic Light.", GUIIconSubSys::getIcon(ICON_LOCATETLS), this, MID_LOCATETLS); new FXMenuCommand(myLocatorMenu, "Locate &Additional\t\tOpen a Dialog for Locating an Additional Structure.", GUIIconSubSys::getIcon(ICON_LOCATEADD), this, MID_LOCATEADD); new FXMenuCommand(myLocatorMenu, - "Locate &PoI\t\tOpen a Dialog for Locating a Point of Intereset.", + "Locate P&oI\t\tOpen a Dialog for Locating a Point of Intereset.", GUIIconSubSys::getIcon(ICON_LOCATEPOI), this, MID_LOCATEPOI); new FXMenuCommand(myLocatorMenu, - "Locate P&olygon\t\tOpen a Dialog for Locating a Polygon.", + "Locate Po&lygon\t\tOpen a Dialog for Locating a Polygon.", GUIIconSubSys::getIcon(ICON_LOCATEPOLY), this, MID_LOCATEPOLY); new FXMenuSeparator(myLocatorMenu); new FXMenuCheck(myLocatorMenu, @@ -633,10 +653,12 @@ long GUIApplicationWindow::onCmdQuit(FXObject*, FXSelector, void*) { - getApp()->reg().writeIntEntry("SETTINGS", "x", getX()); - getApp()->reg().writeIntEntry("SETTINGS", "y", getY()); - getApp()->reg().writeIntEntry("SETTINGS", "width", getWidth()); - getApp()->reg().writeIntEntry("SETTINGS", "height", getHeight()); + if (!myAmFullScreen) { + getApp()->reg().writeIntEntry("SETTINGS", "x", getX()); + getApp()->reg().writeIntEntry("SETTINGS", "y", getY()); + getApp()->reg().writeIntEntry("SETTINGS", "width", getWidth()); + getApp()->reg().writeIntEntry("SETTINGS", "height", getHeight()); + } getApp()->reg().writeStringEntry("SETTINGS", "basedir", gCurrentFolder.text()); getApp()->reg().writeIntEntry("SETTINGS", "maximized", isMaximized() ? 1 : 0); getApp()->reg().writeIntEntry("gui", "timeasHMS", myShowTimeAsHMS ? 1 : 0); @@ -703,7 +725,7 @@ if (opendialog.execute()) { gCurrentFolder = opendialog.getDirectory(); std::string file = opendialog.getFilename().text(); - load(file, false); + loadConfigOrNet(file, false); myRecentConfigs.appendFile(file.c_str()); } return 1; @@ -723,7 +745,7 @@ if (opendialog.execute()) { gCurrentFolder = opendialog.getDirectory(); std::string file = opendialog.getFilename().text(); - load(file, true); + loadConfigOrNet(file, true); myRecentNets.appendFile(file.c_str()); } return 1; @@ -731,8 +753,31 @@ long +GUIApplicationWindow::onCmdOpenShapes(FXObject*, FXSelector, void*) { + // get the shape file name + FXFileDialog opendialog(this, "Open Shapes"); + opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + opendialog.setSelectMode(SELECTFILE_EXISTING); + opendialog.setPatternList("Additional files (*.xml)\nAll files (*)"); + if (gCurrentFolder.length() != 0) { + opendialog.setDirectory(gCurrentFolder); + } + if (opendialog.execute()) { + gCurrentFolder = opendialog.getDirectory(); + std::string file = opendialog.getFilename().text(); + + NLShapeHandler handler(file, myRunThread->getNet().getShapeContainer()); + if (!XMLSubSys::runParser(handler, file, false)) { + WRITE_MESSAGE("Loading of " + file + " failed."); + } + } + return 1; +} + + +long GUIApplicationWindow::onCmdReload(FXObject*, FXSelector, void*) { - load("", false, true); + loadConfigOrNet("", false, true); return 1; } @@ -744,7 +789,7 @@ return 1; } std::string file((const char*)data); - load(file, sender == &myRecentNets); + loadConfigOrNet(file, sender == &myRecentNets); return 1; } @@ -951,12 +996,62 @@ myLCDLabel->setFgColor(MFXUtils::getFXColor(RGBColor::GREEN)); gSchemeStorage.getDefault().gaming = false; } + if (myMDIClient->numChildren() > 0) { + GUISUMOViewParent* w = dynamic_cast(myMDIClient->getActiveChild()); + if (w != 0) { + w->setToolBarVisibility(!myAmGaming && !myAmFullScreen); + } + } update(); return 1; } long +GUIApplicationWindow::onCmdFullScreen(FXObject*, FXSelector, void*) { + myAmFullScreen = !myAmFullScreen; + if (myAmFullScreen) { + getApp()->reg().writeIntEntry("SETTINGS", "x", getX()); + getApp()->reg().writeIntEntry("SETTINGS", "y", getY()); + getApp()->reg().writeIntEntry("SETTINGS", "width", getWidth()); + getApp()->reg().writeIntEntry("SETTINGS", "height", getHeight()); + maximize(); + setDecorations(DECOR_NONE); + place(PLACEMENT_MAXIMIZED); + myMenuBar->hide(); + myStatusbar->hide(); + myToolBar1->hide(); + myToolBar2->hide(); + myToolBar3->hide(); + myToolBar4->hide(); + myToolBar5->hide(); + myToolBar6->hide(); + myToolBar7->hide(); + myMessageWindow->hide(); + if (myMDIClient->numChildren() > 0) { + GUISUMOViewParent* w = dynamic_cast(myMDIClient->getActiveChild()); + if (w != 0) { + w->setToolBarVisibility(false); + } + } + update(); + } else { + place(PLACEMENT_VISIBLE); + setDecorations(DECOR_ALL); + restore(); + myToolBar3->show(); + myAmGaming = !myAmGaming; + onCmdGaming(0, 0, 0); + setWidth(getApp()->reg().readIntEntry("SETTINGS", "width", 600)); + setHeight(getApp()->reg().readIntEntry("SETTINGS", "height", 400)); + setX(getApp()->reg().readIntEntry("SETTINGS", "x", 150)); + setY(getApp()->reg().readIntEntry("SETTINGS", "y", 150)); + } + return 1; +} + + +long GUIApplicationWindow::onCmdListInternal(FXObject*, FXSelector, void*) { myListInternal = !myListInternal; return 1; @@ -1015,7 +1110,7 @@ GUIApplicationWindow::eventOccured() { while (!myEvents.empty()) { // get the next event - GUIEvent* e = static_cast(myEvents.top()); + GUIEvent* e = myEvents.top(); myEvents.pop(); // process switch (e->getOwnType()) { @@ -1068,6 +1163,7 @@ // report success setStatusBarText("'" + ec->myFile + "' loaded."); myWasStarted = false; + myHaveNotifiedAboutSimEnd = false; // initialise views myViewNumber = 0; const GUISUMOViewParent::ViewType defaultType = ec->myOsgView ? GUISUMOViewParent::VIEW_3D_OSG : GUISUMOViewParent::VIEW_2D_OPENGL; @@ -1108,10 +1204,10 @@ } if (isGaming()) { - setTitle("SUMO Traffic Light Game"); + setTitle("SUMO Interactive Traffic Light"); } else { // set simulation name on the caption - std::string caption = "SUMO " + std::string(VERSION_STRING); + std::string caption = "SUMO " + getBuildName(VERSION_STRING); setTitle(MFXUtils::getTitleText(caption.c_str(), ec->myFile.c_str())); } // set simulation step begin information @@ -1141,7 +1237,7 @@ void GUIApplicationWindow::handleEvent_Message(GUIEvent* e) { GUIEvent_Message* ec = static_cast(e); - myMessageWindow->appendText(ec->getOwnType(), ec->getMsg()); + myMessageWindow->appendMsg(ec->getOwnType(), ec->getMsg()); } @@ -1152,11 +1248,12 @@ if (GUIGlobals::gQuitOnEnd) { closeAllWindows(); getApp()->exit(ec->getReason() == MSNet::SIMSTATE_ERROR_IN_SIM); - } else { + } else if (!myHaveNotifiedAboutSimEnd) { // 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", "%s", text.c_str()); + myHaveNotifiedAboutSimEnd = true; } } @@ -1166,6 +1263,7 @@ MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl(); MSVehicleControl::constVehIt it = vc.loadedVehBegin(); MSVehicleControl::constVehIt end = vc.loadedVehEnd(); +#ifdef HAVE_INTERNAL if (myJamSounds.getOverallProb() > 0) { // play honking sound if some vehicle is waiting too long for (; it != end; ++it) { @@ -1181,6 +1279,7 @@ } } } +#endif // updated peformance indicators for (it = vc.loadedVehBegin(); it != end; ++it) { @@ -1199,16 +1298,16 @@ void -GUIApplicationWindow::load(const std::string& file, bool isNet, bool isReload) { +GUIApplicationWindow::loadConfigOrNet(const std::string& file, bool isNet, bool isReload) { getApp()->beginWaitCursor(); myAmLoading = true; closeAllWindows(); if (isReload) { - myLoadThread->start(); + myLoadThread->reloadConfigOrNet(); setStatusBarText("Reloading."); } else { gSchemeStorage.saveViewport(0, 0, -1); // recenter view - myLoadThread->load(file, isNet); + myLoadThread->loadConfigOrNet(file, isNet); setStatusBarText("Loading '" + file + "'."); } update(); @@ -1263,7 +1362,7 @@ // delete the simulation myRunThread->deleteSim(); // reset the caption - setTitle(MFXUtils::getTitleText(("SUMO " + std::string(VERSION_STRING)).c_str())); + setTitle(MFXUtils::getTitleText(("SUMO " + getBuildName(VERSION_STRING)).c_str())); // delete other children while (myTrackerWindows.size() != 0) { delete myTrackerWindows[0]; @@ -1300,7 +1399,7 @@ void GUIApplicationWindow::loadOnStartup() { - load("", false); + loadConfigOrNet("", false); } diff -Nru sumo-0.21.0+dfsg/src/gui/GUIApplicationWindow.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIApplicationWindow.h --- sumo-0.21.0+dfsg/src/gui/GUIApplicationWindow.h 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIApplicationWindow.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Christian Roessel /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIApplicationWindow.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: GUIApplicationWindow.h 18096 2015-03-17 09:50:59Z behrisch $ /// // The main window of the SUMO-gui. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -134,6 +134,9 @@ /// @brief Called on menu File->Open Network long onCmdOpenNetwork(FXObject*, FXSelector, void*); + /// @brief Called on menu File->Load Shapes + long onCmdOpenShapes(FXObject*, FXSelector, void*); + /// @brief Called on reload long onCmdReload(FXObject*, FXSelector, void*); @@ -160,6 +163,9 @@ /// @brief Toggle gaming mode long onCmdGaming(FXObject*, FXSelector, void*); + /// @brief Toggle full screen mode + long onCmdFullScreen(FXObject*, FXSelector, void*); + /// @brief Toggle listing of internal structures long onCmdListInternal(FXObject*, FXSelector, void*); @@ -229,12 +235,20 @@ long onClipboardRequest(FXObject* sender, FXSelector sel, void* ptr); /// @} + + /** @brief Returns the simulation delay + * @return delay in milliseconds + */ + virtual SUMOReal getDelay() const { + return mySimDelayTarget->getValue(); + } + protected: virtual void addToWindowsMenu(FXMenuPane*) { } private: /** starts to load a simulation */ - void load(const std::string& file, bool isNet, bool isReload = false); + void loadConfigOrNet(const std::string& file, bool isNet, bool isReload = false); /** this method closes all windows and deletes the current simulation */ void closeAllWindows(); @@ -300,7 +314,7 @@ SUMOTime myAlternateSimDelay; /// List of got requests - MFXEventQue myEvents; + MFXEventQue myEvents; /// The menu used for the MDI-windows FXMDIMenu* myMDIMenu; @@ -334,6 +348,11 @@ /// @brief whether to show time as hour:minute:second bool myShowTimeAsHMS; + /// @brief whether to show the window in full screen mode + bool myAmFullScreen; + + /// @brief whether the simulation end was already announced + bool myHaveNotifiedAboutSimEnd; /// @name game related things /// { diff -Nru sumo-0.21.0+dfsg/src/gui/GUIEvent_SimulationEnded.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIEvent_SimulationEnded.h --- sumo-0.21.0+dfsg/src/gui/GUIEvent_SimulationEnded.h 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIEvent_SimulationEnded.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 19 Jun 2003 -/// @version $Id: GUIEvent_SimulationEnded.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIEvent_SimulationEnded.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Event sent when the the simulation is over /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/GUIEvent_SimulationLoaded.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIEvent_SimulationLoaded.h --- sumo-0.21.0+dfsg/src/gui/GUIEvent_SimulationLoaded.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIEvent_SimulationLoaded.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: GUIEvent_SimulationLoaded.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUIEvent_SimulationLoaded.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Event send when the simulation has been loaded by GUILadThread /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/GUIGlobals.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIGlobals.cpp --- sumo-0.21.0+dfsg/src/gui/GUIGlobals.cpp 2014-04-23 22:02:20.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIGlobals.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004 -/// @version $Id: GUIGlobals.cpp 16231 2014-04-23 09:33:59Z behrisch $ +/// @version $Id: GUIGlobals.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // } /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/GUIGlobals.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIGlobals.h --- sumo-0.21.0+dfsg/src/gui/GUIGlobals.h 2014-04-23 22:02:20.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIGlobals.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date 2004 -/// @version $Id: GUIGlobals.h 16231 2014-04-23 09:33:59Z behrisch $ +/// @version $Id: GUIGlobals.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some global variables (yep) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/GUILoadThread.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUILoadThread.cpp --- sumo-0.21.0+dfsg/src/gui/GUILoadThread.cpp 2014-04-10 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUILoadThread.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUILoadThread.cpp 16163 2014-04-10 13:44:46Z namdre $ +/// @version $Id: GUILoadThread.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Class describing the thread that performs the loading of a simulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -55,7 +55,9 @@ #include #include #include +#include #include +#include #include "GUIApplicationWindow.h" #include "GUILoadThread.h" #include "GUIGlobals.h" @@ -79,7 +81,7 @@ // member method definitions // =========================================================================== GUILoadThread::GUILoadThread(FXApp* app, MFXInterThreadEventClient* mw, - MFXEventQue& eq, FXEX::FXThreadEvent& ev) + MFXEventQue& eq, FXEX::FXThreadEvent& ev) : FXSingleEventThread(app, mw), myParent(mw), myEventQue(eq), myEventThrow(ev) { myErrorRetriever = new MsgRetrievingFunction(this, &GUILoadThread::retrieveMessage, MsgHandler::MT_ERROR); @@ -113,23 +115,45 @@ } // try to load the given configuration - if (!initOptions()) { + try { + oc.clear(); + MSFrame::fillOptions(); + if (myFile != "") { + myTitle = myFile; + // triggered by menu option + if (myLoadNet) { + oc.set("net-file", myFile); + } else { + oc.set("configuration-file", myFile); + } + OptionsIO::getOptions(true, 1, 0); + } else { + // triggered at application start or reload + OptionsIO::getOptions(true); + if (oc.isSet("configuration-file")) { + myTitle = oc.getString("configuration-file"); + } else if (oc.isSet("net-file")) { + myTitle = oc.getString("net-file"); + } + } + // within gui-based applications, nothing is reported to the console + MsgHandler::getMessageInstance()->removeRetriever(&OutputDevice::getDevice("stdout")); + MsgHandler::getWarningInstance()->removeRetriever(&OutputDevice::getDevice("stderr")); + MsgHandler::getErrorInstance()->removeRetriever(&OutputDevice::getDevice("stderr")); + // do this once again to get parsed options + MsgHandler::initOutputOptions(); + XMLSubSys::setValidation(oc.getString("xml-validation"), oc.getString("xml-validation.net")); + GUIGlobals::gRunAfterLoad = oc.getBool("start"); + GUIGlobals::gQuitOnEnd = oc.getBool("quit-on-end"); + if (!MSFrame::checkOptions()) { + throw ProcessError(); + } + } catch (ProcessError& e) { + if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) { + WRITE_ERROR(e.what()); + } // the options are not valid but maybe we want to quit GUIGlobals::gQuitOnEnd = oc.getBool("quit-on-end"); - submitEndAndCleanup(net, simStartTime, simEndTime); - return 0; - } - // within gui-based applications, nothing is reported to the console - MsgHandler::getMessageInstance()->removeRetriever(&OutputDevice::getDevice("stdout")); - MsgHandler::getWarningInstance()->removeRetriever(&OutputDevice::getDevice("stderr")); - MsgHandler::getErrorInstance()->removeRetriever(&OutputDevice::getDevice("stderr")); - // do this once again to get parsed options - MsgHandler::initOutputOptions(); - XMLSubSys::setValidation(oc.getString("xml-validation"), oc.getString("xml-validation.net")); - 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); return 0; @@ -137,7 +161,7 @@ // initialise global settings RandHelper::initRandGlobal(); - RandHelper::initRandGlobal(&MSVehicleControl::myVehicleParamsRNG); + RandHelper::initRandGlobal(MSRouteHandler::getParsingRNG()); MSFrame::setMSGlobals(oc); GUITexturesHelper::allowTextures(!oc.getBool("disable-textures")); MSVehicleControl* vehControl = 0; @@ -220,41 +244,19 @@ MsgHandler::getWarningInstance()->removeRetriever(myWarningRetriever); MsgHandler::getMessageInstance()->removeRetriever(myMessageRetriever); // inform parent about the process - GUIEvent* e = new GUIEvent_SimulationLoaded(net, simStartTime, simEndTime, myFile, guiSettingsFiles, osgView); + GUIEvent* e = new GUIEvent_SimulationLoaded(net, simStartTime, simEndTime, myTitle, guiSettingsFiles, osgView); myEventQue.add(e); myEventThrow.signal(); } -bool -GUILoadThread::initOptions() { - try { - OptionsCont& oc = OptionsCont::getOptions(); - oc.clear(); - MSFrame::fillOptions(); - if (myFile != "") { - if (myLoadNet) { - oc.set("net-file", myFile); - } else { - oc.set("configuration-file", myFile); - } - OptionsIO::getOptions(true, 1, 0); - } else { - OptionsIO::getOptions(true); - } - return true; - } catch (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); - } - return false; +void +GUILoadThread::reloadConfigOrNet() { + start(); } - void -GUILoadThread::load(const std::string& file, bool isNet) { +GUILoadThread::loadConfigOrNet(const std::string& file, bool isNet) { myFile = file; myLoadNet = isNet; start(); diff -Nru sumo-0.21.0+dfsg/src/gui/GUILoadThread.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUILoadThread.h --- sumo-0.21.0+dfsg/src/gui/GUILoadThread.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUILoadThread.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: GUILoadThread.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUILoadThread.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Class describing the thread that performs the loading of a simulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -34,17 +34,18 @@ #endif #include +#include #include #include -#include +#include // =========================================================================== // class declarations // =========================================================================== class MFXInterThreadEventClient; -class MFXEventQue; class GUINet; +class GUIEvent; // =========================================================================== @@ -56,7 +57,7 @@ class GUILoadThread : public FXSingleEventThread { public: /// constructor - GUILoadThread(FXApp* app, MFXInterThreadEventClient* mw, MFXEventQue& eq, + GUILoadThread(FXApp* app, MFXInterThreadEventClient* mw, MFXEventQue& eq, FXEX::FXThreadEvent& ev); /// destructor @@ -66,8 +67,11 @@ the thread ends after the net has been loaded */ FXint run(); + /// reloads according to the given input options + void reloadConfigOrNet(); + /// begins the loading of the given file - void load(const std::string& file, bool isNet); + void loadConfigOrNet(const std::string& file, bool isNet); /// Retrieves messages from the loading module void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg); @@ -75,9 +79,6 @@ const std::string& getFileName() const; protected: - virtual bool initOptions(); - - /** @brief Closes the loading process * * This method is called both on success and failure. @@ -94,11 +95,14 @@ /// the path to load the simulation from std::string myFile; + /// the title string for the application + std::string myTitle; + /** @brief The instances of message retriever encapsulations Needed to be deleted from the handler later on */ OutputDevice* myErrorRetriever, *myMessageRetriever, *myWarningRetriever; - MFXEventQue& myEventQue; + MFXEventQue& myEventQue; FXEX::FXThreadEvent& myEventThrow; diff -Nru sumo-0.21.0+dfsg/src/gui/GUIManipulator.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIManipulator.cpp --- sumo-0.21.0+dfsg/src/gui/GUIManipulator.cpp 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIManipulator.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file GUIManipulator.cpp /// @author Daniel Krajzewicz /// @date Jun 2004 -/// @version $Id: GUIManipulator.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIManipulator.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Abstract GUI manipulation class /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/GUIManipulator.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIManipulator.h --- sumo-0.21.0+dfsg/src/gui/GUIManipulator.h 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIManipulator.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Sascha Krieg /// @date Jun 2004 -/// @version $Id: GUIManipulator.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIManipulator.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Abstract GUI manipulation class /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/GUIRunThread.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIRunThread.cpp --- sumo-0.21.0+dfsg/src/gui/GUIRunThread.cpp 2014-04-23 22:02:20.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIRunThread.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIRunThread.cpp 16231 2014-04-23 09:33:59Z behrisch $ +/// @version $Id: GUIRunThread.cpp 18154 2015-03-26 08:46:55Z namdre $ /// // The thread that runs the simulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -63,7 +63,7 @@ // member method definitions // =========================================================================== GUIRunThread::GUIRunThread(FXApp* app, MFXInterThreadEventClient* parent, - FXRealSpinDial& simDelay, MFXEventQue& eq, + FXRealSpinDial& simDelay, MFXEventQue& eq, FXEX::FXThreadEvent& ev) : FXSingleEventThread(app, parent), myNet(0), myHalting(true), myQuit(false), mySimulationInProgress(false), myOk(true), @@ -90,6 +90,7 @@ GUIRunThread::init(GUINet* net, SUMOTime start, SUMOTime end) { assert(net != 0); // assign new values + myOk = true; myNet = net; mySimStartTime = start; mySimEndTime = end; @@ -160,7 +161,7 @@ } } else { // sleep if the simulation is not running - sleep(500); + sleep(50); } } // delete a maybe existing simulation at the end diff -Nru sumo-0.21.0+dfsg/src/gui/GUIRunThread.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIRunThread.h --- sumo-0.21.0+dfsg/src/gui/GUIRunThread.h 2014-04-23 22:02:20.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIRunThread.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIRunThread.h 16231 2014-04-23 09:33:59Z behrisch $ +/// @version $Id: GUIRunThread.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The thread that runs the simulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -46,6 +46,7 @@ // class declarations // =========================================================================== class GUINet; +class GUIEvent; class OutputDevice; @@ -63,7 +64,7 @@ public: /// constructor GUIRunThread(FXApp* app, MFXInterThreadEventClient* mw, - FXRealSpinDial& simDelay, MFXEventQue& eq, FXEX::FXThreadEvent& ev); + FXRealSpinDial& simDelay, MFXEventQue& eq, FXEX::FXThreadEvent& ev); /// destructor virtual ~GUIRunThread(); @@ -152,7 +153,7 @@ FXRealSpinDial& mySimDelay; - MFXEventQue& myEventQue; + MFXEventQue& myEventQue; FXEX::FXThreadEvent& myEventThrow; diff -Nru sumo-0.21.0+dfsg/src/gui/GUISUMOViewParent.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUISUMOViewParent.cpp --- sumo-0.21.0+dfsg/src/gui/GUISUMOViewParent.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUISUMOViewParent.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Laura Bieker /// @author Andreas Gaubatz /// @date Sept 2002 -/// @version $Id: GUISUMOViewParent.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: GUISUMOViewParent.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A single child window which contains a view of the simulation area /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -34,7 +34,6 @@ #include #include -#include #include #include #include @@ -43,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -50,10 +50,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include "GUIGlobals.h" #include "GUIViewTraffic.h" @@ -78,6 +80,7 @@ FXMAPFUNC(SEL_COMMAND, MID_LOCATEJUNCTION, GUISUMOViewParent::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_LOCATEEDGE, GUISUMOViewParent::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_LOCATEVEHICLE, GUISUMOViewParent::onCmdLocate), + FXMAPFUNC(SEL_COMMAND, MID_LOCATEPERSON, GUISUMOViewParent::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_LOCATETLS, GUISUMOViewParent::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_LOCATEADD, GUISUMOViewParent::onCmdLocate), FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOI, GUISUMOViewParent::onCmdLocate), @@ -130,11 +133,11 @@ void -GUISUMOViewParent::toggleGaming() { - if (myParent->isGaming()) { - myNavigationToolBar->hide(); - } else { +GUISUMOViewParent::setToolBarVisibility(const bool value) { + if (value) { myNavigationToolBar->show(); + } else { + myNavigationToolBar->hide(); } } @@ -170,49 +173,46 @@ long GUISUMOViewParent::onCmdLocate(FXObject*, FXSelector sel, void*) { - GUIGlObjectType type; std::vector ids; GUIIcon icon; std::string title; switch (FXSELID(sel)) { case MID_LOCATEJUNCTION: - type = GLO_JUNCTION; ids = static_cast(GUINet::getInstance())->getJunctionIDs(myParent->listInternal()); icon = ICON_LOCATEJUNCTION; title = "Junction Chooser"; break; case MID_LOCATEEDGE: - type = GLO_EDGE; ids = GUIEdge::getIDs(myParent->listInternal()); icon = ICON_LOCATEEDGE; title = "Edge Chooser"; break; case MID_LOCATEVEHICLE: - type = GLO_VEHICLE; static_cast(MSNet::getInstance()->getVehicleControl()).insertVehicleIDs(ids); icon = ICON_LOCATEVEHICLE; title = "Vehicle Chooser"; break; + case MID_LOCATEPERSON: + static_cast(MSNet::getInstance()->getPersonControl()).insertPersonIDs(ids); + icon = ICON_LOCATEPERSON; + title = "Person Chooser"; + break; case MID_LOCATETLS: - type = GLO_TLLOGIC; ids = static_cast(GUINet::getInstance())->getTLSIDs(); icon = ICON_LOCATETLS; title = "Traffic Lights Chooser"; break; case MID_LOCATEADD: - type = GLO_ADDITIONAL; ids = GUIGlObject_AbstractAdd::getIDList(); icon = ICON_LOCATEADD; title = "Additional Objects Chooser"; break; case MID_LOCATEPOI: - type = GLO_POI; ids = static_cast(GUINet::getInstance()->getShapeContainer()).getPOIIds(); icon = ICON_LOCATEPOI; title = "POI Chooser"; break; case MID_LOCATEPOLY: - type = GLO_POLYGON; ids = static_cast(GUINet::getInstance()->getShapeContainer()).getPolygonIDs(); icon = ICON_LOCATEPOLY; title = "Polygon Chooser"; @@ -224,7 +224,7 @@ myLocatorButton->killFocus(); myLocatorPopup->update(); GUIDialog_GLObjChooser* chooser = new GUIDialog_GLObjChooser( - this, GUIIconSubSys::getIcon(icon), title.c_str(), type, ids, GUIGlObjectStorage::gIDStorage); + this, GUIIconSubSys::getIcon(icon), title.c_str(), ids, GUIGlObjectStorage::gIDStorage); chooser->create(); chooser->show(); return 1; diff -Nru sumo-0.21.0+dfsg/src/gui/GUISUMOViewParent.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUISUMOViewParent.h --- sumo-0.21.0+dfsg/src/gui/GUISUMOViewParent.h 2014-03-19 23:02:08.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUISUMOViewParent.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Andreas Gaubatz /// @date Sept 2002 -/// @version $Id: GUISUMOViewParent.h 15972 2014-03-19 12:51:21Z namdre $ +/// @version $Id: GUISUMOViewParent.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A single child window which contains a view of the simulation area /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -120,7 +120,7 @@ bool isSelected(GUIGlObject* o) const; /// @notify about toggled gaming status - void toggleGaming(); + void setToolBarVisibility(const bool value); protected: /// @brief FOX needs this diff -Nru sumo-0.21.0+dfsg/src/gui/GUITLLogicPhasesTrackerWindow.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUITLLogicPhasesTrackerWindow.cpp --- sumo-0.21.0+dfsg/src/gui/GUITLLogicPhasesTrackerWindow.cpp 2014-06-04 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUITLLogicPhasesTrackerWindow.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Oct/Nov 2003 -/// @version $Id: GUITLLogicPhasesTrackerWindow.cpp 16517 2014-06-04 10:50:35Z namdre $ +/// @version $Id: GUITLLogicPhasesTrackerWindow.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A window displaying the phase diagram of a tl-logic /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -73,7 +73,7 @@ FXComposite* c, GUIMainWindow& app, GUITLLogicPhasesTrackerWindow& parent) : FXGLCanvas(c, app.getGLVisual(), app.getBuildGLCanvas(), (FXObject*) 0, (FXSelector) 0, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y/*, 0, 0, 300, 200*/), - myParent(&parent), myApplication(&app) {} + myParent(&parent) {} GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::~GUITLLogicPhasesTrackerPanel() {} @@ -254,6 +254,10 @@ myDurations.push_back((*j)->duration); myLastTime += (*j)->duration; } + if (myLastTime <= myBeginTime) { + WRITE_ERROR("Overflow in time computation occured."); + return; + } } else { SUMOTime beginOffset = TIME2STEPS(myBeginOffset->getValue()); myBeginTime = myLastTime - beginOffset; @@ -296,7 +300,9 @@ const SUMOReal width = (SUMOReal) caller.getWidth(); pfSetScaleXY((SUMOReal)(.08 * 300. / width), (SUMOReal)(.08 * 300. / height)); const SUMOReal h4 = ((SUMOReal) 4 / height); + const SUMOReal h9 = ((SUMOReal) 9 / height); const SUMOReal h10 = ((SUMOReal) 10 / height); + const SUMOReal h11 = ((SUMOReal) 11 / height); const SUMOReal h16 = ((SUMOReal) 16 / height); const SUMOReal h20 = ((SUMOReal) 20 / height); // draw the link names and the lines dividing them @@ -366,10 +372,13 @@ GLHelper::setColor(getLinkColor(state)); switch (state) { case LINKSTATE_TL_RED: + case LINKSTATE_TL_REDYELLOW: // draw a thin line - glBegin(GL_LINES); - glVertex2d(x, h - h10); - glVertex2d(x2, h - h10); + glBegin(GL_QUADS); + glVertex2d(x, h - h11); + glVertex2d(x, h - h9); + glVertex2d(x2, h - h9); + glVertex2d(x2, h - h11); glEnd(); break; default: diff -Nru sumo-0.21.0+dfsg/src/gui/GUITLLogicPhasesTrackerWindow.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUITLLogicPhasesTrackerWindow.h --- sumo-0.21.0+dfsg/src/gui/GUITLLogicPhasesTrackerWindow.h 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUITLLogicPhasesTrackerWindow.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Oct/Nov 2003 -/// @version $Id: GUITLLogicPhasesTrackerWindow.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUITLLogicPhasesTrackerWindow.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A window displaying the phase diagram of a tl-logic /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -172,9 +172,6 @@ /// @brief The parent window GUITLLogicPhasesTrackerWindow* myParent; - /// @brief The main application - GUIMainWindow* myApplication; - protected: /// @brief protected constructor for FOX GUITLLogicPhasesTrackerPanel() { } diff -Nru sumo-0.21.0+dfsg/src/gui/GUIViewTraffic.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIViewTraffic.cpp --- sumo-0.21.0+dfsg/src/gui/GUIViewTraffic.cpp 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIViewTraffic.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Andreas Gaubatz /// @date Sept 2002 -/// @version $Id: GUIViewTraffic.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIViewTraffic.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // A view on the simulation; this view is a microscopic one /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -117,6 +118,10 @@ GUIIconSubSys::getIcon(ICON_LOCATEVEHICLE), &v, MID_LOCATEVEHICLE, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); } + new FXButton(v.getLocatorPopup(), + "\tLocate Vehicle\tLocate a person within the network.", + GUIIconSubSys::getIcon(ICON_LOCATEPERSON), &v, MID_LOCATEPERSON, + ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for tls new FXButton(v.getLocatorPopup(), "\tLocate TLS\tLocate a tls within the network.", @@ -276,4 +281,6 @@ GUIViewTraffic::getCurrentTimeStep() const { return MSNet::getInstance()->getCurrentTimeStep(); } + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/gui/GUIViewTraffic.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIViewTraffic.h --- sumo-0.21.0+dfsg/src/gui/GUIViewTraffic.h 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/GUIViewTraffic.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Andreas Gaubatz /// @date Sept 2002 -/// @version $Id: GUIViewTraffic.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIViewTraffic.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A view on the simulation; this view is a microscopic one /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/Makefile.in --- sumo-0.21.0+dfsg/src/gui/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -267,6 +267,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -277,7 +279,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/gui/TraCIServerAPI_GUI.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/TraCIServerAPI_GUI.cpp --- sumo-0.21.0+dfsg/src/gui/TraCIServerAPI_GUI.cpp 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/TraCIServerAPI_GUI.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_GUI.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_GUI.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting GUI values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/gui/TraCIServerAPI_GUI.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/TraCIServerAPI_GUI.h --- sumo-0.21.0+dfsg/src/gui/TraCIServerAPI_GUI.h 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/gui/TraCIServerAPI_GUI.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_GUI.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_GUI.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting GUI values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guinetload/GUIDetectorBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/GUIDetectorBuilder.cpp --- sumo-0.21.0+dfsg/src/guinetload/GUIDetectorBuilder.cpp 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/GUIDetectorBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 22 Jul 2003 -/// @version $Id: GUIDetectorBuilder.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDetectorBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Builds detectors for guisim /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guinetload/GUIDetectorBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/GUIDetectorBuilder.h --- sumo-0.21.0+dfsg/src/guinetload/GUIDetectorBuilder.h 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/GUIDetectorBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 22 Jul 2003 -/// @version $Id: GUIDetectorBuilder.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDetectorBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Builds detectors for guisim /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guinetload/GUIEdgeControlBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/GUIEdgeControlBuilder.cpp --- sumo-0.21.0+dfsg/src/guinetload/GUIEdgeControlBuilder.cpp 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/GUIEdgeControlBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIEdgeControlBuilder.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: GUIEdgeControlBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Derivation of NLEdgeControlBuilder which build gui-edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -71,8 +71,9 @@ MSEdge* -GUIEdgeControlBuilder::buildEdge(const std::string& id, const MSEdge::EdgeBasicFunction function, const std::string& streetName, const std::string& edgeType) { - return new GUIEdge(id, myCurrentNumericalEdgeID++, function, streetName, edgeType); +GUIEdgeControlBuilder::buildEdge(const std::string& id, const MSEdge::EdgeBasicFunction function, + const std::string& streetName, const std::string& edgeType, const int priority) { + return new GUIEdge(id, myCurrentNumericalEdgeID++, function, streetName, edgeType, priority); } /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/guinetload/GUIEdgeControlBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/GUIEdgeControlBuilder.h --- sumo-0.21.0+dfsg/src/guinetload/GUIEdgeControlBuilder.h 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/GUIEdgeControlBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIEdgeControlBuilder.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: GUIEdgeControlBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Derivation of NLEdgeControlBuilder which builds gui-edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -96,7 +96,8 @@ * * @param[in] id The id of the edge to build */ - MSEdge* buildEdge(const std::string& id, const MSEdge::EdgeBasicFunction function, const std::string& streetName, const std::string& edgeType); + MSEdge* buildEdge(const std::string& id, const MSEdge::EdgeBasicFunction function, + const std::string& streetName, const std::string& edgeType, const int priority); private: diff -Nru sumo-0.21.0+dfsg/src/guinetload/GUITriggerBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/GUITriggerBuilder.cpp --- sumo-0.21.0+dfsg/src/guinetload/GUITriggerBuilder.cpp 2014-02-22 23:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/GUITriggerBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 26.04.2004 -/// @version $Id: GUITriggerBuilder.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUITriggerBuilder.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Builds trigger objects for guisim /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,6 +36,7 @@ #include #include #include +#include #include #include "GUITriggerBuilder.h" @@ -65,7 +66,7 @@ MSTriggeredRerouter* GUITriggerBuilder::buildRerouter(MSNet& net, const std::string& id, - std::vector& edges, + MSEdgeVector& edges, SUMOReal prob, const std::string& file, bool off) { GUITriggeredRerouter* rr = new GUITriggeredRerouter(id, edges, prob, file, off, dynamic_cast(net).getVisualisationSpeedUp()); @@ -85,6 +86,19 @@ } static_cast(net).getVisualisationSpeedUp().addAdditionalGLObject(stop); } + +void +GUITriggerBuilder::buildContainerStop(MSNet& net, const std::string& id, + const std::vector& lines, + MSLane* lane, + SUMOReal frompos, SUMOReal topos) { + GUIContainerStop* stop = new GUIContainerStop(id, lines, *lane, frompos, topos); + if (!net.addContainerStop(stop)) { + delete stop; + throw InvalidArgument("Could not build container stop '" + id + "'; probably declared twice."); + } + static_cast(net).getVisualisationSpeedUp().addAdditionalGLObject(stop); +} MSCalibrator* diff -Nru sumo-0.21.0+dfsg/src/guinetload/GUITriggerBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/GUITriggerBuilder.h --- sumo-0.21.0+dfsg/src/guinetload/GUITriggerBuilder.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/GUITriggerBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 26.04.2004 -/// @version $Id: GUITriggerBuilder.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUITriggerBuilder.h 18096 2015-03-17 09:50:59Z behrisch $ /// // Builds trigger objects for guisim /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -98,7 +98,7 @@ * @param[in] file The file to read the reroute definitions from */ virtual MSTriggeredRerouter* buildRerouter(MSNet& net, - const std::string& id, std::vector& edges, + const std::string& id, MSEdgeVector& edges, SUMOReal prob, const std::string& file, bool off); @@ -119,6 +119,23 @@ SUMOReal frompos, SUMOReal topos); + /** @brief Builds a container stop + * + * Simply calls the GUIContainerStop constructor. + * + * @param[in] net The net the container stop belongs to + * @param[in] id The id of the container stop + * @param[in] lines Names of the lines that halt on this container stop + * @param[in] lane The lane the container stop is placed on + * @param[in] frompos Begin position of the container stop on the lane + * @param[in] topos End position of the container stop on the lane + * @exception InvalidArgument If the container stop can not be added to the net (is duplicate) + */ + virtual void buildContainerStop(MSNet& net, const std::string& id, + const std::vector& lines, MSLane* lane, + SUMOReal frompos, SUMOReal topos); + + /** @brief builds a microscopic calibrator * * Simply calls the MSCalibrator constructor. diff -Nru sumo-0.21.0+dfsg/src/guinetload/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/Makefile.in --- sumo-0.21.0+dfsg/src/guinetload/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guinetload/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -221,6 +221,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -231,7 +233,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIBusStop.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIBusStop.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIBusStop.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIBusStop.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 07.12.2005 -/// @version $Id: GUIBusStop.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIBusStop.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A lane area vehicles can halt at (gui-version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -135,7 +135,8 @@ GLHelper::setColor(green); GLHelper::drawBoxLines(myFGShape, myFGShapeRotations, myFGShapeLengths, 1.0); // draw details unless zoomed out to far - if (s.scale * s.addExaggeration >= 10) { + const SUMOReal exaggeration = s.addSize.getExaggeration(s); + if (s.scale * exaggeration >= 10) { // draw the lines for (i = 0; i != myLines.size(); ++i) { glPushMatrix(); @@ -145,7 +146,7 @@ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); pfSetPosition(0, 0); pfSetScale(1.f); - glScaled(s.addExaggeration, s.addExaggeration, 1); + glScaled(exaggeration, exaggeration, 1); glTranslated(1.2, -(double)i, 0); pfDrawString(myLines[i].c_str()); glPopMatrix(); @@ -153,16 +154,16 @@ // draw the sign glTranslated(myFGSignPos.x(), myFGSignPos.y(), 0); int noPoints = 9; - if (s.scale * s.addExaggeration > 25) { - noPoints = MIN2((int)(9.0 + (s.scale * s.addExaggeration) / 10.0), 36); + if (s.scale * exaggeration > 25) { + noPoints = MIN2((int)(9.0 + (s.scale * exaggeration) / 10.0), 36); } - glScaled(s.addExaggeration, s.addExaggeration, 1); + glScaled(exaggeration, exaggeration, 1); GLHelper::drawFilledCircle((SUMOReal) 1.1, noPoints); glTranslated(0, 0, .1); GLHelper::setColor(yellow); GLHelper::drawFilledCircle((SUMOReal) 0.9, noPoints); - if (s.scale * s.addExaggeration >= 4.5) { - GLHelper::drawText("H", Position(), .1, 1.6 * s.addExaggeration, green, myFGSignRot); + if (s.scale * exaggeration >= 4.5) { + GLHelper::drawText("H", Position(), .1, 1.6 * exaggeration, green, myFGSignRot); } } glPopMatrix(); diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIBusStop.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIBusStop.h --- sumo-0.21.0+dfsg/src/guisim/GUIBusStop.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIBusStop.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 07.12.2005 -/// @version $Id: GUIBusStop.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIBusStop.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A lane area vehicles can halt at (gui-version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUICalibrator.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUICalibrator.cpp --- sumo-0.21.0+dfsg/src/guisim/GUICalibrator.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUICalibrator.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 26.04.2004 -/// @version $Id: GUICalibrator.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUICalibrator.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Changes flow and speed on a set of lanes (gui version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -362,6 +362,7 @@ flow = toString((int)myCurrentStateInterval->q) + "v/h"; } } + const SUMOReal exaggeration = s.addSize.getExaggeration(s); for (size_t i = 0; i < myFGPositions.size(); ++i) { const Position& pos = myFGPositions[i]; SUMOReal rot = myFGRotations[i]; @@ -369,7 +370,7 @@ glTranslated(pos.x(), pos.y(), getType()); glRotated(rot, 0, 0, 1); glTranslated(0, 0, getType()); - glScaled(s.addExaggeration, s.addExaggeration, 1); + glScaled(exaggeration, exaggeration, 1); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glBegin(GL_TRIANGLES); @@ -384,7 +385,7 @@ glEnd(); // draw text - if (s.scale * s.addExaggeration >= 1.) { + if (s.scale * exaggeration >= 1.) { glTranslated(0, 0, .1); glColor3d(0, 0, 0); pfSetPosition(0, 0); diff -Nru sumo-0.21.0+dfsg/src/guisim/GUICalibrator.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUICalibrator.h --- sumo-0.21.0+dfsg/src/guisim/GUICalibrator.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUICalibrator.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 26.04.2004 -/// @version $Id: GUICalibrator.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUICalibrator.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Changes flow and speed on a set of lanes (gui version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIContainerControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIContainerControl.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIContainerControl.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIContainerControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,59 @@ +/****************************************************************************/ +/// @file GUIContainerControl.cpp +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Wed, 01.08.2014 +/// @version $Id: GUIContainerControl.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// GUI-version of the container control for building gui containers +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 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 "GUIContainerControl.h" +#include "GUIContainer.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +GUIContainerControl::GUIContainerControl() {} + + +GUIContainerControl::~GUIContainerControl() { +} + + +MSContainer* +GUIContainerControl::buildContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainer::MSContainerPlan* plan) const { + return new GUIContainer(pars, vtype, plan); +} + + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIContainerControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIContainerControl.h --- sumo-0.21.0+dfsg/src/guisim/GUIContainerControl.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIContainerControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,66 @@ +/****************************************************************************/ +/// @file GUIContainerControl.h +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Wed, 01.08.2014 +/// @version $Id: GUIContainerControl.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// GUI-version of the container control for building gui containers +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 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 GUIContainerControl_h +#define GUIContainerControl_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** @class GUIContainerControl + * @brief GUI-version of the container control for building gui containers + */ +class GUIContainerControl : public MSContainerControl { +public: + /// constructor + GUIContainerControl(); + + + /// destructor + virtual ~GUIContainerControl(); + + + /** @brief Builds a new container + * @param[in] pars The parameter + * @param[in] vtype The type (reusing vehicle type container here) + * @param[in] plan This container's plan + */ + virtual MSContainer* buildContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainer::MSContainerPlan* plan) const; + +}; + + +#endif + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIContainer.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIContainer.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIContainer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIContainer.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,408 @@ +/****************************************************************************/ +/// @file GUIContainer.cpp +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Wed, 01.08.2014 +/// @version $Id: GUIContainer.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// A MSContainer extended by some values for usage within the gui +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 +#include +#include +#include "GUIContainer.h" +#include "GUINet.h" +#include "GUIEdge.h" +#include + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + +//#define GUIContainer_DEBUG_DRAW_WALKING_AREA_SHAPE + +// =========================================================================== +// FOX callback mapping +// =========================================================================== +/* +FXDEFMAP(GUIContainer::GUIContainerPopupMenu) GUIContainerPopupMenuMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_SHOW_ALLROUTES, GUIContainer::GUIContainerPopupMenu::onCmdShowAllRoutes), + FXMAPFUNC(SEL_COMMAND, MID_HIDE_ALLROUTES, GUIContainer::GUIContainerPopupMenu::onCmdHideAllRoutes), + FXMAPFUNC(SEL_COMMAND, MID_SHOW_CURRENTROUTE, GUIContainer::GUIContainerPopupMenu::onCmdShowCurrentRoute), + FXMAPFUNC(SEL_COMMAND, MID_HIDE_CURRENTROUTE, GUIContainer::GUIContainerPopupMenu::onCmdHideCurrentRoute), + FXMAPFUNC(SEL_COMMAND, MID_SHOW_BEST_LANES, GUIContainer::GUIContainerPopupMenu::onCmdShowBestLanes), + FXMAPFUNC(SEL_COMMAND, MID_HIDE_BEST_LANES, GUIContainer::GUIContainerPopupMenu::onCmdHideBestLanes), + FXMAPFUNC(SEL_COMMAND, MID_START_TRACK, GUIContainer::GUIContainerPopupMenu::onCmdStartTrack), + FXMAPFUNC(SEL_COMMAND, MID_STOP_TRACK, GUIContainer::GUIContainerPopupMenu::onCmdStopTrack), + FXMAPFUNC(SEL_COMMAND, MID_SHOW_LFLINKITEMS, GUIContainer::GUIContainerPopupMenu::onCmdShowLFLinkItems), + FXMAPFUNC(SEL_COMMAND, MID_HIDE_LFLINKITEMS, GUIContainer::GUIContainerPopupMenu::onCmdHideLFLinkItems), +}; + +// Object implementation +FXIMPLEMENT(GUIContainer::GUIContainerPopupMenu, GUIGLObjectPopupMenu, GUIContainerPopupMenuMap, ARRAYNUMBER(GUIContainerPopupMenuMap)) +*/ + +#define WATER_WAY_OFFSET 6.0 + +// =========================================================================== +// method definitions +// =========================================================================== +/* ------------------------------------------------------------------------- + * GUIContainer::GUIContainerPopupMenu - methods + * ----------------------------------------------------------------------- */ +GUIContainer::GUIContainerPopupMenu::GUIContainerPopupMenu( + GUIMainWindow& app, GUISUMOAbstractView& parent, + GUIGlObject& o, std::map& additionalVisualizations) + : GUIGLObjectPopupMenu(app, parent, o), myVehiclesAdditionalVisualizations(additionalVisualizations) { +} + + +GUIContainer::GUIContainerPopupMenu::~GUIContainerPopupMenu() {} + + + +/* ------------------------------------------------------------------------- + * GUIContainer - methods + * ----------------------------------------------------------------------- */ +GUIContainer::GUIContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainer::MSContainerPlan* plan) : + MSContainer(pars, vtype, plan), + GUIGlObject(GLO_CONTAINER, pars->id) +{ } + + +GUIContainer::~GUIContainer() { +} + + +GUIGLObjectPopupMenu* +GUIContainer::getPopUpMenu(GUIMainWindow& app, + GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIContainerPopupMenu(app, parent, *this, myAdditionalVisualizations); + buildPopupHeader(ret, app); + buildCenterPopupEntry(ret); + buildNameCopyPopupEntry(ret); + buildSelectionPopupEntry(ret); + // + buildShowParamsPopupEntry(ret); + buildPositionCopyEntry(ret, false); + return ret; +} + + +GUIParameterTableWindow* +GUIContainer::getParameterWindow(GUIMainWindow& app, + GUISUMOAbstractView&) { + GUIParameterTableWindow* ret = + new GUIParameterTableWindow(app, *this, 8); + // add items + //ret->mkItem("type [NAME]", false, myType->getID()); + ret->mkItem("stage", false, getCurrentStageDescription()); + ret->mkItem("start edge [id]", false, getFromEdge()->getID()); + ret->mkItem("dest edge [id]", false, getDestination().getID()); + ret->mkItem("edge [id]", false, getEdge()->getID()); + ret->mkItem("position [m]", true, new FunctionBinding(this, &GUIContainer::getEdgePos)); + ret->mkItem("speed [m/s]", true, new FunctionBinding(this, &GUIContainer::getSpeed)); + ret->mkItem("angle [degree]", true, new FunctionBinding(this, &GUIContainer::getAngle)); + ret->mkItem("waiting time [s]", true, new FunctionBinding(this, &GUIContainer::getWaitingSeconds)); + // close building + ret->closeBuilding(); + return ret; +} + + +Boundary +GUIContainer::getCenteringBoundary() const { + Boundary b; + b.add(getPosition()); + b.grow(20); + return b; +} + + +void +GUIContainer::drawGL(const GUIVisualizationSettings& s) const { + glPushName(getGlID()); + glPushMatrix(); + Position p1 = getPosition(); + glTranslated(p1.x(), p1.y(), getType()); + glRotated(90, 0, 0, 1); + // XXX use container specific gui settings + // set container color + setColor(s); + // scale + const SUMOReal upscale = s.containerSize.getExaggeration(s); + glScaled(upscale, upscale, 1); + switch (s.containerQuality) { + case 0: + case 1: + case 2: + drawAction_drawAsPoly(s); + break; + case 3: + default: + drawAction_drawAsImage(s); + break; + } + glPopMatrix(); + + drawName(p1, s.scale, s.containerName); + glPopName(); +} + + +void +GUIContainer::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 +GUIContainer::setColor(const GUIVisualizationSettings& s) const { + const GUIColorer& c = s.containerColorer; + if (!setFunctionalColor(c.getActive())) { + GLHelper::setColor(c.getScheme().getColor(getColorValue(c.getActive()))); + } +} + + +bool +GUIContainer::setFunctionalColor(size_t activeScheme) const { + switch (activeScheme) { + case 0: { + if (getParameter().wasSet(VEHPARS_COLOR_SET)) { + GLHelper::setColor(getParameter().color); + return true; + } + if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) { + GLHelper::setColor(getVehicleType().getColor()); + return true; + } + return false; + } + case 2: { + if (getParameter().wasSet(VEHPARS_COLOR_SET)) { + GLHelper::setColor(getParameter().color); + return true; + } + return false; + } + case 3: { + if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) { + GLHelper::setColor(getVehicleType().getColor()); + return true; + } + return false; + } + case 8: { + SUMOReal hue = getAngle() + 180; // [0-360] + GLHelper::setColor(RGBColor::fromHSV(hue, 1., 1.)); + return true; + } + default: + return false; + } +} + + +SUMOReal +GUIContainer::getColorValue(size_t activeScheme) const { + switch (activeScheme) { + case 4: + return getSpeed(); + case 5: + if (isWaiting4Vehicle()) { + return 3; + } else { + return (SUMOReal)getCurrentStageType(); + } + case 6: + return getWaitingSeconds(); + case 7: + return gSelected.isSelected(GLO_CONTAINER, getGlID()); + } + return 0; +} + + +SUMOReal +GUIContainer::getEdgePos() const { + AbstractMutex::ScopedLocker locker(myLock); + return MSContainer::getEdgePos(); +} + + +Position +GUIContainer::getPosition() const { + AbstractMutex::ScopedLocker locker(myLock); + if (getCurrentStageType() == DRIVING && !isWaiting4Vehicle()) { + return myPositionInVehicle; + } + if (getCurrentStageType() == WAITING && getEdge()->getPermissions() == SVC_SHIP) { + MSLane* lane = getEdge()->getLanes().front(); //the most right lane of the water way + PositionVector laneShape = lane->getShape(); + return laneShape.positionAtOffset2D(getEdgePos(), WATER_WAY_OFFSET); + } + return MSContainer::getPosition(); +} + + +SUMOReal +GUIContainer::getAngle() const { + AbstractMutex::ScopedLocker locker(myLock); + return MSContainer::getAngle(); +} + + +SUMOReal +GUIContainer::getWaitingSeconds() const { + AbstractMutex::ScopedLocker locker(myLock); + return MSContainer::getWaitingSeconds(); +} + + +SUMOReal +GUIContainer::getSpeed() const { + AbstractMutex::ScopedLocker locker(myLock); + return MSContainer::getSpeed(); +} + + +void +GUIContainer::drawAction_drawAsPoly(const GUIVisualizationSettings& /* s */) const { + // draw pedestrian shape + glRotated(getAngle(), 0, 0, 1); + glScaled(getVehicleType().getLength(), getVehicleType().getWidth(), 1); + glBegin(GL_QUADS); + glVertex2d(0, 0.5); + glVertex2d(0, -0.5); + glVertex2d(-1, -0.5); + glVertex2d(-1, 0.5); + glEnd(); + GLHelper::setColor(GLHelper::getColor().changedBrightness(-30)); + glTranslated(0, 0, .045); + glBegin(GL_QUADS); + glVertex2d(-0.1, 0.4); + glVertex2d(-0.1, -0.4); + glVertex2d(-0.9, -0.4); + glVertex2d(-0.9, 0.4); + glEnd(); +} + + +void +GUIContainer::drawAction_drawAsImage(const GUIVisualizationSettings& s) const { + const std::string& file = getVehicleType().getImgFile(); + if (file != "") { + // @todo invent an option for controlling whether images should be rotated or not + //if (getVehicleType().getGuiShape() == SVS_CONTAINER) { + // glRotated(getAngle(), 0, 0, 1); + //} + int textureID = GUITexturesHelper::getTextureID(file); + if (textureID > 0) { + const SUMOReal exaggeration = s.personSize.getExaggeration(s); + const SUMOReal halfLength = getVehicleType().getLength() / 2.0 * exaggeration; + const SUMOReal halfWidth = getVehicleType().getWidth() / 2.0 * exaggeration; + GUITexturesHelper::drawTexturedBox(textureID, -halfWidth, -halfLength, halfWidth, halfLength); + } + } else { + // fallback if no image is defined + drawAction_drawAsPoly(s); + } +} +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIContainer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIContainer.h --- sumo-0.21.0+dfsg/src/guisim/GUIContainer.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIContainer.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,213 @@ +/****************************************************************************/ +/// @file GUIContainer.h +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Wed, 01.08.2014 +/// @version $Id: GUIContainer.h 18096 2015-03-17 09:50:59Z behrisch $ +/// +// A MSVehicle extended by some values for usage within the gui +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 GUIContainer_h +#define GUIContainer_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 GUIContainer + */ +class GUIContainer : public MSContainer, public GUIGlObject { +public: + /** @brief Constructor + */ + GUIContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainer::MSContainerPlan* plan); + + + /// @brief destructor + ~GUIContainer(); + + + /// @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 container while being transporte by a vehicle + * @note This must be called by the vehicle before the call to drawGl */ + void setPositionInVehicle(const Position& pos) { + myPositionInVehicle = pos; + } + + /// @name inherited from MSContainer with added locking + //@{ + + /// @brief return the offset from the start of the current edge + SUMOReal getEdgePos() const; + + /// @brief return the Network coordinate of the container + // @note overrides the base method and returns myPositionInVehicle while in driving stage + Position getPosition() const; + + /// @brief return the current angle of the container + SUMOReal getAngle() const; + + /// @brief the time this container spent waiting in seconds + SUMOReal getWaitingSeconds() const; + + /// @brief the current speed of the container + SUMOReal getSpeed() const; + + //@} + + + /** + * @class GUIContainerPopupMenu + * + * 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 GUIContainerPopupMenu : public GUIGLObjectPopupMenu { + //FXDECLARE(GUIContainerPopupMenu) + 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) + */ + GUIContainerPopupMenu(GUIMainWindow& app, + GUISUMOAbstractView& parent, GUIGlObject& o, std::map& additionalVisualizations); + + /// @brief Destructor + ~GUIContainerPopupMenu(); + + + 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 + GUIContainerPopupMenu() : 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 container 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; + + /// @name drawing helper methods + /// @{ + void drawAction_drawAsPoly(const GUIVisualizationSettings& s) const; + void drawAction_drawAsImage(const GUIVisualizationSettings& s) const; + /// @} +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIContainerStop.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIContainerStop.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIContainerStop.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIContainerStop.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,188 @@ +/****************************************************************************/ +/// @file GUIContainerStop.cpp +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Wed, 01.08.2014 +/// @version $Id: GUIContainerStop.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// A lane area vehicles can halt at (gui-version) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "GUINet.h" +#include "GUIEdge.h" +#include "GUIContainer.h" +#include "GUIContainerStop.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +GUIContainerStop::GUIContainerStop(const std::string& id, const std::vector& lines, MSLane& lane, + SUMOReal frompos, SUMOReal topos) + : MSContainerStop(id, lines, lane, frompos, topos), + GUIGlObject_AbstractAdd("containerStop", GLO_TRIGGER, id) { + myFGShape = lane.getShape(); + myFGShape.move2side((SUMOReal) 1.65); + myFGShape = myFGShape.getSubpart(frompos, topos); + myFGShapeRotations.reserve(myFGShape.size() - 1); + myFGShapeLengths.reserve(myFGShape.size() - 1); + int e = (int) myFGShape.size() - 1; + for (int i = 0; i < e; ++i) { + const Position& f = myFGShape[i]; + const Position& s = myFGShape[i + 1]; + myFGShapeLengths.push_back(f.distanceTo(s)); + myFGShapeRotations.push_back((SUMOReal) atan2((s.x() - f.x()), (f.y() - s.y())) * (SUMOReal) 180.0 / (SUMOReal) PI); + } + PositionVector tmp = myFGShape; + tmp.move2side(1.5); + myFGSignPos = tmp.getLineCenter(); + myFGSignRot = 0; + if (tmp.length() != 0) { + myFGSignRot = myFGShape.rotationDegreeAtOffset(SUMOReal((myFGShape.length() / 2.))); + myFGSignRot -= 90; + } +} + + +GUIContainerStop::~GUIContainerStop() {} + + +GUIGLObjectPopupMenu* +GUIContainerStop::getPopUpMenu(GUIMainWindow& app, + GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + buildPopupHeader(ret, app); + buildCenterPopupEntry(ret); + buildNameCopyPopupEntry(ret); + buildSelectionPopupEntry(ret); + buildShowParamsPopupEntry(ret); + buildPositionCopyEntry(ret, false); + return ret; +} + + +GUIParameterTableWindow* +GUIContainerStop::getParameterWindow(GUIMainWindow& app, + GUISUMOAbstractView&) { + 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("container number [#]", true, new FunctionBinding(this, &MSContainerStop::getContainerNumber)); + // close building + ret->closeBuilding(); + return ret; +} + + +void +GUIContainerStop::drawGL(const GUIVisualizationSettings& s) const { + glPushName(getGlID()); + glPushMatrix(); + RGBColor grey(177, 184, 186, 171); + RGBColor blue(83, 89, 172, 255); + // draw the area + size_t i; + glTranslated(0, 0, getType()); + GLHelper::setColor(blue); + GLHelper::drawBoxLines(myFGShape, myFGShapeRotations, myFGShapeLengths, 1.0); + // draw details unless zoomed out to far + const SUMOReal exaggeration = s.addSize.getExaggeration(s); + if (s.scale * exaggeration >= 10) { + // draw the lines + for (i = 0; i != myLines.size(); ++i) { + glPushMatrix(); + glTranslated(myFGSignPos.x(), myFGSignPos.y(), 0); + glRotated(180, 1, 0, 0); + glRotated(myFGSignRot, 0, 0, 1); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + pfSetPosition(0, 0); + pfSetScale(1.f); + glScaled(exaggeration, exaggeration, 1); + glTranslated(1.2, -(double)i, 0); + pfDrawString(myLines[i].c_str()); + glPopMatrix(); + } + // draw the sign + glTranslated(myFGSignPos.x(), myFGSignPos.y(), 0); + int noPoints = 9; + if (s.scale * exaggeration > 25) { + noPoints = MIN2((int)(9.0 + (s.scale * exaggeration) / 10.0), 36); + } + glScaled(exaggeration, exaggeration, 1); + GLHelper::drawFilledCircle((SUMOReal) 1.1, noPoints); + glTranslated(0, 0, .1); + GLHelper::setColor(grey); + GLHelper::drawFilledCircle((SUMOReal) 0.9, noPoints); + if (s.scale * exaggeration >= 4.5) { + GLHelper::drawText("C", Position(), .1, 1.6 * exaggeration, blue, myFGSignRot); + } + } + glPopMatrix(); + glPopName(); + drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); + for (std::vector::const_iterator i = myWaitingContainers.begin(); i != myWaitingContainers.end(); ++i) { + glTranslated(0, 1, 0); // make multiple containers viewable + static_cast(*i)->drawGL(s); + } +} + + +Boundary +GUIContainerStop::getCenteringBoundary() const { + Boundary b = myFGShape.getBoxBoundary(); + b.grow(20); + return b; +} + + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIContainerStop.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIContainerStop.h --- sumo-0.21.0+dfsg/src/guisim/GUIContainerStop.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIContainerStop.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,156 @@ +/****************************************************************************/ +/// @file GUIContainerStop.h +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Wed, 01.08.2014 +/// @version $Id: GUIContainerStop.h 18096 2015-03-17 09:50:59Z behrisch $ +/// +// A lane area vehicles can halt at (gui-version) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 GUIContainerStop_h +#define GUIContainerStop_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSNet; +class MSLane; +class GUIManipulator; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GUIContainerStop + * @brief A lane area vehicles can halt at (gui-version) + * + * This gui-version of a container-stop extends MSContainerStop by methods for displaying + * and interaction. + * + * @see MSContainerStop + * @see GUIGlObject_AbstractAdd + * @see GUIGlObject + */ +class GUIContainerStop : public MSContainerStop, public GUIGlObject_AbstractAdd { +public: + /** @brief Constructor + * @param[in] idStorage The gl-id storage for giving this object an gl-id + * @param[in] id The id of the container stop + * @param[in] lines Names of the container lines that halt on this container stop + * @param[in] lane The lane the container stop is placed on + * @param[in] begPos Begin position of the container stop on the lane + * @param[in] endPos End position of the container stop on the lane + */ + GUIContainerStop(const std::string& id, + const std::vector& lines, MSLane& lane, + SUMOReal frompos, SUMOReal topos); + + + /// @brief Destructor + ~GUIContainerStop(); + + + + /// @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 + * + * Container stops have no parameter windows (yet). + * + * @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 (always 0 in this case) + * @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: + /// @brief The rotations of the shape parts + std::vector myFGShapeRotations; + + /// @brief The lengths of the shape parts + std::vector myFGShapeLengths; + + /// @brief The shape + PositionVector myFGShape; + + /// @brief The position of the sign + Position myFGSignPos; + + /// @brief The rotation of the sign + SUMOReal myFGSignRot; + + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIDetectorWrapper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIDetectorWrapper.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIDetectorWrapper.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIDetectorWrapper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: GUIDetectorWrapper.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDetectorWrapper.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The base class for detector wrapper /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIDetectorWrapper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIDetectorWrapper.h --- sumo-0.21.0+dfsg/src/guisim/GUIDetectorWrapper.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIDetectorWrapper.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIDetectorWrapper.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDetectorWrapper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The base class for detector wrapper /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUI_E2_ZS_Collector.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUI_E2_ZS_Collector.cpp --- sumo-0.21.0+dfsg/src/guisim/GUI_E2_ZS_Collector.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUI_E2_ZS_Collector.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Okt 2003 -/// @version $Id: GUI_E2_ZS_Collector.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUI_E2_ZS_Collector.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The gui-version of the MS_E2_ZS_Collector /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -151,16 +151,16 @@ glPushMatrix(); glTranslated(0, 0, getType()); SUMOReal dwidth = 1; + const SUMOReal exaggeration = s.addSize.getExaggeration(s); if (myDetector.getUsageType() == DU_TL_CONTROL) { dwidth = (SUMOReal) 0.3; glColor3d(0, (SUMOReal) .6, (SUMOReal) .8); } else { glColor3d(0, (SUMOReal) .8, (SUMOReal) .8); } - SUMOReal width = 2; // !!! - if (width * s.addExaggeration > 1.0) { - glScaled(s.addExaggeration, s.addExaggeration, 1); - GLHelper::drawBoxLines(myFullGeometry, myShapeRotations, myShapeLengths, dwidth); + SUMOReal width = (SUMOReal) 2.0 * s.scale; + if (width * exaggeration > 1.0) { + GLHelper::drawBoxLines(myFullGeometry, myShapeRotations, myShapeLengths, dwidth * exaggeration); } else { int e = (int) myFullGeometry.size() - 1; for (int i = 0; i < e; ++i) { diff -Nru sumo-0.21.0+dfsg/src/guisim/GUI_E2_ZS_Collector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUI_E2_ZS_Collector.h --- sumo-0.21.0+dfsg/src/guisim/GUI_E2_ZS_Collector.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUI_E2_ZS_Collector.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Okt 2003 -/// @version $Id: GUI_E2_ZS_Collector.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUI_E2_ZS_Collector.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The gui-version of the MS_E2_ZS_Collector /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUI_E2_ZS_CollectorOverLanes.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUI_E2_ZS_CollectorOverLanes.cpp --- sumo-0.21.0+dfsg/src/guisim/GUI_E2_ZS_CollectorOverLanes.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUI_E2_ZS_CollectorOverLanes.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Okt 2003 -/// @version $Id: GUI_E2_ZS_CollectorOverLanes.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUI_E2_ZS_CollectorOverLanes.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The gui-version of a MS_E2_ZS_CollectorOverLanes. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUI_E2_ZS_CollectorOverLanes.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUI_E2_ZS_CollectorOverLanes.h --- sumo-0.21.0+dfsg/src/guisim/GUI_E2_ZS_CollectorOverLanes.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUI_E2_ZS_CollectorOverLanes.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Okt 2003 -/// @version $Id: GUI_E2_ZS_CollectorOverLanes.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUI_E2_ZS_CollectorOverLanes.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The gui-version of a MS_E2_ZS_CollectorOverLanes. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIE3Collector.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIE3Collector.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIE3Collector.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIE3Collector.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Jan 2004 -/// @version $Id: GUIE3Collector.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIE3Collector.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The gui-version of a MSE3Collector /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -89,11 +89,11 @@ // add items // values ret->mkItem("vehicles within [#]", true, - new FunctionBinding(&myDetector, &MSE3Collector::getVehiclesWithin)); + new FunctionBinding(&myDetector, &MSE3Collector::getVehiclesWithin)); ret->mkItem("mean speed [m/s]", true, new FunctionBinding(&myDetector, &MSE3Collector::getCurrentMeanSpeed)); ret->mkItem("haltings [#]", true, - new FunctionBinding(&myDetector, &MSE3Collector::getCurrentHaltingNumber)); + new FunctionBinding(&myDetector, &MSE3Collector::getCurrentHaltingNumber)); // close building ret->closeBuilding(); return ret; @@ -108,12 +108,13 @@ typedef std::vector CrossingDefinitions; CrossingDefinitions::const_iterator i; glColor3d(0, .8, 0); + const SUMOReal exaggeration = s.addSize.getExaggeration(s); for (i = myEntryDefinitions.begin(); i != myEntryDefinitions.end(); ++i) { - drawSingleCrossing((*i).myFGPosition, (*i).myFGRotation, s.addExaggeration); + drawSingleCrossing((*i).myFGPosition, (*i).myFGRotation, exaggeration); } glColor3d(.8, 0, 0); for (i = myExitDefinitions.begin(); i != myExitDefinitions.end(); ++i) { - drawSingleCrossing((*i).myFGPosition, (*i).myFGRotation, s.addExaggeration); + drawSingleCrossing((*i).myFGPosition, (*i).myFGRotation, exaggeration); } glPopMatrix(); drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIE3Collector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIE3Collector.h --- sumo-0.21.0+dfsg/src/guisim/GUIE3Collector.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIE3Collector.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Jan 2004 -/// @version $Id: GUIE3Collector.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIE3Collector.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The gui-version of a MSE3Collector /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIEdge.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIEdge.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIEdge.cpp 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIEdge.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: GUIEdge.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: GUIEdge.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // A road/street connecting two junctions (gui-version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -53,9 +53,11 @@ #include #include #include "GUIEdge.h" +#include "GUIVehicle.h" #include "GUINet.h" #include "GUILane.h" #include "GUIPerson.h" +#include "GUIContainer.h" #ifdef HAVE_INTERNAL #include @@ -73,8 +75,9 @@ // included modules // =========================================================================== GUIEdge::GUIEdge(const std::string& id, int numericalID, - const EdgeBasicFunction function, const std::string& streetName, const std::string& edgeType) - : MSEdge(id, numericalID, function, streetName, edgeType), + const EdgeBasicFunction function, + const std::string& streetName, const std::string& edgeType, int priority) + : MSEdge(id, numericalID, function, streetName, edgeType, priority), GUIGlObject(GLO_EDGE, id) {} @@ -97,8 +100,8 @@ GUIEdge::getIDs(bool includeInternal) { std::vector ret; ret.reserve(MSEdge::myDict.size()); - for (MSEdge::DictType::iterator i = MSEdge::myDict.begin(); i != MSEdge::myDict.end(); ++i) { - GUIEdge* edge = dynamic_cast(i->second); + for (MSEdge::DictType::const_iterator i = MSEdge::myDict.begin(); i != MSEdge::myDict.end(); ++i) { + const GUIEdge* edge = dynamic_cast(i->second); assert(edge); if (edge->getPurpose() != EDGEFUNCTION_INTERNAL || includeInternal) { ret.push_back(edge->getGlID()); @@ -108,6 +111,20 @@ } +SUMOReal +GUIEdge::getTotalLength(bool includeInternal, bool eachLane) { + SUMOReal result = 0; + for (MSEdge::DictType::const_iterator i = MSEdge::myDict.begin(); i != MSEdge::myDict.end(); ++i) { + const MSEdge* edge = i->second; + if (edge->getPurpose() != EDGEFUNCTION_INTERNAL || includeInternal) { + // @note needs to be change once lanes may have different length + result += edge->getLength() * (eachLane ? edge->getLanes().size() : 1); + } + } + return result; +} + + Boundary GUIEdge::getBoundary() const { Boundary ret; @@ -158,7 +175,7 @@ // add edge items ret->mkItem("length [m]", false, (*myLanes)[0]->getLength()); ret->mkItem("allowed speed [m/s]", false, getAllowedSpeed()); - ret->mkItem("occupancy [%]", true, new FunctionBinding(this, &GUIEdge::getBruttoOccupancy)); + ret->mkItem("occupancy [%]", true, new FunctionBinding(this, &GUIEdge::getBruttoOccupancy, 100.)); ret->mkItem("mean vehicle speed [m/s]", true, new FunctionBinding(this, &GUIEdge::getMeanSpeed)); ret->mkItem("flow [veh/h/lane]", true, new FunctionBinding(this, &GUIEdge::getFlow)); ret->mkItem("#vehicles", true, new CastingFunctionBinding(this, &GUIEdge::getVehicleNo)); @@ -198,9 +215,7 @@ if (s.hideConnectors && myFunction == MSEdge::EDGEFUNCTION_CONNECTOR) { return; } - if (MSGlobals::gUseMesoSim) { - glPushName(getGlID()); - } + glPushName(getGlID()); // draw the lanes for (std::vector::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) { #ifdef HAVE_INTERNAL @@ -215,81 +230,12 @@ } #ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { - 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 (std::vector::const_iterator msl = myLanes->begin(); msl != myLanes->end(); ++msl, ++laneIndex) { - GUILane* l = static_cast(*msl); - 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->getBruttoOccupancy() / 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(); - 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); - } - } - } - segmentOffset += length; - } - glPopMatrix(); - } - vehicleControl->releaseVehicles(); + if (s.scale * s.vehicleSize.getExaggeration(s) > s.vehicleSize.minSize) { + drawMesoVehicles(s); } - glPopName(); } #endif + glPopName(); // (optionally) draw the name and/or the street name const bool drawEdgeName = s.edgeName.show && myFunction == EDGEFUNCTION_NORMAL; const bool drawInternalEdgeName = s.internalEdgeName.show && myFunction == EDGEFUNCTION_INTERNAL; @@ -320,7 +266,7 @@ } } } - if (s.scale > s.minPersonSize) { + if (s.scale * s.personSize.getExaggeration(s) > s.personSize.minSize) { myLock.lock(); for (std::set::const_iterator i = myPersons.begin(); i != myPersons.end(); ++i) { GUIPerson* person = dynamic_cast(*i); @@ -329,9 +275,92 @@ } myLock.unlock(); } + if (s.scale * s.containerSize.getExaggeration(s) > s.containerSize.minSize) { + myLock.lock(); + for (std::set::const_iterator i = myContainers.begin(); i != myContainers.end(); ++i) { + GUIContainer* container = dynamic_cast(*i); + assert(container != 0); + container->drawGL(s); + } + myLock.unlock(); + } } + #ifdef HAVE_INTERNAL +void +GUIEdge::drawMesoVehicles(const GUIVisualizationSettings& s) const { + const GUIVisualizationTextSettings& nameSettings = s.vehicleName; + const SUMOReal exaggeration = s.vehicleSize.getExaggeration(s); + GUIMEVehicleControl* vehicleControl = GUINet::getGUIInstance()->getGUIMEVehicleControl(); + if (vehicleControl != 0) { + // draw the meso vehicles + vehicleControl->secureVehicles(); + size_t laneIndex = 0; + MESegment::Queue queue; + for (std::vector::const_iterator msl = myLanes->begin(); msl != myLanes->end(); ++msl, ++laneIndex) { + GUILane* l = static_cast(*msl); + // go through the vehicles + 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() * segment->getLengthGeometryFactor(); + if (laneIndex < segment->numQueues()) { + // make a copy so we don't have to worry about synchronization + queue = segment->getQueue(laneIndex); + const SUMOReal avgCarSize = segment->getBruttoOccupancy() / segment->getCarNumber(); + const SUMOReal avgCarHalfSize = 0.5 * avgCarSize; + const size_t queueSize = queue.size(); + SUMOReal vehiclePosition = segmentOffset + length; + // draw vehicles beginning with the leader at the end of the segment + SUMOReal xOff = 0; + for (size_t i = 0; i < queueSize; ++i) { + MSBaseVehicle* veh = queue[queueSize - i - 1]; + const SUMOReal vehLength = veh->getVehicleType().getLengthWithGap(); + setVehicleColor(s, veh); + 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 += 2; + } + const Position p = l->geometryPositionAtOffset(vehiclePosition); + const SUMOReal angle = -l->getShape().rotationDegreeAtOffset(l->interpolateLanePosToGeometryPos(vehiclePosition)); + glPushMatrix(); + glTranslated(p.x(), p.y(), 0); + glRotated(angle, 0, 0, 1); + glTranslated(xOff, 0, GLO_VEHICLE); + glScaled(exaggeration, vehLength * exaggeration, 1); + glBegin(GL_TRIANGLES); + glVertex2d(0, 0); + glVertex2d(0 - 1.25, 1); + glVertex2d(0 + 1.25, 1); + glEnd(); + glPopMatrix(); + if (nameSettings.show) { + glPushMatrix(); + glRotated(angle, 0, 0, 1); + glTranslated(xOff, 0, 0); + glRotated(-angle, 0, 0, 1); + GLHelper::drawText(veh->getID(), + l->geometryPositionAtOffset(vehiclePosition - 0.5 * vehLength), + GLO_MAX, nameSettings.size / s.scale, nameSettings.color); + glPopMatrix(); + } + vehiclePosition -= vehLength; + } + } + segmentOffset += length; + } + glPopMatrix(); + } + vehicleControl->releaseVehicles(); + } +} + + + unsigned int GUIEdge::getVehicleNo() const { size_t vehNo = 0; @@ -433,6 +462,26 @@ } +SUMOReal +GUIEdge::getScaleValue(size_t activeScheme) const { + switch (activeScheme) { + case 1: + return gSelected.isSelected(getType(), getGlID()); + case 2: + return getAllowedSpeed(); + case 3: + return getBruttoOccupancy(); + case 4: + return getMeanSpeed(); + case 5: + return getFlow(); + case 6: + return getRelativeSpeed(); + } + return 0; +} + + MESegment* GUIEdge::getSegmentAtPosition(const Position& pos) { const PositionVector& shape = getLanes()[0]->getShape(); @@ -444,32 +493,61 @@ void GUIEdge::setVehicleColor(const GUIVisualizationSettings& s, MSBaseVehicle* veh) const { const GUIColorer& c = s.vehicleColorer; - switch (c.getActive()) { - case 0: - if (veh->getParameter().wasSet(VEHPARS_COLOR_SET)) { - GLHelper::setColor(veh->getParameter().color); - } - if (veh->getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) { - GLHelper::setColor(veh->getVehicleType().getColor()); - } - if (veh->getRoute().getColor() != RGBColor::DEFAULT_COLOR) { - GLHelper::setColor(veh->getRoute().getColor()); + if (!GUIVehicle::setFunctionalColor(c.getActive(), veh)) { + GLHelper::setColor(c.getScheme().getColor(getVehicleColorValue(c.getActive(), veh))); + } +} + + +SUMOReal +GUIEdge::getVehicleColorValue(size_t activeScheme, MSBaseVehicle* veh) const { + switch (activeScheme) { + case 8: + return veh->getSpeed(); + case 9: + return STEPS2TIME(veh->getWaitingTime()); + case 10: + return 0; // invalid getLastLaneChangeOffset(); + case 11: + return MIN2(veh->getMaxSpeed(), getVehicleMaxSpeed(veh)); + case 12: + return 0; // invalid getCO2Emissions(); + case 13: + return 0; // invalid getCOEmissions(); + case 14: + return 0; // invalid getPMxEmissions(); + case 15: + return 0; // invalid getNOxEmissions(); + case 16: + return 0; // invalid getHCEmissions(); + case 17: + return 0; // invalid getFuelConsumption(); + case 18: + return 0; // invalid getHarmonoise_NoiseEmissions(); + case 19: // !!! unused!? + if (veh->getNumberReroutes() == 0) { + return -1; } - break; - case 2: - GLHelper::setColor(veh->getParameter().color); - break; - case 4: - GLHelper::setColor(veh->getVehicleType().getColor()); - break; - case 5: - GLHelper::setColor(veh->getRoute().getColor()); - break; - default: - GLHelper::setColor(c.getScheme().getColor(0)); + return veh->getNumberReroutes(); + case 20: + return 0; // invalid gSelected.isSelected(GLO_VEHICLE, getGlID()); + case 21: + return 0; // invalid getBestLaneOffset(); + case 22: + return 0; // invalid getAcceleration(); + case 23: + return 0; // invalid getTimeGap(); } + return 0; } + + + + + + + #endif /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIEdge.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIEdge.h --- sumo-0.21.0+dfsg/src/guisim/GUIEdge.h 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIEdge.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIEdge.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: GUIEdge.h 18096 2015-03-17 09:50:59Z behrisch $ /// // A road/street connecting two junctions (gui-version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -66,7 +66,8 @@ * @see MSEdge */ GUIEdge(const std::string& id, int numericalID, - const EdgeBasicFunction function, const std::string& streetName, const std::string& edgeType); + const EdgeBasicFunction function, + const std::string& streetName, const std::string& edgeType, int priority); /// @brief Destructor. @@ -78,6 +79,12 @@ */ static std::vector getIDs(bool includeInternal); + /* @brief Returns the combined length of all edges + * @param[in] includeInternal Whether to include lengths of internal edges + * @param[in] eachLane Whether to count each lane separately + */ + static SUMOReal getTotalLength(bool includeInternal, bool eachLane); + /// Returns the street's geometry Boundary getBoundary() const; @@ -148,6 +155,16 @@ } + void addContainer(MSContainer* c) const { + AbstractMutex::ScopedLocker locker(myLock); + MSEdge::addContainer(c); + } + + void removeContainer(MSContainer* c) const { + AbstractMutex::ScopedLocker locker(myLock); + MSEdge::removeContainer(c); + } + #ifdef HAVE_INTERNAL unsigned int getVehicleNo() const; std::string getVehicleIDs() const; @@ -165,12 +182,20 @@ /// @brief gets the color value according to the current scheme index SUMOReal getColorValue(size_t activeScheme) const; + /// @brief gets the scaling value according to the current scheme index + SUMOReal getScaleValue(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; + /// @brief gets the vehicle color value according to the current scheme index + SUMOReal getVehicleColorValue(size_t activeScheme, MSBaseVehicle* veh) const; + + void drawMesoVehicles(const GUIVisualizationSettings& s) const; + #endif @@ -183,7 +208,7 @@ private: - /// The mutex used to avoid concurrent updates of myPersons + /// The mutex used to avoid concurrent updates of myPersons/ myContainers mutable MFXMutex myLock; }; diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIEventControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIEventControl.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIEventControl.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIEventControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 04 Feb 2008 -/// @version $Id: GUIEventControl.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIEventControl.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Stores time-dependant events and executes them at the proper time (guisim) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIEventControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIEventControl.h --- sumo-0.21.0+dfsg/src/guisim/GUIEventControl.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIEventControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 04 Feb 2008 -/// @version $Id: GUIEventControl.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIEventControl.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Stores time-dependant events and executes them at the proper time (guisim) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIInductLoop.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIInductLoop.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIInductLoop.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIInductLoop.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Aug 2003 -/// @version $Id: GUIInductLoop.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIInductLoop.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The gui-version of the MSInductLoop, together with the according /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -156,13 +155,14 @@ glPushName(getGlID()); SUMOReal width = (SUMOReal) 2.0 * s.scale; glLineWidth(1.0); + const SUMOReal exaggeration = s.addSize.getExaggeration(s); // shape glColor3d(1, 1, 0); glPushMatrix(); glTranslated(0, 0, getType()); glTranslated(myFGPosition.x(), myFGPosition.y(), 0); glRotated(myFGRotation, 0, 0, 1); - glScaled(s.addExaggeration, s.addExaggeration, 1); + glScaled(exaggeration, exaggeration, 1); glBegin(GL_QUADS); glVertex2d(0 - 1.0, 2); glVertex2d(-1.0, -2); @@ -176,7 +176,7 @@ glEnd(); // outline - if (width * s.addExaggeration > 1) { + if (width * exaggeration > 1) { glColor3d(1, 1, 1); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glBegin(GL_QUADS); @@ -189,7 +189,7 @@ } // position indicator - if (width * s.addExaggeration > 1) { + if (width * exaggeration > 1) { glRotated(90, 0, 0, -1); glColor3d(1, 1, 1); glBegin(GL_LINES); diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIInductLoop.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIInductLoop.h --- sumo-0.21.0+dfsg/src/guisim/GUIInductLoop.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIInductLoop.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Aug 2003 -/// @version $Id: GUIInductLoop.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIInductLoop.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The gui-version of the MSInductLoop, together with the according /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIInstantInductLoop.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIInstantInductLoop.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIInstantInductLoop.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIInstantInductLoop.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Aug 2003 -/// @version $Id: GUIInstantInductLoop.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUIInstantInductLoop.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The gui-version of the MSInstantInductLoop /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -113,13 +112,14 @@ glPushName(getGlID()); SUMOReal width = (SUMOReal) 2.0 * s.scale; glLineWidth(1.0); + const SUMOReal exaggeration = s.addSize.getExaggeration(s); // shape glColor3d(1, 0, 1); glPushMatrix(); glTranslated(0, 0, getType()); glTranslated(myFGPosition.x(), myFGPosition.y(), 0); glRotated(myFGRotation, 0, 0, 1); - glScaled(s.addExaggeration, s.addExaggeration, 1); + glScaled(exaggeration, exaggeration, 1); glBegin(GL_QUADS); glVertex2d(0 - 1.0, 2); glVertex2d(-1.0, -2); @@ -133,7 +133,7 @@ glEnd(); // outline - if (width * s.addExaggeration > 1) { + if (width * exaggeration > 1) { glColor3d(1, 1, 1); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glBegin(GL_QUADS); @@ -146,7 +146,7 @@ } // position indicator - if (width * s.addExaggeration > 1) { + if (width * exaggeration > 1) { glRotated(90, 0, 0, -1); glColor3d(1, 1, 1); glBegin(GL_LINES); diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIInstantInductLoop.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIInstantInductLoop.h --- sumo-0.21.0+dfsg/src/guisim/GUIInstantInductLoop.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIInstantInductLoop.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file GUIInstantInductLoop.h /// @author Daniel Krajzewicz /// @date Aug 2003 -/// @version $Id: GUIInstantInductLoop.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIInstantInductLoop.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The gui-version of the MSInstantInductLoop /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIJunctionWrapper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIJunctionWrapper.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIJunctionWrapper.cpp 2014-02-26 23:02:08.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIJunctionWrapper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Laura Bieker /// @author Andreas Gaubatz /// @date Mon, 1 Jul 2003 -/// @version $Id: GUIJunctionWrapper.cpp 15749 2014-02-26 12:11:30Z namdre $ +/// @version $Id: GUIJunctionWrapper.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // } /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -38,6 +38,7 @@ #include #endif #include +#include #include #include #include @@ -58,6 +59,7 @@ #include #endif // CHECK_MEMORY_LEAKS +//#define GUIJunctionWrapper_DEBUG_DRAW_NODE_SHAPE_VERTICES // =========================================================================== // method definitions @@ -77,6 +79,19 @@ #else myIsInner = false; #endif + myAmWaterway = true; + for (ConstMSEdgeVector::const_iterator it = myJunction.getIncoming().begin(); it != myJunction.getIncoming().end(); ++it) { + if (!(*it)->isInternal() && !isWaterway((*it)->getPermissions())) { + myAmWaterway = false; + break; + } + } + for (ConstMSEdgeVector::const_iterator it = myJunction.getOutgoing().begin(); it != myJunction.getOutgoing().end(); ++it) { + if (!(*it)->isInternal() && !isWaterway((*it)->getPermissions())) { + myAmWaterway = false; + break; + } + } } @@ -118,9 +133,9 @@ return; } if (!myIsInner && s.drawJunctionShape) { - glPushName(getGlID()); glPushMatrix(); - const SUMOReal colorValue = static_cast(s.junctionColorer.getActive() == 1 && gSelected.isSelected(getType(), getGlID())); + glPushName(getGlID()); + const SUMOReal colorValue = getColorValue(s); GLHelper::setColor(s.junctionColorer.getScheme().getColor(colorValue)); glTranslated(0, 0, getType()); if (s.scale * myMaxSize < 40.) { @@ -128,6 +143,10 @@ } else { GLHelper::drawFilledPolyTesselated(myJunction.getShape(), true); } +#ifdef GUIJunctionWrapper_DEBUG_DRAW_NODE_SHAPE_VERTICES + GLHelper::debugVertices(myJunction.getShape(), 80 / s.scale); +#endif + glPopName(); glPopMatrix(); } if (myIsInner) { @@ -135,14 +154,59 @@ } else { drawName(myJunction.getPosition(), s.scale, s.junctionName); } - glPopName(); +} + + +SUMOReal +GUIJunctionWrapper::getColorValue(const GUIVisualizationSettings& s) const { + switch (s.junctionColorer.getActive()) { + case 0: + if (myAmWaterway) { + return 1; + } else { + return 0; + } + case 1: + return gSelected.isSelected(getType(), getGlID()) ? 1 : 0; + case 2: + switch (myJunction.getType()) { + case NODETYPE_TRAFFIC_LIGHT: + return 0; + case NODETYPE_TRAFFIC_LIGHT_NOJUNCTION: + return 1; + case NODETYPE_PRIORITY: + return 2; + case NODETYPE_PRIORITY_STOP: + return 3; + case NODETYPE_RIGHT_BEFORE_LEFT: + return 4; + case NODETYPE_ALLWAY_STOP: + return 5; + case NODETYPE_DISTRICT: + return 6; + case NODETYPE_NOJUNCTION: + return 7; + case NODETYPE_DEAD_END: + case NODETYPE_DEAD_END_DEPRECATED: + return 8; + case NODETYPE_UNKNOWN: + case NODETYPE_INTERNAL: + assert(false); + return 8; + case NODETYPE_RAIL_SIGNAL: + return 9; + } + default: + assert(false); + return 0; + } } #ifdef HAVE_OSG void GUIJunctionWrapper::updateColor(const GUIVisualizationSettings& s) { - const SUMOReal colorValue = static_cast(s.junctionColorer.getActive() == 1 && gSelected.isSelected(getType(), getGlID())); + const SUMOReal colorValue = getColorValue(s); const RGBColor& col = s.junctionColorer.getScheme().getColor(colorValue); osg::Vec4ubArray* colors = dynamic_cast(myGeom->getColorArray()); (*colors)[0].set(col.red(), col.green(), col.blue(), col.alpha()); diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIJunctionWrapper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIJunctionWrapper.h --- sumo-0.21.0+dfsg/src/guisim/GUIJunctionWrapper.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIJunctionWrapper.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 1 Jul 2003 -/// @version $Id: GUIJunctionWrapper.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIJunctionWrapper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Holds geometrical values for a junction /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -148,6 +148,9 @@ #endif private: + SUMOReal getColorValue(const GUIVisualizationSettings& s) const; + +private: /// @brief A reference to the represented junction MSJunction& myJunction; @@ -160,6 +163,9 @@ /// @brief whether this wraps an instance of MSInternalJunction bool myIsInner; + /// @brief whether this junction has only waterways as incoming and outgoing edges + bool myAmWaterway; + #ifdef HAVE_OSG osg::Geometry* myGeom; #endif diff -Nru sumo-0.21.0+dfsg/src/guisim/GUILane.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUILane.cpp --- sumo-0.21.0+dfsg/src/guisim/GUILane.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUILane.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUILane.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: GUILane.cpp 18114 2015-03-20 08:06:51Z namdre $ /// // Representation of a lane in the micro simulation (gui-version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -70,11 +71,12 @@ GUILane::GUILane(const std::string& id, SUMOReal maxSpeed, SUMOReal length, MSEdge* const edge, unsigned int numericalID, const PositionVector& shape, SUMOReal width, - SVCPermissions permissions, unsigned int index) - : MSLane(id, maxSpeed, length, edge, numericalID, shape, width, permissions), - GUIGlObject(GLO_LANE, id) { + SVCPermissions permissions, unsigned int index) : + MSLane(id, maxSpeed, length, edge, numericalID, shape, width, permissions), + GUIGlObject(GLO_LANE, id) { myShapeRotations.reserve(myShape.size() - 1); myShapeLengths.reserve(myShape.size() - 1); + myShapeColors.reserve(myShape.size() - 1); int e = (int) myShape.size() - 1; for (int i = 0; i < e; ++i) { const Position& f = myShape[i]; @@ -136,9 +138,9 @@ MSVehicle* -GUILane::removeVehicle(MSVehicle* remVehicle, MSMoveReminder::Notification notification) { +GUILane::removeVehicle(MSVehicle* remVehicle, MSMoveReminder::Notification notification, bool notify) { AbstractMutex::ScopedLocker locker(myLock); - return MSLane::removeVehicle(remVehicle, notification); + return MSLane::removeVehicle(remVehicle, notification, notify); } @@ -238,10 +240,10 @@ void -GUILane::drawLinkRules(const GUINet& net) const { +GUILane::drawLinkRules(const GUIVisualizationSettings& s, const GUINet& net) const { unsigned int noLinks = (unsigned int)myLinks.size(); if (noLinks == 0) { - drawLinkRule(net, 0, getShape(), 0, 0); + drawLinkRule(s, net, 0, getShape(), 0, 0); return; } if (getEdge().isCrossing()) { @@ -249,8 +251,8 @@ MSLink* link = MSLinkContHelper::getConnectingLink(*getLogicalPredecessorLane(), *this); PositionVector shape = getShape(); shape.extrapolate(0.5); // draw on top of the walking area - drawLinkRule(net, link, shape, 0, myWidth); - drawLinkRule(net, link, shape.reverse(), 0, myWidth); + drawLinkRule(s, net, link, shape, 0, myWidth); + drawLinkRule(s, net, link, shape.reverse(), 0, myWidth); return; } // draw all links @@ -258,19 +260,18 @@ SUMOReal x1 = 0; for (unsigned int i = 0; i < noLinks; ++i) { SUMOReal x2 = x1 + w; - drawLinkRule(net, myLinks[i], getShape(), x1, x2); + drawLinkRule(s, net, myLinks[i], getShape(), x1, x2); x1 = x2; } } void -GUILane::drawLinkRule(const GUINet& net, MSLink* link, const PositionVector& shape, SUMOReal x1, SUMOReal x2) const { +GUILane::drawLinkRule(const GUIVisualizationSettings& s, const GUINet& net, MSLink* link, const PositionVector& shape, SUMOReal x1, SUMOReal x2) const { const Position& end = shape.back(); const Position& f = shape[-2]; const SUMOReal rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y()))); if (link == 0) { - glPushName(getGlID()); GLHelper::setColor(getLinkColor(LINKSTATE_DEADEND)); glPushMatrix(); glTranslated(end.x(), end.y(), 0); @@ -282,7 +283,6 @@ glVertex2d(myHalfLaneWidth, 0.0); glEnd(); glPopMatrix(); - glPopName(); } else { glPushMatrix(); glTranslated(end.x(), end.y(), 0); @@ -292,6 +292,7 @@ case LINKSTATE_TL_GREEN_MAJOR: case LINKSTATE_TL_GREEN_MINOR: case LINKSTATE_TL_RED: + case LINKSTATE_TL_REDYELLOW: case LINKSTATE_TL_YELLOW_MAJOR: case LINKSTATE_TL_YELLOW_MINOR: case LINKSTATE_TL_OFF_BLINKING: @@ -306,9 +307,9 @@ break; } GLHelper::setColor(getLinkColor(link->getState())); - if (!isRailway(myPermissions) || link->getState() != LINKSTATE_MAJOR) { - // THE WHITE BAR SHOULD BE THE DEFAULT FOR MOST RAILWAY - // LINKS AND LOOKS UGLY SO WE DO NOT DRAW IT + if (!(drawAsRailway(s) || drawAsWaterway(s)) || link->getState() != LINKSTATE_MAJOR) { + // the white bar should be the default for most railway + // links and looks ugly so we do not draw it glBegin(GL_QUADS); glVertex2d(x1 - myHalfLaneWidth, 0.0); glVertex2d(x1 - myHalfLaneWidth, 0.5); @@ -331,7 +332,6 @@ const Position& f = getShape()[-2]; const SUMOReal rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y()))); glPushMatrix(); - glPushName(0); glColor3d(1, 1, 1); glTranslated(end.x(), end.y(), 0); glRotated(rot, 0, 0, 1); @@ -380,56 +380,17 @@ } } glPopMatrix(); - glPopName(); } void GUILane::drawLane2LaneConnections() const { for (std::vector::const_iterator i = myLinks.begin(); i != myLinks.end(); ++i) { - LinkState state = (*i)->getState(); const MSLane* connected = (*i)->getLane(); if (connected == 0) { continue; } - switch (state) { - case LINKSTATE_TL_GREEN_MAJOR: - case LINKSTATE_TL_GREEN_MINOR: - glColor3d(0, 1, 0); - break; - case LINKSTATE_TL_RED: - glColor3d(1, 0, 0); - break; - case LINKSTATE_TL_YELLOW_MAJOR: - case LINKSTATE_TL_YELLOW_MINOR: - glColor3d(1, 1, 0); - break; - case LINKSTATE_TL_OFF_BLINKING: - glColor3d(1, 1, 0); - break; - case LINKSTATE_TL_OFF_NOSIGNAL: - glColor3d(0, 1, 1); - break; - case LINKSTATE_MAJOR: - glColor3d(1, 1, 1); - break; - case LINKSTATE_MINOR: - glColor3d(.2, .2, .2); - break; - case LINKSTATE_STOP: - glColor3d(.4, .2, .2); - break; - case LINKSTATE_EQUAL: - glColor3d(.5, .5, .5); - break; - case LINKSTATE_ALLWAY_STOP: - glColor3d(.2, .2, .4); - break; - case LINKSTATE_DEADEND: - glColor3d(0, 0, 0); - break; - } - + GLHelper::setColor(getLinkColor((*i)->getState())); glBegin(GL_LINES); const Position& p1 = getShape()[-1]; const Position& p2 = connected->getShape()[0]; @@ -444,115 +405,131 @@ void GUILane::drawGL(const GUIVisualizationSettings& s) const { glPushMatrix(); + glPushName(getGlID()); const bool isCrossing = myEdge->getPurpose() == MSEdge::EDGEFUNCTION_CROSSING; const bool isWalkingArea = myEdge->getPurpose() == MSEdge::EDGEFUNCTION_WALKINGAREA; const bool isInternal = isCrossing || isWalkingArea || myEdge->getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL; bool mustDrawMarkings = false; - const bool drawDetails = s.scale * s.laneWidthExaggeration > 5; + SUMOReal exaggeration = s.laneWidthExaggeration * s.laneScaler.getScheme().getColor(getScaleValue(s.laneScaler.getActive())); +#ifdef HAVE_INTERNAL + if (MSGlobals::gUseMesoSim) { + GUIEdge* myGUIEdge = dynamic_cast(myEdge); + exaggeration *= s.edgeScaler.getScheme().getColor(myGUIEdge->getScaleValue(s.edgeScaler.getActive())); + } +#endif + const bool drawDetails = s.scale * exaggeration > 5; if (isCrossing || isWalkingArea) { // draw internal lanes on top of junctions glTranslated(0, 0, GLO_JUNCTION + 0.1); + } else if (isWaterway(myPermissions)) { + // draw waterways below normal roads + glTranslated(0, 0, getType() - 0.2); } else { glTranslated(0, 0, getType()); } // set lane color if (!MSGlobals::gUseMesoSim) { setColor(s); - glPushName(getGlID()); // do not register for clicks in MESOSIM } - // draw lane - // check whether it is not too small - if (s.scale * s.laneWidthExaggeration < 1.) { - GLHelper::drawLine(myShape); - if (!MSGlobals::gUseMesoSim) { - glPopName(); - } - glPopMatrix(); - } else { - GUINet* net = (GUINet*) MSNet::getInstance(); - if (isRailway(myPermissions)) { - // draw as railway - const SUMOReal halfRailWidth = 0.725 * s.laneWidthExaggeration; - GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, halfRailWidth); - glColor3d(1, 1, 1); - glTranslated(0, 0, .1); - GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, halfRailWidth - 0.2); - if (!MSGlobals::gUseMesoSim) { - setColor(s); - } - drawCrossties(0.3 * s.laneWidthExaggeration, 1 * s.laneWidthExaggeration, 1 * s.laneWidthExaggeration); - } else if (isCrossing) { - // determine priority to decide color - MSLink* link = MSLinkContHelper::getConnectingLink(*getLogicalPredecessorLane(), *this); - if (link->havePriority() || net->getLinkTLIndex(link) > 0) { - glColor3d(0.9, 0.9, 0.9); - } else { - glColor3d(0.1, 0.1, 0.1); - } - glTranslated(0, 0, .2); - drawCrossties(0.5, 1.0, getWidth() * 0.5); - glTranslated(0, 0, -.2); - } else if (isWalkingArea) { - glTranslated(0, 0, .2); - if (s.scale * s.laneWidthExaggeration < 20.) { - GLHelper::drawFilledPoly(myShape, true); + // recognize full transparency and simply don't draw + GLfloat color[4]; + glGetFloatv(GL_CURRENT_COLOR, color); + if (color[3] != 0) { + // draw lane + // check whether it is not too small + if (s.scale * exaggeration < 1.) { + if (myShapeColors.size() > 0) { + GLHelper::drawLine(myShape, myShapeColors); } else { - GLHelper::drawFilledPolyTesselated(myShape, true); + GLHelper::drawLine(myShape); } - glTranslated(0, 0, -.2); + glPopMatrix(); + } else { + GUINet* net = (GUINet*) MSNet::getInstance(); + if (drawAsRailway(s)) { + // draw as railway + const SUMOReal halfRailWidth = 0.725 * exaggeration; + if (myShapeColors.size() > 0) { + GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, myShapeColors, halfRailWidth); + } else { + GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, halfRailWidth); + } + glColor3d(1, 1, 1); + glTranslated(0, 0, .1); + GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, halfRailWidth - 0.2); + if (!MSGlobals::gUseMesoSim) { + setColor(s); + } + drawCrossties(0.3 * exaggeration, 1 * exaggeration, 1 * exaggeration); + } else if (isCrossing) { + // determine priority to decide color + MSLink* link = MSLinkContHelper::getConnectingLink(*getLogicalPredecessorLane(), *this); + if (link->havePriority() || net->getLinkTLIndex(link) > 0) { + glColor3d(0.9, 0.9, 0.9); + } else { + glColor3d(0.1, 0.1, 0.1); + } + glTranslated(0, 0, .2); + drawCrossties(0.5, 1.0, getWidth() * 0.5); + glTranslated(0, 0, -.2); + } else if (isWalkingArea) { + glTranslated(0, 0, .2); + if (s.scale * exaggeration < 20.) { + GLHelper::drawFilledPoly(myShape, true); + } else { + GLHelper::drawFilledPolyTesselated(myShape, true); + } + glTranslated(0, 0, -.2); #ifdef GUILane_DEBUG_DRAW_WALKING_AREA_VERTICES - RGBColor color = RGBColor::fromHSV(RandHelper::rand(360), 1, 1); - glTranslated(0, 0, .4); - for (int i = 0; i < (int)myShape.size(); ++i) { - GLHelper::drawText(toString(i), myShape[i], GLO_JUNCTION, - 80 / s.scale, color, 0); - } - glTranslated(0, 0, -.4); + GLHelper::debugVertices(myShape, 80 / s.scale); #endif - } else { - const SUMOReal laneWidth = isInternal ? myQuarterLaneWidth : myHalfLaneWidth; - mustDrawMarkings = !isInternal && myPermissions != 0 && myPermissions != SVC_PEDESTRIAN; - // recognize full transparency and simply don't draw - GLfloat color[4]; - glGetFloatv(GL_CURRENT_COLOR, color); - if (color[3] > 0) { - const int cornerDetail = drawDetails ? s.scale * s.laneWidthExaggeration : 0; - GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, laneWidth * s.laneWidthExaggeration, cornerDetail); + } else { + const SUMOReal halfWidth = isInternal ? myQuarterLaneWidth : myHalfLaneWidth; + mustDrawMarkings = !isInternal && myPermissions != 0 && myPermissions != SVC_PEDESTRIAN && exaggeration == 1.0 && !isWaterway(myPermissions); + const int cornerDetail = drawDetails && !isInternal ? s.scale * exaggeration : 0; + const SUMOReal offset = halfWidth * MAX2((SUMOReal)0, (exaggeration - 1)); + if (myShapeColors.size() > 0) { + GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, myShapeColors, halfWidth * exaggeration, cornerDetail, offset); + } else { + GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, halfWidth * exaggeration, cornerDetail, offset); + } + } + glPopMatrix(); + // draw ROWs (not for inner lanes) + if ((!isInternal || isCrossing) && drawDetails) { + glPushMatrix(); + glTranslated(0, 0, GLO_JUNCTION); // must draw on top of junction shape + glTranslated(0, 0, .5); + drawLinkRules(s, *net); + if (s.showLinkDecals && !drawAsRailway(s) && !drawAsWaterway(s) && myPermissions != SVC_PEDESTRIAN) { + drawArrows(); + } + if (s.showLane2Lane) { + // this should be independent to the geometry: + // draw from end of first to the begin of second + drawLane2LaneConnections(); + } + glTranslated(0, 0, .1); + if (s.drawLinkJunctionIndex) { + drawLinkNo(); + } + if (s.drawLinkTLIndex) { + drawTLSLinkNo(*net); + } + glPopMatrix(); } } - if (!MSGlobals::gUseMesoSim) { - glPopName(); + if (mustDrawMarkings && drawDetails) { // needs matrix reset + drawMarkings(s, exaggeration); } - glPopMatrix(); - // draw ROWs (not for inner lanes) - if ((!isInternal || isCrossing) && drawDetails) { - glPushMatrix(); - glTranslated(0, 0, GLO_JUNCTION); // must draw on top of junction shape - glTranslated(0, 0, .5); - drawLinkRules(*net); - if (s.showLinkDecals && !isRailway(myPermissions) && myPermissions != SVC_PEDESTRIAN) { - drawArrows(); - } - if (s.showLane2Lane) { - // this should be independent to the geometry: - // draw from end of first to the begin of second - drawLane2LaneConnections(); - } - glTranslated(0, 0, .1); - if (s.drawLinkJunctionIndex) { - drawLinkNo(); - } - if (s.drawLinkTLIndex) { - drawTLSLinkNo(*net); - } - glPopMatrix(); + if (drawDetails && isInternal && myPermissions == SVC_BICYCLE && exaggeration == 1.0 && s.showLinkDecals) { + drawBikeMarkings(); } - } - if (mustDrawMarkings && drawDetails) { // needs matrix reset - drawMarkings(s, s.laneWidthExaggeration); + } else { + glPopMatrix(); } // draw vehicles - if (s.scale > s.minVehicleSize) { + if (s.scale * s.vehicleSize.getExaggeration(s) > s.vehicleSize.minSize) { // retrieve vehicles from lane; disallow simulation const MSLane::VehCont& vehicles = getVehiclesSecure(); for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) { @@ -568,13 +545,13 @@ // allow lane simulation releaseVehicles(); } + glPopName(); } void GUILane::drawMarkings(const GUIVisualizationSettings& s, SUMOReal scale) const { glPushMatrix(); - glPushName(0); glTranslated(0, 0, GLO_EDGE); #ifdef HAVE_INTERNAL if (!MSGlobals::gUseMesoSim) @@ -589,10 +566,11 @@ glTranslated(getShape()[i].x(), getShape()[i].y(), 0.1); glRotated(myShapeRotations[i], 0, 0, 1); for (SUMOReal t = 0; t < myShapeLengths[i]; t += 6) { + const SUMOReal length = MIN2((SUMOReal)3, myShapeLengths[i] - t); glBegin(GL_QUADS); glVertex2d(-mw, -t); - glVertex2d(-mw, -t - 3.); - glVertex2d(myQuarterLaneWidth * scale, -t - 3.); + glVertex2d(-mw, -t - length); + glVertex2d(myQuarterLaneWidth * scale, -t - length); glVertex2d(myQuarterLaneWidth * scale, -t); glEnd(); } @@ -607,14 +585,37 @@ getShapeLengths(), (getHalfWidth() + SUMO_const_laneOffset) * scale); glPopMatrix(); - glPopName(); } void +GUILane::drawBikeMarkings() const { + // draw bike lane markings onto the intersection + glColor3d(1, 1, 1); + int e = (int) getShape().size() - 1; + SUMOReal mw = (myHalfLaneWidth + SUMO_const_laneOffset); + for (int i = 0; i < e; ++i) { + glPushMatrix(); + glTranslated(getShape()[i].x(), getShape()[i].y(), GLO_JUNCTION + 0.1); + glRotated(myShapeRotations[i], 0, 0, 1); + for (SUMOReal t = 0; t < myShapeLengths[i]; t += 0.5) { + // left and right marking + for (int side = -1; side <= 1; side += 2) { + glBegin(GL_QUADS); + glVertex2d(side * mw, -t); + glVertex2d(side * mw, -t - 0.35); + glVertex2d(side * (mw + SUMO_const_laneOffset), -t - 0.35); + glVertex2d(side * (mw + SUMO_const_laneOffset), -t); + glEnd(); + } + } + glPopMatrix(); + } +} + +void GUILane::drawCrossties(SUMOReal length, SUMOReal spacing, SUMOReal halfWidth) const { glPushMatrix(); - glPushName(0); // draw on top of of the white area between the rails glTranslated(0, 0, 0.1); int e = (int) getShape().size() - 1; @@ -633,7 +634,6 @@ glPopMatrix(); } glPopMatrix(); - glPopName(); } // ------ inherited from GUIGlObject @@ -649,7 +649,8 @@ // buildShowParamsPopupEntry(ret, false); const SUMOReal pos = interpolateGeometryPosToLanePos(myShape.nearest_offset_to_point2D(parent.getPositionInformation())); - new FXMenuCommand(ret, ("pos: " + toString(pos)).c_str(), 0, 0, 0); + const SUMOReal height = myShape.positionAtOffset2D(myShape.nearest_offset_to_point2D(parent.getPositionInformation())).z(); + new FXMenuCommand(ret, ("pos: " + toString(pos) + " height: " + toString(height)).c_str(), 0, 0, 0); new FXMenuSeparator(ret); buildPositionCopyEntry(ret, false); return ret; @@ -659,14 +660,17 @@ GUIParameterTableWindow* GUILane::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { - GUIParameterTableWindow* ret = - new GUIParameterTableWindow(app, *this, 7); + GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this, 11); // add items ret->mkItem("maxspeed [m/s]", false, getSpeedLimit()); ret->mkItem("length [m]", false, myLength); + ret->mkItem("width [m]", false, myWidth); ret->mkItem("street name", false, myEdge->getStreetName()); ret->mkItem("stored traveltime [s]", true, new FunctionBinding(this, &GUILane::getStoredEdgeTravelTime)); + ret->mkItem("loaded weight", true, new FunctionBinding(this, &GUILane::getLoadedEdgeWeight)); + ret->mkItem("occupancy [%]", true, new FunctionBinding(this, &GUILane::getBruttoOccupancy, 100.)); ret->mkItem("edge type", false, myEdge->getEdgeType()); + ret->mkItem("priority", false, myEdge->getPriority()); ret->mkItem("allowed vehicle class", false, getVehicleClassNames(myPermissions)); ret->mkItem("disallowed vehicle class", false, getVehicleClassNames(~myPermissions)); ret->mkItem("permission code", false, myPermissions); @@ -734,10 +738,23 @@ } +SUMOReal +GUILane::getLoadedEdgeWeight() const { + MSEdgeWeightsStorage& ews = MSNet::getInstance()->getWeightsStorage(); + if (!ews.knowsEffort(myEdge)) { + return -1; + } else { + SUMOReal value(0); + ews.retrieveExistingEffort(myEdge, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), value); + return value; + } +} + + void GUILane::setColor(const GUIVisualizationSettings& s) const { const GUIColorer& c = s.laneColorer; - if (!setFunctionalColor(c.getActive())) { + if (!setFunctionalColor(c.getActive()) && !setMultiColor(c)) { GLHelper::setColor(c.getScheme().getColor(getColorValue(c.getActive()))); } } @@ -757,6 +774,28 @@ } +bool +GUILane::setMultiColor(const GUIColorer& c) const { + const size_t activeScheme = c.getActive(); + myShapeColors.clear(); + switch (activeScheme) { + case 22: // color by height at segment start + for (PositionVector::const_iterator ii = myShape.begin(); ii != myShape.end() - 1; ++ii) { + myShapeColors.push_back(c.getScheme().getColor(ii->z())); + } + return true; + case 24: // color by inclination at segment start + for (int ii = 1; ii < (int)myShape.size(); ++ii) { + const SUMOReal inc = (myShape[ii].z() - myShape[ii - 1].z()) / MAX2(POSITION_EPS, myShape[ii].distanceTo2D(myShape[ii - 1])); + myShapeColors.push_back(c.getScheme().getColor(inc)); + } + return true; + default: + return false; + } +} + + SUMOReal GUILane::getColorValue(size_t activeScheme) const { switch (activeScheme) { @@ -768,6 +807,8 @@ return 2; case 0: return 3; + case SVC_SHIP: + return 4; default: return 0; } @@ -816,10 +857,112 @@ case 17: { return 1 / myLengthGeometryFactor; } + case 19: { + return getLoadedEdgeWeight(); + } + case 20: { + return myEdge->getPriority(); + } + case 21: { + // color by z of first shape point + return getShape()[0].z(); + } + case 23: { + // color by incline + return (getShape()[-1].z() - getShape()[0].z()) / getLength(); + } + case 25: { + // color by average speed + return getMeanSpeed(); + } + case 26: { + // color by average relative speed + return getMeanSpeed() / myMaxSpeed; + } + } + return 0; +} + + +SUMOReal +GUILane::getScaleValue(size_t activeScheme) const { + switch (activeScheme) { + case 0: + return 0; + case 1: + return gSelected.isSelected(getType(), getGlID()) || + gSelected.isSelected(GLO_EDGE, dynamic_cast(myEdge)->getGlID()); + case 2: + return getSpeedLimit(); + case 3: + return getBruttoOccupancy(); + case 4: + return getNettoOccupancy(); + case 5: + return firstWaitingTime(); + case 6: + return getEdgeLaneNumber(); + case 7: + return getCO2Emissions() / myLength; + case 8: + return getCOEmissions() / myLength; + case 9: + return getPMxEmissions() / myLength; + case 10: + return getNOxEmissions() / myLength; + case 11: + return getHCEmissions() / myLength; + case 12: + return getFuelConsumption() / myLength; + case 13: + return getHarmonoise_NoiseEmissions(); + case 14: { + return getStoredEdgeTravelTime(); + } + case 15: { + MSEdgeWeightsStorage& ews = MSNet::getInstance()->getWeightsStorage(); + if (!ews.knowsTravelTime(myEdge)) { + return -1; + } else { + SUMOReal value(0); + ews.retrieveExistingTravelTime(myEdge, 0, value); + return 100 * myLength / value / getSpeedLimit(); + } + } + case 16: { + return 1 / myLengthGeometryFactor; + } + case 17: { + return getLoadedEdgeWeight(); + } + case 18: { + return myEdge->getPriority(); + } + case 19: { + // scale by average speed + return getMeanSpeed(); + } + case 20: { + // scale by average relative speed + return getMeanSpeed() / myMaxSpeed; + } } return 0; } + +bool +GUILane::drawAsRailway(const GUIVisualizationSettings& s) const { + return isRailway(myPermissions) && s.showRails; +} + + +bool +GUILane::drawAsWaterway(const GUIVisualizationSettings& s) const { + return isWaterway(myPermissions) && s.showRails; // reusing the showRails setting +} + + #ifdef HAVE_OSG void GUILane::updateColor(const GUIVisualizationSettings& s) { diff -Nru sumo-0.21.0+dfsg/src/guisim/GUILane.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUILane.h --- sumo-0.21.0+dfsg/src/guisim/GUILane.h 2014-05-08 22:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUILane.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUILane.h 16328 2014-05-08 13:08:00Z namdre $ +/// @version $Id: GUILane.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Representation of a lane in the micro simulation (gui-version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,7 +41,7 @@ #include #include #include -#include +#include // =========================================================================== @@ -142,7 +142,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 */ - MSVehicle* removeVehicle(MSVehicle* remVehicle, MSMoveReminder::Notification notification); + MSVehicle* removeVehicle(MSVehicle* remVehicle, MSMoveReminder::Notification notification, bool notify); @@ -197,6 +197,9 @@ /// @brief draw lane borders and white markings void drawMarkings(const GUIVisualizationSettings& s, SUMOReal scale) const; + /// @brief bike lane markings on top of an intersection + void drawBikeMarkings() const; + /// @brief draw crossties for railroads or pedestrian crossings void drawCrossties(SUMOReal length, SUMOReal spacing, SUMOReal halfWidth) const; @@ -211,6 +214,10 @@ */ SUMOReal getStoredEdgeTravelTime() const; + /** @brief Returns the loaded weight (effort) for the edge of this lane + */ + SUMOReal getLoadedEdgeWeight() const; + #ifdef HAVE_OSG void setGeometry(osg::Geometry* geom) { myGeom = geom; @@ -242,8 +249,8 @@ void drawLinkNo() const; void drawTLSLinkNo(const GUINet& net) const; void drawTextAtEnd(const std::string& text, const PositionVector& shape, SUMOReal x) const; - void drawLinkRules(const GUINet& net) const; - void drawLinkRule(const GUINet& net, MSLink* link, const PositionVector& shape, SUMOReal x1, SUMOReal x2) const; + void drawLinkRules(const GUIVisualizationSettings& s, const GUINet& net) const; + void drawLinkRule(const GUIVisualizationSettings& s, const GUINet& net, MSLink* link, const PositionVector& shape, SUMOReal x1, SUMOReal x2) const; void drawArrows() const; void drawLane2LaneConnections() const; @@ -253,18 +260,33 @@ /// @brief gets the color value according to the current scheme index SUMOReal getColorValue(size_t activeScheme) const; + /// @brief gets the scaling value according to the current scheme index + SUMOReal getScaleValue(size_t activeScheme) const; + /// @brief sets the color according to the current scheme index and some lane function bool setFunctionalColor(size_t activeScheme) const; + /// @brief sets multiple colors according to the current scheme index and some lane function + bool setMultiColor(const GUIColorer& c) const; + /// @brief sets the color according to the currente settings void setColor(const GUIVisualizationSettings& s) const; + /// @brief whether to draw this lane as a railway + bool drawAsRailway(const GUIVisualizationSettings& s) const; + + /// @brief whether to draw this lane as a waterway + bool drawAsWaterway(const GUIVisualizationSettings& s) const; + /// The rotations of the shape parts std::vector myShapeRotations; /// The lengths of the shape parts std::vector myShapeLengths; + /// The color of the shape parts (cached) + mutable std::vector myShapeColors; + /// @brief Half of lane width, for speed-up SUMOReal myHalfLaneWidth; diff -Nru sumo-0.21.0+dfsg/src/guisim/GUILaneSpeedTrigger.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUILaneSpeedTrigger.cpp --- sumo-0.21.0+dfsg/src/guisim/GUILaneSpeedTrigger.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUILaneSpeedTrigger.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 26.04.2004 -/// @version $Id: GUILaneSpeedTrigger.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUILaneSpeedTrigger.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Changes the speed allowed on a set of lanes (gui version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -330,11 +330,12 @@ glPushName(getGlID()); glPushMatrix(); glTranslated(0, 0, getType()); + const SUMOReal exaggeration = s.addSize.getExaggeration(s); 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); + glScaled(exaggeration, exaggeration, 1); glTranslated(pos.x(), pos.y(), 0); glRotated(rot, 0, 0, 1); glTranslated(0, -1.5, 0); diff -Nru sumo-0.21.0+dfsg/src/guisim/GUILaneSpeedTrigger.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUILaneSpeedTrigger.h --- sumo-0.21.0+dfsg/src/guisim/GUILaneSpeedTrigger.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUILaneSpeedTrigger.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 26.04.2004 -/// @version $Id: GUILaneSpeedTrigger.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUILaneSpeedTrigger.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Changes the speed allowed on a set of lanes (gui version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUINet.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUINet.cpp --- sumo-0.21.0+dfsg/src/guisim/GUINet.cpp 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUINet.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: GUINet.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: GUINet.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A MSNet extended by some values for usage within the gui /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -45,7 +46,7 @@ #include #include #include -#include +#include #include #include #include @@ -53,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -60,7 +62,6 @@ #include #include #include "GUINet.h" -#include "GUIShapeContainer.h" #ifdef HAVE_INTERNAL #include @@ -131,6 +132,15 @@ } +MSContainerControl& +GUINet::getContainerControl() { + if (myContainerControl == 0) { + myContainerControl = new GUIContainerControl(); + } + return *myContainerControl; +} + + void GUINet::initTLMap() { // get the list of loaded tl-logics @@ -216,6 +226,7 @@ GUINet::guiSimulationStep() { GLObjectValuePassConnector::updateAll(); GLObjectValuePassConnector >::updateAll(); + GUIParameterTableWindow::updateAll(); } @@ -417,7 +428,7 @@ GUINet::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { GUIParameterTableWindow* ret = - new GUIParameterTableWindow(app, *this, 15); + new GUIParameterTableWindow(app, *this, 19); // add items ret->mkItem("loaded vehicles [#]", true, new FunctionBinding(&getVehicleControl(), &MSVehicleControl::getLoadedVehicleNo)); @@ -454,6 +465,11 @@ ret->mkItem("ups [#]", true, new FunctionBinding(this, &GUINet::getUPS)); ret->mkItem("mean ups [#]", true, new FunctionBinding(this, &GUINet::getMeanUPS)); } + ret->mkItem("nodes [#]", false, (int)myJunctions->size()); + ret->mkItem("edges [#]", false, (int)GUIEdge::getIDs(false).size()); + ret->mkItem("total edge length [km]", false, GUIEdge::getTotalLength(false, false) / 1000); + ret->mkItem("total lane length [km]", false, GUIEdge::getTotalLength(false, true) / 1000); + // close building ret->closeBuilding(); return ret; diff -Nru sumo-0.21.0+dfsg/src/guisim/GUINet.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUINet.h --- sumo-0.21.0+dfsg/src/guisim/GUINet.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUINet.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUINet.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUINet.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A MSNet extended by some values for usage within the gui /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -220,6 +220,17 @@ MSPersonControl& getPersonControl(); + /** @brief Returns the container control + * + * If the container control does not exist, yet, it is created. + * + * @return The container control + * @see MSContainerControl + * @see myContainerControl + */ + MSContainerControl& getContainerControl(); + + /** 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; diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIPersonControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIPersonControl.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIPersonControl.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIPersonControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 13.06.2012 -/// @version $Id: GUIPersonControl.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUIPersonControl.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // GUI-version of the person control for building gui persons /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -57,4 +57,13 @@ } +void +GUIPersonControl::insertPersonIDs(std::vector& into) { + into.reserve(myPersons.size()); + for (std::map::const_iterator it = myPersons.begin(); it != myPersons.end(); ++it) { + into.push_back(static_cast((*it).second)->getGlID()); + } +} + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIPersonControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIPersonControl.h --- sumo-0.21.0+dfsg/src/guisim/GUIPersonControl.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIPersonControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 13.06.2012 -/// @version $Id: GUIPersonControl.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUIPersonControl.h 18095 2015-03-17 09:39:00Z behrisch $ /// // GUI-version of the person control for building gui persons /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -59,6 +59,11 @@ */ virtual MSPerson* buildPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan) const; + /** @brief Returns the list of all known persons by gl-id + * @param[fill] into The list to fill with vehicle ids + * @todo Well, what about concurrent modifications? + */ + void insertPersonIDs(std::vector& into); }; diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIPerson.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIPerson.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIPerson.cpp 2014-06-10 22:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIPerson.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIPerson.cpp 16566 2014-06-10 09:22:55Z behrisch $ +/// @version $Id: GUIPerson.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // A MSPerson extended by some values for usage within the gui /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -34,15 +34,15 @@ #include #include #include -#include -#include +#include +#include #include #include #include -#include +//#include #include #include -#include +#include #include #include #include @@ -62,28 +62,18 @@ #include #endif // CHECK_MEMORY_LEAKS -//#define GUIPerson_DEBUG_DRAW_WALKING_AREA_SHAPE +//#define GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS 1 // =========================================================================== // 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), + FXMAPFUNC(SEL_COMMAND, MID_SHOW_WALKINGAREA_PATH, GUIPerson::GUIPersonPopupMenu::onCmdShowWalkingareaPath), + FXMAPFUNC(SEL_COMMAND, MID_HIDE_WALKINGAREA_PATH, GUIPerson::GUIPersonPopupMenu::onCmdHideWalkingareaPath), }; // Object implementation FXIMPLEMENT(GUIPerson::GUIPersonPopupMenu, GUIGLObjectPopupMenu, GUIPersonPopupMenuMap, ARRAYNUMBER(GUIPersonPopupMenuMap)) -*/ @@ -102,6 +92,23 @@ GUIPerson::GUIPersonPopupMenu::~GUIPersonPopupMenu() {} +long +GUIPerson::GUIPersonPopupMenu::onCmdShowWalkingareaPath(FXObject*, FXSelector, void*) { + assert(myObject->getType() == GLO_PERSON); + if (!static_cast(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH)) { + static_cast(myObject)->addActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH); + } + return 1; +} + +long +GUIPerson::GUIPersonPopupMenu::onCmdHideWalkingareaPath(FXObject*, FXSelector, void*) { + assert(myObject->getType() == GLO_PERSON); + static_cast(myObject)->removeActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH); + return 1; +} + + /* ------------------------------------------------------------------------- @@ -109,8 +116,7 @@ * ----------------------------------------------------------------------- */ GUIPerson::GUIPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPerson::MSPersonPlan* plan) : MSPerson(pars, vtype, plan), - GUIGlObject(GLO_PERSON, pars->id), - myAmVisualizedAsStopped(false) + GUIGlObject(GLO_PERSON, pars->id) { } @@ -126,6 +132,12 @@ buildCenterPopupEntry(ret); buildNameCopyPopupEntry(ret); buildSelectionPopupEntry(ret); + + if (hasActiveAddVisualisation(&parent, VO_SHOW_WALKINGAREA_PATH)) { + new FXMenuCommand(ret, "Hide Walkingarea Path", 0, ret, MID_HIDE_WALKINGAREA_PATH); + } else { + new FXMenuCommand(ret, "Show Walkingarea Path", 0, ret, MID_SHOW_WALKINGAREA_PATH); + } // buildShowParamsPopupEntry(ret); buildPositionCopyEntry(ret, false); @@ -174,7 +186,7 @@ // set person color setColor(s); // scale - SUMOReal upscale = s.personExaggeration; + const SUMOReal upscale = s.personSize.getExaggeration(s); glScaled(upscale, upscale, 1); switch (s.personQuality) { case 0: @@ -190,10 +202,18 @@ break; } glPopMatrix(); +#ifdef GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS + drawAction_drawWalkingareaPath(s); +#endif + drawName(p1, s.scale, s.personName); + glPopName(); +} -#ifdef GUIPerson_DEBUG_DRAW_WALKING_AREA_SHAPE +void +GUIPerson::drawAction_drawWalkingareaPath(const GUIVisualizationSettings& s) const { MSPersonStage_Walking* stage = dynamic_cast(getCurrentStage()); if (stage != 0) { + setColor(s); MSPModel_Striping::PState* stripingState = dynamic_cast(stage->getPedestrianState()); if (stripingState != 0) { MSPModel_Striping::WalkingAreaPath* waPath = stripingState->myWalkingAreaPath; @@ -205,64 +225,16 @@ } } } -#endif - - drawName(p1, s.scale, s.personName); - glPopName(); } - void -GUIPerson::drawGLAdditional(GUISUMOAbstractView* const /* parent */, const GUIVisualizationSettings& /* s */) const { +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_WALKINGAREA_PATH)) { + drawAction_drawWalkingareaPath(s); } - 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(); } @@ -307,11 +279,17 @@ } return false; } - case 8: { + case 8: { // color by angle SUMOReal hue = getAngle() + 180; // [0-360] GLHelper::setColor(RGBColor::fromHSV(hue, 1., 1.)); return true; } + case 9: { // color randomly (by pointer) + const SUMOReal hue = (long)this % 360; // [0-360] + const SUMOReal sat = (((long)this / 360) % 67) / 100.0 + 0.33; // [0.33-1] + GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); + return true; + } default: return false; } @@ -386,6 +364,15 @@ glVertex2d(1, -0.5); glVertex2d(1, 0.5); glEnd(); + // draw a smaller triangle to indicate facing + GLHelper::setColor(GLHelper::getColor().changedBrightness(-64)); + glTranslated(0, 0, .045); + glBegin(GL_TRIANGLES); + glVertex2d(0., 0.); + glVertex2d(0.5, -0.25); + glVertex2d(0.5, 0.25); + glEnd(); + glTranslated(0, 0, -.045); } @@ -424,8 +411,9 @@ } 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; + const SUMOReal exaggeration = s.personSize.getExaggeration(s); + const SUMOReal halfLength = getVehicleType().getLength() / 2.0 * exaggeration; + const SUMOReal halfWidth = getVehicleType().getWidth() / 2.0 * exaggeration; GUITexturesHelper::drawTexturedBox(textureID, -halfWidth, -halfLength, halfWidth, halfLength); } } else { @@ -433,5 +421,29 @@ drawAction_drawAsPoly(s); } } + + +// ------------ Additional visualisations +bool +GUIPerson::hasActiveAddVisualisation(GUISUMOAbstractView* const parent, int which) const { + return myAdditionalVisualizations.find(parent) != myAdditionalVisualizations.end() && (myAdditionalVisualizations.find(parent)->second & which) != 0; +} + + +void +GUIPerson::addActiveAddVisualisation(GUISUMOAbstractView* const parent, int which) { + if (myAdditionalVisualizations.find(parent) == myAdditionalVisualizations.end()) { + myAdditionalVisualizations[parent] = 0; + } + myAdditionalVisualizations[parent] |= which; + parent->addAdditionalGLVisualisation(this); +} + + +void +GUIPerson::removeActiveAddVisualisation(GUISUMOAbstractView* const parent, int which) { + myAdditionalVisualizations[parent] &= ~which; + parent->removeAdditionalGLVisualisation(this); +} /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIPerson.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIPerson.h --- sumo-0.21.0+dfsg/src/guisim/GUIPerson.h 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIPerson.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIPerson.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: GUIPerson.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -38,10 +38,10 @@ #include #include #include -#include +#include #include #include -#include +#include // =========================================================================== @@ -150,7 +150,7 @@ * also allows to trigger further visualisations and to track the vehicle. */ class GUIPersonPopupMenu : public GUIGLObjectPopupMenu { - //FXDECLARE(GUIPersonPopupMenu) + FXDECLARE(GUIPersonPopupMenu) public: /** @brief Constructor * @param[in] app The main window for instantiation of other windows @@ -164,6 +164,11 @@ /// @brief Destructor ~GUIPersonPopupMenu(); + /// @brief Called if the walkingarea path of the person shall be shown + long onCmdShowWalkingareaPath(FXObject*, FXSelector, void*); + /// @brief Called if the walkingarea path of the person shall be hidden + long onCmdHideWalkingareaPath(FXObject*, FXSelector, void*); + protected: /// @brief Information which additional visualisations are enabled (per view) @@ -178,11 +183,47 @@ }; + /** @brief Additional visualisation feature ids + */ + enum VisualisationFeatures { + /// @brief show the current walkingarea path + VO_SHOW_WALKINGAREA_PATH = 1, + /// @brief show persons's current route + VO_SHOW_ROUTE = 2, + /// @brief track person + VO_TRACKED = 8 + }; /// @brief Enabled visualisations, per view std::map myAdditionalVisualizations; + /// @name Additional visualisations + /// @{ + + /** @brief Returns whether the named feature is enabled in the given view + * @param[in] parent The view for which the feature may be enabled + * @param[in] which The visualisation feature + * @return see comment + */ + bool hasActiveAddVisualisation(GUISUMOAbstractView* const parent, int which) const; + + + /** @brief Adds the named visualisation feature to the given view + * @param[in] parent The view for which the feature shall be enabled + * @param[in] which The visualisation feature to enable + * @see GUISUMOAbstractView::addAdditionalGLVisualisation + */ + void addActiveAddVisualisation(GUISUMOAbstractView* const parent, int which); + + + /** @brief Adds the named visualisation feature to the given view + * @param[in] parent The view for which the feature shall be enabled + * @param[in] which The visualisation feature to enable + * @see GUISUMOAbstractView::removeAdditionalGLVisualisation + */ + void removeActiveAddVisualisation(GUISUMOAbstractView* const parent, int which); + /// @} private: @@ -201,14 +242,13 @@ /// @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; + + void drawAction_drawWalkingareaPath(const GUIVisualizationSettings& s) const; /// @} }; diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIShapeContainer.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIShapeContainer.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIShapeContainer.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIShapeContainer.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -/****************************************************************************/ -/// @file GUIShapeContainer.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date 08.10.2009 -/// @version $Id: GUIShapeContainer.cpp 15692 2014-02-22 09:17:02Z behrisch $ -/// -// Storage for geometrical objects extended by mutexes -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 "GUIShapeContainer.h" -#include -#include -#include -#include -#include - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// method definitions -// =========================================================================== -GUIShapeContainer::GUIShapeContainer(SUMORTree& vis) - : myVis(vis) {} - - -GUIShapeContainer::~GUIShapeContainer() {} - - -bool -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; - } -} - - -bool -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; - } -} - - -bool -GUIShapeContainer::removePolygon(const std::string& id) { - AbstractMutex::ScopedLocker locker(myLock); - GUIPolygon* p = dynamic_cast(myPolygons.get(id)); - if (p == 0) { - return false; - } - myVis.removeAdditionalGLObject(p); - return myPolygons.remove(id); -} - - -bool -GUIShapeContainer::removePOI(const std::string& id) { - AbstractMutex::ScopedLocker locker(myLock); - GUIPointOfInterest* p = dynamic_cast(myPOIs.get(id)); - if (p == 0) { - return false; - } - myVis.removeAdditionalGLObject(p); - return myPOIs.remove(id); -} - - -void -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); - } -} - - -void -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); - } -} - - - -std::vector -GUIShapeContainer::getPOIIds() const { - AbstractMutex::ScopedLocker locker(myLock); - std::vector ret; - 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.21.0+dfsg/src/guisim/GUIShapeContainer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIShapeContainer.h --- sumo-0.21.0+dfsg/src/guisim/GUIShapeContainer.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIShapeContainer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ -/****************************************************************************/ -/// @file GUIShapeContainer.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @author Jakob Erdmann -/// @date 08.10.2009 -/// @version $Id: GUIShapeContainer.h 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// Storage for geometrical objects extended by mutexes -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 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 GUIShapeContainer_h -#define GUIShapeContainer_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include - -// =========================================================================== -// class declarations -// =========================================================================== -class SUMORTree; -class Position; -class MFXMutex; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GUIShapeContainer - * @brief Storage for geometrical objects extended by mutexes - * @see ShapeContainer - */ -class GUIShapeContainer : public ShapeContainer { -public: - /// @brief Constructor - GUIShapeContainer(SUMORTree& vis); - - - /// @brief Destructor - virtual ~GUIShapeContainer(); - - /** @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] id The id of the polygon - * @return Whether the polygon could be removed - */ - virtual bool removePolygon(const std::string& id); - - - /** @brief Removes a PoI from the container - * @param[in] id The id of the PoI - * @return Whether the poi could be removed - */ - virtual bool removePOI(const std::string& id); - - - - /** @brief Assigns a new position to the named PoI - * @param[in] id The id of the PoI to move - * @param[in] pos The PoI's new position - */ - virtual void movePOI(const std::string& id, const Position& pos); - - - /** @brief Assigns a shape to the named polygon - * @param[in] id The id of the polygon to reshape - * @param[in] shape The polygon's new shape - */ - virtual void reshapePolygon(const std::string& id, const PositionVector& shape); - - - - /// 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 - mutable MFXMutex myLock; - - /// @brief The RTree structure to add and remove visualization elements - SUMORTree& myVis; - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/guisim/GUITrafficLightLogicWrapper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUITrafficLightLogicWrapper.cpp --- sumo-0.21.0+dfsg/src/guisim/GUITrafficLightLogicWrapper.cpp 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUITrafficLightLogicWrapper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Oct/Nov 2003 -/// @version $Id: GUITrafficLightLogicWrapper.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: GUITrafficLightLogicWrapper.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A wrapper for tl-logics to allow their visualisation and interaction /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUITrafficLightLogicWrapper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUITrafficLightLogicWrapper.h --- sumo-0.21.0+dfsg/src/guisim/GUITrafficLightLogicWrapper.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUITrafficLightLogicWrapper.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Oct/Nov 2003 -/// @version $Id: GUITrafficLightLogicWrapper.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUITrafficLightLogicWrapper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A wrapper for tl-logics to allow their visualisation and interaction /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/guisim/GUITriggeredRerouter.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUITriggeredRerouter.cpp --- sumo-0.21.0+dfsg/src/guisim/GUITriggeredRerouter.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUITriggeredRerouter.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 25.07.2005 -/// @version $Id: GUITriggeredRerouter.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUITriggeredRerouter.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Reroutes vehicles passing an edge (gui version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -228,27 +228,16 @@ * ----------------------------------------------------------------------- */ GUITriggeredRerouter::GUITriggeredRerouter( const std::string& id, - const std::vector& edges, + const MSEdgeVector& 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) { + for (MSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) { myEdgeVisualizations.push_back(new GUITriggeredRerouterEdge(dynamic_cast(*it), this, false)); - } - // 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()); + rtree.addAdditionalGLObject(myEdgeVisualizations.back()); + myBoundary.add(myEdgeVisualizations.back()->getCenteringBoundary()); } } @@ -261,6 +250,21 @@ } +void +GUITriggeredRerouter::myEndElement(int element) { + MSTriggeredRerouter::myEndElement(element); + if (element == SUMO_TAG_INTERVAL) { + // add visualisation objects for closed edges + const RerouteInterval& ri = myIntervals.back(); + for (MSEdgeVector::const_iterator it = ri.closed.begin(); it != ri.closed.end(); ++it) { + myEdgeVisualizations.push_back(new GUITriggeredRerouterEdge(dynamic_cast(*it), this, true)); + dynamic_cast(GUINet::getInstance())->getVisualisationSpeedUp().addAdditionalGLObject(myEdgeVisualizations.back()); + myBoundary.add(myEdgeVisualizations.back()->getCenteringBoundary()); + } + } +} + + GUIGLObjectPopupMenu* GUITriggeredRerouter::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { @@ -348,16 +352,17 @@ void GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(const GUIVisualizationSettings& s) const { - if (s.scale * s.addExaggeration >= 3) { + const SUMOReal exaggeration = s.addSize.getExaggeration(s); + if (s.scale * exaggeration >= 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()); + const RerouteInterval* const ri = + myParent->getCurrentReroute(MSNet::getInstance()->getCurrentTimeStep()); + if (ri != 0 && prob > 0) { // draw only if the edge is closed at this time - if (std::find(ri.closed.begin(), ri.closed.end(), myEdge) != ri.closed.end()) { + 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]; @@ -374,7 +379,7 @@ } } glTranslated(0, 0, getType()); - //glScaled(s.addExaggeration, s.addExaggeration, 1); + //glScaled(exaggeration, exaggeration, 1); glColor3d(0.7, 0, 0); GLHelper::drawFilledCircle((SUMOReal) 1.3, noPoints); glTranslated(0, 0, .1); @@ -405,7 +410,7 @@ glTranslated(pos.x(), pos.y(), 0); glRotated(rot, 0, 0, 1); glTranslated(0, 0, getType()); - glScaled(s.addExaggeration, s.addExaggeration, 1); + glScaled(exaggeration, exaggeration, 1); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glBegin(GL_TRIANGLES); diff -Nru sumo-0.21.0+dfsg/src/guisim/GUITriggeredRerouter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUITriggeredRerouter.h --- sumo-0.21.0+dfsg/src/guisim/GUITriggeredRerouter.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUITriggeredRerouter.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 25.07.2005 -/// @version $Id: GUITriggeredRerouter.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUITriggeredRerouter.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Reroutes vehicles passing an edge (gui-version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -64,7 +64,7 @@ * @param[in] off Whether the rerouter is off (not working) initially */ GUITriggeredRerouter(const std::string& id, - const std::vector& edges, SUMOReal prob, + const MSEdgeVector& edges, SUMOReal prob, const std::string& aXMLFilename, bool off, SUMORTree& rtree); @@ -73,6 +73,14 @@ ~GUITriggeredRerouter(); + /** @brief Called when a closing tag occurs + * + * @param[in] element ID of the currently opened element + * @exception ProcessError If something fails + * @see GenericSAXHandler::myEndElement + */ + void myEndElement(int element); + /// @name inherited from GUIGlObject //@{ diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIVehicleControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIVehicleControl.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIVehicleControl.cpp 2014-05-23 22:02:09.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIVehicleControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 10. Dec 2003 -/// @version $Id: GUIVehicleControl.cpp 16418 2014-05-23 06:57:58Z behrisch $ +/// @version $Id: GUIVehicleControl.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The class responsible for building and deletion of vehicles (gui-version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -31,6 +31,7 @@ #endif #include +#include #include "GUIVehicleControl.h" #include "GUIVehicle.h" #include "GUINet.h" @@ -58,13 +59,14 @@ SUMOVehicle* GUIVehicleControl::buildVehicle(SUMOVehicleParameter* defs, - const MSRoute* route, const MSVehicleType* type) { + const MSRoute* route, const MSVehicleType* type, + const bool ignoreStopErrors, const bool fromRouteFile) { myLoadedVehNo++; - if (myMaxRandomDepartOffset > 0) { - // round to the closest usable simulation step - defs->depart += DELTA_T * int((myVehicleParamsRNG.rand((int)myMaxRandomDepartOffset) + 0.5 * DELTA_T) / DELTA_T); + if (fromRouteFile) { + defs->depart += computeRandomDepartOffset(); } - MSVehicle* built = new GUIVehicle(defs, route, type, type->computeChosenSpeedDeviation(myVehicleParamsRNG)); + MSVehicle* built = new GUIVehicle(defs, route, type, type->computeChosenSpeedDeviation(fromRouteFile ? MSRouteHandler::getParsingRNG() : 0)); + built->addStops(ignoreStopErrors); MSNet::getInstance()->informVehicleStateListener(built, MSNet::VEHICLE_STATE_BUILT); return built; } diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIVehicleControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIVehicleControl.h --- sumo-0.21.0+dfsg/src/guisim/GUIVehicleControl.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIVehicleControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Wed, 10. Dec 2003 -/// @version $Id: GUIVehicleControl.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUIVehicleControl.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The class responsible for building and deletion of vehicles (gui-version) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -76,11 +76,14 @@ * @param[in] defs The parameter defining the vehicle * @param[in] route The route of this vehicle * @param[in] type The type of this vehicle - * @return The built vehicle (MSVehicle instance) + * @param[in] ignoreStopErrors whether invalid stops trigger a warning only + * @param[in] fromRouteFile whether we are just reading the route file or creating via trigger, traci, ... + * @return The built vehicle (GUIVehicle instance) * @see MSVehicleControl::buildVehicle */ SUMOVehicle* buildVehicle(SUMOVehicleParameter* defs, - const MSRoute* route, const MSVehicleType* type); + const MSRoute* route, const MSVehicleType* type, + const bool ignoreStopErrors, const bool fromRouteFile = true); /// @} diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIVehicle.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIVehicle.cpp --- sumo-0.21.0+dfsg/src/guisim/GUIVehicle.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIVehicle.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIVehicle.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: GUIVehicle.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -51,13 +51,16 @@ #include #include #include -#include +#include #include #include +#include +#include #include #include #include "GUIVehicle.h" #include "GUIPerson.h" +#include "GUIContainer.h" #include "GUINet.h" #include "GUIEdge.h" #include "GUILane.h" @@ -128,6 +131,11 @@ //double vehiclePoly_EVehicleFrontGlass[] = { 0.35,0, 0.1,0, 0.1,0.4, 0.43,0.3, 0.43,-0.3, 0.1,-0.4, 0.1,0, -10000 }; double vehiclePoly_EVehicleBackGlass[] = { 0.65, 0, 0.9, 0, 0.9, 0.4, 0.57, 0.3, 0.57, -0.3, 0.9, -0.4, 0.9, 0, -10000 }; +double vehiclePoly_Ship[] = { 0.25, 0, 0, 0, 0.1, 0.25, 0.2, 0.45, 0.25, 0.5, 0.95, 0.5, 1.0, 0.45, 1.0, -0.45, 0.95, -0.5, 0.25, -0.5, 0.2, -0.45, 0.1, -0.25, 0, 0, -10000 }; +double vehiclePoly_ShipDeck[] = { 0.5, 0, 0.25, 0.4, 0.95, 0.4, 0.95, -0.4, 0.25, -0.4, 0.25, 0.4, -10000 }; +double vehiclePoly_ShipSuperStructure[] = { 0.8, 0, 0.5, 0.3, 0.85, 0.3, 0.85, -0.3, 0.5, -0.3, 0.5, 0.3, -10000 }; + +double vehiclePoly_Cyclist[] = { 0.5, 0, 0.25, 0.45, 0.25, 0.5, 0.8, 0.15, 0.8, -0.15, 0.25, -0.5, 0.25, -0.45, -10000 }; // =========================================================================== // method definitions @@ -243,8 +251,7 @@ * GUIVehicle - methods * ----------------------------------------------------------------------- */ GUIVehicle::GUIVehicle(SUMOVehicleParameter* pars, const MSRoute* route, - const MSVehicleType* type, - SUMOReal speedFactor) : + const MSVehicleType* type, const SUMOReal speedFactor) : MSVehicle(pars, route, type, speedFactor), GUIGlObject(GLO_VEHICLE, pars->id) { // as it is possible to show all vehicle routes, we have to store them... (bug [ 2519761 ]) @@ -315,7 +322,7 @@ GUIVehicle::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { GUIParameterTableWindow* ret = - new GUIParameterTableWindow(app, *this, 34); + new GUIParameterTableWindow(app, *this, 36); // add items ret->mkItem("lane [id]", false, myLane->getID()); ret->mkItem("position [m]", true, @@ -346,6 +353,7 @@ ret->mkItem("insertion probability", false, getParameter().repetitionProbability); } ret->mkItem("stop info", false, getStopInfo()); + ret->mkItem("line", false, myParameter->line); ret->mkItem("CO2 [mg/s]", true, new FunctionBinding(this, &GUIVehicle::getCO2Emissions)); ret->mkItem("CO [mg/s]", true, @@ -360,6 +368,14 @@ new FunctionBinding(this, &GUIVehicle::getFuelConsumption)); ret->mkItem("noise (Harmonoise) [dB]", true, new FunctionBinding(this, &GUIVehicle::getHarmonoise_NoiseEmissions)); + std::ostringstream str; + for (std::vector::const_iterator i = myDevices.begin(); i != myDevices.end(); ++i) { + if (i != myDevices.begin()) { + str << ' '; + } + str << (*i)->getID().substr(0, (*i)->getID().find(getID())); + } + ret->mkItem("devices", false, str.str()); ret->mkItem("parameters [key:val]", false, toString(getParameter().getMap())); ret->mkItem("", false, ""); ret->mkItem("Type Information:", false, ""); @@ -473,17 +489,28 @@ case SVS_BICYCLE: case SVS_MOPED: case SVS_MOTORCYCLE: { + RGBColor darker = current.changedBrightness(-50); + // body + drawPoly(vehiclePoly_Cyclist, 4); + // head glPushMatrix(); - glTranslated(.5, 0, 0); - glScaled(.25 / (length), 1, 1.); - glTranslated(0, 0, .045); + glTranslated(0.4, 0, .5); + glScaled(0.1, 0.2, 1); + GLHelper::setColor(darker); GLHelper::drawFilledCircle(1); - glScaled(.7, 2, 1); - glTranslated(0, 0, -.045); - glTranslated(0, 0, .04); - GLHelper::setColor(lighter); + glPopMatrix(); + // bike frame + GLHelper::setColor(RGBColor::GREY); + glPushMatrix(); + glTranslated(0.5, 0, .3); + glScaled(0.5, 0.05, 1); + GLHelper::drawFilledCircle(1); + glPopMatrix(); + // handle bar + glPushMatrix(); + glTranslated(0.25, 0, .3); + glScaled(0.02, 0.5, 1); GLHelper::drawFilledCircle(1); - glTranslated(0, 0, -.04); glPopMatrix(); } break; @@ -637,6 +664,16 @@ GLHelper::drawFilledCircle(.3, 16); glPopMatrix(); break; + case SVS_SHIP: { + RGBColor darker = current.changedBrightness(-30); + RGBColor darker2 = current.changedBrightness(-70); + drawPoly(vehiclePoly_Ship, 4); + GLHelper::setColor(darker); + drawPoly(vehiclePoly_ShipDeck, 5); + GLHelper::setColor(darker2); + drawPoly(vehiclePoly_ShipSuperStructure, 6); + break; + } default: // same as passenger drawPoly(vehiclePoly_PassengerCarBody, 4); glColor3d(1, 1, 1); @@ -739,6 +776,7 @@ case SVS_RAIL_CARGO: case SVS_E_VEHICLE: case SVS_ANT: + case SVS_SHIP: break; default: // same as passenger/sedan drawPoly(vehiclePoly_PassengerSedanRightGlass, 4.5); @@ -825,10 +863,11 @@ if (file != "") { int textureID = GUITexturesHelper::getTextureID(file); if (textureID > 0) { + const SUMOReal exaggeration = s.vehicleSize.getExaggeration(s); if (length < 0) { - length = getVehicleType().getLength() * s.vehicleExaggeration; + length = getVehicleType().getLength() * exaggeration; } - const SUMOReal halfWidth = getVehicleType().getWidth() / 2.0 * s.vehicleExaggeration; + const SUMOReal halfWidth = getVehicleType().getWidth() / 2.0 * exaggeration; GUITexturesHelper::drawTexturedBox(textureID, -halfWidth, 0, halfWidth, length); return true; } @@ -926,7 +965,7 @@ // set lane color setColor(s); // scale - SUMOReal upscale = s.vehicleExaggeration; + const SUMOReal upscale = s.vehicleSize.getExaggeration(s); glScaled(upscale, upscale, 1); /* MSLCM_DK2004 &m2 = static_cast(veh->getLaneChangeModel()); @@ -962,7 +1001,7 @@ break; } if (s.drawMinGap) { - SUMOReal minGap = -getVehicleType().getMinGap(); + const SUMOReal minGap = -getVehicleType().getMinGap(); glColor3d(0., 1., 0.); glBegin(GL_LINES); glVertex2d(0., 0); @@ -971,6 +1010,11 @@ glVertex2d(.5, minGap); glEnd(); } + MSDevice_BTreceiver* dev = static_cast(getDevice(typeid(MSDevice_BTreceiver))); + if (dev != 0 && s.showBTRange) { + glColor3d(1., 0., 0.); + GLHelper::drawOutlineCircle(dev->getRange(), dev->getRange() - .2, 32); + } // draw the blinker and brakelights if wished if (s.showBlinker) { glTranslated(0, 0, .1); @@ -978,6 +1022,7 @@ case SVS_PEDESTRIAN: case SVS_BICYCLE: case SVS_ANT: + case SVS_SHIP: case SVS_RAIL: case SVS_RAIL_CARGO: // only SVS_RAIL_CAR has blinkers and brake lights @@ -1036,9 +1081,13 @@ } */ glPopMatrix(); - drawName(getPosition(-MIN2(getVehicleType().getLength() / 2, SUMOReal(5))), - s.scale, + const Position namePos = getPosition(-MIN2(getVehicleType().getLength() / 2, SUMOReal(5))); + drawName(namePos, s.scale, getVehicleType().getGuiShape() == SVS_PEDESTRIAN ? s.personName : s.vehicleName); + if (s.vehicleName.show && myParameter->line != "") { + GLHelper::drawText("line:" + myParameter->line, namePos + Position(0, -0.6 * s.vehicleName.size / s.scale), + GLO_MAX, s.vehicleName.size / s.scale, s.vehicleName.color); + } glPopName(); if (myPersonDevice != 0) { const std::vector& ps = myPersonDevice->getPersons(); @@ -1050,6 +1099,16 @@ person->drawGL(s); } } + if (myContainerDevice != 0) { + const std::vector& cs = myContainerDevice->getContainers(); + size_t containerIndex = 0; + for (std::vector::const_iterator i = cs.begin(); i != cs.end(); ++i) { + GUIContainer* container = dynamic_cast(*i); + assert(container != 0); + container->setPositionInVehicle(getSeatPosition(containerIndex++)); + container->drawGL(s); + } + } } @@ -1091,7 +1150,7 @@ } const SUMOTime leaveTime = (*i).myLink->getLeaveTime( (*i).myArrivalTime, (*i).myArrivalSpeed, (*i).getLeaveSpeed(), getVehicleType().getLengthWithGap()); - drawLinkItem(p, (*i).myArrivalTime, leaveTime, s.addExaggeration); + drawLinkItem(p, (*i).myArrivalTime, leaveTime, s.vehicleSize.getExaggeration(s)); // the time slot that ego vehicle uses when checking opened may // differ from the one it requests in setApproaching MSLink::ApproachingVehicleInformation avi = (*i).myLink->getApproaching(this); @@ -1118,53 +1177,53 @@ void GUIVehicle::setColor(const GUIVisualizationSettings& s) const { const GUIColorer& c = s.vehicleColorer; - if (!setFunctionalColor(c.getActive())) { + if (!setFunctionalColor(c.getActive(), this)) { GLHelper::setColor(c.getScheme().getColor(getColorValue(c.getActive()))); } } bool -GUIVehicle::setFunctionalColor(size_t activeScheme) const { +GUIVehicle::setFunctionalColor(size_t activeScheme, const MSBaseVehicle* veh) { switch (activeScheme) { case 0: { - if (getParameter().wasSet(VEHPARS_COLOR_SET)) { - GLHelper::setColor(getParameter().color); + if (veh->getParameter().wasSet(VEHPARS_COLOR_SET)) { + GLHelper::setColor(veh->getParameter().color); return true; } - if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) { - GLHelper::setColor(getVehicleType().getColor()); + if (veh->getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) { + GLHelper::setColor(veh->getVehicleType().getColor()); return true; } - if (&getRoute().getColor() != &RGBColor::DEFAULT_COLOR) { - GLHelper::setColor(getRoute().getColor()); + if (&(veh->getRoute().getColor()) != &RGBColor::DEFAULT_COLOR) { + GLHelper::setColor(veh->getRoute().getColor()); return true; } return false; } case 2: { - if (getParameter().wasSet(VEHPARS_COLOR_SET)) { - GLHelper::setColor(getParameter().color); + if (veh->getParameter().wasSet(VEHPARS_COLOR_SET)) { + GLHelper::setColor(veh->getParameter().color); return true; } return false; } case 3: { - if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) { - GLHelper::setColor(getVehicleType().getColor()); + if (veh->getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) { + GLHelper::setColor(veh->getVehicleType().getColor()); return true; } return false; } case 4: { - if (&getRoute().getColor() != &RGBColor::DEFAULT_COLOR) { - GLHelper::setColor(getRoute().getColor()); + if (&(veh->getRoute().getColor()) != &RGBColor::DEFAULT_COLOR) { + GLHelper::setColor(veh->getRoute().getColor()); return true; } return false; } case 5: { - Position p = getRoute().getEdges()[0]->getLanes()[0]->getShape()[0]; + Position p = veh->getRoute().getEdges()[0]->getLanes()[0]->getShape()[0]; const Boundary& b = ((GUINet*) MSNet::getInstance())->getBoundary(); Position center = b.getCenter(); SUMOReal hue = 180. + atan2(center.x() - p.x(), center.y() - p.y()) * 180. / PI; @@ -1173,7 +1232,7 @@ return true; } case 6: { - Position p = getRoute().getEdges().back()->getLanes()[0]->getShape()[-1]; + Position p = veh->getRoute().getEdges().back()->getLanes()[0]->getShape()[-1]; const Boundary& b = ((GUINet*) MSNet::getInstance())->getBoundary(); Position center = b.getCenter(); SUMOReal hue = 180. + atan2(center.x() - p.x(), center.y() - p.y()) * 180. / PI; @@ -1182,8 +1241,8 @@ return true; } case 7: { - Position pb = getRoute().getEdges()[0]->getLanes()[0]->getShape()[0]; - Position pe = getRoute().getEdges().back()->getLanes()[0]->getShape()[-1]; + Position pb = veh->getRoute().getEdges()[0]->getLanes()[0]->getShape()[0]; + Position pe = veh->getRoute().getEdges().back()->getLanes()[0]->getShape()[-1]; const Boundary& b = ((GUINet*) MSNet::getInstance())->getBoundary(); SUMOReal hue = 180. + atan2(pb.x() - pe.x(), pb.y() - pe.y()) * 180. / PI; Position minp(b.xmin(), b.ymin()); @@ -1192,6 +1251,12 @@ GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); return true; } + case 24: { // color randomly (by pointer) + const SUMOReal hue = (long)veh % 360; // [0-360] + const SUMOReal sat = (((long)veh / 360) % 67) / 100.0 + 0.33; // [0.33-1] + GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); + return true; + } } return false; } @@ -1286,12 +1351,13 @@ colors[3] = 0; } glColor3dv(colors); + const SUMOReal exaggeration = s.vehicleSize.getExaggeration(s); if (routeNo == 0) { - drawRouteHelper(*myRoute, s.vehicleExaggeration); + drawRouteHelper(*myRoute, exaggeration); return; } --routeNo; // only prior routes are stored - drawRouteHelper(*myRoutes->getRoute(routeNo), s.vehicleExaggeration); + drawRouteHelper(*myRoutes->getRoute(routeNo), exaggeration); } @@ -1365,13 +1431,19 @@ GUIVehicle::drawAction_drawRailCarriages(const GUIVisualizationSettings& s, SUMOReal defaultLength, SUMOReal carriageGap, int firstPassengerCarriage, bool asImage) const { RGBColor current = GLHelper::getColor(); RGBColor darker = current.changedBrightness(-51); - const SUMOReal length = getVehicleType().getLength() * s.vehicleExaggeration; - const SUMOReal halfWidth = getVehicleType().getWidth() / 2.0 * s.vehicleExaggeration; + const SUMOReal exaggeration = s.vehicleSize.getExaggeration(s); + defaultLength *= exaggeration; + if (exaggeration == 0) { + return; + } + carriageGap *= exaggeration; + const SUMOReal length = getVehicleType().getLength() * exaggeration; + const SUMOReal halfWidth = getVehicleType().getWidth() / 2.0 * exaggeration; glPopMatrix(); // undo scaling and 90 degree rotation glPopMatrix(); // undo initial translation and rotation GLHelper::setColor(darker); - const SUMOReal xCornerCut = 0.3; - const SUMOReal yCornerCut = 0.4; + const SUMOReal xCornerCut = 0.3 * exaggeration; + const SUMOReal yCornerCut = 0.4 * exaggeration; // round to closest integer const int numCarriages = floor(length / (defaultLength + carriageGap) + 0.5); assert(numCarriages > 0); @@ -1398,7 +1470,7 @@ while (carriageOffset < 0) { MSLane* prev = getPreviousLane(lane, furtherIndex); if (prev != lane) { - carriageOffset += lane->getLength(); + carriageOffset += prev->getLength(); } else { // no lane available for drawing. carriageOffset = 0; @@ -1406,11 +1478,21 @@ lane = prev; } while (carriageBackOffset < 0) { - backLane = getPreviousLane(backLane, backFurtherIndex); - carriageBackOffset += backLane->getLength(); + MSLane* prev = getPreviousLane(backLane, backFurtherIndex); + if (prev != backLane) { + carriageBackOffset += prev->getLength(); + } else { + // no lane available for drawing. + carriageBackOffset = 0; + } + backLane = prev; } front = lane->getShape().positionAtOffset2D(carriageOffset); back = backLane->getShape().positionAtOffset2D(carriageBackOffset); + if (front == back) { + // no place for drawing available + continue; + } angle = atan2((front.x() - back.x()), (back.y() - front.y())) * (SUMOReal) 180.0 / (SUMOReal) PI; if (i >= firstPassengerCarriage) { computeSeats(front, back, requiredSeats); @@ -1498,6 +1580,8 @@ } if (myStops.front().triggered) { result += ", triggered"; + } else if (myStops.front().containerTriggered) { + result += ", containerTriggered"; } else { result += ", duration=" + time2string(myStops.front().duration); } @@ -1526,7 +1610,7 @@ // the vehicle to enter the junction first has priority const GUIVehicle* leader = dynamic_cast(it->vehAndGap.first); if (leader != 0) { - if (leader->myLinkLeaders.count(getID()) == 0) { + if (leader->myLinkLeaders[dpi.myLink->getJunction()].count(getID()) == 0) { // leader isn't already following us, now we follow it gSelected.select(leader->getGlID()); } diff -Nru sumo-0.21.0+dfsg/src/guisim/GUIVehicle.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIVehicle.h --- sumo-0.21.0+dfsg/src/guisim/GUIVehicle.h 2014-06-02 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/GUIVehicle.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIVehicle.h 16445 2014-06-02 08:01:04Z namdre $ +/// @version $Id: GUIVehicle.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -42,7 +42,7 @@ #include #include #include -#include +#include // =========================================================================== @@ -72,11 +72,10 @@ * @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, SUMOReal speedFactor); + const MSVehicleType* type, const SUMOReal speedFactor); /// @brief destructor @@ -271,13 +270,13 @@ /// @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 + static bool setFunctionalColor(size_t activeScheme, const MSBaseVehicle* veh); private: /// @brief sets the color according to the currente settings void setColor(const GUIVisualizationSettings& s) const; - /// @brief sets the color according to the current scheme index and some vehicle function - bool setFunctionalColor(size_t activeScheme) const; /// @name drawing helper methods /// @{ diff -Nru sumo-0.21.0+dfsg/src/guisim/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/Makefile.am --- sumo-0.21.0+dfsg/src/guisim/Makefile.am 2013-08-21 22:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,9 @@ noinst_LIBRARIES = libguisim.a libguisim_a_SOURCES = GUIBusStop.cpp GUIBusStop.h \ +GUIContainer.cpp GUIContainer.h \ +GUIContainerControl.cpp GUIContainerControl.h \ +GUIContainerStop.cpp GUIContainerStop.h \ GUIDetectorWrapper.cpp GUIDetectorWrapper.h \ GUIE3Collector.cpp GUIE3Collector.h GUIEdge.cpp GUIEdge.h \ GUIEventControl.cpp GUIEventControl.h \ @@ -11,7 +14,6 @@ GUILaneSpeedTrigger.cpp GUILaneSpeedTrigger.h \ GUIPerson.cpp GUIPerson.h GUIPersonControl.cpp GUIPersonControl.h \ GUINet.cpp GUINet.h \ -GUIShapeContainer.cpp GUIShapeContainer.h \ GUITrafficLightLogicWrapper.cpp GUITrafficLightLogicWrapper.h \ GUITriggeredRerouter.cpp GUITriggeredRerouter.h \ GUICalibrator.cpp GUICalibrator.h \ diff -Nru sumo-0.21.0+dfsg/src/guisim/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/Makefile.in --- sumo-0.21.0+dfsg/src/guisim/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -98,14 +98,14 @@ am__v_AR_1 = libguisim_a_AR = $(AR) $(ARFLAGS) libguisim_a_LIBADD = -am_libguisim_a_OBJECTS = GUIBusStop.$(OBJEXT) \ +am_libguisim_a_OBJECTS = GUIBusStop.$(OBJEXT) GUIContainer.$(OBJEXT) \ + GUIContainerControl.$(OBJEXT) GUIContainerStop.$(OBJEXT) \ GUIDetectorWrapper.$(OBJEXT) GUIE3Collector.$(OBJEXT) \ GUIEdge.$(OBJEXT) GUIEventControl.$(OBJEXT) \ GUIInductLoop.$(OBJEXT) GUIInstantInductLoop.$(OBJEXT) \ GUIJunctionWrapper.$(OBJEXT) GUILane.$(OBJEXT) \ GUILaneSpeedTrigger.$(OBJEXT) GUIPerson.$(OBJEXT) \ GUIPersonControl.$(OBJEXT) GUINet.$(OBJEXT) \ - GUIShapeContainer.$(OBJEXT) \ GUITrafficLightLogicWrapper.$(OBJEXT) \ GUITriggeredRerouter.$(OBJEXT) GUICalibrator.$(OBJEXT) \ GUIVehicle.$(OBJEXT) GUIVehicleControl.$(OBJEXT) \ @@ -232,6 +232,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -242,7 +244,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -338,6 +339,9 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libguisim.a libguisim_a_SOURCES = GUIBusStop.cpp GUIBusStop.h \ +GUIContainer.cpp GUIContainer.h \ +GUIContainerControl.cpp GUIContainerControl.h \ +GUIContainerStop.cpp GUIContainerStop.h \ GUIDetectorWrapper.cpp GUIDetectorWrapper.h \ GUIE3Collector.cpp GUIE3Collector.h GUIEdge.cpp GUIEdge.h \ GUIEventControl.cpp GUIEventControl.h \ @@ -348,7 +352,6 @@ GUILaneSpeedTrigger.cpp GUILaneSpeedTrigger.h \ GUIPerson.cpp GUIPerson.h GUIPersonControl.cpp GUIPersonControl.h \ GUINet.cpp GUINet.h \ -GUIShapeContainer.cpp GUIShapeContainer.h \ GUITrafficLightLogicWrapper.cpp GUITrafficLightLogicWrapper.h \ GUITriggeredRerouter.cpp GUITriggeredRerouter.h \ GUICalibrator.cpp GUICalibrator.h \ @@ -408,6 +411,9 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIBusStop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUICalibrator.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIContainer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIContainerControl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIContainerStop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIDetectorWrapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIE3Collector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIEdge.Po@am__quote@ @@ -420,7 +426,6 @@ @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@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIVehicle.Po@am__quote@ diff -Nru sumo-0.21.0+dfsg/src/guisim_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim_main.cpp --- sumo-0.21.0+dfsg/src/guisim_main.cpp 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/guisim_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Felix Brack /// @date Tue, 20 Nov 2001 -/// @version $Id: guisim_main.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: guisim_main.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Main for GUISIM /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -72,7 +72,7 @@ OptionsCont& oc = OptionsCont::getOptions(); // give some application descriptions oc.setApplicationDescription("GUI version of the simulation SUMO."); - oc.setApplicationName("sumo-gui.exe", "SUMO gui Version " + (std::string)VERSION_STRING); + oc.setApplicationName("sumo-gui.exe", "SUMO gui Version " + getBuildName(VERSION_STRING)); int ret = 0; try { // initialise subsystems @@ -96,8 +96,8 @@ // build the main window GUIApplicationWindow* window = new GUIApplicationWindow(&application, "*.sumo.cfg,*.sumocfg"); - window->dependentBuild(oc.getBool("game")); gSchemeStorage.init(&application); + window->dependentBuild(oc.getBool("game")); // Create app application.addSignal(SIGINT, window, MID_QUIT); application.create(); diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/jtrrouter_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/jtrrouter_main.cpp --- sumo-0.21.0+dfsg/src/jtrrouter/jtrrouter_main.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/jtrrouter_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: jtrrouter_main.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: jtrrouter_main.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Main for JTRROUTER /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -149,11 +149,13 @@ // prepare the output net.openOutput(oc.getString("output-file"), "", oc.getString("vtype-output")); // build the router - ROJTRRouter router(net, oc.getBool("ignore-errors"), oc.getBool("accept-all-destinations"), - (int)(((SUMOReal) net.getEdgeNo()) * OptionsCont::getOptions().getFloat("max-edges-factor")), - oc.getBool("ignore-vclasses"), oc.getBool("allow-loops")); - loader.processRoutes(string2time(oc.getString("begin")), string2time(oc.getString("end")), net, router); - net.closeOutput(); + ROJTRRouter* router = new ROJTRRouter(oc.getBool("ignore-errors"), oc.getBool("accept-all-destinations"), + (int)(((SUMOReal) net.getEdgeNo()) * OptionsCont::getOptions().getFloat("max-edges-factor")), + oc.getBool("ignore-vclasses"), oc.getBool("allow-loops")); + RORouteDef::setUsingJTRR(); + loader.processRoutes(string2time(oc.getString("begin")), string2time(oc.getString("end")), + string2time(oc.getString("route-steps")), net, *router); + net.cleanup(router); } @@ -165,7 +167,7 @@ OptionsCont& oc = OptionsCont::getOptions(); // give some application descriptions oc.setApplicationDescription("Router for the microscopic road traffic simulation SUMO based on junction turning ratios."); - oc.setApplicationName("jtrrouter", "SUMO jtrrouter Version " + (std::string)VERSION_STRING); + oc.setApplicationName("jtrrouter", "SUMO jtrrouter Version " + getBuildName(VERSION_STRING)); int ret = 0; RONet* net = 0; try { @@ -230,5 +232,4 @@ } - /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/Makefile.am --- sumo-0.21.0+dfsg/src/jtrrouter/Makefile.am 2014-02-24 23:02:17.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -16,6 +16,7 @@ jtrrouter_LDADD = ../router/librouter.a \ ../utils/options/liboptions.a \ ../utils/xml/libxml.a \ +../utils/vehicle/libvehicle.a \ ../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ @@ -23,5 +24,4 @@ ../utils/emissions/libemissions.a \ ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) \ --l$(LIB_XERCES) - +-l$(LIB_XERCES) $(FOX_LDFLAGS) diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/Makefile.in --- sumo-0.21.0+dfsg/src/jtrrouter/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -97,12 +97,14 @@ ROJTREdgeBuilder.$(OBJEXT) ROJTRRouter.$(OBJEXT) \ ROJTRTurnDefLoader.$(OBJEXT) ROJTRFrame.$(OBJEXT) jtrrouter_OBJECTS = $(am_jtrrouter_OBJECTS) +am__DEPENDENCIES_1 = jtrrouter_DEPENDENCIES = ../router/librouter.a \ ../utils/options/liboptions.a ../utils/xml/libxml.a \ - ../utils/common/libcommon.a ../utils/importio/libimportio.a \ + ../utils/vehicle/libvehicle.a ../utils/common/libcommon.a \ + ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a ../utils/geom/libgeom.a \ ../utils/emissions/libemissions.a ../foreign/tcpip/libtcpip.a \ - $(MEM_LIBS) + $(MEM_LIBS) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -226,6 +228,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -236,7 +240,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -341,6 +344,7 @@ jtrrouter_LDADD = ../router/librouter.a \ ../utils/options/liboptions.a \ ../utils/xml/libxml.a \ +../utils/vehicle/libvehicle.a \ ../utils/common/libcommon.a \ ../utils/importio/libimportio.a \ ../utils/iodevices/libiodevices.a \ @@ -348,7 +352,7 @@ ../utils/emissions/libemissions.a \ ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) \ --l$(LIB_XERCES) +-l$(LIB_XERCES) $(FOX_LDFLAGS) all: all-am diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/ROJTREdgeBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTREdgeBuilder.cpp --- sumo-0.21.0+dfsg/src/jtrrouter/ROJTREdgeBuilder.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTREdgeBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Yun-Pang Floetteroed /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTREdgeBuilder.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: ROJTREdgeBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The builder for jtrrouter-edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/ROJTREdgeBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTREdgeBuilder.h --- sumo-0.21.0+dfsg/src/jtrrouter/ROJTREdgeBuilder.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTREdgeBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Yun-Pang Floetteroed /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTREdgeBuilder.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: ROJTREdgeBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Interface for building instances of jtrrouter-edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/ROJTREdge.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTREdge.cpp --- sumo-0.21.0+dfsg/src/jtrrouter/ROJTREdge.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTREdge.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Yun-Pang Floetteroed /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTREdge.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: ROJTREdge.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An edge the jtr-router may route through /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -58,8 +58,8 @@ void -ROJTREdge::addFollower(ROEdge* s, std::string) { - ROEdge::addFollower(s); +ROJTREdge::addSuccessor(ROEdge* s, std::string) { + ROEdge::addSuccessor(s); ROJTREdge* js = static_cast(s); if (myFollowingDefs.find(js) == myFollowingDefs.end()) { myFollowingDefs[js] = new ValueTimeLine(); @@ -68,8 +68,8 @@ void -ROJTREdge::addFollowerProbability(ROJTREdge* follower, SUMOTime begTime, - SUMOTime endTime, SUMOReal probability) { +ROJTREdge::addFollowerProbability(ROJTREdge* follower, SUMOReal begTime, + SUMOReal endTime, SUMOReal probability) { FollowerUsageCont::iterator i = myFollowingDefs.find(follower); if (i == myFollowingDefs.end()) { WRITE_ERROR("The edges '" + getID() + "' and '" + follower->getID() + "' are not connected."); @@ -80,7 +80,7 @@ ROJTREdge* -ROJTREdge::chooseNext(const ROVehicle* const veh, SUMOTime time) const { +ROJTREdge::chooseNext(const ROVehicle* const veh, SUMOReal time, const std::set& avoid) const { // if no usable follower exist, return 0 // their probabilities are not yet regarded if (myFollowingEdges.size() == 0 || (veh != 0 && allFollowersProhibit(veh))) { @@ -90,15 +90,19 @@ RandomDistributor dist; // use the loaded definitions, first for (FollowerUsageCont::const_iterator i = myFollowingDefs.begin(); i != myFollowingDefs.end(); ++i) { - if ((veh == 0 || !(*i).first->prohibits(veh)) && (*i).second->describesTime(time)) { - dist.add((*i).second->getValue(time), (*i).first); + if (avoid.count(i->first) == 0) { + if ((veh == 0 || !(*i).first->prohibits(veh)) && (*i).second->describesTime(time)) { + dist.add((*i).second->getValue(time), (*i).first); + } } } // if no loaded definitions are valid for this time, try to use the defaults if (dist.getOverallProb() == 0) { for (size_t i = 0; i < myParsedTurnings.size(); ++i) { - if (veh == 0 || !myFollowingEdges[i]->prohibits(veh)) { - dist.add(myParsedTurnings[i], static_cast(myFollowingEdges[i])); + if (avoid.count(myFollowingEdges[i]) == 0) { + if (veh == 0 || !myFollowingEdges[i]->prohibits(veh)) { + dist.add(myParsedTurnings[i], static_cast(myFollowingEdges[i])); + } } } } diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/ROJTREdge.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTREdge.h --- sumo-0.21.0+dfsg/src/jtrrouter/ROJTREdge.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTREdge.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Yun-Pang Floetteroed /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTREdge.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: ROJTREdge.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An edge the jtr-router may route through /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -81,26 +81,27 @@ * @param[in] s The following edge * @see ROEdge::addFollower */ - void addFollower(ROEdge* s, std::string dir = ""); + void addSuccessor(ROEdge* s, std::string dir = ""); /** @brief adds the information about the percentage of using a certain follower * * @param[in] follower The following edge - * @param[in] begTime Time begin for which this probability is valid - * @param[in] endTime Time end for which this probability is valid + * @param[in] begTime Time begin (in seconds) for which this probability is valid + * @param[in] endTime Time end (in seconds) for which this probability is valid * @param[in] probability The probability to use the given follower */ void addFollowerProbability(ROJTREdge* follower, - SUMOTime begTime, SUMOTime endTime, SUMOReal probability); + SUMOReal begTime, SUMOReal endTime, SUMOReal probability); /** @brief Returns the next edge to use * @param[in] veh The vehicle to choose the next edge for - * @param[in] time The time at which the next edge shall be entered + * @param[in] time The time at which the next edge shall be entered (in seconds) + * @param[in] avoid The set of edges to avoid * @return The chosen edge */ - ROJTREdge* chooseNext(const ROVehicle* const veh, SUMOTime time) const; + ROJTREdge* chooseNext(const ROVehicle* const veh, SUMOReal time, const std::set& avoid) const; /** @brief Sets the turning definition defaults diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/ROJTRFrame.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTRFrame.cpp --- sumo-0.21.0+dfsg/src/jtrrouter/ROJTRFrame.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTRFrame.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROJTRFrame.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ROJTRFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for jtr-routing /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -42,7 +42,7 @@ #include #include #include -#include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -76,12 +76,12 @@ oc.addDescription("exit-times", "Output", "Write exit times (weights) for each edge"); oc.doRegister("max-edges-factor", new Option_Float(2.0)); - oc.addDescription("max-edges-factor", "Processing", ""); + oc.addDescription("max-edges-factor", "Processing", "Routes are cut off when the route edges to net edges ratio is larger than FLOAT"); oc.doRegister("turn-defaults", 'T', new Option_String("30,50,20")); oc.addDescription("turn-defaults", "Processing", "Use STR as default turn definition"); - oc.doRegister("sink-edges", 's', new Option_String()); + oc.doRegister("sink-edges", new Option_String()); oc.addSynonyme("sink-edges", "sinks"); oc.addDescription("sink-edges", "Processing", "Use STR as list of sink edges"); @@ -134,6 +134,4 @@ } - /****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/ROJTRFrame.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTRFrame.h --- sumo-0.21.0+dfsg/src/jtrrouter/ROJTRFrame.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTRFrame.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROJTRFrame.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ROJTRFrame.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for jtr-routing /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/ROJTRRouter.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTRRouter.cpp --- sumo-0.21.0+dfsg/src/jtrrouter/ROJTRRouter.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTRRouter.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTRRouter.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ROJTRRouter.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Computes routes using junction turning percentages /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -43,10 +43,10 @@ // =========================================================================== // method definitions // =========================================================================== -ROJTRRouter::ROJTRRouter(RONet& net, bool unbuildIsWarningOnly, bool acceptAllDestinations, +ROJTRRouter::ROJTRRouter(bool unbuildIsWarningOnly, bool acceptAllDestinations, int maxEdges, bool ignoreClasses, bool allowLoops) : - SUMOAbstractRouter("JTRRouter"), - myNet(net), myUnbuildIsWarningOnly(unbuildIsWarningOnly), + SUMOAbstractRouter(0, "JTRRouter"), + myUnbuildIsWarningOnly(unbuildIsWarningOnly), myAcceptAllDestination(acceptAllDestinations), myMaxEdges(maxEdges), myIgnoreClasses(ignoreClasses), myAllowLoops(allowLoops) { } @@ -56,24 +56,26 @@ void -ROJTRRouter::compute(const ROEdge* from, const ROEdge* /*to*/, +ROJTRRouter::compute(const ROEdge* from, const ROEdge* to, const ROVehicle* const vehicle, - SUMOTime time, std::vector& into) { + SUMOTime time, ConstROEdgeVector& into) { const ROJTREdge* current = static_cast(from); + SUMOReal timeS = STEPS2TIME(time); + std::set avoidEdges; // route until a sinks has been found - while (current != 0 - && - current->getType() != ROEdge::ET_SINK - && - (int) into.size() < myMaxEdges) { - + while (current != 0 && current != to && + current->getType() != ROEdge::ET_SINK && + (int)into.size() < myMaxEdges) { into.push_back(current); - time += (SUMOTime) current->getTravelTime(vehicle, time); - current = current->chooseNext(myIgnoreClasses ? 0 : vehicle, time); + if (!myAllowLoops) { + avoidEdges.insert(current); + } + timeS += current->getTravelTime(vehicle, timeS); + current = current->chooseNext(myIgnoreClasses ? 0 : vehicle, timeS, avoidEdges); assert(myIgnoreClasses || current == 0 || !current->prohibits(vehicle)); } // check whether no valid ending edge was found - if ((int) into.size() >= myMaxEdges) { + if (current == 0 || (int) into.size() >= myMaxEdges) { if (myAcceptAllDestination) { return; } else { @@ -89,9 +91,9 @@ SUMOReal -ROJTRRouter::recomputeCosts(const std::vector& edges, const ROVehicle* const v, SUMOTime time) const { +ROJTRRouter::recomputeCosts(const ConstROEdgeVector& edges, const ROVehicle* const v, SUMOTime time) const { SUMOReal costs = 0; - for (std::vector::const_iterator i = edges.begin(); i != edges.end(); ++i) { + for (ConstROEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) { costs += (*i)->getTravelTime(v, time); } return costs; diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/ROJTRRouter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTRRouter.h --- sumo-0.21.0+dfsg/src/jtrrouter/ROJTRRouter.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTRRouter.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTRRouter.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ROJTRRouter.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Computes routes using junction turning percentages /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -31,7 +31,7 @@ #include #endif -#include +#include // =========================================================================== @@ -52,14 +52,13 @@ class ROJTRRouter : public SUMOAbstractRouter { public: /** @brief Constructor - * @param[in] net The net used for routing * @param[in] unbuildIsWarningOnly Whether not closed routes shall not yield in an error * @param[in] acceptAllDestinations If false, only sinks will be used as final edges * @param[in] maxEdges The maximum number of edges a route may have * @param[in] ignoreClasses Whether routing shall be done without regarding vehicle classes * @param[in] allowLoops Whether a vehicle may reuse a road */ - ROJTRRouter(RONet& net, bool unbuildIsWarningOnly, + ROJTRRouter(bool unbuildIsWarningOnly, bool acceptAllDestinations, int maxEdges, bool ignoreClasses, bool allowLoops); @@ -67,7 +66,9 @@ /// @brief Destructor ~ROJTRRouter(); - + virtual SUMOAbstractRouter* clone() const { + return new ROJTRRouter(myUnbuildIsWarningOnly, myAcceptAllDestination, myMaxEdges, myIgnoreClasses, myAllowLoops); + } /// @name Implementatios of SUMOAbstractRouter /// @{ @@ -82,7 +83,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, ConstROEdgeVector& into); /** @brief Recomputes the costs of a route @@ -91,14 +92,11 @@ * @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 ConstROEdgeVector& edges, const ROVehicle* const v, SUMOTime time) const; /// @} private: - /// @brief The network to use - RONet& myNet; - /// @brief Whether unbuildable routes shall be reported as warniings, not errors const bool myUnbuildIsWarningOnly; diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/ROJTRTurnDefLoader.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTRTurnDefLoader.cpp --- sumo-0.21.0+dfsg/src/jtrrouter/ROJTRTurnDefLoader.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTRTurnDefLoader.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTRTurnDefLoader.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ROJTRTurnDefLoader.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Loader for the of turning percentages and source/sink definitions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -65,8 +65,8 @@ bool ok = true; switch (element) { case SUMO_TAG_INTERVAL: - myIntervalBegin = attrs.getSUMOTimeReporting(SUMO_ATTR_BEGIN, 0, ok); - myIntervalEnd = attrs.getSUMOTimeReporting(SUMO_ATTR_END, 0, ok); + myIntervalBegin = attrs.get(SUMO_ATTR_BEGIN, 0, ok); + myIntervalEnd = attrs.get(SUMO_ATTR_END, 0, ok); break; case SUMO_TAG_FROMEDGE: beginFromEdge(attrs); @@ -143,7 +143,7 @@ WRITE_ERROR("The edge '" + id + "' is not known within the network (within a 'to-edge' tag)."); return; } - SUMOReal probability = attrs.get(SUMO_ATTR_PROB, id.c_str(), ok); + const SUMOReal probability = attrs.get(SUMO_ATTR_PROB, id.c_str(), ok); if (ok) { if (probability < 0) { WRITE_ERROR("'probability' must be positive (in definition of to-edge '" + id + "')."); diff -Nru sumo-0.21.0+dfsg/src/jtrrouter/ROJTRTurnDefLoader.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTRTurnDefLoader.h --- sumo-0.21.0+dfsg/src/jtrrouter/ROJTRTurnDefLoader.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/jtrrouter/ROJTRTurnDefLoader.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Jan 2004 -/// @version $Id: ROJTRTurnDefLoader.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ROJTRTurnDefLoader.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Loader for the of turning percentages and source/sink definitions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -122,7 +122,7 @@ RONet& myNet; /// @brief The begin and the end of the current interval - SUMOTime myIntervalBegin, myIntervalEnd; + SUMOReal myIntervalBegin, myIntervalEnd; /// @brief The current incoming edge the turning probabilities are set into ROJTREdge* myEdge; diff -Nru sumo-0.21.0+dfsg/src/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/Makefile.am --- sumo-0.21.0+dfsg/src/Makefile.am 2014-02-24 23:02:20.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/Makefile.am 2015-04-17 05:44:23.000000000 +0000 @@ -1,9 +1,8 @@ -XERCES_LIBS = -l$(LIB_XERCES) +XERCES_LIBS = -l$(LIB_XERCES) -lpthread -lGLU -lGL if INTERNAL MESO_LIBS = ./mesosim/libmesosim.a MESOGUI_LIBS = ./mesogui/libmesogui.a ./osgview/libosgview.a -INTERNAL_LIBS = ./internal/libinternal.a endif if WITH_GUI @@ -20,7 +19,7 @@ TRACI_DIRS = traci-server traci_testclient endif -bin_PROGRAMS = sumo netconvert $(GUI_APPS) +bin_PROGRAMS = od2trips sumo netconvert $(GUI_APPS) COMMON_LIBS = ./utils/options/liboptions.a \ ./utils/xml/libxml.a \ @@ -32,25 +31,39 @@ $(XERCES_LIBS) +od2trips_SOURCES = od2trips_main.cpp + +od2trips_LDADD = ./od/libod.a \ +./utils/options/liboptions.a \ +./utils/distribution/libdistribution.a \ +./utils/vehicle/libvehicle.a \ +./utils/common/libcommon.a \ +./utils/geom/libgeom.a \ +$(COMMON_LIBS) $(XERCES_LDFLAGS) + + sumo_SOURCES = sumo_main.cpp sumo_LDADD = ./netload/libnetload.a \ ./microsim/libmicrosim.a \ ./microsim/cfmodels/libmicrosimcfmodels.a \ +./microsim/lcmodels/libmicrosimlcmodels.a \ ./microsim/devices/libmicrosimdevs.a \ ./microsim/output/libmicrosimoutput.a \ ./microsim/MSMoveReminder.o \ ./microsim/trigger/libmicrosimtrigger.a \ ./microsim/actions/libmsactions.a \ ./microsim/traffic_lights/libmicrosimtls.a \ +./microsim/pedestrians/libmicrosimpeds.a \ $(MESO_LIBS) \ ./utils/geom/libgeom.a \ +./utils/vehicle/libvehicle.a \ ./utils/shapes/libshapes.a \ ./utils/emissions/libemissions.a \ $(TRACI_LIBS) \ $(COMMON_LIBS) \ $(PYTHON_LIBS) \ -$(XERCES_LDFLAGS) $(PROJ_LDFLAGS) +$(FOX_LDFLAGS) $(XERCES_LDFLAGS) $(PROJ_LDFLAGS) netconvert_SOURCES = netconvert_main.cpp @@ -65,7 +78,6 @@ ./utils/geom/libgeom.a \ ./foreign/eulerspiral/libeulerspiral.a \ $(COMMON_LIBS) \ -$(INTERNAL_LIBS) \ $(XERCES_LDFLAGS) $(GDAL_LDFLAGS) $(PROJ_LDFLAGS) @@ -85,16 +97,15 @@ ./utils/foxtools/libfoxtools.a \ $(MESOGUI_LIBS) \ $(sumo_LDADD) \ -./foreign/gl2ps/libgl2ps.a \ ./foreign/polyfonts/libpolyfonts.a \ ./gui/GUIManipulator.o \ ./gui/GUITLLogicPhasesTrackerWindow.o \ $(OSG_LIBS) \ -$(FOX_LDFLAGS) $(sumo_LDFLAGS) $(GDAL_LDFLAGS) $(X_LDFLAGS) +$(sumo_LDFLAGS) $(GDAL_LDFLAGS) $(X_LDFLAGS) endif -SUBDIRS = foreign utils microsim router od2trips $(INTERNAL_DIRS) \ +SUBDIRS = foreign utils microsim router od marouter $(INTERNAL_DIRS) \ netbuild netwrite netgen netimport netload \ polyconvert dfrouter duarouter jtrrouter activitygen tools \ $(TRACI_DIRS) $(GUI_DIRS) diff -Nru sumo-0.21.0+dfsg/src/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/Makefile.in --- sumo-0.21.0+dfsg/src/Makefile.in 2014-06-11 22:03:55.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/Makefile.in 2015-04-17 05:44:23.000000000 +0000 @@ -79,7 +79,8 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -bin_PROGRAMS = sumo$(EXEEXT) netconvert$(EXEEXT) $(am__EXEEXT_1) +bin_PROGRAMS = od2trips$(EXEEXT) sumo$(EXEEXT) netconvert$(EXEEXT) \ + $(am__EXEEXT_1) subdir = src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/config.h.in $(top_srcdir)/depcomp @@ -108,41 +109,54 @@ ./netbuild/libnetbuild.a ./netwrite/libnetwrite.a \ ./utils/distribution/libdistribution.a ./utils/geom/libgeom.a \ ./foreign/eulerspiral/libeulerspiral.a $(am__DEPENDENCIES_2) \ - $(INTERNAL_LIBS) $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +am_od2trips_OBJECTS = od2trips_main.$(OBJEXT) +od2trips_OBJECTS = $(am_od2trips_OBJECTS) +od2trips_DEPENDENCIES = ./od/libod.a ./utils/options/liboptions.a \ + ./utils/distribution/libdistribution.a \ + ./utils/vehicle/libvehicle.a ./utils/common/libcommon.a \ + ./utils/geom/libgeom.a $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) am_sumo_OBJECTS = sumo_main.$(OBJEXT) sumo_OBJECTS = $(am_sumo_OBJECTS) sumo_DEPENDENCIES = ./netload/libnetload.a ./microsim/libmicrosim.a \ ./microsim/cfmodels/libmicrosimcfmodels.a \ + ./microsim/lcmodels/libmicrosimlcmodels.a \ ./microsim/devices/libmicrosimdevs.a \ ./microsim/output/libmicrosimoutput.a \ ./microsim/MSMoveReminder.o \ ./microsim/trigger/libmicrosimtrigger.a \ ./microsim/actions/libmsactions.a \ - ./microsim/traffic_lights/libmicrosimtls.a $(MESO_LIBS) \ - ./utils/geom/libgeom.a ./utils/shapes/libshapes.a \ - ./utils/emissions/libemissions.a $(TRACI_LIBS) \ - $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + ./microsim/traffic_lights/libmicrosimtls.a \ + ./microsim/pedestrians/libmicrosimpeds.a $(MESO_LIBS) \ + ./utils/geom/libgeom.a ./utils/vehicle/libvehicle.a \ + ./utils/shapes/libshapes.a ./utils/emissions/libemissions.a \ + $(TRACI_LIBS) $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am__sumo_gui_SOURCES_DIST = guisim_main.cpp @WITH_GUI_TRUE@am_sumo_gui_OBJECTS = guisim_main.$(OBJEXT) sumo_gui_OBJECTS = $(am_sumo_gui_OBJECTS) am__DEPENDENCIES_3 = ./netload/libnetload.a ./microsim/libmicrosim.a \ ./microsim/cfmodels/libmicrosimcfmodels.a \ + ./microsim/lcmodels/libmicrosimlcmodels.a \ ./microsim/devices/libmicrosimdevs.a \ ./microsim/output/libmicrosimoutput.a \ ./microsim/MSMoveReminder.o \ ./microsim/trigger/libmicrosimtrigger.a \ ./microsim/actions/libmsactions.a \ - ./microsim/traffic_lights/libmicrosimtls.a $(MESO_LIBS) \ - ./utils/geom/libgeom.a ./utils/shapes/libshapes.a \ - ./utils/emissions/libemissions.a $(TRACI_LIBS) \ - $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + ./microsim/traffic_lights/libmicrosimtls.a \ + ./microsim/pedestrians/libmicrosimpeds.a $(MESO_LIBS) \ + ./utils/geom/libgeom.a ./utils/vehicle/libvehicle.a \ + ./utils/shapes/libshapes.a ./utils/emissions/libemissions.a \ + $(TRACI_LIBS) $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) @WITH_GUI_TRUE@sumo_gui_DEPENDENCIES = ./gui/libgui.a \ @WITH_GUI_TRUE@ ./guinetload/libguinetload.a \ @WITH_GUI_TRUE@ ./guisim/libguisim.a \ @@ -155,12 +169,10 @@ @WITH_GUI_TRUE@ ./utils/gui/tracker/libguiutilstracker.a \ @WITH_GUI_TRUE@ ./utils/foxtools/libfoxtools.a $(MESOGUI_LIBS) \ @WITH_GUI_TRUE@ $(am__DEPENDENCIES_3) \ -@WITH_GUI_TRUE@ ./foreign/gl2ps/libgl2ps.a \ @WITH_GUI_TRUE@ ./foreign/polyfonts/libpolyfonts.a \ @WITH_GUI_TRUE@ ./gui/GUIManipulator.o \ @WITH_GUI_TRUE@ ./gui/GUITLLogicPhasesTrackerWindow.o \ -@WITH_GUI_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -@WITH_GUI_TRUE@ $(am__DEPENDENCIES_1) +@WITH_GUI_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -195,9 +207,10 @@ am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = -SOURCES = $(netconvert_SOURCES) $(sumo_SOURCES) $(sumo_gui_SOURCES) -DIST_SOURCES = $(netconvert_SOURCES) $(sumo_SOURCES) \ - $(am__sumo_gui_SOURCES_DIST) +SOURCES = $(netconvert_SOURCES) $(od2trips_SOURCES) $(sumo_SOURCES) \ + $(sumo_gui_SOURCES) +DIST_SOURCES = $(netconvert_SOURCES) $(od2trips_SOURCES) \ + $(sumo_SOURCES) $(am__sumo_gui_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -239,7 +252,7 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = foreign utils microsim router od2trips netbuild \ +DIST_SUBDIRS = foreign utils microsim router od marouter netbuild \ netwrite netgen netimport netload polyconvert dfrouter \ duarouter jtrrouter activitygen tools traci-server \ traci_testclient gui guinetload guisim @@ -306,6 +319,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -316,7 +331,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -352,7 +366,7 @@ VERSION = @VERSION@ XERCES_CFLAGS = @XERCES_CFLAGS@ XERCES_LDFLAGS = @XERCES_LDFLAGS@ -XERCES_LIBS = -l$(LIB_XERCES) +XERCES_LIBS = -l$(LIB_XERCES) -lpthread -lGLU -lGL abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -412,7 +426,6 @@ top_srcdir = @top_srcdir@ @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 $(GUI_INTERNAL_DIRS) @CHECK_MEMORY_LEAKS_TRUE@MEM_LIBS = ./foreign/nvwa/libnvwa.a @@ -427,24 +440,36 @@ $(MEM_LIBS) \ $(XERCES_LIBS) +od2trips_SOURCES = od2trips_main.cpp +od2trips_LDADD = ./od/libod.a \ +./utils/options/liboptions.a \ +./utils/distribution/libdistribution.a \ +./utils/vehicle/libvehicle.a \ +./utils/common/libcommon.a \ +./utils/geom/libgeom.a \ +$(COMMON_LIBS) $(XERCES_LDFLAGS) + sumo_SOURCES = sumo_main.cpp sumo_LDADD = ./netload/libnetload.a \ ./microsim/libmicrosim.a \ ./microsim/cfmodels/libmicrosimcfmodels.a \ +./microsim/lcmodels/libmicrosimlcmodels.a \ ./microsim/devices/libmicrosimdevs.a \ ./microsim/output/libmicrosimoutput.a \ ./microsim/MSMoveReminder.o \ ./microsim/trigger/libmicrosimtrigger.a \ ./microsim/actions/libmsactions.a \ ./microsim/traffic_lights/libmicrosimtls.a \ +./microsim/pedestrians/libmicrosimpeds.a \ $(MESO_LIBS) \ ./utils/geom/libgeom.a \ +./utils/vehicle/libvehicle.a \ ./utils/shapes/libshapes.a \ ./utils/emissions/libemissions.a \ $(TRACI_LIBS) \ $(COMMON_LIBS) \ $(PYTHON_LIBS) \ -$(XERCES_LDFLAGS) $(PROJ_LDFLAGS) +$(FOX_LDFLAGS) $(XERCES_LDFLAGS) $(PROJ_LDFLAGS) netconvert_SOURCES = netconvert_main.cpp netconvert_LDADD = ./netimport/libnetimport.a \ @@ -457,7 +482,6 @@ ./utils/geom/libgeom.a \ ./foreign/eulerspiral/libeulerspiral.a \ $(COMMON_LIBS) \ -$(INTERNAL_LIBS) \ $(XERCES_LDFLAGS) $(GDAL_LDFLAGS) $(PROJ_LDFLAGS) @WITH_GUI_TRUE@sumo_gui_SOURCES = guisim_main.cpp @@ -474,14 +498,13 @@ @WITH_GUI_TRUE@./utils/foxtools/libfoxtools.a \ @WITH_GUI_TRUE@$(MESOGUI_LIBS) \ @WITH_GUI_TRUE@$(sumo_LDADD) \ -@WITH_GUI_TRUE@./foreign/gl2ps/libgl2ps.a \ @WITH_GUI_TRUE@./foreign/polyfonts/libpolyfonts.a \ @WITH_GUI_TRUE@./gui/GUIManipulator.o \ @WITH_GUI_TRUE@./gui/GUITLLogicPhasesTrackerWindow.o \ @WITH_GUI_TRUE@$(OSG_LIBS) \ -@WITH_GUI_TRUE@$(FOX_LDFLAGS) $(sumo_LDFLAGS) $(GDAL_LDFLAGS) $(X_LDFLAGS) +@WITH_GUI_TRUE@$(sumo_LDFLAGS) $(GDAL_LDFLAGS) $(X_LDFLAGS) -SUBDIRS = foreign utils microsim router od2trips $(INTERNAL_DIRS) \ +SUBDIRS = foreign utils microsim router od marouter $(INTERNAL_DIRS) \ netbuild netwrite netgen netimport netload \ polyconvert dfrouter duarouter jtrrouter activitygen tools \ $(TRACI_DIRS) $(GUI_DIRS) @@ -594,6 +617,10 @@ @rm -f netconvert$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(netconvert_OBJECTS) $(netconvert_LDADD) $(LIBS) +od2trips$(EXEEXT): $(od2trips_OBJECTS) $(od2trips_DEPENDENCIES) $(EXTRA_od2trips_DEPENDENCIES) + @rm -f od2trips$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(od2trips_OBJECTS) $(od2trips_LDADD) $(LIBS) + sumo$(EXEEXT): $(sumo_OBJECTS) $(sumo_DEPENDENCIES) $(EXTRA_sumo_DEPENDENCIES) @rm -f sumo$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(sumo_OBJECTS) $(sumo_LDADD) $(LIBS) @@ -610,6 +637,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guisim_main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netconvert_main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/od2trips_main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sumo_main.Po@am__quote@ .cpp.o: diff -Nru sumo-0.21.0+dfsg/src/marouter/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/Makefile.am --- sumo-0.21.0+dfsg/src/marouter/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,28 @@ +if CHECK_MEMORY_LEAKS +MEM_LIBS = ../foreign/nvwa/libnvwa.a +endif + +bin_PROGRAMS = marouter + +marouter_SOURCES = marouter_main.cpp \ +ROMAAssignments.cpp ROMAAssignments.h \ +ROMAEdge.cpp ROMAEdge.h \ +ROMAEdgeBuilder.cpp ROMAEdgeBuilder.h \ +ROMAFrame.cpp ROMAFrame.h + +marouter_LDFLAGS = $(XERCES_LDFLAGS) + +marouter_LDADD = ../router/librouter.a \ +../od/libod.a \ +../utils/distribution/libdistribution.a \ +../utils/options/liboptions.a \ +../utils/xml/libxml.a \ +../utils/vehicle/libvehicle.a \ +../utils/common/libcommon.a \ +../utils/importio/libimportio.a \ +../utils/iodevices/libiodevices.a \ +../utils/geom/libgeom.a \ +../utils/emissions/libemissions.a \ +../foreign/tcpip/libtcpip.a \ +$(MEM_LIBS) \ +-l$(LIB_XERCES) $(FOX_LDFLAGS) diff -Nru sumo-0.21.0+dfsg/src/marouter/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/Makefile.in --- sumo-0.21.0+dfsg/src/marouter/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,695 @@ +# Makefile.in generated by automake 1.13.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +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@ +bin_PROGRAMS = marouter$(EXEEXT) +subdir = src/marouter +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +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 = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_marouter_OBJECTS = marouter_main.$(OBJEXT) \ + ROMAAssignments.$(OBJEXT) ROMAEdge.$(OBJEXT) \ + ROMAEdgeBuilder.$(OBJEXT) ROMAFrame.$(OBJEXT) +marouter_OBJECTS = $(am_marouter_OBJECTS) +am__DEPENDENCIES_1 = +marouter_DEPENDENCIES = ../router/librouter.a ../od/libod.a \ + ../utils/distribution/libdistribution.a \ + ../utils/options/liboptions.a ../utils/xml/libxml.a \ + ../utils/vehicle/libvehicle.a ../utils/common/libcommon.a \ + ../utils/importio/libimportio.a \ + ../utils/iodevices/libiodevices.a ../utils/geom/libgeom.a \ + ../utils/emissions/libemissions.a ../foreign/tcpip/libtcpip.a \ + $(MEM_LIBS) $(am__DEPENDENCIES_1) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +marouter_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(marouter_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +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) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(marouter_SOURCES) +DIST_SOURCES = $(marouter_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +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@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +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_CONFIG = @FOX_CONFIG@ +FOX_LDFLAGS = @FOX_LDFLAGS@ +GDAL_CONFIG = @GDAL_CONFIG@ +GDAL_LDFLAGS = @GDAL_LDFLAGS@ +GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ +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_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@ +@CHECK_MEMORY_LEAKS_TRUE@MEM_LIBS = ../foreign/nvwa/libnvwa.a +marouter_SOURCES = marouter_main.cpp \ +ROMAAssignments.cpp ROMAAssignments.h \ +ROMAEdge.cpp ROMAEdge.h \ +ROMAEdgeBuilder.cpp ROMAEdgeBuilder.h \ +ROMAFrame.cpp ROMAFrame.h + +marouter_LDFLAGS = $(XERCES_LDFLAGS) +marouter_LDADD = ../router/librouter.a \ +../od/libod.a \ +../utils/distribution/libdistribution.a \ +../utils/options/liboptions.a \ +../utils/xml/libxml.a \ +../utils/vehicle/libvehicle.a \ +../utils/common/libcommon.a \ +../utils/importio/libimportio.a \ +../utils/iodevices/libiodevices.a \ +../utils/geom/libgeom.a \ +../utils/emissions/libemissions.a \ +../foreign/tcpip/libtcpip.a \ +$(MEM_LIBS) \ +-l$(LIB_XERCES) $(FOX_LDFLAGS) + +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/marouter/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/marouter/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): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +marouter$(EXEEXT): $(marouter_OBJECTS) $(marouter_DEPENDENCIES) $(EXTRA_marouter_DEPENDENCIES) + @rm -f marouter$(EXEEXT) + $(AM_V_CXXLD)$(marouter_LINK) $(marouter_OBJECTS) $(marouter_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ROMAAssignments.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ROMAEdge.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ROMAEdgeBuilder.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ROMAFrame.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/marouter_main.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + 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-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + 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" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +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 $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +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-binPROGRAMS clean-generic clean-libtool 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-binPROGRAMS + +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: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + 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 tags-am uninstall uninstall-am uninstall-binPROGRAMS + + +# 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.21.0+dfsg/src/marouter/marouter_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/marouter_main.cpp --- sumo-0.21.0+dfsg/src/marouter/marouter_main.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/marouter_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,406 @@ +/****************************************************************************/ +/// @file marouter_main.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date Thu, 06 Jun 2002 +/// @version $Id: marouter_main.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Main for MAROUTER +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 + +#ifdef HAVE_VERSION_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ROMAFrame.h" +#include "ROMAAssignments.h" +#include "ROMAEdgeBuilder.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// functions +// =========================================================================== +/* ------------------------------------------------------------------------- + * data processing methods + * ----------------------------------------------------------------------- */ +/** + * loads the net + * The net is in this meaning made up by the net itself and the dynamic + * weights which may be supplied in a separate file + */ +void +initNet(RONet& net, ROLoader& loader, OptionsCont& oc) { + // load the net + ROMAEdgeBuilder builder(oc.getBool("weights.expand"), oc.getBool("weights.interpolate")); + loader.loadNet(net, builder); + // load the weights when wished/available + if (oc.isSet("weight-files")) { + loader.loadWeights(net, "weight-files", oc.getString("weight-attribute"), false); + } + if (oc.isSet("lane-weight-files")) { + loader.loadWeights(net, "lane-weight-files", oc.getString("weight-attribute"), true); + } +} + +SUMOReal +getTravelTime(const ROEdge* const edge, const ROVehicle* const /* veh */, SUMOReal /* time */) { + return edge->getLength() / edge->getSpeed(); +} + + +/** + * Computes all pair shortest paths, saving them + */ +void +computeAllPairs(RONet& net, OptionsCont& oc) { + std::ofstream outFile(oc.getString("all-pairs-output").c_str(), std::ios::binary); + // build the router + typedef DijkstraRouterTT > Dijkstra; + Dijkstra router(net.getEdgeNo(), oc.getBool("ignore-errors"), &getTravelTime); + ConstROEdgeVector into; + const int numInternalEdges = net.getInternalEdgeNumber(); + const int numTotalEdges = (int)net.getEdgeNo(); + for (int i = numInternalEdges; i < numTotalEdges; i++) { + const Dijkstra::EdgeInfo& ei = router.getEdgeInfo(i); + if (ei.edge->getType() != ROEdge::ET_INTERNAL) { + router.compute(ei.edge, 0, 0, 0, into); + for (int j = numInternalEdges; j < numTotalEdges; j++) { + FileHelpers::writeFloat(outFile, router.getEdgeInfo(j).traveltime); + } + } + } +} + +/** + * Computes the routes saving them + */ +void +computeRoutes(RONet& net, OptionsCont& oc, ODMatrix& matrix) { + // build the router + SUMOAbstractRouter* router; + const std::string measure = oc.getString("weight-attribute"); + const std::string routingAlgorithm = oc.getString("routing-algorithm"); + if (measure == "traveltime") { + if (routingAlgorithm == "dijkstra") { + if (net.hasRestrictions()) { + if (oc.getInt("paths") > 1) { + router = new DijkstraRouterTT >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedTT); + } else { + router = new DijkstraRouterTT >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic); + } + } else { + if (oc.getInt("paths") > 1) { + router = new DijkstraRouterTT >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedTT); + } else { + router = new DijkstraRouterTT >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic); + } + } + } else if (routingAlgorithm == "astar") { + if (net.hasRestrictions()) { + if (oc.getInt("paths") > 1) { + router = new AStarRouter >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedTT); + } else { + router = new AStarRouter >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic); + } + } else { + if (oc.getInt("paths") > 1) { + router = new AStarRouter >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedTT); + } else { + router = new AStarRouter >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic); + } + } + } else if (routingAlgorithm == "bulkstar") { + if (net.hasRestrictions()) { + router = new BulkStarRouter >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, &ROEdge::getMinimumTravelTime); + } else { + router = new BulkStarRouter >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, &ROEdge::getMinimumTravelTime); + } + } else if (routingAlgorithm == "CH") { + 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::getTravelTimeStatic, SVC_IGNORING, weightPeriod, true); + } else { + router = new CHRouter >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, SVC_IGNORING, weightPeriod, false); + } + } 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()); + + router = new CHRouterWrapper >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROEdge::getTravelTimeStatic, begin, weightPeriod); + } else { + throw ProcessError("Unknown routing Algorithm '" + routingAlgorithm + "'!"); + } + + } else { + DijkstraRouterEffort >::Operation op; + if (measure == "CO") { + op = &ROEdge::getEmissionEffort; + } else if (measure == "CO2") { + op = &ROEdge::getEmissionEffort; + } else if (measure == "PMx") { + op = &ROEdge::getEmissionEffort; + } else if (measure == "HC") { + op = &ROEdge::getEmissionEffort; + } else if (measure == "NOx") { + op = &ROEdge::getEmissionEffort; + } else if (measure == "fuel") { + op = &ROEdge::getEmissionEffort; + } else if (measure == "noise") { + op = &ROEdge::getNoiseEffort; + } else { + throw ProcessError("Unknown measure (weight attribute '" + measure + "')!"); + } + if (net.hasRestrictions()) { + if (oc.getInt("paths") > 1) { + router = new DijkstraRouterEffort >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedEffort, &ROMAAssignments::getTravelTime); + } else { + router = new DijkstraRouterEffort >( + net.getEdgeNo(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic); + } + } else { + if (oc.getInt("paths") > 1) { + router = new DijkstraRouterEffort >( + net.getEdgeNo(), oc.getBool("ignore-errors"), &ROMAAssignments::getPenalizedEffort, &ROMAAssignments::getTravelTime); + } else { + router = new DijkstraRouterEffort >( + net.getEdgeNo(), oc.getBool("ignore-errors"), op, &ROEdge::getTravelTimeStatic); + } + } + } + // prepare the output + net.openOutput(oc.isSet("output-file") ? oc.getString("output-file") : "", + oc.isSet("flow-output") ? oc.getString("flow-output") : "", ""); + // process route definitions + try { + if (oc.isSet("timeline")) { + matrix.applyCurve(matrix.parseTimeLine(oc.getStringVector("timeline"), oc.getBool("timeline.day-in-hours"))); + } + ROVehicle defaultVehicle(SUMOVehicleParameter(), 0, net.getVehicleTypeSecure(DEFAULT_VTYPE_ID), &net); + ROMAAssignments a(string2time(oc.getString("begin")), string2time(oc.getString("end")), net, matrix, *router); + const std::string assignMethod = oc.getString("assignment-method"); + if (assignMethod == "incremental") { + a.incremental(oc.getInt("max-iterations")); + } else if (assignMethod == "SUE") { + a.sue(oc.getInt("max-iterations"), oc.getInt("max-inner-iterations"), + oc.getInt("paths"), oc.getFloat("paths.penalty"), oc.getFloat("tolerance"), oc.getString("route-choice-method")); + } + // update path costs and output + bool haveOutput = false; + OutputDevice* dev = net.getRouteOutput(); + if (dev != 0) { + for (std::vector::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) { + const ODCell* const c = *i; + dev->openTag(SUMO_TAG_ROUTE_DISTRIBUTION).writeAttr(SUMO_ATTR_ID, c->origin + "_" + c->destination + "_" + time2string(c->begin) + "_" + time2string(c->end)); + for (std::vector::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) { + (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, string2time(oc.getString("begin")))); + (*j)->writeXMLDefinition(*dev, 0, true, false); + } + dev->closeTag(); + } + haveOutput = true; + } + dev = net.getRouteOutput(true); + if (dev != 0) { + int num = 0; + for (std::vector::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) { + const ODCell* const c = *i; + dev->openTag(SUMO_TAG_FLOW).writeAttr(SUMO_ATTR_ID, oc.getString("prefix") + toString(num++)); + dev->writeAttr(SUMO_ATTR_BEGIN, time2string(c->begin)).writeAttr(SUMO_ATTR_END, time2string(c->end)); + dev->writeAttr(SUMO_ATTR_NUMBER, int(c->vehicleNumber)); + matrix.writeDefaultAttrs(*dev, oc.getBool("ignore-vehicle-type"), c); + dev->openTag(SUMO_TAG_ROUTE_DISTRIBUTION); + for (std::vector::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) { + (*j)->setCosts(router->recomputeCosts((*j)->getEdgeVector(), &defaultVehicle, string2time(oc.getString("begin")))); + (*j)->writeXMLDefinition(*dev, 0, true, false); + } + dev->closeTag(); + dev->closeTag(); + } + haveOutput = true; + } + if (!haveOutput) { + throw ProcessError("No output file given."); + } + // end the processing + net.cleanup(router); + } catch (ProcessError&) { + net.cleanup(router); + throw; + } +} + + +/* ------------------------------------------------------------------------- + * main + * ----------------------------------------------------------------------- */ +int +main(int argc, char** argv) { + OptionsCont& oc = OptionsCont::getOptions(); + oc.setApplicationDescription("Import O/D-matrices for macroscopic traffic assignment"); + oc.setApplicationName("marouter", "SUMO marouter Version " + getBuildName(VERSION_STRING)); + int ret = 0; + RONet* net = 0; + try { + XMLSubSys::init(); + ROMAFrame::fillOptions(); + OptionsIO::getOptions(true, argc, argv); + if (oc.processMetaOptions(argc < 2)) { + SystemFrame::close(); + return 0; + } + XMLSubSys::setValidation(oc.getString("xml-validation"), oc.getString("xml-validation.net")); + MsgHandler::initOutputOptions(); + if (!ROMAFrame::checkOptions()) { + throw ProcessError(); + } + RandHelper::initRandGlobal(); + // load data + ROLoader loader(oc, false, false); + net = new RONet(); + initNet(*net, loader, oc); + if (oc.isSet("all-pairs-output")) { + computeAllPairs(*net, oc); + if (net->getDistricts().empty()) { + delete net; + SystemFrame::close(); + if (ret == 0) { + std::cout << "Success." << std::endl; + } + return ret; + } + } + if (net->getDistricts().empty()) { + throw ProcessError("No districts loaded."); + } + // load districts + ODDistrictCont districts; + districts.makeDistricts(net->getDistricts()); + // load the matrix + ODMatrix matrix(districts); + matrix.loadMatrix(oc); + if (matrix.getNoLoaded() == 0) { + throw ProcessError("No vehicles loaded."); + } + if (MsgHandler::getErrorInstance()->wasInformed() && !oc.getBool("ignore-errors")) { + throw ProcessError("Loading failed."); + } + MsgHandler::getErrorInstance()->clear(); + WRITE_MESSAGE(toString(matrix.getNoLoaded()) + " vehicles loaded."); + + // build routes and parse the incremental rates if the incremental method is choosen. + try { + computeRoutes(*net, oc, matrix); + } catch (XERCES_CPP_NAMESPACE::SAXParseException& e) { + WRITE_ERROR(toString(e.getLineNumber())); + ret = 1; + } catch (XERCES_CPP_NAMESPACE::SAXException& e) { + WRITE_ERROR(TplConvert::_2str(e.getMessage())); + ret = 1; + } + if (MsgHandler::getErrorInstance()->wasInformed() || ret != 0) { + throw ProcessError(); + } + } 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; + } + + delete net; + SystemFrame::close(); + if (ret == 0) { + std::cout << "Success." << std::endl; + } + return ret; +} + + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/marouter/ROMAAssignments.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAAssignments.cpp --- sumo-0.21.0+dfsg/src/marouter/ROMAAssignments.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAAssignments.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,292 @@ +/****************************************************************************/ +/// @file ROMAAssignments.cpp +/// @author Yun-Pang Floetteroed +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date Feb 2013 +/// @version $Id: ROMAAssignments.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Assignment methods +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "ROMAEdge.h" +#include "ROMAAssignments.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// static member variables +// =========================================================================== +std::map ROMAAssignments::myPenalties; +ROVehicle* ROMAAssignments::myDefaultVehicle = 0; + + +// =========================================================================== +// method definitions +// =========================================================================== + +ROMAAssignments::ROMAAssignments(const SUMOTime begin, const SUMOTime end, + RONet& net, ODMatrix& matrix, + SUMOAbstractRouter& router) : myBegin(begin), myEnd(end), myNet(net), myMatrix(matrix), myRouter(router) { + myDefaultVehicle = new ROVehicle(SUMOVehicleParameter(), 0, net.getVehicleTypeSecure(DEFAULT_VTYPE_ID), &net); +} + + +ROMAAssignments::~ROMAAssignments() { + delete myDefaultVehicle; +} + +// based on the definitions in PTV-Validate and in the VISUM-Köln network +SUMOReal +ROMAAssignments::capacityConstraintFunction(const ROEdge* edge, const SUMOReal flow) const { + if (edge->getType() == ROEdge::ET_DISTRICT) { + return 0; + } + const int roadClass = -edge->getPriority(); + // TODO: differ road class 1 from the unknown road class 1!!! + if (edge->getLaneNo() == 0) { + // TAZ have no cost + return 0; + } else if (roadClass == 0 || roadClass == 1) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 2000.*1.3)) * 2.); //CR13 in table.py + } else if (roadClass == 2 && edge->getSpeed() <= 11.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 1333.33 * 0.9)) * 3.); //CR5 in table.py + } else if (roadClass == 2 && edge->getSpeed() > 11. && edge->getSpeed() <= 16.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 1500.*1.)) * 2.); //CR3 in table.py + } else if (roadClass == 2 && edge->getSpeed() > 16.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 2000.*1.3)) * 2.); //CR13 in table.py + } else if (roadClass == 3 && edge->getSpeed() <= 11.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 800.*0.9)) * 3.); //CR5 in table.py + } else if (roadClass == 3 && edge->getSpeed() > 11. && edge->getSpeed() <= 13.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 875.*0.9)) * 3.); //CR5 in table.py + } else if (roadClass == 3 && edge->getSpeed() > 13. && edge->getSpeed() <= 16.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.7 * (flow / (edge->getLaneNo() * 1500.*1.)) * 2.); //CR4 in table.py + } else if (roadClass == 3 && edge->getSpeed() > 16.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 1800.*1.3)) * 2.); //CR13 in table.py + } else if ((roadClass >= 4 || roadClass == -1) && edge->getSpeed() <= 5.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 200.*0.5)) * 3.); //CR7 in table.py + } else if ((roadClass >= 4 || roadClass == -1) && edge->getSpeed() > 5. && edge->getSpeed() <= 7.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 412.5 * 0.5)) * 3.); //CR7 in table.py + } else if ((roadClass >= 4 || roadClass == -1) && edge->getSpeed() > 7. && edge->getSpeed() <= 9.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 600.*0.8)) * 3.); //CR6 in table.py + } else if ((roadClass >= 4 || roadClass == -1) && edge->getSpeed() > 9. && edge->getSpeed() <= 11.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 800.*0.9)) * 3.); //CR5 in table.py + } else if ((roadClass >= 4 || roadClass == -1) && edge->getSpeed() > 11. && edge->getSpeed() <= 13.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 1125.*0.9)) * 3.); //CR5 in table.py + } else if ((roadClass >= 4 || roadClass == -1) && edge->getSpeed() > 13. && edge->getSpeed() <= 16.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.7 * (flow / (edge->getLaneNo() * 1583.*1.)) * 2.); //CR4 in table.py + } else if ((roadClass >= 4 || roadClass == -1) && edge->getSpeed() > 16. && edge->getSpeed() <= 18.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 1100.*1.)) * 2.); //CR3 in table.py + } else if ((roadClass >= 4 || roadClass == -1) && edge->getSpeed() > 18. && edge->getSpeed() <= 22.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 1200.*1.)) * 2.); //CR3 in table.py + } else if ((roadClass >= 4 || roadClass == -1) && edge->getSpeed() > 22. && edge->getSpeed() <= 26.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 1300.*1.)) * 2.); //CR3 in table.py + } else if ((roadClass >= 4 || roadClass == -1) && edge->getSpeed() > 26.) { + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 1400.*1.)) * 2.); //CR3 in table.py + } + return edge->getLength() / edge->getSpeed() * (1. + 1.*(flow / (edge->getLaneNo() * 800.*0.9)) * 3.); //CR5 in table.py +} + + +bool +ROMAAssignments::addRoute(ConstROEdgeVector& edges, std::vector& paths, std::string routeId, SUMOReal costs, SUMOReal prob) { + RORoute* dup = 0; + for (std::vector::const_iterator p = paths.begin(); p != paths.end(); p++) { + if (edges == (*p)->getEdgeVector()) { + dup = *p; + break; + } + } + if (dup == 0) { + paths.push_back(new RORoute(routeId, costs, prob, edges, 0, std::vector())); + return true; + } + dup->addProbability(prob); + return false; +} + + +void +ROMAAssignments::getKPaths(const int kPaths, const SUMOReal penalty) { + for (std::vector::const_iterator i = myMatrix.getCells().begin(); i != myMatrix.getCells().end(); ++i) { + ODCell* c = *i; + myPenalties.clear(); + for (int k = 0; k < kPaths; k++) { + ConstROEdgeVector edges; + myRouter.compute(myNet.getEdge(c->origin + "-source"), myNet.getEdge(c->destination + "-sink"), myDefaultVehicle, 0, edges); + for (ConstROEdgeVector::iterator e = edges.begin(); e != edges.end(); e++) { + myPenalties[*e] = penalty; + } + addRoute(edges, c->pathsVector, c->origin + c->destination + toString(c->pathsVector.size()), 0, 0); + } + } + myPenalties.clear(); +} + + +void +ROMAAssignments::incremental(const int numIter) { + for (int t = 0; t < numIter; t++) { + for (std::vector::const_iterator i = myMatrix.getCells().begin(); i != myMatrix.getCells().end(); i++) { + ODCell* c = *i; + ConstROEdgeVector edges; + SUMOReal linkFlow = c->vehicleNumber / numIter; + myRouter.compute(myNet.getEdge(c->origin + "-source"), myNet.getEdge(c->destination + "-sink"), myDefaultVehicle, 0, edges); + SUMOReal costs = 0.; + for (ConstROEdgeVector::iterator e = edges.begin(); e != edges.end(); e++) { + ROEdge* edge = myNet.getEdge((*e)->getID()); + edge->addEffort(linkFlow, STEPS2TIME(myBegin), STEPS2TIME(myEnd)); + const SUMOReal travelTime = capacityConstraintFunction(edge, linkFlow); + edge->addTravelTime(travelTime, STEPS2TIME(myBegin), STEPS2TIME(myEnd)); + costs += travelTime; + } + addRoute(edges, c->pathsVector, c->origin + c->destination + toString(c->pathsVector.size()), costs, linkFlow); + } + } +} + + +void +ROMAAssignments::sue(const int maxOuterIteration, const int maxInnerIteration, const int kPaths, const SUMOReal penalty, const SUMOReal tolerance, const std::string /* routeChoiceMethod */) { + getKPaths(kPaths, penalty); + for (int outer = 0; outer < maxOuterIteration; outer++) { + for (int inner = 0; inner < maxInnerIteration; inner++) { + for (std::vector::const_iterator i = myMatrix.getCells().begin(); i != myMatrix.getCells().end(); ++i) { + ODCell* c = *i; + // update path cost + for (std::vector::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) { + RORoute* r = *j; + r->setCosts(myRouter.recomputeCosts(r->getEdgeVector(), myDefaultVehicle, 0)); +// std::cout << std::setprecision(20) << r->getID() << ":" << r->getCosts() << std::endl; + } + // calculate route utilities and probabilities + RouteCostCalculator::getCalculator().calculateProbabilities(c->pathsVector, myDefaultVehicle, 0); + // calculate route flows + for (std::vector::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) { + RORoute* r = *j; + const SUMOReal pathFlow = r->getProbability() * c->vehicleNumber; + // assign edge flow deltas + for (ConstROEdgeVector::const_iterator e = r->getEdgeVector().begin(); e != r->getEdgeVector().end(); e++) { + ROMAEdge* edge = static_cast(myNet.getEdge((*e)->getID())); + edge->setHelpFlow(edge->getHelpFlow() + pathFlow); + } + } + } + // calculate new edge flows and check for stability + int unstableEdges = 0; + for (std::map::const_iterator i = myNet.getEdgeMap().begin(); i != myNet.getEdgeMap().end(); ++i) { + ROMAEdge* edge = static_cast((*i).second); + const SUMOReal oldFlow = edge->getEffort(myDefaultVehicle, 0.); + SUMOReal newFlow = oldFlow; + if (inner == 0 && outer == 0) { + newFlow += edge->getHelpFlow(); + } else { + newFlow += (edge->getHelpFlow() - oldFlow) / (inner + 1); + } +// if not lohse: + if (newFlow > 0.) { + if (abs(newFlow - oldFlow) / newFlow > tolerance) { + unstableEdges++; + } + } else if (newFlow == 0.) { + if (oldFlow != 0. && (abs(newFlow - oldFlow) / oldFlow > tolerance)) { + unstableEdges++; + } + } else { // newFlow < 0. + unstableEdges++; + newFlow = 0.; + } + edge->addEffort(newFlow, STEPS2TIME(myBegin), STEPS2TIME(myEnd)); + const SUMOReal travelTime = capacityConstraintFunction(edge, newFlow); + edge->addTravelTime(travelTime, STEPS2TIME(myBegin), STEPS2TIME(myEnd)); + edge->setHelpFlow(0.); + } + // if stable break + if (unstableEdges == 0) { + break; + } + // additional stability check from python script: if notstable < math.ceil(net.geteffEdgeCounts()*0.005) or notstable < 3: stable = True + } + // check for a new route, if none available, break + // several modifications about when a route is new and when to break are in the original script + bool newRoute = false; + for (std::vector::const_iterator i = myMatrix.getCells().begin(); i != myMatrix.getCells().end(); ++i) { + ODCell* c = *i; + ConstROEdgeVector edges; + myRouter.compute(myNet.getEdge(c->origin + "-source"), myNet.getEdge(c->destination + "-sink"), myDefaultVehicle, 0, edges); + newRoute |= addRoute(edges, c->pathsVector, c->origin + c->destination + toString(c->pathsVector.size()), 0, 0); + } + if (!newRoute) { + break; + } + } + // final round of assignment + for (std::vector::const_iterator i = myMatrix.getCells().begin(); i != myMatrix.getCells().end(); ++i) { + ODCell* c = *i; + // update path cost + for (std::vector::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) { + RORoute* r = *j; + r->setCosts(myRouter.recomputeCosts(r->getEdgeVector(), myDefaultVehicle, 0)); + } + // calculate route utilities and probabilities + RouteCostCalculator::getCalculator().calculateProbabilities(c->pathsVector, myDefaultVehicle, 0); + // calculate route flows + for (std::vector::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) { + RORoute* r = *j; + r->setProbability(r->getProbability() * c->vehicleNumber); + } + } +} + + +SUMOReal +ROMAAssignments::getPenalizedEffort(const ROEdge* const e, const ROVehicle* const v, SUMOReal t) { + const std::map::const_iterator i = myPenalties.find(e); + return i == myPenalties.end() ? e->getEffort(v, t) : e->getEffort(v, t) + i->second; +} + + +SUMOReal +ROMAAssignments::getPenalizedTT(const ROEdge* const e, const ROVehicle* const v, SUMOReal t) { + const std::map::const_iterator i = myPenalties.find(e); + return i == myPenalties.end() ? e->getTravelTime(v, t) : e->getTravelTime(v, t) + i->second; +} + + +SUMOReal +ROMAAssignments::getTravelTime(const ROEdge* const e, const ROVehicle* const v, SUMOReal t) { + return e->getTravelTime(v, t); +} diff -Nru sumo-0.21.0+dfsg/src/marouter/ROMAAssignments.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAAssignments.h --- sumo-0.21.0+dfsg/src/marouter/ROMAAssignments.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAAssignments.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,139 @@ +/****************************************************************************/ +/// @file ROMAAssignments.h +/// @author Yun-Pang Floetteroed +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date Feb 2013 +/// @version $Id: ROMAAssignments.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Assignment methods +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 ROMAAssignments_h +#define ROMAAssignments_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class RONet; +class ODMatrix; +class Distribution_Points; +class ROEdge; +class ROMAEdge; +class ROVehicle; + + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ROMAAssignments + * @brief assignment methods + * + */ +class ROMAAssignments { +public: + /// Constructor + ROMAAssignments(const SUMOTime begin, const SUMOTime end, RONet& net, ODMatrix& matrix, SUMOAbstractRouter& router); + + /// Destructor + ~ROMAAssignments(); + + // @brief calculate edge travel time with the given road class and max link speed + SUMOReal capacityConstraintFunction(const ROEdge* edge, const SUMOReal flow) const; + + // @brief incremental method + void incremental(const int numIter); + + // @brief UE method + void ue(); + + // @brief SUE method + void sue(const int maxOuterIteration, const int maxInnerIteration, const int kPaths, const SUMOReal penalty, const SUMOReal tolerance, const std::string routeChoiceMethod); + + /** @brief Returns the effort to pass an edge including penalties + * + * This method is given to the used router in order to obtain the efforts + * to pass an edge from the internal edge weights container. + * + * @param[in] e The edge for which the effort to be passed shall be returned + * @param[in] v The (default) vehicle that is routed + * @param[in] t The time for which the effort shall be returned + * @return The effort (time to pass in this case) for an edge + * @see DijkstraRouterTT_ByProxi + */ + static SUMOReal getPenalizedEffort(const ROEdge* const e, const ROVehicle* const v, SUMOReal t); + + /** @brief Returns the traveltime on an edge including penalties + * + * This method is given to the used router in order to obtain the efforts + * to pass an edge from the internal edge weights container. + * + * @param[in] e The edge for which the effort to be passed shall be returned + * @param[in] v The (default) vehicle that is routed + * @param[in] t The time for which the effort shall be returned + * @return The effort (time to pass in this case) for an edge + * @see DijkstraRouterTT_ByProxi + */ + static SUMOReal getPenalizedTT(const ROEdge* const e, const ROVehicle* const v, SUMOReal t); + + /** @brief Returns the traveltime on an edge without penalties + * + * This method is given to the used router in order to obtain the efforts + * to pass an edge from the internal edge weights container. + * + * @param[in] e The edge for which the effort to be passed shall be returned + * @param[in] v The (default) vehicle that is routed + * @param[in] t The time for which the effort shall be returned + * @return The effort (time to pass in this case) for an edge + * @see DijkstraRouterTT_ByProxi + */ + static SUMOReal getTravelTime(const ROEdge* const e, const ROVehicle* const v, SUMOReal t); + +private: + /// @brief add a route and check for duplicates + bool addRoute(ConstROEdgeVector& edges, std::vector& paths, std::string routeId, SUMOReal costs, SUMOReal prob); + + /// @brief get the k shortest paths + void getKPaths(const int kPaths, const SUMOReal penalty); + +private: + const SUMOTime myBegin; + const SUMOTime myEnd; + RONet& myNet; + ODMatrix& myMatrix; + SUMOAbstractRouter& myRouter; + static std::map myPenalties; + static ROVehicle* myDefaultVehicle; + +private: + /// @brief Invalidated assignment operator + ROMAAssignments& operator=(const ROMAAssignments& src); + +}; + +#endif diff -Nru sumo-0.21.0+dfsg/src/marouter/ROMAEdgeBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAEdgeBuilder.cpp --- sumo-0.21.0+dfsg/src/marouter/ROMAEdgeBuilder.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAEdgeBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,59 @@ +/****************************************************************************/ +/// @file ROMAEdgeBuilder.cpp +/// @author Daniel Krajzewicz +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date Tue, 20 Jan 2004 +/// @version $Id: ROMAEdgeBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Interface for building instances of duarouter-edges +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "ROMAEdgeBuilder.h" +#include "ROMAEdge.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +ROMAEdgeBuilder::ROMAEdgeBuilder(bool useBoundariesOnOverride, bool interpolate) { + ROEdge::setTimeLineOptions(useBoundariesOnOverride, useBoundariesOnOverride, interpolate); +} + + +ROMAEdgeBuilder::~ROMAEdgeBuilder() {} + + +ROEdge* +ROMAEdgeBuilder::buildEdge(const std::string& name, RONode* from, RONode* to, const int priority) { + return new ROMAEdge(name, from, to, getNextIndex(), priority); +} + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/marouter/ROMAEdgeBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAEdgeBuilder.h --- sumo-0.21.0+dfsg/src/marouter/ROMAEdgeBuilder.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAEdgeBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,96 @@ +/****************************************************************************/ +/// @file ROMAEdgeBuilder.h +/// @author Daniel Krajzewicz +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date Tue, 20 Jan 2004 +/// @version $Id: ROMAEdgeBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Interface for building instances of duarouter-edges +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 ROMAEdgeBuilder_h +#define ROMAEdgeBuilder_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class ROEdge; +class RONode; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ROMAEdgeBuilder + * @brief Interface for building instances of duarouter-edges + * + * This ROAbstractEdgeBuilder implementation builds edges for the duarouter + * (instances of ROEdge). + * + * @see ROEdge + */ +class ROMAEdgeBuilder : public ROAbstractEdgeBuilder { +public: + /** @brief Constructor + * + * @param[in] useBoundariesOnOverride Whether edges shall use a boundary value if the requested is beyond known time scale + * @param[in] interpolate Whether edges shall interpolate at interval boundaries + * @todo useBoundariesOnOverride should not be a member of the edges + */ + ROMAEdgeBuilder(bool useBoundariesOnOverride, bool interpolate); + + + /// @brief Destructor + ~ROMAEdgeBuilder(); + + + /// @name Methods to be implemented, inherited from ROAbstractEdgeBuilder + /// @{ + + /** @brief Builds an edge with the given name + * + * This implementation builds a ROEdge. + * + * @param[in] name The name of the edge + * @param[in] from The node the edge begins at + * @param[in] to The node the edge ends at + * @param[in] priority The edge priority (road class) + * @return A proper instance of the named edge + * @see ROEdge + */ + ROEdge* buildEdge(const std::string& name, RONode* from, RONode* to, const int priority); + /// @} + + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/marouter/ROMAEdge.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAEdge.cpp --- sumo-0.21.0+dfsg/src/marouter/ROMAEdge.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAEdge.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,64 @@ +/****************************************************************************/ +/// @file ROMAEdge.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Christian Roessel +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date Sept 2002 +/// @version $Id: ROMAEdge.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A basic edge for routing applications +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "ROMAEdge.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +ROMAEdge::ROMAEdge(const std::string& id, RONode* from, RONode* to, unsigned int index, const int priority) + : ROEdge(id, from, to, index, priority), myHelpFlow(0.) { +} + + +ROMAEdge::~ROMAEdge() { +} + + +void +ROMAEdge::addSuccessor(ROEdge* s, std::string dir) { + ROEdge::addSuccessor(s, dir); + if (dir == "l" || dir == "L") { + myLeftTurns.insert(static_cast(s)); + } +} + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/marouter/ROMAEdge.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAEdge.h --- sumo-0.21.0+dfsg/src/marouter/ROMAEdge.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAEdge.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,113 @@ +/****************************************************************************/ +/// @file ROMAEdge.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Christian Roessel +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date Sept 2002 +/// @version $Id: ROMAEdge.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A basic edge for routing applications +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 ROMAEdge_h +#define ROMAEdge_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class ROLane; +class ROVehicle; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ROMAEdge + * @brief A basic edge for routing applications + * + * The edge contains two time lines, one for the travel time and one for a second + * measure which may be used for computing the costs of a route. After loading + * the weights, it is needed to call "buildTimeLines" in order to initialise + * these time lines. + */ +class ROMAEdge : public ROEdge { +public: + /** @brief Constructor + * + * @param[in] id The id of the edge + * @param[in] from The node the edge begins at + * @param[in] to The node the edge ends at + * @param[in] index The numeric id of the edge + */ + ROMAEdge(const std::string& id, RONode* from, RONode* to, unsigned int index, const int priority); + + + /// Destructor + virtual ~ROMAEdge(); + + /** @brief Adds information about a connected edge. + * + * In addition to ROEdge::addSuccessor it keeps track of left turns. + * + * @param[in] s The edge to add + * @todo What about vehicle-type aware connections? + */ + virtual void addSuccessor(ROEdge* s, std::string dir = ""); + + void setHelpFlow(const SUMOReal flow) { + myHelpFlow = flow; + } + + SUMOReal getHelpFlow() const { + return myHelpFlow; + } + +private: + std::set myLeftTurns; + SUMOReal myHelpFlow; + +private: + /// @brief Invalidated copy constructor + ROMAEdge(const ROMAEdge& src); + + /// @brief Invalidated assignment operator + ROMAEdge& operator=(const ROMAEdge& src); + +}; + + +#endif + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/marouter/ROMAFrame.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAFrame.cpp --- sumo-0.21.0+dfsg/src/marouter/ROMAFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAFrame.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,288 @@ +/****************************************************************************/ +/// @file ROMAFrame.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date Sept 2002 +/// @version $Id: ROMAFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Sets and checks options for dua-routing +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "ROMAFrame.h" +#include +#include +#include +#include + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +void +ROMAFrame::fillOptions() { + OptionsCont& oc = OptionsCont::getOptions(); + oc.addCallExample("-c ", "run routing with options from file"); + + // insert options sub-topics + SystemFrame::addConfigurationOptions(oc); // fill this subtopic, too + oc.addOptionSubTopic("Input"); + oc.addOptionSubTopic("Output"); + oc.addOptionSubTopic("Processing"); + oc.addOptionSubTopic("Defaults"); + oc.addOptionSubTopic("Time"); + SystemFrame::addReportOptions(oc); // fill this subtopic, too + + // insert options + addImportOptions(); + addAssignmentOptions(); + // add rand options + RandHelper::insertRandOptions(); +} + + +void +ROMAFrame::addImportOptions() { + OptionsCont& oc = OptionsCont::getOptions(); + // register import options + oc.doRegister("output-file", 'o', new Option_FileName()); + oc.addSynonyme("output-file", "output"); + oc.addDescription("output-file", "Output", "Write route distributions to FILE"); + + oc.doRegister("flow-output", new Option_FileName()); + oc.addDescription("flow-output", "Output", "Writes flow definitions into FILE"); + + oc.doRegister("ignore-vehicle-type", new Option_Bool(false)); + oc.addSynonyme("ignore-vehicle-type", "no-vtype", true); + oc.addDescription("ignore-vehicle-type", "Output", "Does not save vtype information"); + + oc.doRegister("netload-output", new Option_FileName()); + oc.addDescription("netload-output", "Output", "Writes edge loads and final costs into FILE"); + + oc.doRegister("all-pairs-output", new Option_FileName()); + oc.addDescription("all-pairs-output", "Output", "Writes complete distance matrix into FILE"); + + oc.doRegister("net-file", 'n', new Option_FileName()); + oc.addSynonyme("net-file", "net"); + oc.addDescription("net-file", "Input", "Use FILE as SUMO-network to route on"); + + oc.doRegister("additional-files", 'd', new Option_FileName()); + oc.addSynonyme("additional-files", "additional"); + oc.addSynonyme("additional-files", "taz-files"); + oc.addSynonyme("additional-files", "districts", true); + oc.addDescription("additional-files", "Input", "Read additional network data (districts, bus stops) from FILE"); + + oc.doRegister("od-matrix-files", 'm', new Option_FileName()); + oc.addSynonyme("od-matrix-files", "od-files"); + oc.addDescription("od-matrix-files", "Input", "Loads O/D-files from FILE(s)"); + + oc.doRegister("od-amitran-files", new Option_FileName()); + oc.addSynonyme("od-amitran-files", "amitran-files"); + oc.addSynonyme("od-amitran-files", "amitran"); + oc.addDescription("od-amitran-files", "Input", "Loads O/D-matrix in Amitran format from FILE(s)"); + + oc.doRegister("weight-files", 'w', new Option_FileName()); + oc.addSynonyme("weight-files", "weights"); + oc.addDescription("weight-files", "Input", "Read network weights from FILE(s)"); + + oc.doRegister("lane-weight-files", new Option_FileName()); + oc.addDescription("lane-weight-files", "Input", "Read lane-based network weights from FILE(s)"); + + oc.doRegister("weight-attribute", 'x', new Option_String("traveltime")); + 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"); + + oc.doRegister("end", 'e', new Option_String(SUMOTIME_MAXSTRING, "TIME")); + oc.addDescription("end", "Time", "Defines the end time; Later trips will be discarded; Defaults to the maximum time that SUMO can represent"); + + // register the processing options + oc.doRegister("ignore-errors", new Option_Bool(false)); + oc.addSynonyme("ignore-errors", "continue-on-unbuild", true); + oc.addSynonyme("ignore-errors", "dismiss-loading-errors", true); + oc.addDescription("ignore-errors", "Processing", "Continue if a route could not be build"); + + oc.doRegister("max-alternatives", new Option_Integer(5)); + oc.addDescription("max-alternatives", "Processing", "Prune the number of alternatives to INT"); + + oc.doRegister("weights.interpolate", new Option_Bool(false)); + oc.addSynonyme("weights.interpolate", "interpolate", true); + oc.addDescription("weights.interpolate", "Processing", "Interpolate edge weights at interval boundaries"); + + oc.doRegister("weights.expand", new Option_Bool(false)); + oc.addSynonyme("weights.expand", "expand-weights", true); + oc.addDescription("weights.expand", "Processing", "Expand weights behind the simulation's end"); + + oc.doRegister("routing-algorithm", new Option_String("dijkstra")); + oc.addDescription("routing-algorithm", "Processing", "Select among routing algorithms ['dijkstra', 'astar', 'bulkstar', 'CH', 'CHWrapper']"); + + oc.doRegister("weight-period", new Option_String("3600", "TIME")); + oc.addDescription("weight-period", "Processing", "Aggregation period for the given weight files; triggers rebuilding of Contraction Hierarchy"); + + // register defaults options + oc.doRegister("flow-output.departlane", new Option_String("free")); + oc.addSynonyme("flow-output.departlane", "departlane"); + oc.addDescription("flow-output.departlane", "Defaults", "Assigns a default depart lane"); + + oc.doRegister("flow-output.departpos", new Option_String()); + oc.addSynonyme("flow-output.departpos", "departpos"); + oc.addDescription("flow-output.departpos", "Defaults", "Assigns a default depart position"); + + oc.doRegister("flow-output.departspeed", new Option_String("max")); + oc.addSynonyme("flow-output.departspeed", "departspeed"); + oc.addDescription("flow-output.departspeed", "Defaults", "Assigns a default depart speed"); + + oc.doRegister("flow-output.arrivallane", new Option_String()); + oc.addSynonyme("flow-output.arrivallane", "arrivallane"); + oc.addDescription("flow-output.arrivallane", "Defaults", "Assigns a default arrival lane"); + + oc.doRegister("flow-output.arrivalpos", new Option_String()); + oc.addSynonyme("flow-output.arrivalpos", "arrivalpos"); + oc.addDescription("flow-output.arrivalpos", "Defaults", "Assigns a default arrival position"); + + oc.doRegister("flow-output.arrivalspeed", new Option_String()); + oc.addSynonyme("flow-output.arrivalspeed", "arrivalspeed"); + oc.addDescription("flow-output.arrivalspeed", "Defaults", "Assigns a default arrival speed"); + +} + + +void +ROMAFrame::addAssignmentOptions() { + OptionsCont& oc = OptionsCont::getOptions(); + // register the data processing options + oc.doRegister("scale", 's', new Option_Float(1)); + oc.addDescription("scale", "Processing", "Scales the loaded flows by FLOAT"); + + oc.doRegister("vtype", new Option_String("")); + oc.addDescription("vtype", "Processing", "Defines the name of the vehicle type to use"); + + oc.doRegister("prefix", new Option_String("")); + oc.addDescription("prefix", "Processing", "Defines the prefix for vehicle flow names"); + + oc.doRegister("timeline", new Option_String()); + oc.addDescription("timeline", "Processing", "Uses STR as a timeline definition"); + + oc.doRegister("timeline.day-in-hours", new Option_Bool(false)); + oc.addDescription("timeline.day-in-hours", "Processing", "Uses STR as a 24h-timeline definition"); + + // register macroscopic SUE-settings + oc.doRegister("assignment-method", new Option_String("incremental")); + oc.addDescription("assignment-method", "Processing", "Choose a assignment method: incremental, UE or SUE"); + + oc.doRegister("tolerance", new Option_Float(SUMOReal(0.001))); + oc.addDescription("tolerance", "Processing", "Use FLOAT as tolerance when checking for SUE stability"); + + oc.doRegister("left-turn-penalty", new Option_Float(SUMOReal(0))); + oc.addDescription("left-turn-penalty", "Processing", "Use left-turn penalty FLOAT to calculate link travel time when searching routes"); + + oc.doRegister("paths", new Option_Integer(1)); + oc.addDescription("paths", "Processing", "Use INTEGER as the number of paths needed to be searched for each OD pair at each iteration"); + + oc.doRegister("paths.penalty", new Option_Float(SUMOReal(1))); + oc.addDescription("paths.penalty", "Processing", "Penalize existing routes with FLOAT to find secondary routes"); + + oc.doRegister("upperbound", new Option_Float(SUMOReal(0.5))); + oc.addSynonyme("upperbound", "upper", true); + oc.addDescription("upperbound", "Processing", "Use FLOAT as the upper bound to determine auxiliary link cost"); + + oc.doRegister("lowerbound", new Option_Float(SUMOReal(0.15))); + oc.addSynonyme("lowerbound", "lower", true); + oc.addDescription("lowerbound", "Processing", "Use FLOAT as the lower bound to determine auxiliary link cost"); + + oc.doRegister("max-iterations", 'i', new Option_Integer(20)); + oc.addDescription("max-iterations", "Processing", "maximal number of iterations for new route searching in incremental and stochastic user assignment"); + + oc.doRegister("max-inner-iterations", new Option_Integer(1000)); + oc.addDescription("max-inner-iterations", "Processing", "maximal number of inner iterations for user equilibrium calcuation in the stochastic user assignment"); + + // register route choice settings + oc.doRegister("route-choice-method", new Option_String("logit")); + oc.addDescription("route-choice-method", "Processing", "Choose a route choice method: gawron, logit, or lohse"); + + oc.doRegister("gawron.beta", new Option_Float(SUMOReal(0.3))); + oc.addSynonyme("gawron.beta", "gBeta", true); + oc.addDescription("gawron.beta", "Processing", "Use FLOAT as Gawron's beta"); + + oc.doRegister("gawron.a", new Option_Float(SUMOReal(0.05))); + oc.addSynonyme("gawron.a", "gA", true); + oc.addDescription("gawron.a", "Processing", "Use FLOAT as Gawron's a"); + + oc.doRegister("exit-times", new Option_Bool(false)); + oc.addDescription("exit-times", "Output", "Write exit times (weights) for each edge"); + + oc.doRegister("keep-all-routes", new Option_Bool(false)); + oc.addDescription("keep-all-routes", "Processing", "Save routes with near zero probability"); + + oc.doRegister("skip-new-routes", new Option_Bool(false)); + oc.addDescription("skip-new-routes", "Processing", "Only reuse routes from input, do not calculate new ones"); + + oc.doRegister("logit.beta", new Option_Float(SUMOReal(0.15))); // check: remove the default? + oc.addSynonyme("logit.beta", "lBeta", true); + oc.addDescription("logit.beta", "Processing", "Use FLOAT as (c-)logit's beta for the commonality factor"); + + oc.doRegister("logit.gamma", new Option_Float(SUMOReal(1))); + oc.addSynonyme("logit.gamma", "lGamma", true); + oc.addDescription("logit.gamma", "Processing", "Use FLOAT as (c-)logit's gamma for the commonality factor"); + + oc.doRegister("logit.theta", new Option_Float(SUMOReal(0.01))); + oc.addSynonyme("logit.theta", "lTheta", true); + oc.addDescription("logit.theta", "Processing", "Use FLOAT as (c-)logit's theta"); +} + + +bool +ROMAFrame::checkOptions() { + OptionsCont& oc = OptionsCont::getOptions(); + if (oc.isSet("assignment-method") && oc.getString("assignment-method") != "incremental" && oc.getString("assignment-method") != "UE" && oc.getString("assignment-method") != "SUE") { + WRITE_ERROR("invalid assignment method"); + return false; + } + if (oc.getString("route-choice-method") != "gawron" && oc.getString("route-choice-method") != "logit" && oc.getString("route-choice-methods") != "lohse") { + WRITE_ERROR("invalid route choice method"); + return false; + } + return true; +} + + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/marouter/ROMAFrame.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAFrame.h --- sumo-0.21.0+dfsg/src/marouter/ROMAFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/marouter/ROMAFrame.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,83 @@ +/****************************************************************************/ +/// @file ROMAFrame.h +/// @author Daniel Krajzewicz +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date Sept 2002 +/// @version $Id: ROMAFrame.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Sets and checks options for dua-routing +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 ROMAFrame_h +#define ROMAFrame_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ROMAFrame + * @brief Sets and checks options for dua-routing + */ +class ROMAFrame { +public: + /** @brief Inserts options used by duarouter into the OptionsCont-singleton + * + * As duarouter shares several options with other routing appplications, the + * insertion of these is done via a call to ROFrame::fillOptions. + * + * duarouter-specific options are added afterwards via calls to + * "addImportOptions" and "addDUAOptions". + */ + static void fillOptions(); + + + /** @brief Checks set options from the OptionsCont-singleton for being valid for usage within duarouter + * + * Currently, this is done via a call to "ROFrame::checkOptions". + * + * @return Whether all needed options are set + * @todo probably, more things should be checked... + */ + static bool checkOptions(); + + +protected: + /** @brief Inserts import options used by duarouter into the OptionsCont-singleton + */ + static void addImportOptions(); + + + /** @brief Inserts dua options used by duarouter into the OptionsCont-singleton + */ + static void addAssignmentOptions(); + + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLCoupledDet.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLCoupledDet.cpp --- sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLCoupledDet.cpp 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLCoupledDet.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 15 Feb 2004 -/// @version $Id: Command_SaveTLCoupledDet.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Command_SaveTLCoupledDet.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes e2 state on each tls switch /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLCoupledDet.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLCoupledDet.h --- sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLCoupledDet.h 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLCoupledDet.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 15 Feb 2004 -/// @version $Id: Command_SaveTLCoupledDet.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Command_SaveTLCoupledDet.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes e2 state on each tls switch /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp --- sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 15 Feb 2004 -/// @version $Id: Command_SaveTLCoupledLaneDet.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Command_SaveTLCoupledLaneDet.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes e2 state of a link for the time the link has yellow/red /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLCoupledLaneDet.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLCoupledLaneDet.h --- sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLCoupledLaneDet.h 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLCoupledLaneDet.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 15 Feb 2004 -/// @version $Id: Command_SaveTLCoupledLaneDet.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Command_SaveTLCoupledLaneDet.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes e2 state of a link for the time the link has yellow/red /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLSState.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLSState.cpp --- sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLSState.cpp 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLSState.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 15 Feb 2004 -/// @version $Id: Command_SaveTLSState.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Command_SaveTLSState.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes the state of the tls to a file (in each second) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -46,7 +46,7 @@ Command_SaveTLSState::Command_SaveTLSState(const MSTLLogicControl::TLSLogicVariants& logics, OutputDevice& od) : myOutputDevice(od), myLogics(logics) { - MSNet::getInstance()->getEndOfTimestepEvents().addEvent(this, 0, MSEventControl::ADAPT_AFTER_EXECUTION); + MSNet::getInstance()->getEndOfTimestepEvents()->addEvent(this, 0, MSEventControl::ADAPT_AFTER_EXECUTION); myOutputDevice.writeXMLHeader("tls-states"); } diff -Nru sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLSState.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLSState.h --- sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLSState.h 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLSState.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 15 Feb 2004 -/// @version $Id: Command_SaveTLSState.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Command_SaveTLSState.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes the state of the tls to a file (in each second) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLSSwitches.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLSSwitches.cpp --- sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLSSwitches.cpp 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLSSwitches.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 06 Jul 2006 -/// @version $Id: Command_SaveTLSSwitches.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Command_SaveTLSSwitches.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes information about the green durations of a tls /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -49,7 +49,7 @@ Command_SaveTLSSwitches::Command_SaveTLSSwitches(const MSTLLogicControl::TLSLogicVariants& logics, OutputDevice& od) : myOutputDevice(od), myLogics(logics) { - MSNet::getInstance()->getEndOfTimestepEvents().addEvent(this, 0, MSEventControl::ADAPT_AFTER_EXECUTION); + MSNet::getInstance()->getEndOfTimestepEvents()->addEvent(this, 0, MSEventControl::ADAPT_AFTER_EXECUTION); myOutputDevice.writeXMLHeader("tls-switches"); } diff -Nru sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLSSwitches.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLSSwitches.h --- sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLSSwitches.h 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLSSwitches.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 06 Jul 2006 -/// @version $Id: Command_SaveTLSSwitches.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Command_SaveTLSSwitches.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes information about the green durations of a tls /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLSSwitchStates.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLSSwitchStates.cpp --- sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLSSwitchStates.cpp 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLSSwitchStates.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 08.05.2007 -/// @version $Id: Command_SaveTLSSwitchStates.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Command_SaveTLSSwitchStates.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes the switch times of a tls into a file when the tls switches /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -46,7 +46,7 @@ Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates(const MSTLLogicControl::TLSLogicVariants& logics, OutputDevice& od) : myOutputDevice(od), myLogics(logics) { - MSNet::getInstance()->getEndOfTimestepEvents().addEvent(this, 0, MSEventControl::ADAPT_AFTER_EXECUTION); + MSNet::getInstance()->getEndOfTimestepEvents()->addEvent(this, 0, MSEventControl::ADAPT_AFTER_EXECUTION); myOutputDevice.writeXMLHeader("tls-switch-states"); } diff -Nru sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLSSwitchStates.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLSSwitchStates.h --- sumo-0.21.0+dfsg/src/microsim/actions/Command_SaveTLSSwitchStates.h 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Command_SaveTLSSwitchStates.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 08.05.2007 -/// @version $Id: Command_SaveTLSSwitchStates.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Command_SaveTLSSwitchStates.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes the switch times of a tls into a file when the tls switches /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/actions/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Makefile.in --- sumo-0.21.0+dfsg/src/microsim/actions/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/actions/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -224,6 +224,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -234,7 +236,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/Makefile.am --- sumo-0.21.0+dfsg/src/microsim/cfmodels/Makefile.am 2013-08-05 10:53:45.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -6,6 +6,7 @@ MSCFModel_IDM.cpp MSCFModel_IDM.h \ MSCFModel_Kerner.cpp MSCFModel_Kerner.h \ MSCFModel_Krauss.cpp MSCFModel_Krauss.h \ +MSCFModel_KraussAccelBound.cpp MSCFModel_KraussAccelBound.h \ MSCFModel_KraussOrig1.cpp MSCFModel_KraussOrig1.h \ MSCFModel_KraussPS.cpp MSCFModel_KraussPS.h \ MSCFModel_PWag2009.cpp MSCFModel_PWag2009.h \ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/Makefile.in --- sumo-0.21.0+dfsg/src/microsim/cfmodels/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -101,6 +101,7 @@ am_libmicrosimcfmodels_a_OBJECTS = MSCFModel.$(OBJEXT) \ MSCFModel_Daniel1.$(OBJEXT) MSCFModel_IDM.$(OBJEXT) \ MSCFModel_Kerner.$(OBJEXT) MSCFModel_Krauss.$(OBJEXT) \ + MSCFModel_KraussAccelBound.$(OBJEXT) \ MSCFModel_KraussOrig1.$(OBJEXT) MSCFModel_KraussPS.$(OBJEXT) \ MSCFModel_PWag2009.$(OBJEXT) MSCFModel_SmartSK.$(OBJEXT) \ MSCFModel_Wiedemann.$(OBJEXT) @@ -225,6 +226,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -235,7 +238,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -336,6 +338,7 @@ MSCFModel_IDM.cpp MSCFModel_IDM.h \ MSCFModel_Kerner.cpp MSCFModel_Kerner.h \ MSCFModel_Krauss.cpp MSCFModel_Krauss.h \ +MSCFModel_KraussAccelBound.cpp MSCFModel_KraussAccelBound.h \ MSCFModel_KraussOrig1.cpp MSCFModel_KraussOrig1.h \ MSCFModel_KraussPS.cpp MSCFModel_KraussPS.h \ MSCFModel_PWag2009.cpp MSCFModel_PWag2009.h \ @@ -396,6 +399,7 @@ @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_KraussAccelBound.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCFModel_KraussOrig1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCFModel_KraussPS.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCFModel_PWag2009.Po@am__quote@ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel.cpp --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel.cpp 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 27 Jul 2009 -/// @version $Id: MSCFModel.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSCFModel.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The car-following model abstraction /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include "MSCFModel.h" @@ -89,18 +89,60 @@ SUMOReal -MSCFModel::freeSpeed(const MSVehicle* const /* veh */, SUMOReal /* speed */, SUMOReal seen, SUMOReal maxSpeed) const { - // adapt speed to succeeding lane, no reaction time is involved - // when breaking for y steps the following distance g is covered - // (drive with v in the final step) - // g = (y^2 + y) * 0.5 * b + y * v - // y = ((((sqrt((b + 2.0*v)*(b + 2.0*v) + 8.0*b*g)) - b)*0.5 - v)/b) +MSCFModel::freeSpeed(const MSVehicle* const /* veh */, SUMOReal /* speed */, SUMOReal seen, SUMOReal maxSpeed, const bool onInsertion) const { + return freeSpeed(myDecel, seen, maxSpeed, onInsertion); +} + + +SUMOReal +MSCFModel::insertionFollowSpeed(const MSVehicle* const, SUMOReal, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const { + return maximumSafeFollowSpeed(gap2pred, predSpeed, predMaxDecel); +} + + + +SUMOReal +MSCFModel::maximumSafeStopSpeed(SUMOReal gap) const { + gap -= NUMERICAL_EPS; // lots of code relies on some slack + if (gap <= 0) { + return 0; + } else if (gap <= ACCEL2SPEED(myDecel)) { + return gap; + } + const SUMOReal g = gap; const SUMOReal b = ACCEL2SPEED(myDecel); - const SUMOReal v = SPEED2DIST(maxSpeed); - const SUMOReal y = MAX2(0.0, ((sqrt((b + 2.0 * v) * (b + 2.0 * v) + 8.0 * b * seen) - b) * 0.5 - v) / b); - const SUMOReal yFull = floor(y); - const SUMOReal exactGap = (yFull * yFull + yFull) * 0.5 * b + yFull * v + (y > yFull ? v : 0.0); - return MAX2((SUMOReal)0.0, seen - exactGap) / (yFull + 1) + yFull * b + maxSpeed; + const SUMOReal t = myHeadwayTime; + const SUMOReal s = TS; + // h = the distance that would be covered if it were possible to stop + // exactly after gap and decelerate with b every simulation step + // h = 0.5 * n * (n-1) * b * s + n * b * t (solve for n) + //n = ((1.0/2.0) - ((t + (pow(((s*s) + (4.0*((s*((2.0*h/b) - t)) + (t*t)))), (1.0/2.0))*sign/2.0))/s)); + const SUMOReal n = floor(.5 - ((t + (sqrt(((s * s) + (4.0 * ((s * (2.0 * g / b - t)) + (t * t))))) * -0.5)) / s)); + const SUMOReal h = 0.5 * n * (n - 1) * b * s + n * b * t; + assert(h <= g + NUMERICAL_EPS); + // compute the additional speed that must be used during deceleration to fix + // the discrepancy between g and h + const SUMOReal r = (g - h) / (n * s + t); + const SUMOReal x = n * b + r; + assert(x >= 0); + return x; } + +/** Returns the SK-vsafe. */ +SUMOReal +MSCFModel::maximumSafeFollowSpeed(SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const { + // the speed is safe if allows the ego vehicle to come to a stop behind the leader even if + // the leaders starts braking hard until stopped + // unfortunately it is not sufficent to compare stopping distances if the follower can brake harder than the leader + // (the trajectories might intersect before both vehicles are stopped even if the follower has a shorter stopping distance than the leader) + // To make things safe, we ensure that the leaders brake distance is computed with an deceleration that is at least as high as the follower's. + // @todo: this is a conservative estimate for safe speed which could be increased + const SUMOReal x = maximumSafeStopSpeed(gap + brakeGap(predSpeed, MAX2(myDecel, predMaxDecel), 0)); + assert(x >= 0); + assert(!ISNAN(x)); + return x; +} + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Daniel1.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Daniel1.cpp --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Daniel1.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Daniel1.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 05 Jun 2012 -/// @version $Id: MSCFModel_Daniel1.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSCFModel_Daniel1.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The original Krauss (1998) car-following model and parameter /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -33,7 +33,7 @@ #include #include #include "MSCFModel_Daniel1.h" -#include +#include #include diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Daniel1.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Daniel1.h --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Daniel1.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Daniel1.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 05 Jun 2012 -/// @version $Id: MSCFModel_Daniel1.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSCFModel_Daniel1.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The original Krauss (1998) car-following model and parameter /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -19,7 +19,7 @@ // /****************************************************************************/ #ifndef MSCFModel_Daniel1_h -#define MSCFModel_Daniel1_h +#define MSCFModel_Daniel1_h // =========================================================================== // included modules @@ -170,5 +170,5 @@ }; -#endif /* MSCFModel_Daniel1_H */ +#endif /* MSCFModel_Daniel1_H */ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel.h --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 27 Jul 2009 -/// @version $Id: MSCFModel.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSCFModel.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The car-following model abstraction /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -21,7 +21,7 @@ // /****************************************************************************/ #ifndef MSCFModel_h -#define MSCFModel_h +#define MSCFModel_h // =========================================================================== // included modules @@ -32,6 +32,7 @@ #include #endif +#include #include #include #include @@ -85,17 +86,20 @@ /** @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. If onInsertion is true, the vehicle may still brake + * before the next movement. * @param[in] veh The vehicle (EGO) * @param[in] speed The vehicle's speed * @param[in] seen The look ahead distance * @param[in] maxSpeed The maximum allowed speed + * @param[in] onInsertion whether speed at insertion is asked for * @return EGO's safe speed */ - virtual SUMOReal freeSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal seen, SUMOReal maxSpeed) const; + virtual SUMOReal freeSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal seen, + SUMOReal maxSpeed, const bool onInsertion = false) const; - /** @brief Computes the vehicle's safe speed (no dawdling) + /** @brief Computes the vehicle's follow speed (no dawdling) * * Returns the velocity of the vehicle in dependence to the vehicle's and its leader's values and the distance between them. * @param[in] veh The vehicle (EGO) @@ -107,6 +111,21 @@ virtual SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const = 0; + /** @brief Computes the vehicle's safe speed (no dawdling) + * This method is used during the insertion stage. Whereas the method + * followSpeed returns the desired speed which may be lower than the safe + * speed, this method only considers safety constraints + * + * Returns the velocity of the vehicle in dependence to the vehicle's and its leader's values and the distance between them. + * @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 + */ + virtual SUMOReal insertionFollowSpeed(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) * * Returns the velocity of the vehicle when approaching a static object (such as the end of a lane) assuming no reaction time is needed. @@ -224,6 +243,25 @@ } + inline static SUMOReal freeSpeed(const SUMOReal decel, const SUMOReal seen, const SUMOReal maxSpeed, const bool onInsertion) { + // adapt speed to succeeding lane, no reaction time is involved + // when breaking for y steps the following distance g is covered + // (drive with v in the final step) + // g = (y^2 + y) * 0.5 * b + y * v + // y = ((((sqrt((b + 2.0*v)*(b + 2.0*v) + 8.0*b*g)) - b)*0.5 - v)/b) + const SUMOReal v = SPEED2DIST(maxSpeed); + if (seen < v) { + return maxSpeed; + } + const SUMOReal b = ACCEL2DIST(decel); + const SUMOReal y = MAX2(0.0, ((sqrt((b + 2.0 * v) * (b + 2.0 * v) + 8.0 * b * seen) - b) * 0.5 - v) / b); + const SUMOReal yFull = floor(y); + const SUMOReal exactGap = (yFull * yFull + yFull) * 0.5 * b + yFull * v + (y > yFull ? v : 0.0); + const SUMOReal fullSpeedGain = (yFull + (onInsertion ? 1. : 0.)) * ACCEL2SPEED(decel); + return DIST2SPEED(MAX2((SUMOReal)0.0, seen - exactGap) / (yFull + 1)) + fullSpeedGain + maxSpeed; + } + + /** @brief Returns the minimum gap to reserve if the leader is braking at maximum * @param[in] speed EGO's speed * @param[in] leaderSpeed LEADER's speed @@ -283,6 +321,21 @@ } /// @} +protected: + /** @brief Returns the maximum safe velocity for following the given leader + * @param[in] gap2pred The (netto) distance to the LEADER + * @param[in] predSpeed The LEADER's speed + * @param[in] predMaxDecel The LEADER's maximum deceleration + * @return the safe velocity + */ + SUMOReal maximumSafeFollowSpeed(SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const; + + + /** @brief Returns the maximum velocity for stopping within gap + * This depends stronlgy on the position update model + * @param[in] gap The (netto) distance to the LEADER + */ + SUMOReal maximumSafeStopSpeed(SUMOReal gap) const; protected: /// @brief The type to which this model definition belongs to @@ -299,5 +352,5 @@ }; -#endif /* MSCFModel_h */ +#endif /* MSCFModel_h */ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_IDM.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_IDM.cpp --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_IDM.cpp 2014-05-22 22:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_IDM.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 03 Sep 2009 -/// @version $Id: MSCFModel_IDM.cpp 16407 2014-05-22 06:26:58Z behrisch $ +/// @version $Id: MSCFModel_IDM.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The Intelligent Driver Model (IDM) car-following model /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_IDM.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_IDM.h --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_IDM.h 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_IDM.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 03 Sep 2009 -/// @version $Id: MSCFModel_IDM.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSCFModel_IDM.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The Intelligent Driver Model (IDM) car-following model /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -20,7 +20,7 @@ // /****************************************************************************/ #ifndef MSCFMODEL_IDM_H -#define MSCFMODEL_IDM_H +#define MSCFMODEL_IDM_H // =========================================================================== // included modules @@ -184,4 +184,4 @@ MSCFModel_IDM& operator=(const MSCFModel_IDM& s); }; -#endif /* MSCFMODEL_IDM_H */ +#endif /* MSCFMODEL_IDM_H */ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Kerner.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Kerner.cpp --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Kerner.cpp 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Kerner.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date 03.04.2010 -/// @version $Id: MSCFModel_Kerner.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSCFModel_Kerner.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // car-following model by B. Kerner /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Kerner.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Kerner.h --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Kerner.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Kerner.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 03.04.2010 -/// @version $Id: MSCFModel_Kerner.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSCFModel_Kerner.h 18095 2015-03-17 09:39:00Z behrisch $ /// // car-following model by B. Kerner /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -19,7 +19,7 @@ // /****************************************************************************/ #ifndef MSCFModel_Kerner_h -#define MSCFModel_Kerner_h +#define MSCFModel_Kerner_h // =========================================================================== // included modules @@ -136,10 +136,7 @@ SUMOReal myTauDecel; /// @} - /// @brief The random deviation (constant between two calls of movehelper) - SUMOReal myRand; - }; -#endif /* MSCFModel_Kerner_H */ +#endif /* MSCFModel_Kerner_H */ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_KraussAccelBound.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_KraussAccelBound.cpp --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_KraussAccelBound.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_KraussAccelBound.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,69 @@ +/****************************************************************************/ +/// @file MSCFModel_KraussAccelBound.cpp +/// @author Daniel Krajzewicz +/// @date Fri, 07 Mar 2014 +/// @version $Id: MSCFModel_KraussAccelBound.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// Krauss car-following model, with PHEMlight-based acceleration limits +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "MSCFModel_KraussAccelBound.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +MSCFModel_KraussAccelBound::MSCFModel_KraussAccelBound(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, + SUMOReal dawdle, SUMOReal headwayTime) + : MSCFModel_Krauss(vtype, accel, decel, dawdle, headwayTime) { +} + + +MSCFModel_KraussAccelBound::~MSCFModel_KraussAccelBound() {} + + + +SUMOReal +MSCFModel_KraussAccelBound::maxNextSpeed(SUMOReal speed, const MSVehicle* const veh) const { + const MSLane* const lane = veh->getLane(); + const SUMOReal gp = lane->interpolateLanePosToGeometryPos(veh->getPositionOnLane()); + const SUMOReal slope = lane->getShape().slopeDegreeAtOffset(gp); + const SUMOReal aMax = PollutantsInterface::getMaxAccel(veh->getVehicleType().getEmissionClass(), speed, 0, slope); + return MIN2(speed + (SUMOReal) ACCEL2SPEED(aMax), veh->getVehicleType().getMaxSpeed()); +} + + + +MSCFModel* +MSCFModel_KraussAccelBound::duplicate(const MSVehicleType* vtype) const { + return new MSCFModel_KraussAccelBound(vtype, myAccel, myDecel, myDawdle, myHeadwayTime); +} + + +//void MSCFModel::saveState(std::ostream &os) {} + diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_KraussAccelBound.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_KraussAccelBound.h --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_KraussAccelBound.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_KraussAccelBound.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,96 @@ +/****************************************************************************/ +/// @file MSCFModel_KraussAccelBound.h +/// @author Daniel Krajzewicz +/// @date Fri, 07 Mar 2014 +/// @version $Id: MSCFModel_KraussAccelBound.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Krauss car-following model, with PHEMlight-based acceleration limits +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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_KraussAccelBound_h +#define MSCFModel_KraussAccelBound_h + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include "MSCFModel_Krauss.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** @class MSCFModel_KraussAccelBound + * @brief Krauss car-following model, with PHEMlight-based acceleration limits + * @see MSCFModel + */ +class MSCFModel_KraussAccelBound : public MSCFModel_Krauss { +public: + /** @brief Constructor + * @param[in] accel The maximum acceleration + * @param[in] decel The maximum deceleration + * @param[in] dawdle The driver imperfection + * @param[in] headwayTime The driver's reaction time + */ + MSCFModel_KraussAccelBound(const MSVehicleType* vtype, SUMOReal accel, SUMOReal decel, SUMOReal dawdle, SUMOReal headwayTime); + + + /// @brief Destructor + ~MSCFModel_KraussAccelBound(); + + + /// @name Implementations of the MSCFModel interface + /// @{ + + /** @brief Returns the maximum speed given the current speed + * + * The implementation of this method must take into account the time step + * duration. + * + * Justification: Due to air brake or other influences, the vehicle's next maximum + * speed may depend on the vehicle's current speed (given). + * + * @param[in] speed The vehicle's current speed + * @param[in] speed The vehicle itself, for obtaining other values + * @return The maximum possible speed for the next step + */ + SUMOReal maxNextSpeed(SUMOReal speed, const MSVehicle* const veh) const; + + + /** @brief Returns the model's name + * @return The model's name + * @see MSCFModel::getModelName + */ + int getModelID() const { + return SUMO_TAG_CF_KRAUSS_ACCEL_BOUND; + } + /// @} + + + /** @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 + */ + MSCFModel* duplicate(const MSVehicleType* vtype) const; + + +}; + +#endif /* MSCFModel_KraussAccelBound_H */ + diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Krauss.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Krauss.cpp --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Krauss.cpp 2014-02-25 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Krauss.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 04 Aug 2009 -/// @version $Id: MSCFModel_Krauss.cpp 15727 2014-02-25 08:09:54Z behrisch $ +/// @version $Id: MSCFModel_Krauss.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Krauss car-following model, with acceleration decrease and faster start /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,7 +36,7 @@ #include #include #include "MSCFModel_Krauss.h" -#include +#include #include @@ -53,21 +53,21 @@ SUMOReal -MSCFModel_Krauss::followSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const { - return MIN2(_vsafe(gap, predSpeed, predMaxDecel), maxNextSpeed(speed, veh)); +MSCFModel_Krauss::stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap) const { + return MIN2(maximumSafeStopSpeed(gap), maxNextSpeed(speed, veh)); } SUMOReal -MSCFModel_Krauss::stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap) const { - return MIN2(_vstop(gap), maxNextSpeed(speed, veh)); +MSCFModel_Krauss::followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const { + return MIN2(maximumSafeFollowSpeed(gap, predSpeed, predMaxDecel), maxNextSpeed(speed, veh)); } SUMOReal MSCFModel_Krauss::dawdle(SUMOReal speed) const { - // generate random number out of [0,1] - SUMOReal random = RandHelper::rand(); + // generate random number out of [0,1) + const SUMOReal random = RandHelper::rand(); // Dawdle. if (speed < myAccel) { // we should not prevent vehicles from driving just due to dawdling @@ -81,55 +81,10 @@ } -SUMOReal -MSCFModel_Krauss::_vstop(SUMOReal gap) const { - gap -= NUMERICAL_EPS; // lots of code relies on some slack - if (gap <= 0) { - return 0; - } else if (gap <= ACCEL2SPEED(myDecel)) { - return gap; - } - const SUMOReal g = gap; - const SUMOReal b = ACCEL2SPEED(myDecel); - const SUMOReal t = myHeadwayTime; - const SUMOReal s = TS; - // h = the distance that would be covered if it were possible to stop - // exactly after gap and decelerate with b every simulation step - // h = 0.5 * n * (n-1) * b * s + n * b * t (solve for n) - //n = ((1.0/2.0) - ((t + (pow(((s*s) + (4.0*((s*((2.0*h/b) - t)) + (t*t)))), (1.0/2.0))*sign/2.0))/s)); - const SUMOReal n = floor((1.0 / 2.0) - ((t + (pow(((s * s) + (4.0 * ((s * ((2.0 * g / b) - t)) + (t * t)))), (1.0 / 2.0)) * -0.5)) / s)); - const SUMOReal h = 0.5 * n * (n - 1) * b * s + n * b * t; - assert(h <= g + NUMERICAL_EPS); - // compute the additional speed that must be used during deceleration to fix - // the discrepancy between g and h - const SUMOReal r = (g - h) / (n * s + t); - const SUMOReal x = n * b + r; - assert(x >= 0); - return x; -} - - -/** Returns the SK-vsafe. */ -SUMOReal -MSCFModel_Krauss::_vsafe(SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const { - // the speed is safe if allows the ego vehicle to come to a stop behind the leader even if - // the leaders starts braking hard until stopped - // unfortunately it is not sufficent to compare stopping distances if the follower can brake harder than the leader - // (the trajectories might intersect before both vehicles are stopped even if the follower has a shorter stopping distance than the leader) - // To make things safe, we ensure that the leaders brake distance is computed with an deceleration that is at least as high as the follower's. - // @todo: this is a conservative estimate for safe speed which could be increased - const SUMOReal x = _vstop(gap + brakeGap(predSpeed, MAX2(myDecel, predMaxDecel), 0)); - assert(x >= 0); - assert(!ISNAN(x)); - return x; -} - - MSCFModel* MSCFModel_Krauss::duplicate(const MSVehicleType* vtype) const { return new MSCFModel_Krauss(vtype, myAccel, myDecel, myDawdle, myHeadwayTime); } -//void MSCFModel::saveState(std::ostream &os) {} - +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Krauss.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Krauss.h --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Krauss.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Krauss.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 28 Jul 2009 -/// @version $Id: MSCFModel_Krauss.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSCFModel_Krauss.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Krauss car-following model, with acceleration decrease and faster start /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -21,7 +21,7 @@ // /****************************************************************************/ #ifndef MSCFModel_Krauss_h -#define MSCFModel_Krauss_h +#define MSCFModel_Krauss_h // =========================================================================== // included modules @@ -61,27 +61,27 @@ /// @name Implementations of the MSCFModel interface /// @{ + /** @brief Computes the vehicle's safe speed for approaching a non-moving obstacle (no dawdling) + * this uses the maximumSafeStopSpeed + * @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 + * @todo generic Interface, models can call for the values they need + */ + SUMOReal stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap2pred) const; + + /** @brief Computes the vehicle's safe speed (no dawdling) + * this uses the maximumSafeFollowSpeed * @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 */ 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 - */ - SUMOReal stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap2pred) const; - - /** @brief Returns the model's name * @return The model's name * @see MSCFModel::getModelName @@ -100,17 +100,6 @@ 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 - */ - SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const; - - /** @brief Returns the "safe" velocity for stopping within gap - */ - SUMOReal _vstop(SUMOReal gap) const; - /** @brief Applies driver imperfection (dawdling / sigma) * @param[in] speed The speed with no dawdling @@ -120,5 +109,5 @@ }; -#endif /* MSCFMODEL_KRAUSS_H */ +#endif /* MSCFMODEL_KRAUSS_H */ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 04 Aug 2009 -/// @version $Id: MSCFModel_KraussOrig1.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSCFModel_KraussOrig1.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The original Krauss (1998) car-following model and parameter /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,7 +35,7 @@ #include #include #include "MSCFModel_KraussOrig1.h" -#include +#include #include @@ -73,14 +73,24 @@ SUMOReal -MSCFModel_KraussOrig1::followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap, SUMOReal predSpeed, SUMOReal /*predMaxDecel*/) const { - return MIN2(_vsafe(gap, predSpeed), maxNextSpeed(speed, veh)); +MSCFModel_KraussOrig1::followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const { + return MIN2(vsafe(gap, predSpeed, predMaxDecel), maxNextSpeed(speed, veh)); +} + + +SUMOReal +MSCFModel_KraussOrig1::insertionFollowSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const { + // since the Krauss model tries to compute the maximum follow speed in + // method followSpeed this is also used for insertionFollowSpeed + // (due to discretization error this may not always be the same value as + // returned by maximumSafeFollowSpeed) + return followSpeed(veh, speed, gap2pred, predSpeed, predMaxDecel); } SUMOReal MSCFModel_KraussOrig1::stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap) const { - return MIN2(_vsafe(gap, 0), maxNextSpeed(speed, veh)); + return MIN2(vsafe(gap, 0., 0.), maxNextSpeed(speed, veh)); } @@ -91,7 +101,7 @@ /** Returns the SK-vsafe. */ -SUMOReal MSCFModel_KraussOrig1::_vsafe(SUMOReal gap, SUMOReal predSpeed) const { +SUMOReal MSCFModel_KraussOrig1::vsafe(SUMOReal gap, SUMOReal predSpeed, SUMOReal /* predMaxDecel */) const { if (predSpeed == 0 && gap < 0.01) { return 0; } @@ -110,3 +120,6 @@ MSCFModel_KraussOrig1::duplicate(const MSVehicleType* vtype) const { return new MSCFModel_KraussOrig1(vtype, myAccel, myDecel, myDawdle, myHeadwayTime); } + + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_KraussOrig1.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_KraussOrig1.h --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_KraussOrig1.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_KraussOrig1.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 28 Jul 2009 -/// @version $Id: MSCFModel_KraussOrig1.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSCFModel_KraussOrig1.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The original Krauss (1998) car-following model and parameter /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -21,7 +21,7 @@ // /****************************************************************************/ #ifndef MSCFModel_KraussOrig1_h -#define MSCFModel_KraussOrig1_h +#define MSCFModel_KraussOrig1_h // =========================================================================== // included modules @@ -77,7 +77,7 @@ * @return EGO's safe speed * @see MSCFModel::ffeV */ - virtual SUMOReal followSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const; + 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) @@ -90,6 +90,21 @@ virtual SUMOReal stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap2pred) const; + /** @brief Computes the vehicle's safe speed (no dawdling) + * This method is used during the insertion stage. Whereas the method + * followSpeed returns the desired speed which may be lower than the safe + * speed, this method only considers safety constraints + * + * Returns the velocity of the vehicle in dependence to the vehicle's and its leader's values and the distance between them. + * @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 + */ + SUMOReal insertionFollowSpeed(const MSVehicle* const veh, SUMOReal speed, SUMOReal gap2pred, SUMOReal predSpeed, SUMOReal predMaxDecel) const; + + /** @brief Returns the model's name * @return The model's name * @see MSCFModel::getModelName @@ -148,9 +163,10 @@ /** @brief Returns the "safe" velocity * @param[in] gap2pred The (netto) distance to the LEADER * @param[in] predSpeed The LEADER's speed + * @param[in] predMaxDecel The LEADER's maximum deceleration * @return the safe velocity */ - virtual SUMOReal _vsafe(SUMOReal gap, SUMOReal predSpeed) const; + virtual SUMOReal vsafe(SUMOReal gap, SUMOReal predSpeed, SUMOReal predMaxDecel) const; /** @brief Applies driver imperfection (dawdling / sigma) @@ -167,5 +183,5 @@ SUMOReal myTauDecel; }; -#endif /* MSCFModel_KraussOrig1_H */ +#endif /* MSCFModel_KraussOrig1_H */ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_KraussPS.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_KraussPS.cpp --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_KraussPS.cpp 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_KraussPS.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 04 Aug 2009 -/// @version $Id: MSCFModel_KraussPS.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSCFModel_KraussPS.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Krauss car-following model, changing accel and speed by slope /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -54,10 +54,7 @@ SUMOReal MSCFModel_KraussPS::maxNextSpeed(SUMOReal speed, const MSVehicle* const veh) const { const SUMOReal gravity = 9.80665; - const MSLane* const lane = veh->getLane(); - const SUMOReal gp = lane->interpolateLanePosToGeometryPos(veh->getPositionOnLane()); - const SUMOReal slope = lane->getShape().slopeDegreeAtOffset(gp); - const SUMOReal aMax = MAX2(0., getMaxAccel() - gravity * sin(DEG2RAD(slope))); + const SUMOReal aMax = MAX2(0., getMaxAccel() - gravity * sin(DEG2RAD(veh->getSlope()))); // assuming drag force is proportional to the square of speed const SUMOReal vMax = sqrt(aMax / getMaxAccel()) * myType->getMaxSpeed(); return MIN2(speed + (SUMOReal) ACCEL2SPEED(aMax), vMax); diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_KraussPS.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_KraussPS.h --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_KraussPS.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_KraussPS.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 28 Jul 2009 -/// @version $Id: MSCFModel_KraussPS.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSCFModel_KraussPS.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Krauss car-following model, changing accel and speed by slope /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -21,7 +21,7 @@ // /****************************************************************************/ #ifndef MSCFModel_KraussPS_h -#define MSCFModel_KraussPS_h +#define MSCFModel_KraussPS_h // =========================================================================== // included modules @@ -96,5 +96,5 @@ }; -#endif /* MSCFModel_KraussPS_H */ +#endif /* MSCFModel_KraussPS_H */ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_PWag2009.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_PWag2009.cpp --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_PWag2009.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_PWag2009.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date 03.04.2010 -/// @version $Id: MSCFModel_PWag2009.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSCFModel_PWag2009.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Scalable model based on Krauß by Peter Wagner /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -119,19 +119,19 @@ // return 0; // } // const SUMOReal vsafe = -myTauLastDecel + sqrt(myTauLastDecel * myTauLastDecel + predSpeed * predSpeed + 2.0 * myDecel * gap); -// const SUMOReal asafe = SPEED2ACCEL(vsafe - speed); +// 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; +// 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)); //} // diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_PWag2009.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_PWag2009.h --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_PWag2009.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_PWag2009.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 03.04.2010 -/// @version $Id: MSCFModel_PWag2009.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSCFModel_PWag2009.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Scalable model based on Krauß by Peter Wagner /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -20,7 +20,7 @@ // /****************************************************************************/ #ifndef MSCFModel_PWag2009_h -#define MSCFModel_PWag2009_h +#define MSCFModel_PWag2009_h // =========================================================================== // included modules @@ -164,4 +164,4 @@ }; -#endif /* MSCFModel_PWag2009_H */ +#endif /* MSCFModel_PWag2009_H */ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_SmartSK.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_SmartSK.cpp --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_SmartSK.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_SmartSK.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Peter Wagner /// @date Tue, 05 Jun 2012 -/// @version $Id: MSCFModel_SmartSK.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSCFModel_SmartSK.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A smarter SK /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -34,7 +34,7 @@ #include #include #include "MSCFModel_SmartSK.h" -#include +#include #include @@ -59,7 +59,7 @@ if (myS2Sspeed > 5.0) { myS2Sspeed = 5.0; } -// SUMOReal maxDeltaGap = -0.5*ACCEL2DIST(myDecel + myAccel); +// SUMOReal maxDeltaGap = -0.5*ACCEL2DIST(myDecel + myAccel); maxDeltaGap = -0.5 * (myDecel + myAccel) * TS * TS; std::cout << "# maxDeltaGap = " << maxDeltaGap << std::endl; myTmp2 = TS / myTmp2; @@ -105,7 +105,7 @@ 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) && (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()!!! @@ -130,7 +130,7 @@ MSCFModel_SmartSK::stopSpeed(const MSVehicle* const veh, const SUMOReal speed, SUMOReal gap) const { SSKVehicleVariables* vars = (SSKVehicleVariables*)veh->getCarFollowVariables(); -// if (((gap - vars->gOld) < maxDeltaGap) && (speed>=5.0) && gap>=5.0) { +// 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()!!! diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_SmartSK.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_SmartSK.h --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_SmartSK.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_SmartSK.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Peter Wagner /// @date Tue, 05 Jun 2012 -/// @version $Id: MSCFModel_SmartSK.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSCFModel_SmartSK.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A smarter SK /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -20,7 +20,7 @@ // /****************************************************************************/ #ifndef MSCFModel_SmartSK_h -#define MSCFModel_SmartSK_h +#define MSCFModel_SmartSK_h // =========================================================================== // included modules @@ -203,5 +203,5 @@ }; -#endif /* MSCFModel_SmartSK_H */ +#endif /* MSCFModel_SmartSK_H */ diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,7 +4,7 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date June 2011 -/// @version $Id: MSCFModel_Wiedemann.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSCFModel_Wiedemann.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The psycho-physical model of Wiedemann // references: @@ -12,8 +12,8 @@ // Werner - Integration von Fahrzeugfolge- und Fahrstreifenwechselmodellen in die Nachtfahrsimulation LucidDrive // Olstam, Tapani - Comparison of Car-following models /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Wiedemann.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Wiedemann.h --- sumo-0.21.0+dfsg/src/microsim/cfmodels/MSCFModel_Wiedemann.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/cfmodels/MSCFModel_Wiedemann.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date June 2011 -/// @version $Id: MSCFModel_Wiedemann.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSCFModel_Wiedemann.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The psycho-physical model of Wiedemann /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -19,7 +19,7 @@ // /****************************************************************************/ #ifndef MSCFModel_Wiedemann_H -#define MSCFModel_Wiedemann_H +#define MSCFModel_Wiedemann_H // =========================================================================== // included modules @@ -187,4 +187,4 @@ MSCFModel_Wiedemann& operator=(const MSCFModel_Wiedemann& s); }; -#endif /* MSCFModel_Wiedemann_H */ +#endif /* MSCFModel_Wiedemann_H */ diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/Makefile.am --- sumo-0.21.0+dfsg/src/microsim/devices/Makefile.am 2014-02-24 23:02:17.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -3,6 +3,7 @@ libmicrosimdevs_a_SOURCES = MSDevice.cpp MSDevice.h \ MSDevice_BTreceiver.cpp MSDevice_BTreceiver.h \ MSDevice_BTsender.cpp MSDevice_BTsender.h \ +MSDevice_Container.cpp MSDevice_Container.h \ MSDevice_Emissions.cpp MSDevice_Emissions.h \ MSDevice_Person.cpp MSDevice_Person.h \ MSDevice_Routing.cpp MSDevice_Routing.h \ diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/Makefile.in --- sumo-0.21.0+dfsg/src/microsim/devices/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -100,9 +100,10 @@ libmicrosimdevs_a_LIBADD = am_libmicrosimdevs_a_OBJECTS = MSDevice.$(OBJEXT) \ MSDevice_BTreceiver.$(OBJEXT) MSDevice_BTsender.$(OBJEXT) \ - MSDevice_Emissions.$(OBJEXT) MSDevice_Person.$(OBJEXT) \ - MSDevice_Routing.$(OBJEXT) MSDevice_Tripinfo.$(OBJEXT) \ - MSDevice_Example.$(OBJEXT) MSDevice_Vehroutes.$(OBJEXT) + MSDevice_Container.$(OBJEXT) MSDevice_Emissions.$(OBJEXT) \ + MSDevice_Person.$(OBJEXT) MSDevice_Routing.$(OBJEXT) \ + MSDevice_Tripinfo.$(OBJEXT) MSDevice_Example.$(OBJEXT) \ + MSDevice_Vehroutes.$(OBJEXT) libmicrosimdevs_a_OBJECTS = $(am_libmicrosimdevs_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -224,6 +225,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -234,7 +237,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -332,6 +334,7 @@ libmicrosimdevs_a_SOURCES = MSDevice.cpp MSDevice.h \ MSDevice_BTreceiver.cpp MSDevice_BTreceiver.h \ MSDevice_BTsender.cpp MSDevice_BTsender.h \ +MSDevice_Container.cpp MSDevice_Container.h \ MSDevice_Emissions.cpp MSDevice_Emissions.h \ MSDevice_Person.cpp MSDevice_Person.h \ MSDevice_Routing.cpp MSDevice_Routing.h \ @@ -391,6 +394,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDevice.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDevice_BTreceiver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDevice_BTsender.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDevice_Container.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDevice_Emissions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDevice_Example.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSDevice_Person.Po@am__quote@ diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_BTreceiver.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_BTreceiver.cpp --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_BTreceiver.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_BTreceiver.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 14.08.2013 -/// @version $Id: MSDevice_BTreceiver.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSDevice_BTreceiver.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // A BT sender /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -53,6 +53,8 @@ // static members // =========================================================================== bool MSDevice_BTreceiver::myWasInitialised = false; +SUMOReal MSDevice_BTreceiver::myRange = -1.; +SUMOReal MSDevice_BTreceiver::myOffTime = -1.; MTRand MSDevice_BTreceiver::sRecognitionRNG; std::map MSDevice_BTreceiver::sVehicles; @@ -72,6 +74,11 @@ oc.doRegister("device.btreceiver.all-recognitions", new Option_Bool(false)); oc.addDescription("device.btreceiver.all-recognitions", "Communication", "Whether all recognition point shall be written"); + + oc.doRegister("device.btreceiver.offtime", new Option_Float(0.64)); + oc.addDescription("device.btreceiver.offtime", "Communication", "The offtime used for calculating detection probability (in seconds)"); + + myWasInitialised = false; } @@ -79,11 +86,13 @@ MSDevice_BTreceiver::buildVehicleDevices(SUMOVehicle& v, std::vector& into) { OptionsCont& oc = OptionsCont::getOptions(); if (equippedByDefaultAssignmentOptions(oc, "btreceiver", v)) { - MSDevice_BTreceiver* device = new MSDevice_BTreceiver(v, "btreceiver_" + v.getID(), oc.getFloat("device.btreceiver.range")); + MSDevice_BTreceiver* device = new MSDevice_BTreceiver(v, "btreceiver_" + v.getID()); into.push_back(device); if (!myWasInitialised) { new BTreceiverUpdate(); myWasInitialised = true; + myRange = oc.getFloat("device.btreceiver.range"); + myOffTime = oc.getFloat("device.btreceiver.offtime"); sRecognitionRNG.seed(oc.getInt("seed")); } } @@ -94,7 +103,7 @@ // MSDevice_BTreceiver::BTreceiverUpdate-methods // --------------------------------------------------------------------------- MSDevice_BTreceiver::BTreceiverUpdate::BTreceiverUpdate() { - MSNet::getInstance()->getEndOfTimestepEvents().addEvent(this, 0, MSEventControl::ADAPT_AFTER_EXECUTION); + MSNet::getInstance()->getEndOfTimestepEvents()->addEvent(this, 0, MSEventControl::ADAPT_AFTER_EXECUTION); } @@ -118,7 +127,7 @@ for (std::map::const_iterator i = MSDevice_BTsender::sVehicles.begin(); i != MSDevice_BTsender::sVehicles.end(); ++i) { MSDevice_BTsender::VehicleInformation* vi = (*i).second; Boundary b = vi->getBoxBoundary(); - b.grow(3.); + b.grow(POSITION_EPS); const float cmin[2] = {(float) b.xmin(), (float) b.ymin()}; const float cmax[2] = {(float) b.xmax(), (float) b.ymax()}; rt.Insert(cmin, cmax, vi); @@ -129,20 +138,10 @@ bool allRecognitions = oc.getBool("device.btreceiver.all-recognitions"); bool haveOutput = oc.isSet("bt-output"); for (std::map::iterator i = MSDevice_BTreceiver::sVehicles.begin(); i != MSDevice_BTreceiver::sVehicles.end();) { - // compute own direction vector - MSDevice_BTreceiver::VehicleState& state = (*i).second->updates.back(); - Position egoPosition = state.position; - SUMOReal angle = state.angle * M_PI / 180.; - SUMOReal speed = state.speed; - SUMOReal dist = SPEED2DIST(speed); - Position egoP2 = egoPosition; - Position egoP1(egoP2.x() - sin(angle)*dist, egoP2.y() + cos(angle)*dist); - Position egoD = egoP2 - egoP1; - // collect surrounding vehicles MSDevice_BTreceiver::VehicleInformation* vi = (*i).second; Boundary b = vi->getBoxBoundary(); - b.grow(vi->range + 500 / 3.6); // two vehicles passing at 250*2 km/h + b.grow(vi->range); const float cmin[2] = {(float) b.xmin(), (float) b.ymin()}; const float cmax[2] = {(float) b.xmax(), (float) b.ymax()}; std::set surroundingVehicles; @@ -155,7 +154,7 @@ // seeing oneself? skip continue; } - updateVisibility(*vi, *MSDevice_BTsender::sVehicles.find(*j)->second, egoP1, egoD); + updateVisibility(*vi, *MSDevice_BTsender::sVehicles.find(*j)->second); } if (vi->haveArrived) { @@ -163,26 +162,23 @@ if (haveOutput) { writeOutput((*i).first, vi->seen, allRecognitions); } - delete(*i).second; + delete vi; MSDevice_BTreceiver::sVehicles.erase(i++); } else { // vehicle is still in the simulation; reset state - VehicleState last = (*i).second->updates.back(); - (*i).second->updates.clear(); - (*i).second->updates.push_back(last); + vi->updates.erase(vi->updates.begin(), vi->updates.end() - 1); ++i; } } // remove arrived senders / reset state for (std::map::iterator i = MSDevice_BTsender::sVehicles.begin(); i != MSDevice_BTsender::sVehicles.end();) { - if ((*i).second->haveArrived) { - delete(*i).second; + MSDevice_BTsender::VehicleInformation* vi = (*i).second; + if (vi->haveArrived) { + delete vi; MSDevice_BTsender::sVehicles.erase(i++); } else { - MSDevice_BTsender::VehicleState last = (*i).second->updates.back(); - (*i).second->updates.clear(); - (*i).second->updates.push_back(last); + vi->updates.erase(vi->updates.begin(), vi->updates.end() - 1); ++i; } } @@ -191,75 +187,72 @@ void -MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility(MSDevice_BTreceiver::VehicleInformation& receiver, MSDevice_BTsender::VehicleInformation& sender, - const Position& receiverStartPos, const Position& receiverD) { - Position receiverPos = receiver.updates.back().position; - std::vector intersections; +MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility(MSDevice_BTreceiver::VehicleInformation& receiver, + MSDevice_BTsender::VehicleInformation& sender) { + const MSDevice_BTsender::VehicleState& receiverData = receiver.updates.back(); + const MSDevice_BTsender::VehicleState& senderData = sender.updates.back(); if (!receiver.amOnNet || !sender.amOnNet) { // at least one of the vehicles has left the simulation area for any reason if (receiver.currentlySeen.find(sender.getID()) != receiver.currentlySeen.end()) { - leaveRange(receiver.currentlySeen, receiver.seen, receiverPos, receiver.updates.back().speed, receiver.updates.back().laneID, receiver.updates.back().lanePos, - sender.getID(), sender.updates.back().position, sender.updates.back().speed, sender.updates.back().laneID, sender.updates.back().lanePos, 0); + leaveRange(receiver, receiverData, sender, senderData, 0); } } - // get the encountered vehicle's current and prior position (based on speed and direction) - Position otherPosition = sender.updates.back().position; - Position otherP2 = otherPosition; - const SUMOReal angle = sender.updates.back().angle * M_PI / 180.; - const SUMOReal speed = sender.updates.back().speed; - const SUMOReal dist = SPEED2DIST(speed); + const Position& oldReceiverPosition = receiver.updates.front().position; + const Position& oldSenderPosition = sender.updates.front().position; // let the other's current position be the one obtained by applying the relative direction vector to the initial position - Position otherP1(otherPosition.x() - sin(angle)*dist, otherPosition.y() + cos(angle)*dist); - Position otherD = otherP2 - otherP1; - otherP2 = otherP1 - receiverD + otherD; + const Position senderDelta = senderData.position - oldSenderPosition; + const Position receiverDelta = receiverData.position - oldReceiverPosition; + const Position translatedSender = senderData.position - receiverDelta; // find crossing points - GeomHelper::FindLineCircleIntersections(receiverStartPos, receiver.range, otherP1, otherP2, intersections); + std::vector intersections; + GeomHelper::FindLineCircleIntersections(oldReceiverPosition, receiver.range, oldSenderPosition, translatedSender, intersections); switch (intersections.size()) { case 0: // no intersections -> other vehicle either stays within or beyond range - if (receiver.amOnNet && sender.amOnNet && receiverPos.distanceTo(otherPosition) < receiver.range) { + if (receiver.amOnNet && sender.amOnNet && receiverData.position.distanceTo(senderData.position) < receiver.range) { if (receiver.currentlySeen.find(sender.getID()) == receiver.currentlySeen.end()) { - enterRange(0., receiverPos, receiver.updates.back().speed, receiver.updates.back().laneID, receiver.updates.back().lanePos, - sender.getID(), otherPosition, sender.updates.back().speed, sender.updates.back().laneID, sender.updates.back().lanePos, receiver.currentlySeen); + enterRange(0., receiverData, sender.getID(), senderData, receiver.currentlySeen); } else { - addRecognitionPoint(STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), receiverPos, receiver.updates.back().speed, receiver.updates.back().laneID, receiver.updates.back().lanePos, - otherPosition, sender.updates.back().speed, sender.updates.back().laneID, sender.updates.back().lanePos, receiver.currentlySeen[sender.getID()]); + addRecognitionPoint(SIMTIME, receiverData, senderData, receiver.currentlySeen[sender.getID()]); } } else { if (receiver.currentlySeen.find(sender.getID()) != receiver.currentlySeen.end()) { - leaveRange(receiver.currentlySeen, receiver.seen, receiverPos, receiver.updates.back().speed, receiver.updates.back().laneID, receiver.updates.back().lanePos, - sender.getID(), otherPosition, sender.updates.back().speed, sender.updates.back().laneID, sender.updates.back().lanePos, 0.); + leaveRange(receiver, receiverData, sender, senderData, 0.); } } break; case 1: { // one intersection -> other vehicle either enters or leaves the range - Position intersection1Other = otherP1 + otherD * intersections.front(); - Position intersection1Ego = receiverStartPos + receiverD * intersections.front(); + MSDevice_BTsender::VehicleState intersection1ReceiverData(receiverData); + intersection1ReceiverData.position = oldReceiverPosition + receiverDelta * intersections.front(); + MSDevice_BTsender::VehicleState intersection1SenderData(senderData); + intersection1SenderData.position = oldSenderPosition + senderDelta * intersections.front(); if (receiver.currentlySeen.find(sender.getID()) != receiver.currentlySeen.end()) { - leaveRange(receiver.currentlySeen, receiver.seen, intersection1Ego, receiver.updates.back().speed, receiver.updates.back().laneID, receiver.updates.back().lanePos, - sender.getID(), intersection1Other, sender.updates.back().speed, sender.updates.back().laneID, sender.updates.back().lanePos, (intersections.front() - 1.) * TS); + leaveRange(receiver, intersection1ReceiverData, + sender, intersection1SenderData, (intersections.front() - 1.) * TS); } else { - enterRange((intersections.front() - 1.) * TS, intersection1Ego, receiver.updates.back().speed, receiver.updates.back().laneID, receiver.updates.back().lanePos, - sender.getID(), intersection1Other, sender.updates.back().speed, sender.updates.back().laneID, sender.updates.back().lanePos, receiver.currentlySeen); + enterRange((intersections.front() - 1.) * TS, intersection1ReceiverData, + sender.getID(), intersection1SenderData, receiver.currentlySeen); } } break; case 2: // two intersections -> other vehicle enters and leaves the range if (receiver.currentlySeen.find(sender.getID()) == receiver.currentlySeen.end()) { - Position intersection1Other = otherP1 + otherD * intersections.front(); - Position intersection1Ego = receiverStartPos + receiverD * intersections.front(); - enterRange((intersections.front() - 1.) * TS, intersection1Ego, receiver.updates.back().speed, receiver.updates.back().laneID, receiver.updates.back().lanePos, - sender.getID(), intersection1Other, sender.updates.back().speed, sender.updates.back().laneID, sender.updates.back().lanePos, receiver.currentlySeen); - Position intersection2Other = otherP1 + otherD * intersections[1]; - Position intersection2Ego = receiverStartPos + receiverD * intersections[1]; - leaveRange(receiver.currentlySeen, receiver.seen, intersection2Ego, receiver.updates.back().speed, receiver.updates.back().laneID, receiver.updates.back().lanePos, - sender.getID(), intersection2Other, sender.updates.back().speed, sender.updates.back().laneID, sender.updates.back().lanePos, (intersections.back() - 1.) * TS); + MSDevice_BTsender::VehicleState intersectionReceiverData(receiverData); + intersectionReceiverData.position = oldReceiverPosition + receiverDelta * intersections.front(); + MSDevice_BTsender::VehicleState intersectionSenderData(senderData); + intersectionSenderData.position = oldSenderPosition + senderDelta * intersections.front(); + enterRange((intersections.front() - 1.) * TS, intersectionReceiverData, + sender.getID(), intersectionSenderData, receiver.currentlySeen); + intersectionReceiverData.position = oldReceiverPosition + receiverDelta * intersections.back(); + intersectionSenderData.position = oldSenderPosition + senderDelta * intersections.back(); + leaveRange(receiver, intersectionReceiverData, + sender, intersectionSenderData, (intersections.back() - 1.) * TS); } else { - WRITE_WARNING("Nope, a vehicle cannot be in the range, leave, and enter it in one step."); + WRITE_WARNING("The vehicle '" + sender.getID() + "' cannot be in the range of '" + receiver.getID() + "', leave, and enter it in one step."); } break; default: @@ -270,48 +263,77 @@ void -MSDevice_BTreceiver::BTreceiverUpdate::enterRange(SUMOReal atOffset, - const Position& thisPos, SUMOReal thisSpeed, const std::string& thisLaneID, SUMOReal thisLanePos, - const std::string& otherID, const Position& otherPos, SUMOReal otherSpeed, const std::string& otherLaneID, SUMOReal otherLanePos, +MSDevice_BTreceiver::BTreceiverUpdate::enterRange(SUMOReal atOffset, const MSDevice_BTsender::VehicleState& receiverState, + const std::string& senderID, const MSDevice_BTsender::VehicleState& senderState, std::map& currentlySeen) { - MeetingPoint mp(STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + atOffset, thisPos, thisSpeed, thisLaneID, thisLanePos, otherPos, otherSpeed, otherLaneID, otherLanePos); + MeetingPoint mp(SIMTIME + atOffset, receiverState, senderState); SeenDevice* sd = new SeenDevice(mp); - currentlySeen[otherID] = sd; - addRecognitionPoint(STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), thisPos, thisSpeed, thisLaneID, thisLanePos, - otherPos, otherSpeed, otherLaneID, otherLanePos, sd); + currentlySeen[senderID] = sd; + addRecognitionPoint(SIMTIME, receiverState, senderState, sd); } void -MSDevice_BTreceiver::BTreceiverUpdate::leaveRange(std::map& currentlySeen, std::map >& seen, - const Position& thisPos, SUMOReal thisSpeed, const std::string& thisLaneID, SUMOReal thisLanePos, - const std::string& otherID, const Position& otherPos, SUMOReal otherSpeed, const std::string& otherLaneID, SUMOReal otherLanePos, +MSDevice_BTreceiver::BTreceiverUpdate::leaveRange(VehicleInformation& receiverInfo, const MSDevice_BTsender::VehicleState& receiverState, + MSDevice_BTsender::VehicleInformation& senderInfo, const MSDevice_BTsender::VehicleState& senderState, SUMOReal tOffset) { - std::map::iterator i = currentlySeen.find(otherID); + std::map::iterator i = receiverInfo.currentlySeen.find(senderInfo.getID()); // check whether the other was recognized - addRecognitionPoint(STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + tOffset, thisPos, thisSpeed, thisLaneID, thisLanePos, - otherPos, otherSpeed, otherLaneID, otherLanePos, (*i).second); + addRecognitionPoint(SIMTIME + tOffset, receiverState, senderState, i->second); // build leaving point - MeetingPoint mp(STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + tOffset, thisPos, thisSpeed, thisLaneID, thisLanePos, otherPos, otherSpeed, otherLaneID, otherLanePos); - (*i).second->meetingEnd = mp; - if (seen.find(otherID) == seen.end()) { - seen[otherID] = std::vector(); + i->second->meetingEnd = new MeetingPoint(STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + tOffset, receiverState, senderState); + ConstMSEdgeVector::const_iterator begin = receiverInfo.route.begin() + i->second->meetingBegin.observerState.routePos; + ConstMSEdgeVector::const_iterator end = receiverInfo.route.begin() + receiverState.routePos + 1; + i->second->receiverRoute = toString(begin, end); + begin = senderInfo.route.begin() + i->second->meetingBegin.seenState.routePos; + end = senderInfo.route.begin() + senderState.routePos + 1; + i->second->senderRoute = toString(begin, end); + receiverInfo.seen[senderInfo.getID()].push_back(i->second); + receiverInfo.currentlySeen.erase(i); +} + + +SUMOReal +MSDevice_BTreceiver::inquiryDelaySlots(const int backoffLimit) { + const int phaseOffset = sRecognitionRNG.randInt(2047); + const bool interlaced = sRecognitionRNG.rand() < 0.7; + const SUMOReal delaySlots = sRecognitionRNG.rand() * 15; + const int backoff = sRecognitionRNG.randInt(backoffLimit); + if (interlaced) { + return sRecognitionRNG.rand() * 31 + backoff; + } + if (sRecognitionRNG.randInt(31) < 16) { + // correct train for f0 + return delaySlots + backoff; + } + if (sRecognitionRNG.randInt(30) < 16) { + // correct train for f1 + return 2048 - phaseOffset + delaySlots + backoff; + } + if (sRecognitionRNG.randInt(29) < 16) { + // f2 is in train A but has overlap with both trains + if (2 * 2048 - phaseOffset + backoff < 4096) { + return 2 * 2048 - phaseOffset + delaySlots + backoff; + } + // the following is wrong but should only happen in about 3% of the non-interlaced cases + return 2 * 2048 - phaseOffset + delaySlots + backoff; } - seen[otherID].push_back((*i).second); - currentlySeen.erase(i); + return 2 * 2048 + delaySlots + backoff; } void -MSDevice_BTreceiver::BTreceiverUpdate::addRecognitionPoint(const SUMOReal tEnd, const Position& thisPos, const SUMOReal thisSpeed, const std::string& thisLaneID, const SUMOReal thisLanePos, - const Position& otherPos, const SUMOReal otherSpeed, const std::string& otherLaneID, const SUMOReal otherLanePos, - SeenDevice* otherDevice) const { - const SUMOReal t = tEnd - MAX2(STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - TS, otherDevice->lastView); - // probability of a miss 0.5 (may be in the wrong train), backoff time 0.64s - if (sRecognitionRNG.rand() <= 1 - pow(0.5, t / 0.64)) { - otherDevice->lastView = tEnd; - MeetingPoint* mp = new MeetingPoint(tEnd, thisPos, thisSpeed, thisLaneID, thisLanePos, otherPos, otherSpeed, otherLaneID, otherLanePos); - otherDevice->recognitionPoints.push_back(mp); +MSDevice_BTreceiver::BTreceiverUpdate::addRecognitionPoint(const SUMOReal tEnd, const MSDevice_BTsender::VehicleState& receiverState, + const MSDevice_BTsender::VehicleState& senderState, + SeenDevice* senderDevice) const { + if (senderDevice->nextView == -1.) { + senderDevice->nextView = senderDevice->lastView + inquiryDelaySlots(int(myOffTime / 0.000625 + .5)) * 0.000625; + } + if (tEnd > senderDevice->nextView) { + senderDevice->lastView = senderDevice->nextView; + MeetingPoint* mp = new MeetingPoint(tEnd, receiverState, senderState); + senderDevice->recognitionPoints.push_back(mp); + senderDevice->nextView = senderDevice->lastView + inquiryDelaySlots(int(myOffTime / 0.000625 + .5)) * 0.000625; } } @@ -324,22 +346,27 @@ const std::vector& sts = (*j).second; for (std::vector::const_iterator k = sts.begin(); k != sts.end(); ++k) { os.openTag("seen").writeAttr("id", (*j).first); + const MSDevice_BTsender::VehicleState& obsBeg = (*k)->meetingBegin.observerState; + const MSDevice_BTsender::VehicleState& seenBeg = (*k)->meetingBegin.seenState; os.writeAttr("tBeg", (*k)->meetingBegin.t) - .writeAttr("observerPosBeg", (*k)->meetingBegin.observerPos).writeAttr("observerSpeedBeg", (*k)->meetingBegin.observerSpeed) - .writeAttr("observerLaneIDBeg", (*k)->meetingBegin.observerLaneID).writeAttr("observerLanePosBeg", (*k)->meetingBegin.observerLanePos) - .writeAttr("seenPosBeg", (*k)->meetingBegin.seenPos).writeAttr("seenSpeedBeg", (*k)->meetingBegin.seenSpeed) - .writeAttr("seenLaneIDBeg", (*k)->meetingBegin.seenLaneID).writeAttr("seenLanePosBeg", (*k)->meetingBegin.seenLanePos); - os.writeAttr("tEnd", (*k)->meetingEnd.t) - .writeAttr("observerPosEnd", (*k)->meetingEnd.observerPos).writeAttr("observerSpeedEnd", (*k)->meetingEnd.observerSpeed) - .writeAttr("observerLaneIDEnd", (*k)->meetingEnd.observerLaneID).writeAttr("observerLanePosEnd", (*k)->meetingEnd.observerLanePos) - .writeAttr("seenPosEnd", (*k)->meetingEnd.seenPos).writeAttr("seenSpeedEnd", (*k)->meetingEnd.seenSpeed) - .writeAttr("seenLaneIDEnd", (*k)->meetingEnd.seenLaneID).writeAttr("seenLanePosEnd", (*k)->meetingEnd.seenLanePos); + .writeAttr("observerPosBeg", obsBeg.position).writeAttr("observerSpeedBeg", obsBeg.speed) + .writeAttr("observerLaneIDBeg", obsBeg.laneID).writeAttr("observerLanePosBeg", obsBeg.lanePos) + .writeAttr("seenPosBeg", seenBeg.position).writeAttr("seenSpeedBeg", seenBeg.speed) + .writeAttr("seenLaneIDBeg", seenBeg.laneID).writeAttr("seenLanePosBeg", seenBeg.lanePos); + const MSDevice_BTsender::VehicleState& obsEnd = (*k)->meetingEnd->observerState; + const MSDevice_BTsender::VehicleState& seenEnd = (*k)->meetingEnd->seenState; + os.writeAttr("tEnd", (*k)->meetingEnd->t) + .writeAttr("observerPosEnd", obsEnd.position).writeAttr("observerSpeedEnd", obsEnd.speed) + .writeAttr("observerLaneIDEnd", obsEnd.laneID).writeAttr("observerLanePosEnd", obsEnd.lanePos) + .writeAttr("seenPosEnd", seenEnd.position).writeAttr("seenSpeedEnd", seenEnd.speed) + .writeAttr("seenLaneIDEnd", seenEnd.laneID).writeAttr("seenLanePosEnd", seenEnd.lanePos) + .writeAttr("observerRoute", (*k)->receiverRoute).writeAttr("seenRoute", (*k)->senderRoute); for (std::vector::iterator l = (*k)->recognitionPoints.begin(); l != (*k)->recognitionPoints.end(); ++l) { os.openTag("recognitionPoint").writeAttr("t", (*l)->t) - .writeAttr("observerPos", (*l)->observerPos).writeAttr("observerSpeed", (*l)->observerSpeed) - .writeAttr("observerLaneID", (*l)->observerLaneID).writeAttr("observerLanePos", (*l)->observerLanePos) - .writeAttr("seenPos", (*l)->seenPos).writeAttr("seenSpeed", (*l)->seenSpeed) - .writeAttr("seenLaneID", (*l)->seenLaneID).writeAttr("seenLanePos", (*l)->seenLanePos) + .writeAttr("observerPos", (*l)->observerState.position).writeAttr("observerSpeed", (*l)->observerState.speed) + .writeAttr("observerLaneID", (*l)->observerState.laneID).writeAttr("observerLanePos", (*l)->observerState.lanePos) + .writeAttr("seenPos", (*l)->seenState.position).writeAttr("seenSpeed", (*l)->seenState.speed) + .writeAttr("seenLaneID", (*l)->seenState.laneID).writeAttr("seenLanePos", (*l)->seenState.lanePos) .closeTag(); if (!allRecognitions) { break; @@ -357,8 +384,8 @@ // --------------------------------------------------------------------------- // MSDevice_BTreceiver-methods // --------------------------------------------------------------------------- -MSDevice_BTreceiver::MSDevice_BTreceiver(SUMOVehicle& holder, const std::string& id, SUMOReal range) - : MSDevice(holder, id), myRange(range) { +MSDevice_BTreceiver::MSDevice_BTreceiver(SUMOVehicle& holder, const std::string& id) + : MSDevice(holder, id) { } @@ -370,13 +397,16 @@ MSDevice_BTreceiver::notifyEnter(SUMOVehicle& veh, Notification reason) { if (reason == MSMoveReminder::NOTIFICATION_DEPARTED && sVehicles.find(veh.getID()) == sVehicles.end()) { sVehicles[veh.getID()] = new VehicleInformation(veh.getID(), myRange); + sVehicles[veh.getID()]->route.push_back(veh.getEdge()); } if (reason == MSMoveReminder::NOTIFICATION_TELEPORT && sVehicles.find(veh.getID()) != sVehicles.end()) { sVehicles[veh.getID()]->amOnNet = true; } - sVehicles[veh.getID()]->updates.push_back(VehicleState( - MSNet::getInstance()->getCurrentTimeStep(), veh.getSpeed(), static_cast(veh).getAngle(), static_cast(veh).getPosition(), static_cast(veh).getLane()->getID(), veh.getPositionOnLane() - )); + if (reason == MSMoveReminder::NOTIFICATION_TELEPORT || reason == MSMoveReminder::NOTIFICATION_JUNCTION) { + sVehicles[veh.getID()]->route.push_back(veh.getEdge()); + } + const MSVehicle& v = static_cast(veh); + sVehicles[veh.getID()]->updates.push_back(MSDevice_BTsender::VehicleState(veh.getSpeed(), veh.getPosition(), v.getLane()->getID(), veh.getPositionOnLane(), v.getRoutePosition())); return true; } @@ -387,9 +417,8 @@ WRITE_WARNING("btreceiver: Can not update position of a vehicle that is not within the road network (" + veh.getID() + ")."); return true; } - sVehicles[veh.getID()]->updates.push_back(VehicleState( - MSNet::getInstance()->getCurrentTimeStep(), newSpeed, static_cast(veh).getAngle(), static_cast(veh).getPosition(), static_cast(veh).getLane()->getID(), newPos - )); + const MSVehicle& v = static_cast(veh); + sVehicles[veh.getID()]->updates.push_back(MSDevice_BTsender::VehicleState(newSpeed, veh.getPosition(), v.getLane()->getID(), newPos, v.getRoutePosition())); return true; } @@ -403,9 +432,8 @@ WRITE_WARNING("btreceiver: Can not update position of a vehicle that is not within the road network (" + veh.getID() + ")."); return true; } - sVehicles[veh.getID()]->updates.push_back(VehicleState( - MSNet::getInstance()->getCurrentTimeStep(), veh.getSpeed(), static_cast(veh).getAngle(), static_cast(veh).getPosition(), static_cast(veh).getLane()->getID(), veh.getPositionOnLane() - )); + const MSVehicle& v = static_cast(veh); + sVehicles[veh.getID()]->updates.push_back(MSDevice_BTsender::VehicleState(veh.getSpeed(), veh.getPosition(), v.getLane()->getID(), veh.getPositionOnLane(), v.getRoutePosition())); if (reason == MSMoveReminder::NOTIFICATION_TELEPORT) { sVehicles[veh.getID()]->amOnNet = false; } diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_BTreceiver.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_BTreceiver.h --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_BTreceiver.h 2014-04-25 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_BTreceiver.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 14.08.2013 -/// @version $Id: MSDevice_BTreceiver.h 16253 2014-04-25 12:09:01Z behrisch $ +/// @version $Id: MSDevice_BTreceiver.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A BT receiver /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -75,6 +75,14 @@ static void buildVehicleDevices(SUMOVehicle& v, std::vector& into); + /** @brief Returns the configured range + * @return the device range + */ + static SUMOReal getRange() { + return myRange; + } + + public: /// @brief Destructor. @@ -134,44 +142,27 @@ public: /** @brief Constructor * @param[in] _t The time of the meeting - * @param[in] _observerPos The position the observer had at the time - * @param[in] _observerSpeed The speed the observer had at the time - * @param[in] _observerLaneID The lane the observer was at - * @param[in] _observerLanePos The position at the lane of the observer - * @param[in] _seenPos The position the seen vehicle had at the time - * @param[in] _seenSpeed The speed the vehicle had at the time - * @param[in] _seenLaneID The lane the vehicle was at - * @param[in] _seenLanePos The position at the lane of the vehicle + * @param[in] _observerState The position, speed, lane etc. the observer had at the time + * @param[in] _seenState The position, speed, lane etc. the seen vehicle had at the time */ - MeetingPoint(SUMOReal _t, const Position& _observerPos, SUMOReal _observerSpeed, - const std::string& _observerLaneID, SUMOReal _observerLanePos, - const Position& _seenPos, SUMOReal _seenSpeed, - const std::string& _seenLaneID, SUMOReal _seenLanePos) - : t(_t), observerPos(_observerPos), observerSpeed(_observerSpeed), observerLaneID(_observerLaneID), observerLanePos(_observerLanePos), - seenPos(_seenPos), seenSpeed(_seenSpeed), seenLaneID(_seenLaneID), seenLanePos(_seenLanePos) {} + MeetingPoint(SUMOReal _t, const MSDevice_BTsender::VehicleState& _observerState, + const MSDevice_BTsender::VehicleState& _seenState) + : t(_t), observerState(_observerState), seenState(_seenState) {} /// @brief Destructor ~MeetingPoint() {} public: /// @brief The time of the meeting - SUMOReal t; - /// @brief The position the observer had at the time - Position observerPos; - /// @brief The speed the observer had at the time - SUMOReal observerSpeed; - /// @brief The lane the observer was at - std::string observerLaneID; - /// @brief The position at the lane of the observer - SUMOReal observerLanePos; - /// @brief The position the seen vehicle had at the time - Position seenPos; - /// @brief The speed the vehicle had at the time - SUMOReal seenSpeed; - /// @brief The lane the vehicle was at - std::string seenLaneID; - /// @brief The position at the lane of the vehicle - SUMOReal seenLanePos; + const SUMOReal t; + /// @brief The state the observer had at the time + const MSDevice_BTsender::VehicleState observerState; + /// @brief The state the seen vehicle had at the time + const MSDevice_BTsender::VehicleState seenState; + + private: + /// @brief Invalidated assignment operator. + MeetingPoint& operator=(const MeetingPoint&); }; @@ -186,10 +177,11 @@ * @param[in] meetingBegin_ Description of the meeting's begin */ SeenDevice(const MeetingPoint& meetingBegin_) - : meetingBegin(meetingBegin_), meetingEnd(meetingBegin_), lastView(meetingBegin_.t) {} + : meetingBegin(meetingBegin_), meetingEnd(0), lastView(meetingBegin_.t), nextView(-1.) {} /// @brief Destructor ~SeenDevice() { + delete meetingEnd; for (std::vector::iterator i = recognitionPoints.begin(); i != recognitionPoints.end(); ++i) { delete *i; } @@ -199,13 +191,23 @@ public: /// @brief Description of the meeting's begin - MeetingPoint meetingBegin; + const MeetingPoint meetingBegin; /// @brief Description of the meeting's end - MeetingPoint meetingEnd; + MeetingPoint* meetingEnd; /// @brief Last recognition point SUMOReal lastView; + /// @brief Next possible recognition point + SUMOReal nextView; /// @brief List of recognition points std::vector recognitionPoints; + /// @brief string of travelled receiver edges + std::string receiverRoute; + /// @brief string of travelled sender edges + std::string senderRoute; + + private: + /// @brief Invalidated assignment operator. + SeenDevice& operator=(const SeenDevice&); }; @@ -225,93 +227,38 @@ * @param[in] holder The vehicle that holds this device * @param[in] id The ID of the device */ - MSDevice_BTreceiver(SUMOVehicle& holder, const std::string& id, SUMOReal range); + MSDevice_BTreceiver(SUMOVehicle& holder, const std::string& id); private: - /// @brief The range of the device - SUMOReal myRange; - /// @brief Whether the bt-system was already initialised static bool myWasInitialised; + /// @brief The range of the device + static SUMOReal myRange; - - /** @class VehicleInformation - * @brief Stores the information of a vehicle - */ - class VehicleState { - public: - /** @brief Constructor - * @param[in] _time The current time - * @param[in] _speed The speed of the vehicle - * @param[in] _angle The angle of the vehicle - * @param[in] _position The position of the vehicle - * @param[in] _laneID The id of the lane the vehicle is located at - * @param[in] _lanePos The position of the vehicle along the lane - */ - VehicleState(SUMOReal _time, SUMOReal _speed, SUMOReal _angle, const Position& _position, const std::string& _laneID, SUMOReal _lanePos) - : time(_time), speed(_speed), angle(_angle), position(_position), laneID(_laneID), lanePos(_lanePos) {} - - /// @brief Destructor - ~VehicleState() {} - - /// @brief The current time - SUMOReal time; - /// @brief The speed of the vehicle - SUMOReal speed; - /// @brief The angle of the vehicle - SUMOReal angle; - /// @brief The position of the vehicle - Position position; - /// @brief The lane the vehicle was at - std::string laneID; - /// @brief The position at the lane of the vehicle - SUMOReal lanePos; - - }; - + /// @brief The offtime of the device + static SUMOReal myOffTime; /** @class VehicleInformation * @brief Stores the information of a vehicle */ - class VehicleInformation : public Named { + class VehicleInformation : public MSDevice_BTsender::VehicleInformation { public: /** @brief Constructor * @param[in] id The id of the vehicle * @param[in] range Recognition range of the vehicle */ - VehicleInformation(const std::string& id, const SUMOReal _range) : Named(id), range(_range), amOnNet(true), haveArrived(false) {} + VehicleInformation(const std::string& id, const SUMOReal _range) : MSDevice_BTsender::VehicleInformation(id), range(_range) {} /// @brief Destructor ~VehicleInformation() {} - - /** @brief Returns the boundary of passed positions - * @return The positions boundary - */ - Boundary getBoxBoundary() const { - Boundary ret; - for (std::vector::const_iterator i = updates.begin(); i != updates.end(); ++i) { - ret.add((*i).position); - } - return ret; - } - /// @brief Recognition range of the vehicle const SUMOReal range; - /// @brief List of position updates during last step - std::vector updates; - - /// @brief Whether the vehicle is within the simulated network - bool amOnNet; - - /// @brief Whether the vehicle was removed from the simulation - bool haveArrived; - /// @brief The map of devices seen by the vehicle at removal time std::map currentlySeen; @@ -350,49 +297,31 @@ /** @brief Rechecks the visibility for a given receiver/sender pair * @param[in] receiver Definition of the receiver vehicle * @param[in] sender Definition of the sender vehicle - * @param[in] receiverPos The initial receiver position - * @param[in] receiverD The direction vector of the receiver */ - void updateVisibility(VehicleInformation& receiver, MSDevice_BTsender::VehicleInformation& sender, - const Position& receiverPos, const Position& receiverD); + void updateVisibility(VehicleInformation& receiver, MSDevice_BTsender::VehicleInformation& sender); /** @brief Informs the receiver about a sender entering it's radius * @param[in] atOffset The time offset to the current time step - * @param[in] thisPos The receiver's position at the time - * @param[in] thisSpeed The receiver's speed at the time - * @param[in] thisLaneID The lane the observer was at - * @param[in] thisLanePos The position at the lane of the observer - * @param[in] otherID The ID of the entering sender - * @param[in] otherPos The position of the entering sender - * @param[in] otherSpeed The speed of the entering sender - * @param[in] otherLaneID The lane the sender was at - * @param[in] otherLanePos The position at the lane of the sender + * @param[in] receiverState The position, speed, lane etc. the observer had at the time + * @param[in] senderID The ID of the entering sender + * @param[in] senderState The position, speed, lane etc. the seen vehicle had at the time * @param[in] currentlySeen The container storing episodes */ - void enterRange(SUMOReal atOffset, const Position& thisPos, SUMOReal thisSpeed, const std::string& thisLaneID, SUMOReal thisLanePos, - const std::string& otherID, const Position& otherPos, SUMOReal otherSpeed, const std::string& otherLaneID, SUMOReal otherLanePos, + void enterRange(SUMOReal atOffset, const MSDevice_BTsender::VehicleState& receiverState, + const std::string& senderID, const MSDevice_BTsender::VehicleState& senderState, std::map& currentlySeen); /** @brief Removes the sender from the currently seen devices to past episodes - * @param[in] currentlySeen The currently seen devices - * @param[in] seen The lists of episodes to add this one to - * @param[in] thisPos The receiver's position at the time - * @param[in] thisSpeed The receiver's speed at the time - * @param[in] thisLaneID The lane the observer was at - * @param[in] thisLanePos The position at the lane of the observer - * @param[in] otherID The ID of the entering sender - * @param[in] otherPos The position of the entering sender - * @param[in] otherSpeed The speed of the entering sender - * @param[in] otherLaneID The lane the sender was at - * @param[in] otherLanePos The position at the lane of the sender + * @param[in] receiverInfo The static information of the observer (id, route, etc.) + * @param[in] receiverState The position, speed, lane etc. the observer had at the time + * @param[in] senderInfo The static information of the seen vehicle (id, route, etc.) + * @param[in] senderState The position, speed, lane etc. the seen vehicle had at the time * @param[in] tOffset The time offset to the current time step - * @param[in] remove Whether the sender shall be removed from this device's myCurrentlySeen */ - void leaveRange(std::map& currentlySeen, std::map >& seen, - const Position& thisPos, SUMOReal thisSpeed, const std::string& thisLaneID, SUMOReal thisLanePos, - const std::string& otherID, const Position& otherPos, SUMOReal otherSpeed, const std::string& otherLaneID, SUMOReal otherLanePos, + void leaveRange(VehicleInformation& receiverInfo, const MSDevice_BTsender::VehicleState& receiverState, + MSDevice_BTsender::VehicleInformation& senderInfo, const MSDevice_BTsender::VehicleState& senderState, SUMOReal tOffset); @@ -400,19 +329,13 @@ /** @brief Adds a point of recognition * @param[in] tEnd The time of the recognition - * @param[in] thisPos The receiver's position at the time - * @param[in] thisSpeed The receiver's speed at the time - * @param[in] thisLaneID The lane the observer was at - * @param[in] thisLanePos The position at the lane of the observer - * @param[in] otherPos The position of the entering sender - * @param[in] otherSpeed The speed of the entering sender - * @param[in] otherLaneID The lane the sender was at - * @param[in] otherLanePos The position at the lane of the sender - * @param[in] otherDevice The device of the entering sender - */ - void addRecognitionPoint(const SUMOReal tEnd, const Position& thisPos, const SUMOReal thisSpeed, const std::string& thisLaneID, const SUMOReal thisLanePos, - const Position& otherPos, const SUMOReal otherSpeed, const std::string& otherLaneID, const SUMOReal otherLanePos, - SeenDevice* otherDevice) const; + * @param[in] receiverState The position, speed, lane etc. the observer had at the time + * @param[in] senderState The position, speed, lane etc. the seen vehicle had at the time + * @param[in] senderDevice The device of the entering sender + */ + void addRecognitionPoint(const SUMOReal tEnd, const MSDevice_BTsender::VehicleState& receiverState, + const MSDevice_BTsender::VehicleState& senderState, + SeenDevice* senderDevice) const; /** @brief Writes the output @@ -429,6 +352,8 @@ }; + static SUMOReal inquiryDelaySlots(const int backoffLimit); + /// @brief A random number generator used to determine whether the opposite was recognized static MTRand sRecognitionRNG; diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_BTsender.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_BTsender.cpp --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_BTsender.cpp 2014-04-25 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_BTsender.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 14.08.2013 -/// @version $Id: MSDevice_BTsender.cpp 16253 2014-04-25 12:09:01Z behrisch $ +/// @version $Id: MSDevice_BTsender.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A BT sender /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -88,10 +88,16 @@ MSDevice_BTsender::notifyEnter(SUMOVehicle& veh, Notification reason) { if (reason == MSMoveReminder::NOTIFICATION_DEPARTED && sVehicles.find(veh.getID()) == sVehicles.end()) { sVehicles[veh.getID()] = new VehicleInformation(veh.getID()); + sVehicles[veh.getID()]->route.push_back(veh.getEdge()); } - sVehicles[veh.getID()]->updates.push_back(VehicleState( - MSNet::getInstance()->getCurrentTimeStep(), veh.getSpeed(), static_cast(veh).getAngle(), static_cast(veh).getPosition(), static_cast(veh).getLane()->getID(), veh.getPositionOnLane() - )); + if (reason == MSMoveReminder::NOTIFICATION_TELEPORT && sVehicles.find(veh.getID()) != sVehicles.end()) { + sVehicles[veh.getID()]->amOnNet = true; + } + if (reason == MSMoveReminder::NOTIFICATION_TELEPORT || reason == MSMoveReminder::NOTIFICATION_JUNCTION) { + sVehicles[veh.getID()]->route.push_back(veh.getEdge()); + } + const MSVehicle& v = static_cast(veh); + sVehicles[veh.getID()]->updates.push_back(VehicleState(veh.getSpeed(), veh.getPosition(), v.getLane()->getID(), veh.getPositionOnLane(), v.getRoutePosition())); return true; } @@ -102,9 +108,8 @@ WRITE_WARNING("btsender: Can not update position of a vehicle that is not within the road network (" + veh.getID() + ")."); return true; } - sVehicles[veh.getID()]->updates.push_back(VehicleState( - MSNet::getInstance()->getCurrentTimeStep(), newSpeed, static_cast(veh).getAngle(), static_cast(veh).getPosition(), static_cast(veh).getLane()->getID(), newPos - )); + const MSVehicle& v = static_cast(veh); + sVehicles[veh.getID()]->updates.push_back(VehicleState(newSpeed, veh.getPosition(), v.getLane()->getID(), newPos, v.getRoutePosition())); return true; } @@ -118,13 +123,13 @@ WRITE_WARNING("btsender: Can not update position of a vehicle that is not within the road network (" + veh.getID() + ")."); return true; } - sVehicles[veh.getID()]->updates.push_back(VehicleState( - MSNet::getInstance()->getCurrentTimeStep(), veh.getSpeed(), static_cast(veh).getAngle(), static_cast(veh).getPosition(), static_cast(veh).getLane()->getID(), veh.getPositionOnLane() - )); + const MSVehicle& v = static_cast(veh); + sVehicles[veh.getID()]->updates.push_back(VehicleState(veh.getSpeed(), veh.getPosition(), v.getLane()->getID(), veh.getPositionOnLane(), v.getRoutePosition())); if (reason >= MSMoveReminder::NOTIFICATION_TELEPORT) { sVehicles[veh.getID()]->amOnNet = false; } if (reason >= MSMoveReminder::NOTIFICATION_ARRIVED) { + sVehicles[veh.getID()]->amOnNet = false; sVehicles[veh.getID()]->haveArrived = true; } return true; diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_BTsender.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_BTsender.h --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_BTsender.h 2014-04-25 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_BTsender.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 14.08.2013 -/// @version $Id: MSDevice_BTsender.h 16253 2014-04-25 12:09:01Z behrisch $ +/// @version $Id: MSDevice_BTsender.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A BT sender /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -136,31 +136,28 @@ class VehicleState { public: /** @brief Constructor - * @param[in] _time The current time * @param[in] _speed The speed of the vehicle - * @param[in] _angle The angle of the vehicle * @param[in] _position The position of the vehicle * @param[in] _laneID The id of the lane the vehicle is located at * @param[in] _lanePos The position of the vehicle along the lane */ - VehicleState(SUMOReal _time, SUMOReal _speed, SUMOReal _angle, const Position& _position, const std::string& _laneID, SUMOReal _lanePos) - : time(_time), speed(_speed), angle(_angle), position(_position), laneID(_laneID), lanePos(_lanePos) {} + VehicleState(const SUMOReal _speed, const Position& _position, const std::string& _laneID, + const SUMOReal _lanePos, const unsigned int _routePos) + : speed(_speed), position(_position), laneID(_laneID), lanePos(_lanePos), routePos(_routePos) {} /// @brief Destructor ~VehicleState() {} - /// @brief The current time - SUMOReal time; /// @brief The speed of the vehicle SUMOReal speed; - /// @brief The angle of the vehicle - SUMOReal angle; /// @brief The position of the vehicle Position position; /// @brief The lane the vehicle was at std::string laneID; /// @brief The position at the lane of the vehicle SUMOReal lanePos; + /// @brief The position in the route of the vehicle + unsigned int routePos; }; @@ -199,6 +196,9 @@ /// @brief Whether the vehicle was removed from the simulation bool haveArrived; + /// @brief List of edges travelled + ConstMSEdgeVector route; + }; diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Container.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Container.cpp --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Container.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Container.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,135 @@ +/****************************************************************************/ +/// @file MSDevice_Container.cpp +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Mon, 16 Jun 2014 +/// @version $Id: MSDevice_Container.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// A device which is used to keep track of containers riding with a vehicle +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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. +// +/****************************************************************************/ +#ifdef _MSC_VER +#include +#else +#include +#endif + +//#include +#include +//#include +#include +#include +#include +#include +#include "MSDevice_Container.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +// --------------------------------------------------------------------------- +// static initialisation methods +// --------------------------------------------------------------------------- +MSDevice_Container* +MSDevice_Container::buildVehicleDevices(SUMOVehicle& v, std::vector& into) { + MSDevice_Container* device = new MSDevice_Container(v, "container_" + v.getID()); + into.push_back(device); + return device; +} + + +// --------------------------------------------------------------------------- +// MSDevice_Container-methods +// --------------------------------------------------------------------------- +MSDevice_Container::MSDevice_Container(SUMOVehicle& holder, const std::string& id) + : MSDevice(holder, id), myContainers(), myStopped(holder.isStopped()) { +} + + +MSDevice_Container::~MSDevice_Container() { +} + + +bool +MSDevice_Container::notifyMove(SUMOVehicle& veh, SUMOReal /*oldPos*/, SUMOReal /*newPos*/, SUMOReal /*newSpeed*/) { + if (myStopped) { + // if veh is not anymore at the stop + if (!veh.isStopped()) { + for (std::vector::iterator i = myContainers.begin(); i != myContainers.end(); ++i) { + (*i)->setDeparted(MSNet::getInstance()->getCurrentTimeStep()); + } + myStopped = false; + } + } else { + if (veh.isStopped()) { + for (std::vector::iterator i = myContainers.begin(); i != myContainers.end();) { + MSContainer* container = *i; + if (&(container->getDestination()) == veh.getEdge()) { + if (!container->proceed(MSNet::getInstance(), MSNet::getInstance()->getCurrentTimeStep())) { + MSNet::getInstance()->getContainerControl().erase(container); + } + i = myContainers.erase(i); + } else { + ++i; + } + } + myStopped = true; + } + } + return true; +} + + +bool +MSDevice_Container::notifyEnter(SUMOVehicle& /*veh*/, MSMoveReminder::Notification reason) { + if (reason == MSMoveReminder::NOTIFICATION_DEPARTED) { + for (std::vector::iterator i = myContainers.begin(); i != myContainers.end(); ++i) { + (*i)->setDeparted(MSNet::getInstance()->getCurrentTimeStep()); + } + } + return true; +} + + +bool +MSDevice_Container::notifyLeave(SUMOVehicle& veh, SUMOReal /*lastPos*/, + MSMoveReminder::Notification reason) { + if (reason >= MSMoveReminder::NOTIFICATION_ARRIVED) { + for (std::vector::iterator i = myContainers.begin(); i != myContainers.end(); ++i) { + MSContainer* container = *i; + if (&(container->getDestination()) != veh.getEdge()) { + WRITE_WARNING("Teleporting container '" + container->getID() + + "' from vehicle destination '" + veh.getEdge()->getID() + + "' to intended destination '" + container->getDestination().getID() + "'"); + } + if (!container->proceed(MSNet::getInstance(), MSNet::getInstance()->getCurrentTimeStep())) { + MSNet::getInstance()->getContainerControl().erase(container); + }; + } + } + return true; +} + + +void +MSDevice_Container::addContainer(MSContainer* container) { + myContainers.push_back(container); +} + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Container.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Container.h --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Container.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Container.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,172 @@ +/****************************************************************************/ +/// @file MSDevice_Container.h +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Mon, 16 Jun 2014 +/// @version $Id: MSDevice_Container.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A device which is used to keep track of containers riding with a vehicle +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 MSDevice_Container_h +#define MSDevice_Container_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +//#include +#include +//#include +#include "MSDevice.h" +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSLane; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSDevice_Container + * @see MSDevice + */ +class MSDevice_Container : public MSDevice { +public: + /** @brief Build devices for the given vehicle, if needed + * + * The built device is stored in the given vector. + * + * @param[in] v The vehicle for which a device may be built + * @param[filled] into The vector to store the built device in + */ + static MSDevice_Container* buildVehicleDevices(SUMOVehicle& v, std::vector& into); + + + +public: + /// @brief Destructor. + ~MSDevice_Container(); + + + /// @name Methods called on vehicle movement / state change, overwriting MSDevice + /// @{ + + /** @brief Checks whether the vehicle is at a stop and container action is needed. + * @param[in] veh The regarded vehicle + * @param[in] oldPos Position before the move-micro-timestep. + * @param[in] newPos Position after the move-micro-timestep. + * @param[in] newSpeed The vehicle's current speed + * @return false, if the vehicle is beyond the lane, true otherwise + * @see MSMoveReminder + * @see MSMoveReminder::notifyMove + */ + bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed); + + + /** @brief Adds containers on vehicle insertion + * + * @param[in] veh The entering vehicle. + * @param[in] reason how the vehicle enters the lane + * @return Always true + * @see MSMoveReminder::notifyEnter + * @see MSMoveReminder::Notification + */ + bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason); + + + /** @brief Containers leaving on arrival + * + * @param[in] veh The leaving vehicle. + * @param[in] lastPos Position on the lane when leaving. + * @param[in] isArrival whether the vehicle arrived at its destination + * @param[in] isLaneChange whether the vehicle changed from the lane + * + * @return True if it did not leave the net. + */ + bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, + MSMoveReminder::Notification reason); + /// @} + + + + /** @brief Add a container + * + * @param[in] container The container to add. + */ + void addContainer(MSContainer* container); + + + /** @brief Return the number of containers + * @return The number of stored containers + */ + unsigned int size() const { + return static_cast(myContainers.size()); + } + + + /** @brief Returns the list of containers using this vehicle + * @return Containers within this vehicle + */ + const std::vector& getContainers() const { + return myContainers; + } + + + +private: + /** @brief Constructor + * + * @param[in] holder The vehicle that holds this device + * @param[in] id The ID of the device + */ + MSDevice_Container(SUMOVehicle& holder, const std::string& id); + + + +private: + /// @brief The containers of the vehicle + std::vector myContainers; + + /// @brief Whether the vehicle is at a stop + bool myStopped; + + + +private: + /// @brief Invalidated copy constructor. + MSDevice_Container(const MSDevice_Container&); + + /// @brief Invalidated assignment operator. + MSDevice_Container& operator=(const MSDevice_Container&); + + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice.cpp --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice.cpp 2014-04-29 22:02:43.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 14.08.2013 -/// @version $Id: MSDevice.cpp 16282 2014-04-29 16:05:03Z behrisch $ +/// @version $Id: MSDevice.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Abstract in-vehicle device /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,6 +36,7 @@ #include "MSDevice_Tripinfo.h" #include "MSDevice_Routing.h" #include "MSDevice_Person.h" +#include "MSDevice_Container.h" #include "MSDevice_Emissions.h" #include "MSDevice_BTreceiver.h" #include "MSDevice_BTsender.h" diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Emissions.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Emissions.cpp --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Emissions.cpp 2014-04-29 22:02:43.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Emissions.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Emissions.cpp 16282 2014-04-29 16:05:03Z behrisch $ +/// @version $Id: MSDevice_Emissions.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A device which collects vehicular emissions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Emissions.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Emissions.h --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Emissions.h 2014-04-25 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Emissions.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Emissions.h 16253 2014-04-25 12:09:01Z behrisch $ +/// @version $Id: MSDevice_Emissions.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A device which collects vehicular emissions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Example.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Example.cpp --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Example.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Example.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 11.06.2013 -/// @version $Id: MSDevice_Example.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSDevice_Example.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A device which stands as an implementation example and which outputs movereminder calls /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Example.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Example.h --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Example.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Example.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,11 +3,11 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date 11.06.2013 -/// @version $Id: MSDevice_Example.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSDevice_Example.h 17235 2014-11-03 10:53:02Z behrisch $ /// // A device which stands as an implementation example and which outputs movereminder calls /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ // Copyright (C) 200132014 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice.h --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Tue, 04 Dec 2007 -/// @version $Id: MSDevice.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSDevice.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Abstract in-vehicle device /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Person.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Person.cpp --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Person.cpp 2014-02-22 23:02:20.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Person.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Person.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSDevice_Person.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A device which is used to keep track of Persons riding with a vehicle /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include "MSDevice_Person.h" diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Person.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Person.h --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Person.h 2014-02-24 23:02:17.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Person.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Person.h 15707 2014-02-24 09:12:53Z dkrajzew $ +/// @version $Id: MSDevice_Person.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A device which is used to keep track of Persons riding with a vehicle /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Routing.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Routing.cpp --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Routing.cpp 2014-04-03 09:16:41.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Routing.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Christoph Sommer /// @author Jakob Erdmann /// @date Tue, 04 Dec 2007 -/// @version $Id: MSDevice_Routing.cpp 16107 2014-04-03 09:15:26Z behrisch $ +/// @version $Id: MSDevice_Routing.cpp 18103 2015-03-18 12:05:24Z namdre $ /// // A device that performs vehicle rerouting based on current edge speeds /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,11 +36,15 @@ #include #include #include +#include #include #include #include -#include -#include +#include +#include +#include +#include +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -53,10 +57,15 @@ std::vector MSDevice_Routing::myEdgeEfforts; Command* MSDevice_Routing::myEdgeWeightSettingCommand = 0; SUMOReal MSDevice_Routing::myAdaptationWeight; -SUMOTime MSDevice_Routing::myAdaptationInterval; +SUMOTime MSDevice_Routing::myAdaptationInterval = -1; +SUMOTime MSDevice_Routing::myLastAdaptation = -1; bool MSDevice_Routing::myWithTaz; std::map, const MSRoute*> MSDevice_Routing::myCachedRoutes; SUMOAbstractRouter* MSDevice_Routing::myRouter = 0; +SUMOReal MSDevice_Routing::myRandomizeWeightsFactor = 0; +#ifdef HAVE_FOX +FXWorkerThread::Pool MSDevice_Routing::myThreadPool; +#endif // =========================================================================== @@ -67,14 +76,13 @@ // --------------------------------------------------------------------------- void MSDevice_Routing::insertOptions(OptionsCont& oc) { - oc.addOptionSubTopic("Routing"); insertDefaultAssignmentOptions("rerouting", "Routing", oc); oc.doRegister("device.rerouting.period", new Option_String("0", "TIME")); oc.addSynonyme("device.rerouting.period", "device.routing.period", true); oc.addDescription("device.rerouting.period", "Routing", "The period with which the vehicle shall be rerouted"); - oc.doRegister("device.rerouting.pre-period", new Option_String("0", "TIME")); + oc.doRegister("device.rerouting.pre-period", new Option_String("1", "TIME")); oc.addSynonyme("device.rerouting.pre-period", "device.routing.pre-period", true); oc.addDescription("device.rerouting.pre-period", "Routing", "The rerouting period before depart"); @@ -88,13 +96,27 @@ oc.doRegister("device.rerouting.with-taz", new Option_Bool(false)); oc.addSynonyme("device.rerouting.with-taz", "device.routing.with-taz", true); + oc.addSynonyme("device.rerouting.with-taz", "with-taz"); 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"); + oc.doRegister("device.rerouting.shortest-path-file", new Option_FileName()); + oc.addDescription("device.rerouting.shortest-path-file", "Routing", "Initialize lookup table for astar from the given distance matrix"); + +#ifdef HAVE_FOX + oc.doRegister("device.rerouting.threads", new Option_Integer(0)); + oc.addDescription("device.rerouting.threads", "Routing", "The number of parallel execution threads used for rerouting"); +#endif + + oc.doRegister("device.rerouting.output", new Option_FileName()); + oc.addDescription("device.rerouting.output", "Routing", "Save adapting weights to FILE"); + myEdgeWeightSettingCommand = 0; myEdgeEfforts.clear(); + myAdaptationInterval = -1; + myLastAdaptation = -1; } @@ -110,17 +132,14 @@ if (needRerouting) { // route computation is enabled myWithTaz = oc.getBool("device.rerouting.with-taz"); - // build the device - MSDevice_Routing* device = new MSDevice_Routing(v, "routing_" + v.getID(), - string2time(oc.getString("device.rerouting.period")), - string2time(oc.getString("device.rerouting.pre-period"))); - into.push_back(device); + const SUMOTime period = string2time(oc.getString("device.rerouting.period")); + const SUMOTime prePeriod = string2time(oc.getString("device.rerouting.pre-period")); // initialise edge efforts if not done before if (myEdgeEfforts.size() == 0) { - const std::vector& edges = MSNet::getInstance()->getEdgeControl().getEdges(); + const MSEdgeVector& 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) { + const SUMOReal currentSecond = SIMTIME; + for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) { while ((*i)->getNumericalID() >= (int)myEdgeEfforts.size()) { myEdgeEfforts.push_back(0); } @@ -130,25 +149,33 @@ myEdgeEfforts[(*i)->getNumericalID()] = (*i)->getCurrentTravelTime(); } } + myLastAdaptation = MSNet::getInstance()->getCurrentTimeStep(); + myRandomizeWeightsFactor = oc.isSet("weights.random-factor") ? oc.getFloat("weights.random-factor") : 1; + if (myRandomizeWeightsFactor < 1) { + WRITE_ERROR("weights.random-factor cannot be less than 1"); + } } // make the weights be updated - if (myEdgeWeightSettingCommand == 0) { - myEdgeWeightSettingCommand = new StaticCommand< MSDevice_Routing >(&MSDevice_Routing::adaptEdgeEfforts); - MSNet::getInstance()->getEndOfTimestepEvents().addEvent( - myEdgeWeightSettingCommand, 0, MSEventControl::ADAPT_AFTER_EXECUTION); - myAdaptationWeight = oc.getFloat("device.rerouting.adaptation-weight"); + if (myAdaptationInterval == -1) { myAdaptationInterval = string2time(oc.getString("device.rerouting.adaptation-interval")); - } - if (myWithTaz) { - if (MSEdge::dictionary(v.getParameter().fromTaz + "-source") == 0) { - WRITE_ERROR("Source district '" + v.getParameter().fromTaz + "' not known when rerouting '" + v.getID() + "'!"); - return; + if (myAdaptationInterval < 0) { + WRITE_ERROR("Negative value for device.rerouting.adaptation-interval!"); + } + myAdaptationWeight = oc.getFloat("device.rerouting.adaptation-weight"); + if (myAdaptationWeight < 0. || myAdaptationWeight > 1.) { + WRITE_ERROR("The value for device.rerouting.adaptation-weight must be between 0 and 1!"); } - if (MSEdge::dictionary(v.getParameter().toTaz + "-sink") == 0) { - WRITE_ERROR("Destination district '" + v.getParameter().toTaz + "' not known when rerouting '" + v.getID() + "'!"); - return; + if (myAdaptationWeight < 1. && myAdaptationInterval > 0) { + myEdgeWeightSettingCommand = new StaticCommand(&MSDevice_Routing::adaptEdgeEfforts); + MSNet::getInstance()->getEndOfTimestepEvents()->addEvent( + myEdgeWeightSettingCommand, 0, MSEventControl::ADAPT_AFTER_EXECUTION); + } else if (period > 0) { + WRITE_WARNING("Rerouting is useless if the edge weights do not get updated!"); } + OutputDevice::createDeviceByOption("device.rerouting.output", "weights", "meandata_file.xsd"); } + // build the device + into.push_back(new MSDevice_Routing(v, "routing_" + v.getID(), period, prePeriod)); } } @@ -158,19 +185,20 @@ // --------------------------------------------------------------------------- MSDevice_Routing::MSDevice_Routing(SUMOVehicle& holder, const std::string& id, SUMOTime period, SUMOTime preInsertionPeriod) - : MSDevice(holder, id), myPeriod(period), myPreInsertionPeriod(preInsertionPeriod), myRerouteCommand(0) { - if (myWithTaz) { - myRerouteCommand = new WrappingCommand< MSDevice_Routing >(this, &MSDevice_Routing::preInsertionReroute); - MSNet::getInstance()->getInsertionEvents().addEvent( - myRerouteCommand, holder.getParameter().depart, - MSEventControl::ADAPT_AFTER_EXECUTION); - } + : MSDevice(holder, id), myPeriod(period), myPreInsertionPeriod(preInsertionPeriod), myLastRouting(-1), mySkipRouting(-1), myRerouteCommand(0) { + // we do always a pre insertion reroute to fill the best lanes of the vehicle with somehow meaningful values (especially for deaprtLane="best") + myRerouteCommand = new WrappingCommand(this, &MSDevice_Routing::preInsertionReroute); + // if we don't update the edge weights, we might as well reroute now and hopefully use our threads better + const SUMOTime execTime = myEdgeWeightSettingCommand == 0 ? 0 : holder.getParameter().depart; + MSNet::getInstance()->getInsertionEvents()->addEvent( + myRerouteCommand, execTime, + MSEventControl::ADAPT_AFTER_EXECUTION); } MSDevice_Routing::~MSDevice_Routing() { // make the rerouting command invalid if there is one - if (myRerouteCommand != 0) { + if (myRerouteCommand != 0 && MSNet::getInstance()->getInsertionEvents() != 0) { myRerouteCommand->deschedule(); } } @@ -179,19 +207,15 @@ bool MSDevice_Routing::notifyEnter(SUMOVehicle& /*veh*/, MSMoveReminder::Notification reason) { if (reason == MSMoveReminder::NOTIFICATION_DEPARTED) { - if (myRerouteCommand != 0) { // clean up pre depart rerouting - if (myPreInsertionPeriod > 0) { - myRerouteCommand->deschedule(); - } - myRerouteCommand = 0; - } - if (!myWithTaz) { - wrappedRerouteCommandExecute(MSNet::getInstance()->getCurrentTimeStep()); + // clean up pre depart rerouting + if (myPreInsertionPeriod > 0) { + myRerouteCommand->deschedule(); } + myRerouteCommand = 0; // build repetition trigger if routing shall be done more often if (myPeriod > 0) { - myRerouteCommand = new WrappingCommand< MSDevice_Routing >(this, &MSDevice_Routing::wrappedRerouteCommandExecute); - MSNet::getInstance()->getBeginOfTimestepEvents().addEvent( + myRerouteCommand = new WrappingCommand(this, &MSDevice_Routing::wrappedRerouteCommandExecute); + MSNet::getInstance()->getBeginOfTimestepEvents()->addEvent( myRerouteCommand, myPeriod + MSNet::getInstance()->getCurrentTimeStep(), MSEventControl::ADAPT_AFTER_EXECUTION); } @@ -201,26 +225,27 @@ SUMOTime -MSDevice_Routing::preInsertionReroute(SUMOTime currentTime) { - const MSEdge* source = MSEdge::dictionary(myHolder.getParameter().fromTaz + "-source"); - const MSEdge* dest = MSEdge::dictionary(myHolder.getParameter().toTaz + "-sink"); - if (source && dest) { +MSDevice_Routing::preInsertionReroute(const SUMOTime currentTime) { + if (mySkipRouting == currentTime) { + return DELTA_T; + } + const MSEdge* source = *myHolder.getRoute().begin(); + const MSEdge* dest = myHolder.getRoute().getLastEdge(); + if (source->getPurpose() == MSEdge::EDGEFUNCTION_DISTRICT && dest->getPurpose() == MSEdge::EDGEFUNCTION_DISTRICT) { const std::pair key = std::make_pair(source, dest); - if (myCachedRoutes.find(key) == myCachedRoutes.end()) { - myHolder.reroute(currentTime, getRouter(), true); - myCachedRoutes[key] = &myHolder.getRoute(); - myHolder.getRoute().addReference(); - } else { + if (myCachedRoutes.find(key) != myCachedRoutes.end()) { myHolder.replaceRoute(myCachedRoutes[key], true); + return myPreInsertionPeriod; } } + reroute(currentTime, true); return myPreInsertionPeriod; } SUMOTime MSDevice_Routing::wrappedRerouteCommandExecute(SUMOTime currentTime) { - myHolder.reroute(currentTime, getRouter()); + reroute(currentTime); return myPeriod; } @@ -229,53 +254,178 @@ MSDevice_Routing::getEffort(const MSEdge* const e, const SUMOVehicle* const v, SUMOReal) { const int id = e->getNumericalID(); if (id < (int)myEdgeEfforts.size()) { - return MAX2(myEdgeEfforts[id], e->getMinimumTravelTime(v)); + SUMOReal effort = MAX2(myEdgeEfforts[id], e->getMinimumTravelTime(v)); + if (myRandomizeWeightsFactor != 1) { + effort *= RandHelper::rand((SUMOReal)1, myRandomizeWeightsFactor); + } + return effort; } return 0; } SUMOTime -MSDevice_Routing::adaptEdgeEfforts(SUMOTime /*currentTime*/) { +MSDevice_Routing::adaptEdgeEfforts(SUMOTime currentTime) { + if (MSNet::getInstance()->getVehicleControl().getDepartedVehicleNo() == 0) { + return myAdaptationInterval; + } std::map, const MSRoute*>::iterator it = myCachedRoutes.begin(); for (; it != myCachedRoutes.end(); ++it) { it->second->release(); } myCachedRoutes.clear(); const SUMOReal newWeightFactor = (SUMOReal)(1. - myAdaptationWeight); - const std::vector& edges = MSNet::getInstance()->getEdgeControl().getEdges(); - for (std::vector::const_iterator i = edges.begin(); i != edges.end(); ++i) { + const MSEdgeVector& edges = MSNet::getInstance()->getEdgeControl().getEdges(); + for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) { const int id = (*i)->getNumericalID(); - myEdgeEfforts[id] = myEdgeEfforts[id] * myAdaptationWeight + (*i)->getCurrentTravelTime() * newWeightFactor; + const SUMOReal currTT = (*i)->getCurrentTravelTime(); + if (currTT != myEdgeEfforts[id]) { + myEdgeEfforts[id] = myEdgeEfforts[id] * myAdaptationWeight + currTT * newWeightFactor; + } + } + myLastAdaptation = currentTime + DELTA_T; // because we run at the end of the time step + if (OptionsCont::getOptions().isSet("device.rerouting.output")) { + OutputDevice& dev = OutputDevice::getDeviceByOption("device.rerouting.output"); + dev.openTag(SUMO_TAG_INTERVAL); + dev.writeAttr(SUMO_ATTR_ID, "device.rerouting"); + dev.writeAttr(SUMO_ATTR_BEGIN, STEPS2TIME(currentTime)); + dev.writeAttr(SUMO_ATTR_END, STEPS2TIME(currentTime + myAdaptationInterval)); + for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) { + const int id = (*i)->getNumericalID(); + dev.openTag(SUMO_TAG_EDGE); + dev.writeAttr(SUMO_ATTR_ID, (*i)->getID()); + dev.writeAttr("traveltime", myEdgeEfforts[id]); + dev.closeTag(); + } + dev.closeTag(); } return myAdaptationInterval; } -SUMOAbstractRouter& -MSDevice_Routing::getRouter() { - if (myRouter == 0) { - const std::string routingAlgorithm = OptionsCont::getOptions().getString("routing-algorithm"); +void +MSDevice_Routing::reroute(const SUMOTime currentTime, const bool onInit) { + //check whether the weights did change since the last reroute + if (myLastRouting >= myLastAdaptation) { + return; + } + myLastRouting = currentTime; +#ifdef HAVE_FOX + const bool needThread = (myRouter == 0 && myThreadPool.isFull()); +#else + const bool needThread = true; +#endif + if (needThread && myRouter == 0) { + OptionsCont& oc = OptionsCont::getOptions(); + const std::string routingAlgorithm = oc.getString("routing-algorithm"); + const bool mayHaveRestrictions = MSNet::getInstance()->hasRestrictions() || oc.getInt("remote-port") != 0; if (routingAlgorithm == "dijkstra") { - myRouter = new DijkstraRouterTT_ByProxi >( - MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort); + if (mayHaveRestrictions) { + myRouter = new DijkstraRouterTT >( + MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort); + } else { + myRouter = new DijkstraRouterTT >( + MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort); + } } else if (routingAlgorithm == "astar") { - myRouter = new AStarRouterTT_ByProxi >( - MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort); + if (mayHaveRestrictions) { + typedef AStarRouter > AStar; + const AStar::LookupTable* lookup = 0; + if (oc.isSet("device.rerouting.shortest-path-file")) { + lookup = AStar::createLookupTable(oc.getString("device.rerouting.shortest-path-file"), (int)MSEdge::numericalDictSize()); + } + myRouter = new AStar(MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort, lookup); + } else { + typedef AStarRouter > AStar; + const AStar::LookupTable* lookup = 0; + if (oc.isSet("device.rerouting.shortest-path-file")) { + lookup = AStar::createLookupTable(oc.getString("device.rerouting.shortest-path-file"), (int)MSEdge::numericalDictSize()); + } + myRouter = new AStar(MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort, lookup); + } + } else if (routingAlgorithm == "CH") { + const SUMOTime weightPeriod = myAdaptationInterval > 0 ? myAdaptationInterval : std::numeric_limits::max(); + if (mayHaveRestrictions) { + myRouter = new CHRouter >( + MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort, myHolder.getVClass(), weightPeriod, true); + } else { + myRouter = new CHRouter >( + MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort, myHolder.getVClass(), weightPeriod, false); + } + } else if (routingAlgorithm == "CHWrapper") { + const SUMOTime begin = string2time(oc.getString("begin")); + const SUMOTime weightPeriod = myAdaptationInterval > 0 ? myAdaptationInterval : std::numeric_limits::max(); + myRouter = new CHRouterWrapper >( + MSEdge::numericalDictSize(), true, &MSDevice_Routing::getEffort, begin, weightPeriod); } else { - throw ProcessError("Unknown routing Algorithm '" + routingAlgorithm + "'!"); + throw ProcessError("Unknown routing algorithm '" + routingAlgorithm + "'!"); + } + } +#ifdef HAVE_FOX + if (needThread) { + const int numThreads = OptionsCont::getOptions().getInt("device.rerouting.threads"); + if (myThreadPool.size() < numThreads) { + new WorkerThread(myThreadPool, myRouter); + } + if (myThreadPool.size() < numThreads) { + myRouter = 0; } } - return *myRouter; + if (myThreadPool.size() > 0) { + myThreadPool.add(new RoutingTask(myHolder, currentTime, onInit)); + return; + } +#endif + myHolder.reroute(currentTime, *myRouter, onInit, myWithTaz); } void MSDevice_Routing::cleanup() { +#ifdef HAVE_FOX + if (myThreadPool.size() > 0) { + // we cannot wait for the static destructor to do the cleanup + // because the output devices are gone by then + myThreadPool.clear(); + // router deletion is done in thread destructor + myRouter = 0; + return; + } +#endif delete myRouter; myRouter = 0; } +#ifdef HAVE_FOX +void +MSDevice_Routing::waitForAll() { + if (myThreadPool.size() > 0) { + myThreadPool.waitAll(); + } +} + + +// --------------------------------------------------------------------------- +// MSDevice_Routing::RoutingTask-methods +// --------------------------------------------------------------------------- +void +MSDevice_Routing::RoutingTask::run(FXWorkerThread* context) { + myVehicle.reroute(myTime, static_cast(context)->getRouter(), myOnInit, myWithTaz); + const MSEdge* source = *myVehicle.getRoute().begin(); + const MSEdge* dest = myVehicle.getRoute().getLastEdge(); + if (source->getPurpose() == MSEdge::EDGEFUNCTION_DISTRICT && dest->getPurpose() == MSEdge::EDGEFUNCTION_DISTRICT) { + const std::pair key = std::make_pair(source, dest); + lock(); + if (MSDevice_Routing::myCachedRoutes.find(key) == MSDevice_Routing::myCachedRoutes.end()) { + MSDevice_Routing::myCachedRoutes[key] = &myVehicle.getRoute(); + myVehicle.getRoute().addReference(); + } + unlock(); + } +} +#endif + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Routing.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Routing.h --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Routing.h 2014-04-02 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Routing.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Tue, 04 Dec 2007 -/// @version $Id: MSDevice_Routing.h 16099 2014-04-02 07:41:36Z behrisch $ +/// @version $Id: MSDevice_Routing.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A device that performs vehicle rerouting based on current edge speeds /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -37,10 +37,14 @@ #include #include #include -#include +#include #include #include "MSDevice.h" +#ifdef HAVE_FOX +#include +#endif + // =========================================================================== // class declarations @@ -99,6 +103,21 @@ /// @brief deletes the router instance static void cleanup(); + /// @brief returns whether any routing actions take place + static bool isEnabled() { + return !myWithTaz && !myEdgeEfforts.empty(); + } + +#ifdef HAVE_FOX + static void waitForAll(); + static void lock() { + myThreadPool.lock(); + } + static void unlock() { + myThreadPool.unlock(); + } +#endif + public: @@ -132,7 +151,64 @@ /// @} + /// @brief initiate the rerouting, create router / thread pool on first use + void reroute(const SUMOTime currentTime, const bool onInit = false); + + + /** @brief Labels the current time step as "unroutable". + * + * Sets mySkipRouting to the current time in order to skip rerouting. + * This is useful for pre insertion routing when we know in advance + * we cannot insert. + * + * @param[in] currentTime The current simulation time + */ + void skipRouting(const SUMOTime currentTime) { + mySkipRouting = currentTime; + } + + private: +#ifdef HAVE_FOX + /** + * @class WorkerThread + * @brief the thread which provides the router instance as context + */ + class WorkerThread : public FXWorkerThread { + public: + WorkerThread(FXWorkerThread::Pool& pool, + SUMOAbstractRouter* router) + : FXWorkerThread(pool), myRouter(router) {} + SUMOAbstractRouter& getRouter() const { + return *myRouter; + } + virtual ~WorkerThread() { + stop(); + delete myRouter; + } + private: + SUMOAbstractRouter* myRouter; + }; + + /** + * @class RoutingTask + * @brief the routing task which mainly calls reroute of the vehicle + */ + class RoutingTask : public FXWorkerThread::Task { + public: + RoutingTask(SUMOVehicle& v, const SUMOTime time, const bool onInit) + : myVehicle(v), myTime(time), myOnInit(onInit) {} + void run(FXWorkerThread* context); + private: + SUMOVehicle& myVehicle; + const SUMOTime myTime; + const bool myOnInit; + private: + /// @brief Invalidated assignment operator. + RoutingTask& operator=(const RoutingTask&); + }; +#endif + /** @brief Constructor * * @param[in] holder The vehicle that holds this device @@ -143,19 +219,18 @@ MSDevice_Routing(SUMOVehicle& holder, const std::string& id, SUMOTime period, SUMOTime preInsertionPeriod); - /** @brief Performs rerouting at insertion into the network + /** @brief Performs rerouting before insertion into the network * - * A new route is computed by calling the vehicle's "reroute" method, supplying - * "getEffort" as the edge effort retrieval method. + * A new route is computed by calling the reroute method. If the routing + * involves taz the internal route cache is asked beforehand. * * @param[in] currentTime The current simulation time - * @return The offset to the next call (the rerouting period "myPeriod") + * @return The offset to the next call (the rerouting period "myPreInsertionPeriod") * @see MSVehicle::reroute * @see MSEventHandler * @see WrappingCommand */ - SUMOTime preInsertionReroute(SUMOTime currentTime); - + SUMOTime preInsertionReroute(const SUMOTime currentTime); /** @brief Performs rerouting after a period * @@ -210,12 +285,6 @@ /// @} - - /// @brief get the router, initialize on first use - static SUMOAbstractRouter& getRouter(); - - - private: /// @brief The period with which a vehicle shall be rerouted SUMOTime myPeriod; @@ -223,6 +292,12 @@ /// @brief The period with which a vehicle shall be rerouted before insertion SUMOTime myPreInsertionPeriod; + /// @brief The last time a routing took place + SUMOTime myLastRouting; + + /// @brief The time for which routing may be skipped because we cannot be inserted + SUMOTime mySkipRouting; + /// @brief The (optional) command responsible for rerouting WrappingCommand< MSDevice_Routing >* myRerouteCommand; @@ -235,9 +310,12 @@ /// @brief Information which weight prior edge efforts have static SUMOReal myAdaptationWeight; - /// @brief Information which weight prior edge efforts have + /// @brief At which time interval the edge weights get updated static SUMOTime myAdaptationInterval; + /// @brief Information when the last edge weight adaptation occured + static SUMOTime myLastAdaptation; + /// @brief whether taz shall be used at initial rerouting static bool myWithTaz; @@ -247,6 +325,12 @@ /// @brief The router to use static SUMOAbstractRouter* myRouter; + /// @brief Whether to disturb edge weights dynamically + static SUMOReal myRandomizeWeightsFactor; + +#ifdef HAVE_FOX + static FXWorkerThread::Pool myThreadPool; +#endif private: /// @brief Invalidated copy constructor. diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Tripinfo.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Tripinfo.cpp --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Tripinfo.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Tripinfo.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Tripinfo.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSDevice_Tripinfo.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // A device which collects info on the vehicle trip /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -30,8 +30,10 @@ #include #endif +#include #include #include +#include #include #include #include @@ -41,6 +43,13 @@ #include #endif // CHECK_MEMORY_LEAKS +#define NOT_ARRIVED TIME2STEPS(-1) + + +// =========================================================================== +// static members +// =========================================================================== +MSDevice_Tripinfo::DeviceSet MSDevice_Tripinfo::myPendingOutput; // =========================================================================== // method definitions @@ -53,6 +62,7 @@ if (OptionsCont::getOptions().isSet("tripinfo-output")) { MSDevice_Tripinfo* device = new MSDevice_Tripinfo(v, "tripinfo_" + v.getID()); into.push_back(device); + myPendingOutput.insert(device); } } @@ -60,22 +70,42 @@ // --------------------------------------------------------------------------- // MSDevice_Tripinfo-methods // --------------------------------------------------------------------------- -MSDevice_Tripinfo::MSDevice_Tripinfo(SUMOVehicle& holder, const std::string& id) - : MSDevice(holder, id), myDepartLane(""), myDepartPos(-1), myDepartSpeed(-1), - myWaitingSteps(0), myArrivalTime(-1), myArrivalLane(""), myArrivalPos(-1), myArrivalSpeed(-1) { +MSDevice_Tripinfo::MSDevice_Tripinfo(SUMOVehicle& holder, const std::string& id) : + MSDevice(holder, id), + myDepartLane(""), + myDepartPos(-1), + myDepartSpeed(-1), + myWaitingSteps(0), + myArrivalTime(NOT_ARRIVED), + myArrivalLane(""), + myArrivalPos(-1), + myArrivalSpeed(-1), + myTimeLoss(0) { } MSDevice_Tripinfo::~MSDevice_Tripinfo() { + // ensure clean up for vaporized vehicles which do not generate output + myPendingOutput.erase(this); } bool -MSDevice_Tripinfo::notifyMove(SUMOVehicle& /*veh*/, SUMOReal /*oldPos*/, +MSDevice_Tripinfo::notifyMove(SUMOVehicle& veh, SUMOReal /*oldPos*/, SUMOReal /*newPos*/, SUMOReal newSpeed) { if (newSpeed <= SUMO_const_haltingSpeed) { myWaitingSteps++; } + // @note we are including the speed factor here, thus myTimeLoss can never be + // negative. The value is that of a driver who compares his travel time when + // the road is clear (which includes speed factor) with the actual travel time. + // @todo It might be usefull to recognize a departing vehicle and not + // count the time spent accelerating towards time loss since it is unavoidable + // (current interfaces do not give access to maximum acceleration) + const SUMOReal vmax = MIN2(veh.getMaxSpeed(), veh.getEdge()->getVehicleMaxSpeed(&veh)); + if (vmax > 0) { + myTimeLoss += TIME2STEPS(TS * (vmax - newSpeed) / vmax); + } return true; } @@ -103,7 +133,12 @@ } // @note vehicle may have moved past its arrivalPos during the last step // due to non-zero arrivalspeed but we consider it as arrived at the desired position - myArrivalPos = myHolder.getArrivalPos(); + // However, vaporization may happen anywhere (via TraCI) + if (reason == MSMoveReminder::NOTIFICATION_VAPORIZED) { + myArrivalPos = veh.getPositionOnLane(); + } else { + myArrivalPos = myHolder.getArrivalPos(); + } myArrivalSpeed = veh.getSpeed(); } return true; @@ -112,22 +147,45 @@ void MSDevice_Tripinfo::generateOutput() const { - SUMOReal routeLength = myHolder.getRoute().getLength(); + myPendingOutput.erase(this); + SUMOTime finalTime; + SUMOReal finalPos; + SUMOReal finalPosOnInternal = 0; + if (myArrivalTime == NOT_ARRIVED) { + finalTime = MSNet::getInstance()->getCurrentTimeStep(); + finalPos = myHolder.getPositionOnLane(); + if (!MSGlobals::gUseMesoSim) { + const MSLane* lane = static_cast(myHolder).getLane(); + if (lane->getEdge().isInternal()) { + finalPosOnInternal = finalPos; + finalPos = myHolder.getEdge()->getLength(); + } + } + } else { + finalTime = myArrivalTime; + finalPos = myArrivalPos; + } + const bool includeInternalLengths = MSGlobals::gUsingInternalLanes && MSNet::getInstance()->hasInternalLinks(); + const SUMOReal routeLength = myHolder.getRoute().getDistanceBetween(myDepartPos, finalPos, + myHolder.getRoute().begin(), myHolder.getCurrentRouteEdge(), includeInternalLengths) + finalPosOnInternal; + // write OutputDevice& os = OutputDevice::getDeviceByOption("tripinfo-output"); os.openTag("tripinfo").writeAttr("id", myHolder.getID()); - routeLength -= myDepartPos; - os.writeAttr("depart", time2string(myHolder.getDeparture())).writeAttr("departLane", myDepartLane) - .writeAttr("departPos", myDepartPos).writeAttr("departSpeed", myDepartSpeed) - .writeAttr("departDelay", time2string(myHolder.getDeparture() - myHolder.getParameter().depart)); - if (myArrivalLane != "") { - routeLength -= MSLane::dictionary(myArrivalLane)->getLength() - myArrivalPos; - } - os.writeAttr("arrival", time2string(myArrivalTime)).writeAttr("arrivalLane", myArrivalLane) - .writeAttr("arrivalPos", myArrivalPos).writeAttr("arrivalSpeed", myArrivalSpeed) - .writeAttr("duration", time2string(myArrivalTime - myHolder.getDeparture())) - .writeAttr("routeLength", routeLength).writeAttr("waitSteps", myWaitingSteps) - .writeAttr("rerouteNo", myHolder.getNumberReroutes()); + os.writeAttr("depart", time2string(myHolder.getDeparture())); + os.writeAttr("departLane", myDepartLane); + os.writeAttr("departPos", myDepartPos); + os.writeAttr("departSpeed", myDepartSpeed); + os.writeAttr("departDelay", time2string(myHolder.getDeparture() - myHolder.getParameter().depart)); + os.writeAttr("arrival", time2string(myArrivalTime)); + os.writeAttr("arrivalLane", myArrivalLane); + os.writeAttr("arrivalPos", myArrivalPos); + os.writeAttr("arrivalSpeed", myArrivalSpeed); + os.writeAttr("duration", time2string(finalTime - myHolder.getDeparture())); + os.writeAttr("routeLength", routeLength); + os.writeAttr("waitSteps", myWaitingSteps); + os.writeAttr("timeLoss", time2string(myTimeLoss)); + os.writeAttr("rerouteNo", myHolder.getNumberReroutes()); const std::vector& devices = myHolder.getDevices(); std::ostringstream str; for (std::vector::const_iterator i = devices.begin(); i != devices.end(); ++i) { @@ -136,10 +194,28 @@ } str << (*i)->getID(); } - os.writeAttr("devices", str.str()).writeAttr("vType", myHolder.getVehicleType().getID()) - .writeAttr("vaporized", (myHolder.getEdge() == *(myHolder.getRoute().end() - 1) ? "" : "0")); + os.writeAttr("devices", str.str()); + os.writeAttr("vType", myHolder.getVehicleType().getID()); + os.writeAttr("vaporized", (myHolder.getEdge() == *(myHolder.getRoute().end() - 1) ? "" : "0")); + // cannot close tag because emission device output might follow +} + + +void +MSDevice_Tripinfo::generateOutputForUnfinished() { + while (myPendingOutput.size() > 0) { + const MSDevice_Tripinfo* d = *myPendingOutput.begin(); + if (d->myHolder.hasDeparted()) { + d->generateOutput(); + // @todo also generate emission output if holder has a device + OutputDevice::getDeviceByOption("tripinfo-output").closeTag(); + } else { + myPendingOutput.erase(d); + } + } } + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Tripinfo.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Tripinfo.h --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Tripinfo.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Tripinfo.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Tripinfo.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSDevice_Tripinfo.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A device which collects info on the vehicle trip /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -65,7 +65,8 @@ */ static void buildVehicleDevices(SUMOVehicle& v, std::vector& into); - + /// @brief generate output for vehicles which are still in the network + static void generateOutputForUnfinished(); public: /// @brief Destructor. @@ -159,7 +160,12 @@ /// @brief The speed when arriving SUMOReal myArrivalSpeed; + /// @brief The time loss when compared to the desired and allowed speed + SUMOTime myTimeLoss; + /// @brief devices which may still need to produce output + typedef std::set > DeviceSet; + static DeviceSet myPendingOutput; private: /// @brief Invalidated copy constructor. diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Vehroutes.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Vehroutes.cpp --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Vehroutes.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Vehroutes.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Vehroutes.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSDevice_Vehroutes.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A device which collects info on the vehicle trip /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include "MSDevice_Vehroutes.h" @@ -50,11 +50,13 @@ // =========================================================================== bool MSDevice_Vehroutes::mySaveExits = false; bool MSDevice_Vehroutes::myLastRouteOnly = false; +bool MSDevice_Vehroutes::myDUAStyle = false; bool MSDevice_Vehroutes::mySorted = false; +bool MSDevice_Vehroutes::myIntendedDepart = false; bool MSDevice_Vehroutes::myWithTaz = false; MSDevice_Vehroutes::StateListener MSDevice_Vehroutes::myStateListener; std::map MSDevice_Vehroutes::myDepartureCounts; -std::map MSDevice_Vehroutes::myRouteInfos; +std::map > MSDevice_Vehroutes::myRouteInfos; // =========================================================================== @@ -69,7 +71,9 @@ OutputDevice::createDeviceByOption("vehroute-output", "routes", "routes_file.xsd"); mySaveExits = OptionsCont::getOptions().getBool("vehroute-output.exit-times"); myLastRouteOnly = OptionsCont::getOptions().getBool("vehroute-output.last-route"); - mySorted = OptionsCont::getOptions().getBool("vehroute-output.sorted"); + myDUAStyle = OptionsCont::getOptions().getBool("vehroute-output.dua"); + mySorted = myDUAStyle || OptionsCont::getOptions().getBool("vehroute-output.sorted"); + myIntendedDepart = OptionsCont::getOptions().getBool("vehroute-output.intended-depart"); myWithTaz = OptionsCont::getOptions().getBool("device.rerouting.with-taz"); MSNet::getInstance()->addVehicleStateListener(&myStateListener); } @@ -125,7 +129,8 @@ bool MSDevice_Vehroutes::notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) { if (mySorted && reason == NOTIFICATION_DEPARTED && myStateListener.myDevices[&veh] == this) { - myDepartureCounts[MSNet::getInstance()->getCurrentTimeStep()]++; + const SUMOTime departure = myIntendedDepart ? myHolder.getParameter().depart : MSNet::getInstance()->getCurrentTimeStep(); + myDepartureCounts[departure]++; } return mySaveExits; } @@ -136,7 +141,7 @@ if (mySaveExits && reason != NOTIFICATION_LANE_CHANGE) { if (reason != NOTIFICATION_TELEPORT && myLastSavedAt == veh.getEdge()) { // need to check this for internal lanes myExits.back() = MSNet::getInstance()->getCurrentTimeStep(); - } else { + } else if (myLastSavedAt != veh.getEdge()) { myExits.push_back(MSNet::getInstance()->getCurrentTimeStep()); myLastSavedAt = veh.getEdge(); } @@ -212,35 +217,65 @@ MSDevice_Vehroutes::generateOutput() const { OutputDevice& routeOut = OutputDevice::getDeviceByOption("vehroute-output"); OutputDevice_String od(routeOut.isBinary(), 1); + const SUMOTime departure = myIntendedDepart ? myHolder.getParameter().depart : myHolder.getDeparture(); od.openTag(SUMO_TAG_VEHICLE).writeAttr(SUMO_ATTR_ID, myHolder.getID()); if (myHolder.getVehicleType().getID() != DEFAULT_VTYPE_ID) { od.writeAttr(SUMO_ATTR_TYPE, myHolder.getVehicleType().getID()); } - od.writeAttr(SUMO_ATTR_DEPART, time2string(myHolder.getDeparture())); + od.writeAttr(SUMO_ATTR_DEPART, time2string(departure)); if (myHolder.hasArrived()) { od.writeAttr("arrival", time2string(MSNet::getInstance()->getCurrentTimeStep())); } if (myWithTaz) { od.writeAttr(SUMO_ATTR_FROM_TAZ, myHolder.getParameter().fromTaz).writeAttr(SUMO_ATTR_TO_TAZ, myHolder.getParameter().toTaz); } - if (myReplacedRoutes.size() > 0) { - od.openTag(SUMO_TAG_ROUTE_DISTRIBUTION); - for (unsigned int i = 0; i < myReplacedRoutes.size(); ++i) { - writeXMLRoute(od, i); + if (myDUAStyle) { + const RandomDistributor* const routeDist = MSRoute::distDictionary("!" + myHolder.getID()); + if (routeDist != 0) { + const std::vector& routes = routeDist->getVals(); + unsigned index = 0; + while (index < routes.size() && routes[index] != myCurrentRoute) { + ++index; + } + od.openTag(SUMO_TAG_ROUTE_DISTRIBUTION).writeAttr(SUMO_ATTR_LAST, index); + const std::vector& probs = routeDist->getProbs(); + for (unsigned int i = 0; i < routes.size(); ++i) { + od.setPrecision(); + od.openTag(SUMO_TAG_ROUTE).writeAttr(SUMO_ATTR_COST, routes[i]->getCosts()); + od.setPrecision(8); + od.writeAttr(SUMO_ATTR_PROB, probs[i]); + od.setPrecision(); + od << " edges=\""; + routes[i]->writeEdgeIDs(od, *routes[i]->begin()); + (od << "\"").closeTag(); + } + od.closeTag(); + } else { + writeXMLRoute(od); + } + } else { + if (myReplacedRoutes.size() > 0) { + od.openTag(SUMO_TAG_ROUTE_DISTRIBUTION); + for (unsigned int i = 0; i < myReplacedRoutes.size(); ++i) { + writeXMLRoute(od, i); + } + } + writeXMLRoute(od); + if (myReplacedRoutes.size() > 0) { + od.closeTag(); } - } - writeXMLRoute(od); - if (myReplacedRoutes.size() > 0) { - od.closeTag(); } od.closeTag(); od.lf(); if (mySorted) { - myRouteInfos[myHolder.getDeparture()] += od.getString(); - myDepartureCounts[myHolder.getDeparture()]--; + myRouteInfos[departure][myHolder.getID()] = od.getString(); + myDepartureCounts[departure]--; std::map::iterator it = myDepartureCounts.begin(); while (it != myDepartureCounts.end() && it->second == 0) { - routeOut << myRouteInfos[it->first]; + std::map& infos = myRouteInfos[it->first]; + for (std::map::const_iterator it2 = infos.begin(); it2 != infos.end(); ++it2) { + routeOut << it2->second; + } myRouteInfos.erase(it->first); myDepartureCounts.erase(it); it = myDepartureCounts.begin(); diff -Nru sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Vehroutes.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Vehroutes.h --- sumo-0.21.0+dfsg/src/microsim/devices/MSDevice_Vehroutes.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/devices/MSDevice_Vehroutes.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Fri, 30.01.2009 -/// @version $Id: MSDevice_Vehroutes.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSDevice_Vehroutes.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A device which collects info on the vehicle trip /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -163,9 +163,15 @@ /// @brief A shortcut for the Option "vehroute-output.last-route" static bool myLastRouteOnly; + /// @brief A shortcut for the Option "vehroute-output.dua" + static bool myDUAStyle; + /// @brief A shortcut for the Option "vehroute-output.sorted" static bool mySorted; + /// @brief A shortcut for the Option "vehroute-output.intended-depart" + static bool myIntendedDepart; + /// @brief A shortcut for the Option "device.routing.with-taz" static bool myWithTaz; @@ -197,7 +203,7 @@ static std::map myDepartureCounts; /// @todo: describe - static std::map myRouteInfos; + static std::map > myRouteInfos; /** diff -Nru sumo-0.21.0+dfsg/src/microsim/lcmodels/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/Makefile.am --- sumo-0.21.0+dfsg/src/microsim/lcmodels/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,8 @@ +noinst_LIBRARIES = libmicrosimlcmodels.a + +libmicrosimlcmodels_a_SOURCES = MSAbstractLaneChangeModel.cpp \ +MSAbstractLaneChangeModel.h \ +MSLCM_DK2008.cpp MSLCM_DK2008.h \ +MSLCM_LC2013.cpp MSLCM_LC2013.h \ +MSLCM_JE2013.cpp MSLCM_JE2013.h + diff -Nru sumo-0.21.0+dfsg/src/microsim/lcmodels/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/Makefile.in --- sumo-0.21.0+dfsg/src/microsim/lcmodels/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,624 @@ +# Makefile.in generated by automake 1.13.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +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/microsim/lcmodels +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +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 +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libmicrosimlcmodels_a_AR = $(AR) $(ARFLAGS) +libmicrosimlcmodels_a_LIBADD = +am_libmicrosimlcmodels_a_OBJECTS = \ + MSAbstractLaneChangeModel.$(OBJEXT) MSLCM_DK2008.$(OBJEXT) \ + MSLCM_LC2013.$(OBJEXT) MSLCM_JE2013.$(OBJEXT) +libmicrosimlcmodels_a_OBJECTS = $(am_libmicrosimlcmodels_a_OBJECTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +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) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libmicrosimlcmodels_a_SOURCES) +DIST_SOURCES = $(libmicrosimlcmodels_a_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +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@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +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_CONFIG = @FOX_CONFIG@ +FOX_LDFLAGS = @FOX_LDFLAGS@ +GDAL_CONFIG = @GDAL_CONFIG@ +GDAL_LDFLAGS = @GDAL_LDFLAGS@ +GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ +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_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 = libmicrosimlcmodels.a +libmicrosimlcmodels_a_SOURCES = MSAbstractLaneChangeModel.cpp \ +MSAbstractLaneChangeModel.h \ +MSLCM_DK2008.cpp MSLCM_DK2008.h \ +MSLCM_LC2013.cpp MSLCM_LC2013.h \ +MSLCM_JE2013.cpp MSLCM_JE2013.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/microsim/lcmodels/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/microsim/lcmodels/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) + +libmicrosimlcmodels.a: $(libmicrosimlcmodels_a_OBJECTS) $(libmicrosimlcmodels_a_DEPENDENCIES) $(EXTRA_libmicrosimlcmodels_a_DEPENDENCIES) + $(AM_V_at)-rm -f libmicrosimlcmodels.a + $(AM_V_AR)$(libmicrosimlcmodels_a_AR) libmicrosimlcmodels.a $(libmicrosimlcmodels_a_OBJECTS) $(libmicrosimlcmodels_a_LIBADD) + $(AM_V_at)$(RANLIB) libmicrosimlcmodels.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSAbstractLaneChangeModel.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLCM_DK2008.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLCM_JE2013.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLCM_LC2013.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + 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-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + 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" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +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 TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \ + ctags-am 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 tags-am 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.21.0+dfsg/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp --- sumo-0.21.0+dfsg/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,221 @@ +/****************************************************************************/ +/// @file MSAbstractLaneChangeModel.h +/// @author Daniel Krajzewicz +/// @author Friedemann Wesner +/// @author Sascha Krieg +/// @author Michael Behrisch +/// @author Jakob Erdmann +/// @date Fri, 29.04.2005 +/// @version $Id: MSAbstractLaneChangeModel.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Interface for lane-change models +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "MSAbstractLaneChangeModel.h" +#include "MSLCM_DK2008.h" +#include "MSLCM_LC2013.h" +#include "MSLCM_JE2013.h" +#include +#include +#include +#include + +/* ------------------------------------------------------------------------- + * static members + * ----------------------------------------------------------------------- */ +bool MSAbstractLaneChangeModel::myAllowOvertakingRight(false); + +/* ------------------------------------------------------------------------- + * MSAbstractLaneChangeModel-methods + * ----------------------------------------------------------------------- */ + +void +MSAbstractLaneChangeModel::initGlobalOptions(const OptionsCont& oc) { + myAllowOvertakingRight = oc.getBool("lanechange.overtake-right"); +} + + +MSAbstractLaneChangeModel* +MSAbstractLaneChangeModel::build(LaneChangeModel lcm, MSVehicle& v) { + switch (lcm) { + case LCM_DK2008: + return new MSLCM_DK2008(v); + case LCM_LC2013: + return new MSLCM_LC2013(v); + case LCM_JE2013: + return new MSLCM_JE2013(v); + default: + throw ProcessError("Lane change model '" + toString(lcm) + "' not implemented"); + } +} + + +MSAbstractLaneChangeModel::MSAbstractLaneChangeModel(MSVehicle& v) : + myVehicle(v), + myOwnState(0), + myLaneChangeCompletion(1.0), + myLaneChangeDirection(0), + myLaneChangeMidpointPassed(false), + myAlreadyMoved(false), + myShadowLane(0), + myHaveShadow(false), + myCarFollowModel(v.getCarFollowModel()), + myLastLaneChangeOffset(0) { +} + + +MSAbstractLaneChangeModel::~MSAbstractLaneChangeModel() { + if (myShadowLane != 0 && myHaveShadow) { + myShadowLane->removeVehicle(&myVehicle, MSMoveReminder::NOTIFICATION_VAPORIZED, false); + } +} + + +bool +MSAbstractLaneChangeModel::congested(const MSVehicle* const neighLeader) { + if (neighLeader == 0) { + return false; + } + // 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()->getSpeedLimit() <= 70.0 / 3.6) || (neighLeader->getLane()->getSpeedLimit() <= 70.0 / 3.6)) { + + return false; + } + if (myVehicle.congested() && neighLeader->congested()) { + return true; + } + return false; +} + + +bool +MSAbstractLaneChangeModel::predInteraction(const MSVehicle* const leader) { + if (leader == 0) { + return false; + } + // let's check it on highways only + if (leader->getSpeed() < (80.0 / 3.6)) { + return false; + } + SUMOReal gap = leader->getPositionOnLane() - leader->getVehicleType().getLength() - myVehicle.getVehicleType().getMinGap() - myVehicle.getPositionOnLane(); + return gap < myCarFollowModel.interactionGap(&myVehicle, leader->getSpeed()); +} + + +bool +MSAbstractLaneChangeModel::startLaneChangeManeuver(MSLane* source, MSLane* target, int direction) { + target->enteredByLaneChange(&myVehicle); + if (MSGlobals::gLaneChangeDuration > DELTA_T) { + myLaneChangeCompletion = 0; + myShadowLane = target; + myHaveShadow = true; + myLaneChangeMidpointPassed = false; + myLaneChangeDirection = direction; + continueLaneChangeManeuver(false); + return true; + } else { + myVehicle.leaveLane(MSMoveReminder::NOTIFICATION_LANE_CHANGE); + source->leftByLaneChange(&myVehicle); + myVehicle.enterLaneAtLaneChange(target); + changed(direction); + return false; + } +} + + +void +MSAbstractLaneChangeModel::continueLaneChangeManeuver(bool moved) { + if (moved && myHaveShadow) { + // move shadow to next lane + removeLaneChangeShadow(); + const int shadowDirection = myLaneChangeMidpointPassed ? -myLaneChangeDirection : myLaneChangeDirection; + myShadowLane = myVehicle.getLane()->getParallelLane(shadowDirection); + if (myShadowLane == 0) { + // abort lane change + WRITE_WARNING("Vehicle '" + myVehicle.getID() + "' could not finish continuous lane change (lane disappeared) time=" + + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); + endLaneChangeManeuver(); + return; + } + myHaveShadow = true; + } + myLaneChangeCompletion += (SUMOReal)DELTA_T / (SUMOReal)MSGlobals::gLaneChangeDuration; + if (!myLaneChangeMidpointPassed && myLaneChangeCompletion >= + myVehicle.getLane()->getWidth() / (myVehicle.getLane()->getWidth() + myShadowLane->getWidth())) { + // maneuver midpoint reached, swap myLane and myShadowLane + myLaneChangeMidpointPassed = true; + MSLane* tmp = myVehicle.getLane(); + myVehicle.leaveLane(MSMoveReminder::NOTIFICATION_LANE_CHANGE); + myVehicle.enterLaneAtLaneChange(myShadowLane); + myShadowLane = tmp; + if (myVehicle.fixPosition()) { + WRITE_WARNING("vehicle '" + myVehicle.getID() + "' set back by " + toString(myVehicle.getPositionOnLane() - myVehicle.getLane()->getLength()) + + "m when changing lanes on lane '" + myVehicle.getLane()->getID() + " time=" + + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); + } + changed(myLaneChangeDirection); + myAlreadyMoved = true; + } + // remove shadow as soon as the vehicle leaves the original lane geometrically + if (myLaneChangeMidpointPassed && myHaveShadow) { + const SUMOReal sourceHalfWidth = myShadowLane->getWidth() / 2.0; + const SUMOReal targetHalfWidth = myVehicle.getLane()->getWidth() / 2.0; + if (myLaneChangeCompletion * (sourceHalfWidth + targetHalfWidth) - myVehicle.getVehicleType().getWidth() / 2.0 > sourceHalfWidth) { + removeLaneChangeShadow(); + } + } + // finish maneuver + if (!isChangingLanes()) { + assert(myLaneChangeMidpointPassed); + endLaneChangeManeuver(); + } +} + + +void +MSAbstractLaneChangeModel::removeLaneChangeShadow() { + if (myShadowLane != 0 && myHaveShadow) { + myShadowLane->removeVehicle(&myVehicle, MSMoveReminder::NOTIFICATION_LANE_CHANGE); + myHaveShadow = false; + } +} + + +bool +MSAbstractLaneChangeModel::cancelRequest(int state) { + int ret = myVehicle.influenceChangeDecision(state); + return ret != state; +} + + +void +MSAbstractLaneChangeModel::initLastLaneChangeOffset(int dir) { + if (dir > 0) { + myLastLaneChangeOffset = 1; + } else if (dir < 0) { + myLastLaneChangeOffset = -1; + } +} diff -Nru sumo-0.21.0+dfsg/src/microsim/lcmodels/MSAbstractLaneChangeModel.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSAbstractLaneChangeModel.h --- sumo-0.21.0+dfsg/src/microsim/lcmodels/MSAbstractLaneChangeModel.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSAbstractLaneChangeModel.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,377 @@ +/****************************************************************************/ +/// @file MSAbstractLaneChangeModel.h +/// @author Daniel Krajzewicz +/// @author Friedemann Wesner +/// @author Sascha Krieg +/// @author Michael Behrisch +/// @author Jakob Erdmann +/// @date Fri, 29.04.2005 +/// @version $Id: MSAbstractLaneChangeModel.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Interface for lane-change models +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 MSAbstractLaneChangeModel_h +#define MSAbstractLaneChangeModel_h + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include + +class MSLane; + +// =========================================================================== +// used enumeration +// =========================================================================== +/** @enum LaneChangeAction + * @brief A try to store the state of a vehicle's lane-change wish in an int + */ +enum LaneChangeAction { + /// @name currently wanted lane-change action + /// @{ + + /// @brief No action desired + LCA_NONE = 0, + /// @brief Needs to stay on the current lane + LCA_STAY = 1 << 0, + /// @brief Wants go to the left + LCA_LEFT = 1 << 1, + /// @brief Wants go to the right + LCA_RIGHT = 1 << 2, + + /// @brief The action is needed to follow the route (navigational lc) + LCA_STRATEGIC = 1 << 3, + /// @brief The action is done to help someone else + LCA_COOPERATIVE = 1 << 4, + /// @brief The action is due to the wish to be faster (tactical lc) + LCA_SPEEDGAIN = 1 << 5, + /// @brief The action is due to the default of keeping right "Rechtsfahrgebot" + LCA_KEEPRIGHT = 1 << 6, + /// @brief The action is due to a TraCI request + LCA_TRACI = 1 << 7, + + /// @brief The action is urgent (to be defined by lc-model) + LCA_URGENT = 1 << 8, + + LCA_WANTS_LANECHANGE = LCA_LEFT | LCA_RIGHT, + LCA_WANTS_LANECHANGE_OR_STAY = LCA_WANTS_LANECHANGE | LCA_STAY, + /// @} + + /// @name External state + /// @{ + + /// @brief The vehicle is blocked by left leader + LCA_BLOCKED_BY_LEFT_LEADER = 1 << 9, + /// @brief The vehicle is blocked by left follower + LCA_BLOCKED_BY_LEFT_FOLLOWER = 1 << 10, + + /// @brief The vehicle is blocked by right leader + LCA_BLOCKED_BY_RIGHT_LEADER = 1 << 11, + /// @brief The vehicle is blocked by right follower + LCA_BLOCKED_BY_RIGHT_FOLLOWER = 1 << 12, + + // The vehicle is blocked being overlapping + LCA_OVERLAPPING = 1 << 13, + + LCA_BLOCKED_LEFT = LCA_BLOCKED_BY_LEFT_LEADER | LCA_BLOCKED_BY_LEFT_FOLLOWER, + LCA_BLOCKED_RIGHT = LCA_BLOCKED_BY_RIGHT_LEADER | LCA_BLOCKED_BY_RIGHT_FOLLOWER, + LCA_BLOCKED_BY_LEADER = LCA_BLOCKED_BY_LEFT_LEADER | LCA_BLOCKED_BY_RIGHT_LEADER, + LCA_BLOCKED_BY_FOLLOWER = LCA_BLOCKED_BY_LEFT_FOLLOWER | LCA_BLOCKED_BY_RIGHT_FOLLOWER, + LCA_BLOCKED = LCA_BLOCKED_LEFT | LCA_BLOCKED_RIGHT + + /// @} + +}; + + + + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSAbstractLaneChangeModel + * @brief Interface for lane-change models + */ +class MSAbstractLaneChangeModel { +public: + + /** @class MSLCMessager + * @brief A class responsible for exchanging messages between cars involved in lane-change interaction + */ + class MSLCMessager { + public: + /** @brief Constructor + * @param[in] leader The leader on the informed vehicle's lane + * @param[in] neighLead The leader on the lane the vehicle want to change to + * @param[in] neighFollow The follower on the lane the vehicle want to change to + */ + MSLCMessager(MSVehicle* leader, MSVehicle* neighLead, MSVehicle* neighFollow) + : myLeader(leader), myNeighLeader(neighLead), + myNeighFollower(neighFollow) { } + + + /// @brief Destructor + ~MSLCMessager() { } + + + /** @brief Informs the leader on the same lane + * @param[in] info The information to pass + * @param[in] sender The sending vehicle (the lane changing vehicle) + * @return Something!? + */ + void* informLeader(void* info, MSVehicle* sender) { + assert(myLeader != 0); + return myLeader->getLaneChangeModel().inform(info, sender); + } + + + /** @brief Informs the leader on the desired lane + * @param[in] info The information to pass + * @param[in] sender The sending vehicle (the lane changing vehicle) + * @return Something!? + */ + void* informNeighLeader(void* info, MSVehicle* sender) { + assert(myNeighLeader != 0); + return myNeighLeader->getLaneChangeModel().inform(info, sender); + } + + + /** @brief Informs the follower on the desired lane + * @param[in] info The information to pass + * @param[in] sender The sending vehicle (the lane changing vehicle) + * @return Something!? + */ + void* informNeighFollower(void* info, MSVehicle* sender) { + assert(myNeighFollower != 0); + return myNeighFollower->getLaneChangeModel().inform(info, sender); + } + + + private: + /// @brief The leader on the informed vehicle's lane + MSVehicle* myLeader; + /// @brief The leader on the lane the vehicle want to change to + MSVehicle* myNeighLeader; + /// @brief The follower on the lane the vehicle want to change to + MSVehicle* myNeighFollower; + + }; + + /// @brief init global model parameters + void static initGlobalOptions(const OptionsCont& oc); + + /** @brief Factory method for instantiating new lane changing models + * @param[in] lcm The type of model to build + * @param[in] vehicle The vehicle for which this model shall be built + */ + static MSAbstractLaneChangeModel* build(LaneChangeModel lcm, MSVehicle& vehicle); + + /** @brief Constructor + * @param[in] v The vehicle this lane-changer belongs to + */ + MSAbstractLaneChangeModel(MSVehicle& v); + + /// @brief Destructor + virtual ~MSAbstractLaneChangeModel(); + + inline int getOwnState() const { + return myOwnState; + } + + inline void setOwnState(int state) { + myOwnState = state; + } + + virtual void prepareStep() { } + + /** @brief Called to examine whether the vehicle wants to change + * using the given laneOffset. + * This method gets the information about the surrounding vehicles + * and whether another lane may be more preferable */ + virtual int wantsChange( + int laneOffset, + MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked) = 0; + + virtual void* inform(void* info, MSVehicle* sender) = 0; + + /** @brief Called to adapt the speed in order to allow a lane change. + * + * It is guaranteed that min<=wanted<=max, but the implementation needs + * to make sure that the return value is between min and max. + * + * @param min The minimum resulting speed + * @param wanted The aspired speed of the car following model + * @param max The maximum resulting speed + * @param cfModel The model used + * @return the new speed of the vehicle as proposed by the lane changer + */ + virtual SUMOReal patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, + const MSCFModel& cfModel) = 0; + + virtual void changed(int dir) = 0; + + void unchanged() { + if (myLastLaneChangeOffset > 0) { + myLastLaneChangeOffset += DELTA_T; + } else if (myLastLaneChangeOffset < 0) { + myLastLaneChangeOffset -= DELTA_T; + } + } + + /** @brief Returns the lane the vehicles shadow is on during continuouss lane change + * @return The vehicle's shadow lane + */ + MSLane* getShadowLane() const { + return myShadowLane; + } + + + inline SUMOTime getLastLaneChangeOffset() const { + return myLastLaneChangeOffset; + } + + + /// @brief return whether the vehicle passed the midpoint of a continuous lane change maneuver + inline bool isLaneChangeMidpointPassed() const { + return myLaneChangeMidpointPassed; + } + + /// @brief return whether the vehicle passed the midpoint of a continuous lane change maneuver + inline SUMOReal getLaneChangeCompletion() const { + return myLaneChangeCompletion; + } + + /// @brief return true if the vehicle currently performs a lane change maneuver + inline bool isChangingLanes() const { + return myLaneChangeCompletion < (1 - NUMERICAL_EPS); + } + + /// @brief return the direction of the current lane change maneuver + inline int getLaneChangeDirection() const { + return myLaneChangeDirection; + } + + /// @brief reset the flag whether a vehicle already moved to false + inline bool alreadyMoved() const { + return myAlreadyMoved; + } + + /// @brief reset the flag whether a vehicle already moved to false + void resetMoved() { + myAlreadyMoved = false; + } + + + /// @brief start the lane change maneuver and return whether it continues + bool startLaneChangeManeuver(MSLane* source, MSLane* target, int direction); + + + /* @brief continue the lane change maneuver + * @param[in] moved Whether the vehicle has moved to a new lane + */ + void continueLaneChangeManeuver(bool moved); + + /* @brief finish the lane change maneuver + */ + inline void endLaneChangeManeuver() { + removeLaneChangeShadow(); + myLaneChangeCompletion = 1; + myShadowLane = 0; + } + + /// @brief remove the shadow copy of a lane change maneuver + void removeLaneChangeShadow(); + + /// @brief reserve space at the end of the lane to avoid dead locks + virtual void saveBlockerLength(SUMOReal length) { + UNUSED_PARAMETER(length); + }; + +protected: + virtual bool congested(const MSVehicle* const neighLeader); + + virtual bool predInteraction(const MSVehicle* const leader); + + /// @brief whether the influencer cancels the given request + bool cancelRequest(int state); + + +protected: + /// @brief The vehicle this lane-changer belongs to + MSVehicle& myVehicle; + + /// @brief The current state of the vehicle + int myOwnState; + + /// @brief progress of the lane change maneuver 0:started, 1:complete + SUMOReal myLaneChangeCompletion; + + /// @brief direction of the lane change maneuver -1 means right, 1 means left + int myLaneChangeDirection; + + /// @brief whether myLane has already been set to the target of the lane-change maneuver + bool myLaneChangeMidpointPassed; + + /// @brief whether the vehicle has already moved this step + bool myAlreadyMoved; + + /// @brief The lane the vehicle shadow is on during a continuous lane change + MSLane* myShadowLane; + + /// Wether a vehicle shadow exists + bool myHaveShadow; + + /// @brief The vehicle's car following model + const MSCFModel& myCarFollowModel; + + /* @brief to be called by derived classes in their changed() method. + * If dir=0 is given, the current value remains unchanged */ + void initLastLaneChangeOffset(int dir); + + /// @brief whether overtaking on the right is permitted + static bool myAllowOvertakingRight; + +private: + /* @brief information how long ago the vehicle has performed a lane-change, + * sign indicates direction of the last change + */ + SUMOTime myLastLaneChangeOffset; + + + +private: + /// @brief Invalidated assignment operator + MSAbstractLaneChangeModel& operator=(const MSAbstractLaneChangeModel& s); +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/lcmodels/MSLCM_DK2008.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSLCM_DK2008.cpp --- sumo-0.21.0+dfsg/src/microsim/lcmodels/MSLCM_DK2008.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSLCM_DK2008.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,680 @@ +/****************************************************************************/ +/// @file MSLCM_DK2008.cpp +/// @author Daniel Krajzewicz +/// @author Friedemann Wesner +/// @author Sascha Krieg +/// @author Michael Behrisch +/// @author Jakob Erdmann +/// @date Tue, 29.05.2005 +/// @version $Id: MSLCM_DK2008.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A lane change model developed by D. Krajzewicz between 2004 and 2010 +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 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 "MSLCM_DK2008.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + +//#define DEBUG_VEHICLE_GUI_SELECTION 1 +#ifdef DEBUG_VEHICLE_GUI_SELECTION +#include +#include +#include +#endif + + + +// =========================================================================== +// variable definitions +// =========================================================================== +// 80km/h will be the threshold for dividing between long/short foresight +#define LOOK_FORWARD_SPEED_DIVIDER 14. + +#define LOOK_FORWARD_FAR 15. +#define LOOK_FORWARD_NEAR 5. + + + +#define JAM_FACTOR 2. +#define JAM_FACTOR2 1. + + +// =========================================================================== +// member method definitions +// =========================================================================== +MSLCM_DK2008::MSLCM_DK2008(MSVehicle& v) + : MSAbstractLaneChangeModel(v), + myChangeProbability(0), + myLeadingBlockerLength(0), myLeftSpace(0) {} + +MSLCM_DK2008::~MSLCM_DK2008() { + changed(0); +} + +int +MSLCM_DK2008::wantsChange( + int laneOffset, + MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked) { + UNUSED_PARAMETER(firstBlocked); + return (laneOffset == -1 ? + wantsChangeToRight(msgPass, blocked, leader, neighLead, neighFollow, neighLane, preb, lastBlocked, firstBlocked) + : wantsChangeToLeft(msgPass, blocked, leader, neighLead, neighFollow, neighLane, preb, lastBlocked, firstBlocked)); + +} + + +int +MSLCM_DK2008::wantsChangeToRight(MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked) { + UNUSED_PARAMETER(firstBlocked); +#ifdef DEBUG_VEHICLE_GUI_SELECTION + if (gSelected.isSelected(GLO_VEHICLE, static_cast(&myVehicle)->getGlID())) { + int bla = 0; + } +#endif + MSVehicle::LaneQ curr, best; + int bestLaneOffset = 0; + SUMOReal currentDist = 0; + SUMOReal neighDist = 0; + SUMOReal neighExtDist = 0; + SUMOReal currExtDist = 0; + int currIdx = 0; + MSLane* prebLane = myVehicle.getLane(); + if (prebLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { + // internal edges are not kept inside the bestLanes structure + prebLane = prebLane->getLinkCont()[0]->getLane(); + } + for (int p = 0; p < (int) preb.size(); ++p) { + if (preb[p].lane == prebLane && p > 0) { + curr = preb[p]; + bestLaneOffset = curr.bestLaneOffset; + currentDist = curr.length; + currExtDist = curr.lane->getLength(); + neighDist = preb[p - 1].length; + neighExtDist = preb[p - 1].lane->getLength(); + best = preb[p + bestLaneOffset]; + currIdx = p; + break; + } + } + + // keep information about being a leader/follower + int ret = (myOwnState & 0xffff0000); + + if (leader.first != 0 + && + (myOwnState & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0 + && + (leader.first->getLaneChangeModel().getOwnState()&LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0) { + + myOwnState &= (0xffffffff - LCA_AMBLOCKINGFOLLOWER_DONTBRAKE); + if (myVehicle.getSpeed() > SUMO_const_haltingSpeed) { + myOwnState |= LCA_AMBACKBLOCKER; + } else { + ret |= LCA_AMBACKBLOCKER; + myDontBrake = true; + } + } + + // process information about the last blocked vehicle + // if this vehicle is blocking someone in front, we maybe decelerate to let him in + if ((*lastBlocked) != 0) { + SUMOReal gap = (*lastBlocked)->getPositionOnLane() - (*lastBlocked)->getVehicleType().getLength() - myVehicle.getPositionOnLane() - myVehicle.getVehicleType().getMinGap(); + if (gap > 0.1) { + if (myVehicle.getSpeed() < ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel())) { + if ((*lastBlocked)->getSpeed() < SUMO_const_haltingSpeed) { + ret |= LCA_AMBACKBLOCKER_STANDING; + } else { + ret |= LCA_AMBACKBLOCKER; + } + myVSafes.push_back(myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), (SUMOReal)(gap - 0.1), (*lastBlocked)->getSpeed(), (*lastBlocked)->getCarFollowModel().getMaxDecel())); + (*lastBlocked) = 0; + } + return ret; + } + } + + // we try to estimate the distance which is necessary to get on a lane + // we have to get on in order to keep our route + // we assume we need something that depends on our velocity + // and compare this with the free space on our wished lane + // + // if the free space is somehow less than the space we need, we should + // definitely try to get to the desired lane + // + // this rule forces our vehicle to change the lane if a lane changing is necessary soon + SUMOReal rv = myVehicle.getSpeed() > LOOK_FORWARD_SPEED_DIVIDER + ? myVehicle.getSpeed() * (SUMOReal) LOOK_FORWARD_FAR + : myVehicle.getSpeed() * (SUMOReal) LOOK_FORWARD_NEAR; + rv += myVehicle.getVehicleType().getLengthWithGap() * (SUMOReal) 2.; + + SUMOReal tdist = currentDist - myVehicle.getPositionOnLane() - best.occupation * (SUMOReal) JAM_FACTOR2; + + // assert(best.length > curr.length); + // XXX if (curr.length != best.length) && ... + if (fabs(best.length - curr.length) > MIN2((SUMOReal) .1, best.lane->getLength()) && bestLaneOffset < 0 && currentDistDisallows(tdist/*currentDist*/, bestLaneOffset, rv)) { + informBlocker(msgPass, blocked, LCA_MRIGHT, neighLead, neighFollow); + if (neighLead.second > 0 && neighLead.second > leader.second) { + myVSafes.push_back(myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighLead.second, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel()) - (SUMOReal) 0.5); + } + + // letting vehicles merge in at the end of the lane in case of counter-lane change, step#1, right + // if there is a leader and he wants to change to left (we want to change to right) + if (neighLead.first != 0 && (neighLead.first->getLaneChangeModel().getOwnState()&LCA_LEFT) != 0) { + // save at least his length in myLeadingBlockerLength + myLeadingBlockerLength = MAX2(neighLead.first->getVehicleType().getLengthWithGap(), myLeadingBlockerLength); + // save the left space + myLeftSpace = currentDist - myVehicle.getPositionOnLane(); + } + // + + return ret | LCA_RIGHT | LCA_STRATEGIC | LCA_URGENT; + } + + + // the opposite lane-changing direction should be done than the one examined herein + // we'll check whether we assume we could change anyhow and get back in time... + // + // this rule prevents the vehicle from moving in opposite direction of the best lane + // unless the way till the end where the vehicle has to be on the best lane + // is long enough + SUMOReal maxJam = MAX2(preb[currIdx - 1].occupation, preb[currIdx].occupation); + SUMOReal neighLeftPlace = MAX2((SUMOReal) 0, neighDist - myVehicle.getPositionOnLane() - maxJam); + if (bestLaneOffset >= 0 && (currentDistDisallows(neighLeftPlace, bestLaneOffset + 2, rv))) { + // ...we will not change the lane if not + return ret | LCA_STAY | LCA_STRATEGIC; + } + + + // if the current lane is the best and a lane-changing would cause a situation + // of which we assume we will not be able to return to the lane we have to be on... + // + // this rule prevents the vehicle from leaving the current, best lane when it is + // close to this lane's end + if (currExtDist > neighExtDist && (neighLeftPlace * 2. < rv/*||currE[currIdx+1].lengthgetSpeedLimit() > 80. / 3.6) { + return ret | LCA_STAY | LCA_STRATEGIC; + } + // -------- + + // -------- make place on current lane if blocking follower + if (amBlockingFollowerPlusNB() + && + (currentDistAllows(neighDist, bestLaneOffset, rv) || neighDist >= currentDist)) { + + return ret | LCA_RIGHT | LCA_COOPERATIVE | LCA_URGENT; + } + // -------- + + + // -------- security checks for krauss + // (vsafe fails when gap<0) + if ((blocked & LCA_BLOCKED) != 0) { + return ret; + } + // -------- + + // -------- higher speed + if ((congested(neighLead.first) && neighLead.second < 20) || predInteraction(leader.first)) { //!!! + return ret; + } + 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 { + // @todo: what if leader is below safe gap?!!! + neighLaneVSafe = MIN2(neighLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighLead.second, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel())); + } + if (leader.first == 0) { + thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), currentDist, 0, 0)); + } else { + // @todo: what if leader is below safe gap?!!! + thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), leader.second, leader.first->getSpeed(), leader.first->getCarFollowModel().getMaxDecel())); + } + + thisLaneVSafe = MIN2(thisLaneVSafe, myVehicle.getVehicleType().getMaxSpeed()); + neighLaneVSafe = MIN2(neighLaneVSafe, myVehicle.getVehicleType().getMaxSpeed()); + if (thisLaneVSafe - neighLaneVSafe > 5. / 3.6) { + // ok, the current lane is faster than the right one... + if (myChangeProbability < 0) { + myChangeProbability /= 2.0; + } + } else { + // ok, the right lane is faster than the current + myChangeProbability -= (SUMOReal)((neighLaneVSafe - thisLaneVSafe) / (myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle))); + } + + // let's recheck the "Rechtsfahrgebot" + SUMOReal vmax = MIN2(myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle), myVehicle.getVehicleType().getMaxSpeed()); + vmax -= (SUMOReal)(5. / 2.6); + if (neighLaneVSafe >= vmax) { + myChangeProbability -= (SUMOReal)((neighLaneVSafe - vmax) / (vmax)); + } + + if (myChangeProbability < -2 && neighDist / MAX2((SUMOReal) .1, myVehicle.getSpeed()) > 20.) { //./MAX2((SUMOReal) .1, myVehicle.getSpeed())) { // -.1 + return ret | LCA_RIGHT | LCA_SPEEDGAIN; + } + // -------- + + return ret; +} + + +int +MSLCM_DK2008::wantsChangeToLeft(MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked) { + UNUSED_PARAMETER(firstBlocked); +#ifdef DEBUG_VEHICLE_GUI_SELECTION + if (gSelected.isSelected(GLO_VEHICLE, static_cast(&myVehicle)->getGlID())) { + int bla = 0; + } +#endif + MSVehicle::LaneQ curr, best; + int bestLaneOffset = 0; + SUMOReal currentDist = 0; + SUMOReal neighDist = 0; + SUMOReal neighExtDist = 0; + SUMOReal currExtDist = 0; + int currIdx = 0; + MSLane* prebLane = myVehicle.getLane(); + if (prebLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { + // internal edges are not kept inside the bestLanes structure + prebLane = prebLane->getLinkCont()[0]->getLane(); + } + for (int p = 0; p < (int) preb.size(); ++p) { + if (preb[p].lane == prebLane) { + curr = preb[p]; + bestLaneOffset = curr.bestLaneOffset; + currentDist = curr.length; + currExtDist = curr.lane->getLength(); + neighDist = preb[p + 1].length; + neighExtDist = preb[p + 1].lane->getLength(); + best = preb[p + bestLaneOffset]; + currIdx = p; + break; + } + } + // keep information about being a leader/follower + int ret = (myOwnState & 0xffff0000); + + // ?!!! + if (leader.first != 0 + && + (myOwnState & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0 + && + (leader.first->getLaneChangeModel().getOwnState()&LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0) { + + myOwnState &= (0xffffffff - LCA_AMBLOCKINGFOLLOWER_DONTBRAKE); + if (myVehicle.getSpeed() > SUMO_const_haltingSpeed) { + myOwnState |= LCA_AMBACKBLOCKER; + } else { + ret |= LCA_AMBACKBLOCKER; + myDontBrake = true; + } + } + + // process information about the last blocked vehicle + // if this vehicle is blocking someone in front, we maybe decelerate to let him in + if ((*lastBlocked) != 0) { + SUMOReal gap = (*lastBlocked)->getPositionOnLane() - (*lastBlocked)->getVehicleType().getLength() - myVehicle.getPositionOnLane() - myVehicle.getVehicleType().getMinGap(); + if (gap > 0.1) { + if (myVehicle.getSpeed() < ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel())) { + if ((*lastBlocked)->getSpeed() < SUMO_const_haltingSpeed) { + ret |= LCA_AMBACKBLOCKER_STANDING; + } else { + ret |= LCA_AMBACKBLOCKER; + } + myVSafes.push_back(myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), (SUMOReal)(gap - 0.1), (*lastBlocked)->getSpeed(), (*lastBlocked)->getCarFollowModel().getMaxDecel())); + (*lastBlocked) = 0; + } + return ret; + } + } + + // we try to estimate the distance which is necessary to get on a lane + // we have to get on in order to keep our route + // we assume we need something that depends on our velocity + // and compare this with the free space on our wished lane + // + // if the free space is somehow less than the space we need, we should + // definitely try to get to the desired lane + // + // this rule forces our vehicle to change the lane if a lane changing is necessary soon + SUMOReal lv = myVehicle.getSpeed() > LOOK_FORWARD_SPEED_DIVIDER + ? myVehicle.getSpeed() * (SUMOReal) LOOK_FORWARD_FAR + : myVehicle.getSpeed() * (SUMOReal) LOOK_FORWARD_NEAR; + lv += myVehicle.getVehicleType().getLengthWithGap() * (SUMOReal) 2.; + + + SUMOReal tdist = currentDist - myVehicle.getPositionOnLane() - best.occupation * (SUMOReal) JAM_FACTOR2; + if (fabs(best.length - curr.length) > MIN2((SUMOReal) .1, best.lane->getLength()) && bestLaneOffset > 0 + && + currentDistDisallows(tdist/*currentDist*/, bestLaneOffset, lv)) { + informBlocker(msgPass, blocked, LCA_MLEFT, neighLead, neighFollow); + if (neighLead.second > 0 && neighLead.second > leader.second) { + myVSafes.push_back(myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighLead.second, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel()) - (SUMOReal) 0.5); + } + + // letting vehicles merge in at the end of the lane in case of counter-lane change, step#1, left + // if there is a leader and he wants to change to right (we want to change to left) + if (neighLead.first != 0 && (neighLead.first->getLaneChangeModel().getOwnState()&LCA_RIGHT) != 0) { + // save at least his length in myLeadingBlockerLength + myLeadingBlockerLength = MAX2(neighLead.first->getVehicleType().getLengthWithGap(), myLeadingBlockerLength); + // save the left space + myLeftSpace = currentDist - myVehicle.getPositionOnLane(); + } + // + + return ret | LCA_LEFT | LCA_STRATEGIC | LCA_URGENT; + } + + // the opposite lane-changing direction should be rather done, not + // the one examined herein + // we'll check whether we assume we could change anyhow and get back in time... + // + // this rule prevents the vehicle from moving in opposite direction of the best lane + // unless the way till the end where the vehicle has to be on the best lane + // is long enough + SUMOReal maxJam = MAX2(preb[currIdx + 1].occupation, preb[currIdx].occupation); + SUMOReal neighLeftPlace = MAX2((SUMOReal) 0, neighDist - myVehicle.getPositionOnLane() - maxJam); + if (bestLaneOffset <= 0 && (currentDistDisallows(neighLeftPlace, bestLaneOffset - 2, lv))) { + // ...we will not change the lane if not + return ret | LCA_STAY | LCA_STRATEGIC; + } + + + // if the current lane is the best and a lane-changing would cause a situation + // of which we assume we will not be able to return to the lane we have to be on... + // + // this rule prevents the vehicle from leaving the current, best lane when it is + // close to this lane's end + if (currExtDist > neighExtDist && (neighLeftPlace * 2. < lv/*||currE[currIdx+1].length80./3.6) { + return ret; + } + */ + + + /* + // if the current lane is the + if(bestLaneOffset==0&&(neighDist==0||curr.seenVehicles2*JAM_FACTOR>=neighExtDist-curr.length)) { + return ret; + } + */ + // -------- + + // -------- make place on current lane if blocking follower + if (amBlockingFollowerPlusNB() + && + (currentDistAllows(neighDist, bestLaneOffset, lv) || neighDist >= currentDist)) { + + return ret | LCA_LEFT | LCA_COOPERATIVE | LCA_URGENT; + } + // -------- + + // -------- security checks for krauss + // (vsafe fails when gap<0) + if ((blocked & LCA_BLOCKED) != 0) { + return ret; + } + + // -------- higher speed + if ((congested(neighLead.first) && neighLead.second < 20) || predInteraction(leader.first)) { //!!! + return ret; + } + 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 { + // @todo: what if leader is below safe gap?!!! + neighLaneVSafe = MIN2(neighLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighLead.second, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel())); + } + if (leader.first == 0) { + thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), currentDist, 0, 0)); + } else { + // @todo: what if leader is below safe gap?!!! + thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), leader.second, leader.first->getSpeed(), leader.first->getCarFollowModel().getMaxDecel())); + } + thisLaneVSafe = MIN2(thisLaneVSafe, myVehicle.getVehicleType().getMaxSpeed()); + neighLaneVSafe = MIN2(neighLaneVSafe, myVehicle.getVehicleType().getMaxSpeed()); + if (thisLaneVSafe > neighLaneVSafe) { + // this lane is better + if (myChangeProbability > 0) { + myChangeProbability /= 2.0; + } + } else { + // right lane is better + 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; + } + // -------- + + return ret; +} + + +SUMOReal +MSLCM_DK2008::patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel& cfModel) { +#ifdef DEBUG_VEHICLE_GUI_SELECTION + if (gSelected.isSelected(GLO_VEHICLE, static_cast(&myVehicle)->getGlID())) { + int bla = 0; + } +#endif + int state = myOwnState; + + // letting vehicles merge in at the end of the lane in case of counter-lane change, step#2 + SUMOReal MAGIC_offset = 1.; + // if we want to change and have a blocking leader and there is enough room for him in front of us + if (myLeadingBlockerLength != 0) { + SUMOReal space = myLeftSpace - myLeadingBlockerLength - MAGIC_offset - myVehicle.getVehicleType().getMinGap(); + if (space > 0) { + // compute speed for decelerating towards a place which allows the blocking leader to merge in in front + SUMOReal safe = cfModel.stopSpeed(&myVehicle, myVehicle.getSpeed(), space); + // if we are approaching this place + if (safe < wanted) { + // return this speed as the speed to use + return MAX2(min, safe); + } + } + } + + // just to make sure to be notified about lane chaning end + if (myVehicle.getLane()->getEdge().getLanes().size() == 1 || myVehicle.getLane()->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { + // remove chaning information if on a road with a single lane + changed(0); + return wanted; + } + + SUMOReal nVSafe = wanted; + bool gotOne = false; + for (std::vector::const_iterator i = myVSafes.begin(); i != myVSafes.end(); ++i) { + SUMOReal v = (*i); + if (v >= min && v <= max) { + nVSafe = MIN2(v, nVSafe); + gotOne = true; + } + } + + // check whether the vehicle is blocked + if ((state & LCA_WANTS_LANECHANGE) != 0) { + if (gotOne && !myDontBrake) { + return nVSafe; + } + // check whether the vehicle maybe has to be swapped with one of + // the blocking vehicles + if ((state & LCA_BLOCKED) != 0) { + if ((state & LCA_BLOCKED_BY_LEADER) != 0) { + // if interacting with leader and not too slow + return (min + wanted) / (SUMOReal) 2.0; + } + if ((state & LCA_BLOCKED_BY_FOLLOWER) != 0) { + return (max + wanted) / (SUMOReal) 2.0; + } + return (min + wanted) / (SUMOReal) 2.0; + } + } + + + // decelerate if being a blocking follower + // (and does not have to change lanes) + if ((state & LCA_AMBLOCKINGFOLLOWER) != 0) { + if (fabs(max - myVehicle.getCarFollowModel().maxNextSpeed(myVehicle.getSpeed(), &myVehicle)) < 0.001 && min == 0) { // !!! was standing + return 0; + } + return (min + wanted) / (SUMOReal) 2.0; + } + if ((state & LCA_AMBACKBLOCKER) != 0) { + if (max <= myVehicle.getCarFollowModel().maxNextSpeed(myVehicle.getSpeed(), &myVehicle) && min == 0) { // !!! was standing + return min; + } + } + if ((state & LCA_AMBACKBLOCKER_STANDING) != 0) { + return min; + } + // accelerate if being a blocking leader or blocking follower not able to brake + // (and does not have to change lanes) + if ((state & LCA_AMBLOCKINGLEADER) != 0) { + return (max + wanted) / (SUMOReal) 2.0; + } + if ((state & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0) { + if (max <= myVehicle.getCarFollowModel().maxNextSpeed(myVehicle.getSpeed(), &myVehicle) && min == 0) { // !!! was standing + return wanted; + } + return (min + wanted) / (SUMOReal) 2.0; + } + return wanted; +} + + +void* +MSLCM_DK2008::inform(void* info, MSVehicle* /*sender*/) { + Info* pinfo = (Info*) info; + //myOwnState &= 0xffffffff; // reset all bits of MyLCAEnum but only those + myOwnState |= pinfo->second; + delete pinfo; + return (void*) true; +} + + +void +MSLCM_DK2008::changed(int dir) { + myOwnState = 0; + myChangeProbability = 0; + myLeadingBlockerLength = 0; + myLeftSpace = 0; + myVSafes.clear(); + myDontBrake = false; + initLastLaneChangeOffset(dir); +} + + +void +MSLCM_DK2008::informBlocker(MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int& blocked, + int dir, + const std::pair& neighLead, + const std::pair& neighFollow) { + if ((blocked & LCA_BLOCKED_BY_FOLLOWER) != 0) { + assert(neighFollow.first != 0); + MSVehicle* nv = neighFollow.first; + SUMOReal decelGap = + neighFollow.second + + SPEED2DIST(myVehicle.getSpeed()) * (SUMOReal) 2.0 + - MAX2(nv->getSpeed() - (SUMOReal) ACCEL2DIST(nv->getCarFollowModel().getMaxDecel()) * (SUMOReal) 2.0, (SUMOReal) 0); + if (neighFollow.second > 0 && decelGap > 0 && decelGap >= nv->getCarFollowModel().getSecureGap(nv->getSpeed(), myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel())) { + SUMOReal vsafe = myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighFollow.second, neighFollow.first->getSpeed(), neighFollow.first->getCarFollowModel().getMaxDecel()); + msgPass.informNeighFollower(new Info(vsafe, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); + } else { + SUMOReal vsafe = neighFollow.second <= 0 ? 0 : myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighFollow.second, neighFollow.first->getSpeed(), neighFollow.first->getCarFollowModel().getMaxDecel()); + msgPass.informNeighFollower(new Info(vsafe, dir | LCA_AMBLOCKINGFOLLOWER_DONTBRAKE), &myVehicle); + } + } + if ((blocked & LCA_BLOCKED_BY_LEADER) != 0) { + if (neighLead.first != 0 && neighLead.second > 0) { + msgPass.informNeighLeader(new Info(0, dir | LCA_AMBLOCKINGLEADER), &myVehicle); + } + } +} + + +void +MSLCM_DK2008::prepareStep() { + myOwnState = 0; + myLeadingBlockerLength = 0; + myLeftSpace = 0; + myVSafes.clear(); + myDontBrake = false; + // truncate myChangeProbability to work around numerical instability between different builds + myChangeProbability = ceil(myChangeProbability * 100000.0) * 0.00001; +} + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/lcmodels/MSLCM_DK2008.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSLCM_DK2008.h --- sumo-0.21.0+dfsg/src/microsim/lcmodels/MSLCM_DK2008.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSLCM_DK2008.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,172 @@ +/****************************************************************************/ +/// @file MSLCM_DK2008.h +/// @author Daniel Krajzewicz +/// @author Friedemann Wesner +/// @author Sascha Krieg +/// @author Michael Behrisch +/// @author Jakob Erdmann +/// @date Fri, 29.04.2005 +/// @version $Id: MSLCM_DK2008.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A lane change model developed by D. Krajzewicz between 2004 and 2010 +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 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 MSLCM_DK2008_h +#define MSLCM_DK2008_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include "MSAbstractLaneChangeModel.h" +#include + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSLCM_DK2008 + * @brief A lane change model developed by D. Krajzewicz between 2004 and 2010 + */ +class MSLCM_DK2008 : public MSAbstractLaneChangeModel { +public: + + enum MyLCAEnum { + LCA_AMBLOCKINGLEADER = 1 << 16, + LCA_AMBLOCKINGFOLLOWER = 1 << 17, + LCA_MRIGHT = 1 << 18, + LCA_MLEFT = 1 << 19, + // !!! never set LCA_UNBLOCK = 1 << 20, + LCA_AMBLOCKINGFOLLOWER_DONTBRAKE = 1 << 21, + // !!! never used LCA_AMBLOCKINGSECONDFOLLOWER = 1 << 22, + + // !!! never read LCA_KEEP1 = 1 << 24, + // !!! never used LCA_KEEP2 = 1 << 25, + LCA_AMBACKBLOCKER = 1 << 26, + LCA_AMBACKBLOCKER_STANDING = 1 << 27 + }; + + MSLCM_DK2008(MSVehicle& v); + + virtual ~MSLCM_DK2008(); + + /** @brief Called to examine whether the vehicle wants to change + * using the given laneOffset. + * This method gets the information about the surrounding vehicles + * and whether another lane may be more preferable */ + int wantsChange( + int laneOffset, + MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked); + + virtual void* inform(void* info, MSVehicle* sender); + + /** @brief Called to adapt the speed in order to allow a lane change. + * + * @param min The minimum resulting speed + * @param wanted The aspired speed of the car following model + * @param max The maximum resulting speed + * @param cfModel The model used + * @return the new speed of the vehicle as proposed by the lane changer + */ + virtual SUMOReal patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, + const MSCFModel& cfModel); + + virtual void changed(int dir); + + virtual void prepareStep(); + + +protected: + /** @brief Called to examine whether the vehicle wants to change to right + This method gets the information about the surrounding vehicles + 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 MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked); + + /** @brief Called to examine whether the vehicle wants to change to left + This method gets the information about the surrounding vehicles + 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 MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked); + + void informBlocker(MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int& blocked, int dir, + const std::pair& neighLead, + const std::pair& neighFollow); + + inline bool amBlockingLeader() { + return (myOwnState & LCA_AMBLOCKINGLEADER) != 0; + } + inline bool amBlockingFollower() { + return (myOwnState & LCA_AMBLOCKINGFOLLOWER) != 0; + } + inline bool amBlockingFollowerNB() { + return (myOwnState & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0; + } + inline bool amBlockingFollowerPlusNB() { + return (myOwnState & (LCA_AMBLOCKINGFOLLOWER | LCA_AMBLOCKINGFOLLOWER_DONTBRAKE)) != 0; + } + inline bool currentDistDisallows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) { + return dist / (abs(laneOffset)) < lookForwardDist; + } + inline bool currentDistAllows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) { + return dist / abs(laneOffset) > lookForwardDist; + } + + typedef std::pair Info; + + + +protected: + SUMOReal myChangeProbability; + + SUMOReal myLeadingBlockerLength; + SUMOReal myLeftSpace; + + std::vector myVSafes; + bool myDontBrake; + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/lcmodels/MSLCM_JE2013.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSLCM_JE2013.cpp --- sumo-0.21.0+dfsg/src/microsim/lcmodels/MSLCM_JE2013.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSLCM_JE2013.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,1223 @@ +/****************************************************************************/ +/// @file MSLCM_JE2013.h +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @author Laura Bieker +/// @date Fri, 08.10.2013 +/// @version $Id: MSLCM_JE2013.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A lane change model developed by J. Erdmann +// based on the model of D. Krajzewicz developed between 2004 and 2011 (MSLCM_DK2004) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 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 "MSLCM_JE2013.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + +//#define DEBUG_VEHICLE_GUI_SELECTION 1 +#ifdef DEBUG_VEHICLE_GUI_SELECTION +#include +#include +#include +#endif + + + +// =========================================================================== +// variable definitions +// =========================================================================== +// 80km/h will be the threshold for dividing between long/short foresight +#define LOOK_FORWARD_SPEED_DIVIDER (SUMOReal)14. + +// VARIANT_1 (lf*2) +//#define LOOK_FORWARD_FAR 30. +//#define LOOK_FORWARD_NEAR 10. + +#define LOOK_FORWARD_RIGHT (SUMOReal)10. +#define LOOK_FORWARD_LEFT (SUMOReal)20. + +#define JAM_FACTOR (SUMOReal)1. +//#define JAM_FACTOR 2. // VARIANT_8 (makes vehicles more focused but also more "selfish") + +#define LCA_RIGHT_IMPATIENCE (SUMOReal)-1. +#define CUT_IN_LEFT_SPEED_THRESHOLD (SUMOReal)27. +#define MAX_ONRAMP_LENGTH (SUMOReal)200. + +#define LOOK_AHEAD_MIN_SPEED (SUMOReal)0.0 +#define LOOK_AHEAD_SPEED_MEMORY (SUMOReal)0.9 +#define LOOK_AHEAD_SPEED_DECREMENT 6. + +#define HELP_DECEL_FACTOR (SUMOReal)1.0 + +#define HELP_OVERTAKE (SUMOReal)(10.0 / 3.6) +#define MIN_FALLBEHIND (SUMOReal)(14.0 / 3.6) + +#define KEEP_RIGHT_HEADWAY (SUMOReal)2.0 + +#define URGENCY (SUMOReal)2.0 + +#define ROUNDABOUT_DIST_BONUS (SUMOReal)100.0 + +#define CHANGE_PROB_THRESHOLD_RIGHT (SUMOReal)2.0 +#define CHANGE_PROB_THRESHOLD_LEFT (SUMOReal)0.2 +#define KEEP_RIGHT_TIME (SUMOReal)5.0 // the number of seconds after which a vehicle should move to the right lane +#define KEEP_RIGHT_ACCEPTANCE (SUMOReal)7.0 // calibration factor for determining the desire to keep right + +#define RELGAIN_NORMALIZATION_MIN_SPEED (SUMOReal)10.0 + +#define TURN_LANE_DIST (SUMOReal)200.0 // the distance at which a lane leading elsewhere is considered to be a turn-lane that must be avoided + +//#define DEBUG_COND (myVehicle.getID() == "1501_27271428" || myVehicle.getID() == "1502_27270000") +//#define DEBUG_COND (myVehicle.getID() == "175129_26220000") +//#define DEBUG_COND (myVehicle.getID() == "pkw150478" || myVehicle.getID() == "pkw150494" || myVehicle.getID() == "pkw150289") +//#define DEBUG_COND (myVehicle.getID() == "A" || myVehicle.getID() == "B") // fail change to left +//#define DEBUG_COND (myVehicle.getID() == "Costa_12_13") // test stops_overtaking +#define DEBUG_COND false + +// debug function +std::string +tryID(const MSVehicle* v) { + return v == 0 ? "NULL" : v->getID(); +} + + +// =========================================================================== +// member method definitions +// =========================================================================== +MSLCM_JE2013::MSLCM_JE2013(MSVehicle& v) : + MSAbstractLaneChangeModel(v), + mySpeedGainProbability(0), + myKeepRightProbability(0), + myLeadingBlockerLength(0), + myLeftSpace(0), + myLookAheadSpeed(LOOK_AHEAD_MIN_SPEED) +{} + +MSLCM_JE2013::~MSLCM_JE2013() { + changed(0); +} + + +int +MSLCM_JE2013::wantsChange( + int laneOffset, + MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked) { + gDebugFlag2 = DEBUG_COND; + + if (gDebugFlag2) { + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " veh=" << myVehicle.getID() + << " lane=" << myVehicle.getLane()->getID() + << " pos=" << myVehicle.getPositionOnLane() + << " speed=" << myVehicle.getSpeed() + << " considerChangeTo=" << (laneOffset == -1 ? "right" : "left") + << "\n"; + } + + const int result = _wantsChange(laneOffset, msgPass, blocked, leader, neighLead, neighFollow, neighLane, preb, lastBlocked, firstBlocked); + if (gDebugFlag2) { + if (result & LCA_WANTS_LANECHANGE) { + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " veh=" << myVehicle.getID() + << " wantsChangeTo=" << (laneOffset == -1 ? "right" : "left") + << ((result & LCA_URGENT) ? " (urgent)" : "") + << ((result & LCA_CHANGE_TO_HELP) ? " (toHelp)" : "") + << ((result & LCA_STRATEGIC) ? " (strat)" : "") + << ((result & LCA_COOPERATIVE) ? " (coop)" : "") + << ((result & LCA_SPEEDGAIN) ? " (speed)" : "") + << ((result & LCA_KEEPRIGHT) ? " (keepright)" : "") + << ((result & LCA_TRACI) ? " (traci)" : "") + << ((blocked & LCA_BLOCKED) ? " (blocked)" : "") + << ((blocked & LCA_OVERLAPPING) ? " (overlap)" : "") + << "\n\n\n"; + } + } + gDebugFlag2 = false; + return result; +} + + +SUMOReal +MSLCM_JE2013::patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel& cfModel) { + gDebugFlag1 = DEBUG_COND; + + const SUMOReal newSpeed = _patchSpeed(min, wanted, max, cfModel); + if (gDebugFlag1) { + const std::string patched = (wanted != newSpeed ? " patched=" + toString(newSpeed) : ""); + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " veh=" << myVehicle.getID() + << " lane=" << myVehicle.getLane()->getID() + << " pos=" << myVehicle.getPositionOnLane() + << " v=" << myVehicle.getSpeed() + << " wanted=" << wanted + << patched + << "\n\n"; + } + gDebugFlag1 = false; + return newSpeed; +} + + +SUMOReal +MSLCM_JE2013::_patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel& cfModel) { + + const SUMOReal time = STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()); + + int state = myOwnState; + + // letting vehicles merge in at the end of the lane in case of counter-lane change, step#2 + SUMOReal MAGIC_offset = 1.; + // if we want to change and have a blocking leader and there is enough room for him in front of us + if (myLeadingBlockerLength != 0) { + SUMOReal space = myLeftSpace - myLeadingBlockerLength - MAGIC_offset - myVehicle.getVehicleType().getMinGap(); + if (gDebugFlag1) { + std::cout << time << " veh=" << myVehicle.getID() << " myLeadingBlockerLength=" << myLeadingBlockerLength << " space=" << space << "\n"; + } + if (space > 0) { // XXX space > -MAGIC_offset + // compute speed for decelerating towards a place which allows the blocking leader to merge in in front + SUMOReal safe = cfModel.stopSpeed(&myVehicle, myVehicle.getSpeed(), space); + // if we are approaching this place + if (safe < wanted) { + // return this speed as the speed to use + if (gDebugFlag1) { + std::cout << time << " veh=" << myVehicle.getID() << " slowing down for leading blocker, safe=" << safe << (safe + NUMERICAL_EPS < min ? " (not enough)" : "") << "\n"; + } + return MAX2(min, safe); + } + } + } + + SUMOReal nVSafe = wanted; + bool gotOne = false; + for (std::vector::const_iterator i = myVSafes.begin(); i != myVSafes.end(); ++i) { + SUMOReal v = (*i); + if (v >= min && v <= max) { + nVSafe = MIN2(v, nVSafe); + gotOne = true; + if (gDebugFlag1) { + std::cout << time << " veh=" << myVehicle.getID() << " got nVSafe=" << nVSafe << "\n"; + } + } else { + if (v < min) { + if (gDebugFlag1) { + std::cout << time << " veh=" << myVehicle.getID() << " ignoring low nVSafe=" << v << " min=" << min << "\n"; + } + } else { + if (gDebugFlag1) { + std::cout << time << " veh=" << myVehicle.getID() << " ignoring high nVSafe=" << v << " max=" << max << "\n"; + } + } + } + } + + if (gotOne && !myDontBrake) { + if (gDebugFlag1) { + std::cout << time << " veh=" << myVehicle.getID() << " got vSafe\n"; + } + return nVSafe; + } + + // check whether the vehicle is blocked + if ((state & LCA_WANTS_LANECHANGE) != 0 && (state & LCA_BLOCKED) != 0) { + if ((state & LCA_STRATEGIC) != 0) { + // necessary decelerations are controlled via vSafe. If there are + // none it means we should speed up + if (gDebugFlag1) { + std::cout << time << " veh=" << myVehicle.getID() << " LCA_WANTS_LANECHANGE (strat, no vSafe)\n"; + } + return (max + wanted) / (SUMOReal) 2.0; + } else if ((state & LCA_COOPERATIVE) != 0) { + // only minor adjustments in speed should be done + if ((state & LCA_BLOCKED_BY_LEADER) != 0) { + if (gDebugFlag1) { + std::cout << time << " veh=" << myVehicle.getID() << " LCA_BLOCKED_BY_LEADER (coop)\n"; + } + return (min + wanted) / (SUMOReal) 2.0; + } + if ((state & LCA_BLOCKED_BY_FOLLOWER) != 0) { + if (gDebugFlag1) { + std::cout << time << " veh=" << myVehicle.getID() << " LCA_BLOCKED_BY_FOLLOWER (coop)\n"; + } + return (max + wanted) / (SUMOReal) 2.0; + } + //} else { // VARIANT_16 + // // only accelerations should be performed + // if ((state & LCA_BLOCKED_BY_FOLLOWER) != 0) { + // if (gDebugFlag1) std::cout << time << " veh=" << myVehicle.getID() << " LCA_BLOCKED_BY_FOLLOWER\n"; + // return (max + wanted) / (SUMOReal) 2.0; + // } + } + } + + /* + // decelerate if being a blocking follower + // (and does not have to change lanes) + if ((state & LCA_AMBLOCKINGFOLLOWER) != 0) { + if (fabs(max - myVehicle.getCarFollowModel().maxNextSpeed(myVehicle.getSpeed(), &myVehicle)) < 0.001 && min == 0) { // !!! was standing + if (gDebugFlag1) std::cout << time << " veh=" << myVehicle.getID() << " LCA_AMBLOCKINGFOLLOWER (standing)\n"; + return 0; + } + if (gDebugFlag1) std::cout << time << " veh=" << myVehicle.getID() << " LCA_AMBLOCKINGFOLLOWER\n"; + + //return min; // VARIANT_3 (brakeStrong) + return (min + wanted) / (SUMOReal) 2.0; + } + if ((state & LCA_AMBACKBLOCKER) != 0) { + if (max <= myVehicle.getCarFollowModel().maxNextSpeed(myVehicle.getSpeed(), &myVehicle) && min == 0) { // !!! was standing + if (gDebugFlag1) std::cout << time << " veh=" << myVehicle.getID() << " LCA_AMBACKBLOCKER (standing)\n"; + //return min; VARIANT_9 (backBlockVSafe) + return nVSafe; + } + } + if ((state & LCA_AMBACKBLOCKER_STANDING) != 0) { + if (gDebugFlag1) std::cout << time << " veh=" << myVehicle.getID() << " LCA_AMBACKBLOCKER_STANDING\n"; + //return min; + return nVSafe; + } + */ + + // accelerate if being a blocking leader or blocking follower not able to brake + // (and does not have to change lanes) + if ((state & LCA_AMBLOCKINGLEADER) != 0) { + if (gDebugFlag1) { + std::cout << time << " veh=" << myVehicle.getID() << " LCA_AMBLOCKINGLEADER\n"; + } + return (max + wanted) / (SUMOReal) 2.0; + } + + if ((state & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0) { + if (gDebugFlag1) { + std::cout << time << " veh=" << myVehicle.getID() << " LCA_AMBLOCKINGFOLLOWER_DONTBRAKE\n"; + } + /* + // VARIANT_4 (dontbrake) + if (max <= myVehicle.getCarFollowModel().maxNextSpeed(myVehicle.getSpeed(), &myVehicle) && min == 0) { // !!! was standing + return wanted; + } + return (min + wanted) / (SUMOReal) 2.0; + */ + } + if (myVehicle.getLane()->getEdge().getLanes().size() == 1) { + // remove chaning information if on a road with a single lane + changed(0); + } + return wanted; +} + + +void* +MSLCM_JE2013::inform(void* info, MSVehicle* sender) { + Info* pinfo = (Info*) info; + if (pinfo->first >= 0) { + myVSafes.push_back(pinfo->first); + } + //myOwnState &= 0xffffffff; // reset all bits of MyLCAEnum but only those + myOwnState |= pinfo->second; + if (gDebugFlag2 || DEBUG_COND) { + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " veh=" << myVehicle.getID() + << " informedBy=" << sender->getID() + << " info=" << pinfo->second + << " vSafe=" << pinfo->first + << "\n"; + } + delete pinfo; + return (void*) true; +} + + +SUMOReal +MSLCM_JE2013::informLeader(MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, + int dir, + const std::pair& neighLead, + SUMOReal remainingSeconds) { + SUMOReal plannedSpeed = MIN2(myVehicle.getSpeed(), + myVehicle.getCarFollowModel().stopSpeed(&myVehicle, myVehicle.getSpeed(), myLeftSpace - myLeadingBlockerLength)); + for (std::vector::const_iterator i = myVSafes.begin(); i != myVSafes.end(); ++i) { + SUMOReal v = (*i); + if (v >= myVehicle.getSpeed() - ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel())) { + plannedSpeed = MIN2(plannedSpeed, v); + } + } + if (gDebugFlag2) { + std::cout << " informLeader speed=" << myVehicle.getSpeed() << " planned=" << plannedSpeed << "\n"; + } + + if ((blocked & LCA_BLOCKED_BY_LEADER) != 0) { + assert(neighLead.first != 0); + MSVehicle* nv = neighLead.first; + if (gDebugFlag2) std::cout << " blocked by leader nv=" << nv->getID() << " nvSpeed=" << nv->getSpeed() << " needGap=" + << myVehicle.getCarFollowModel().getSecureGap(myVehicle.getSpeed(), nv->getSpeed(), nv->getCarFollowModel().getMaxDecel()) << "\n"; + // decide whether we want to overtake the leader or follow it + const SUMOReal dv = plannedSpeed - nv->getSpeed(); + const SUMOReal overtakeDist = (neighLead.second // drive to back of follower + + nv->getVehicleType().getLengthWithGap() // drive to front of follower + + myVehicle.getVehicleType().getLength() // ego back reaches follower front + + nv->getCarFollowModel().getSecureGap( // save gap to follower + nv->getSpeed(), myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel())); + + if (dv < 0 + // overtaking on the right on an uncongested highway is forbidden (noOvertakeLCLeft) + || (dir == LCA_MLEFT && !myVehicle.congested() && !myAllowOvertakingRight) + // not enough space to overtake? (we will start to brake when approaching a dead end) + || myLeftSpace - myVehicle.getCarFollowModel().brakeGap(myVehicle.getSpeed()) < overtakeDist + // not enough time to overtake? + || dv * remainingSeconds < overtakeDist) { + // cannot overtake + msgPass.informNeighLeader(new Info(-1, dir | LCA_AMBLOCKINGLEADER), &myVehicle); + // slow down smoothly to follow leader + const SUMOReal targetSpeed = myCarFollowModel.followSpeed( + &myVehicle, myVehicle.getSpeed(), neighLead.second, nv->getSpeed(), nv->getCarFollowModel().getMaxDecel()); + if (targetSpeed < myVehicle.getSpeed()) { + // slow down smoothly to follow leader + const SUMOReal decel = ACCEL2SPEED(MIN2(myVehicle.getCarFollowModel().getMaxDecel(), + MAX2(MIN_FALLBEHIND, (myVehicle.getSpeed() - targetSpeed) / remainingSeconds))); + //const SUMOReal nextSpeed = MAX2((SUMOReal)0, MIN2(plannedSpeed, myVehicle.getSpeed() - decel)); + const SUMOReal nextSpeed = MIN2(plannedSpeed, myVehicle.getSpeed() - decel); + if (gDebugFlag2) { + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " cannot overtake leader nv=" << nv->getID() + << " dv=" << dv + << " remainingSeconds=" << remainingSeconds + << " targetSpeed=" << targetSpeed + << " nextSpeed=" << nextSpeed + << "\n"; + } + myVSafes.push_back(nextSpeed); + return nextSpeed; + } else { + // leader is fast enough anyway + if (gDebugFlag2) { + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " cannot overtake fast leader nv=" << nv->getID() + << " dv=" << dv + << " remainingSeconds=" << remainingSeconds + << " targetSpeed=" << targetSpeed + << "\n"; + } + myVSafes.push_back(targetSpeed); + return plannedSpeed; + } + } else { + if (gDebugFlag2) { + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " wants to overtake leader nv=" << nv->getID() + << " dv=" << dv + << " remainingSeconds=" << remainingSeconds + << " currentGap=" << neighLead.second + << " secureGap=" << nv->getCarFollowModel().getSecureGap(nv->getSpeed(), myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel()) + << " overtakeDist=" << overtakeDist + << "\n"; + } + // overtaking, leader should not accelerate + msgPass.informNeighLeader(new Info(nv->getSpeed(), dir | LCA_AMBLOCKINGLEADER), &myVehicle); + return -1; + } + } else if (neighLead.first != 0) { // (remainUnblocked) + // we are not blocked now. make sure we stay far enough from the leader + MSVehicle* nv = neighLead.first; + const SUMOReal nextNVSpeed = nv->getSpeed() - HELP_OVERTAKE; // conservative + const SUMOReal dv = SPEED2DIST(myVehicle.getSpeed() - nextNVSpeed); + const SUMOReal targetSpeed = myCarFollowModel.followSpeed( + &myVehicle, myVehicle.getSpeed(), neighLead.second - dv, nextNVSpeed, nv->getCarFollowModel().getMaxDecel()); + myVSafes.push_back(targetSpeed); + if (gDebugFlag2) { + std::cout << " not blocked by leader nv=" << nv->getID() + << " nvSpeed=" << nv->getSpeed() + << " gap=" << neighLead.second + << " nextGap=" << neighLead.second - dv + << " needGap=" << myVehicle.getCarFollowModel().getSecureGap(myVehicle.getSpeed(), nv->getSpeed(), nv->getCarFollowModel().getMaxDecel()) + << " targetSpeed=" << targetSpeed + << "\n"; + } + return MIN2(targetSpeed, plannedSpeed); + } else { + // not overtaking + return plannedSpeed; + } +} + + +void +MSLCM_JE2013::informFollower(MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, + int dir, + const std::pair& neighFollow, + SUMOReal remainingSeconds, + SUMOReal plannedSpeed) { + if ((blocked & LCA_BLOCKED_BY_FOLLOWER) != 0) { + assert(neighFollow.first != 0); + MSVehicle* nv = neighFollow.first; + if (gDebugFlag2) std::cout << " blocked by follower nv=" << nv->getID() << " nvSpeed=" << nv->getSpeed() << " needGap=" + << nv->getCarFollowModel().getSecureGap(nv->getSpeed(), myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel()) << "\n"; + + // are we fast enough to cut in without any help? + if (plannedSpeed - nv->getSpeed() >= HELP_OVERTAKE) { + const SUMOReal neededGap = nv->getCarFollowModel().getSecureGap(nv->getSpeed(), plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel()); + if ((neededGap - neighFollow.second) / remainingSeconds < (plannedSpeed - nv->getSpeed())) { + if (gDebugFlag2) { + std::cout << " wants to cut in before nv=" << nv->getID() << " without any help neededGap=" << neededGap << "\n"; + } + // follower might even accelerate but not to much + msgPass.informNeighFollower(new Info(plannedSpeed - HELP_OVERTAKE, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); + return; + } + } + // decide whether we will request help to cut in before the follower or allow to be overtaken + + // PARAMETERS + // assume other vehicle will assume the equivalent of 1 second of + // maximum deceleration to help us (will probably be spread over + // multiple seconds) + // ----------- + const SUMOReal helpDecel = nv->getCarFollowModel().getMaxDecel() * HELP_DECEL_FACTOR ; + + // change in the gap between ego and blocker over 1 second (not STEP!) + const SUMOReal neighNewSpeed = MAX2((SUMOReal)0, nv->getSpeed() - ACCEL2SPEED(helpDecel)); + const SUMOReal neighNewSpeed1s = MAX2((SUMOReal)0, nv->getSpeed() - helpDecel); + const SUMOReal dv = plannedSpeed - neighNewSpeed1s; + // new gap between follower and self in case the follower does brake for 1s + const SUMOReal decelGap = neighFollow.second + dv; + const SUMOReal secureGap = nv->getCarFollowModel().getSecureGap(neighNewSpeed1s, plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel()); + if (gDebugFlag2) { + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " egoV=" << myVehicle.getSpeed() + << " egoNV=" << plannedSpeed + << " nvNewSpeed=" << neighNewSpeed + << " nvNewSpeed1s=" << neighNewSpeed1s + << " deltaGap=" << dv + << " decelGap=" << decelGap + << " secGap=" << secureGap + << "\n"; + } + if (decelGap > 0 && decelGap >= secureGap) { + // if the blocking neighbor brakes it could actually help + // how hard does it actually need to be? + const SUMOReal vsafe = MAX2(neighNewSpeed, nv->getCarFollowModel().followSpeed( + nv, nv->getSpeed(), neighFollow.second, plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel())); + msgPass.informNeighFollower(new Info(vsafe, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); + if (gDebugFlag2) { + std::cout << " wants to cut in before nv=" << nv->getID() + << " vsafe=" << vsafe + << " newSecGap=" << nv->getCarFollowModel().getSecureGap(vsafe, plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel()) + << "\n"; + } + } else if (dv > 0 && dv * remainingSeconds > (secureGap - decelGap + POSITION_EPS)) { + // decelerating once is sufficient to open up a large enough gap in time + msgPass.informNeighFollower(new Info(neighNewSpeed, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); + if (gDebugFlag2) { + std::cout << " wants to cut in before nv=" << nv->getID() << " (eventually)\n"; + } + } else if (dir == LCA_MRIGHT && !myAllowOvertakingRight && !nv->congested()) { + const SUMOReal vhelp = MAX2(neighNewSpeed, HELP_OVERTAKE); + msgPass.informNeighFollower(new Info(vhelp, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); + if (gDebugFlag2) { + std::cout << " wants to cut in before nv=" << nv->getID() << " (nv cannot overtake right)\n"; + } + } else { + SUMOReal vhelp = MAX2(nv->getSpeed(), myVehicle.getSpeed() + HELP_OVERTAKE); + if (nv->getSpeed() > myVehicle.getSpeed() && + ((dir == LCA_MRIGHT && myVehicle.getWaitingSeconds() > LCA_RIGHT_IMPATIENCE) + || (dir == LCA_MLEFT && plannedSpeed > CUT_IN_LEFT_SPEED_THRESHOLD) // VARIANT_22 (slowDownLeft) + // XXX this is a hack to determine whether the vehicles is on an on-ramp. This information should be retrieved from the network itself + || (dir == LCA_MLEFT && myLeftSpace > MAX_ONRAMP_LENGTH) + )) { + // let the follower slow down to increase the likelyhood that later vehicles will be slow enough to help + // follower should still be fast enough to open a gap + vhelp = MAX2(neighNewSpeed, myVehicle.getSpeed() + HELP_OVERTAKE); + if (gDebugFlag2) { + std::cout << " wants right follower to slow down a bit\n"; + } + if ((nv->getSpeed() - myVehicle.getSpeed()) / helpDecel < remainingSeconds) { + if (gDebugFlag2) { + std::cout << " wants to cut in before right follower nv=" << nv->getID() << " (eventually)\n"; + } + msgPass.informNeighFollower(new Info(vhelp, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); + return; + } + } + msgPass.informNeighFollower(new Info(vhelp, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); + // this follower is supposed to overtake us. slow down smoothly to allow this + const SUMOReal overtakeDist = (neighFollow.second // follower reaches ego back + + myVehicle.getVehicleType().getLengthWithGap() // follower reaches ego front + + nv->getVehicleType().getLength() // follower back at ego front + + myVehicle.getCarFollowModel().getSecureGap( // follower has safe dist to ego + plannedSpeed, vhelp, nv->getCarFollowModel().getMaxDecel())); + // speed difference to create a sufficiently large gap + const SUMOReal needDV = overtakeDist / remainingSeconds; + // make sure the deceleration is not to strong + myVSafes.push_back(MAX2(vhelp - needDV, myVehicle.getSpeed() - ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel()))); + + if (gDebugFlag2) { + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " veh=" << myVehicle.getID() + << " wants to be overtaken by=" << nv->getID() + << " overtakeDist=" << overtakeDist + << " vneigh=" << nv->getSpeed() + << " vhelp=" << vhelp + << " needDV=" << needDV + << " vsafe=" << myVSafes.back() + << "\n"; + } + } + } else if (neighFollow.first != 0) { + // we are not blocked no, make sure it remains that way + MSVehicle* nv = neighFollow.first; + const SUMOReal vsafe = nv->getCarFollowModel().followSpeed( + nv, nv->getSpeed(), neighFollow.second, plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel()); + msgPass.informNeighFollower(new Info(vsafe, dir), &myVehicle); + if (gDebugFlag2) { + std::cout << " wants to cut in before non-blocking follower nv=" << nv->getID() << "\n"; + } + } +} + + +void +MSLCM_JE2013::prepareStep() { + // keep information about strategic change direction + myOwnState = (myOwnState & LCA_STRATEGIC) ? (myOwnState & LCA_WANTS_LANECHANGE) : 0; + myLeadingBlockerLength = 0; + myLeftSpace = 0; + myVSafes.clear(); + myDontBrake = false; + // truncate to work around numerical instability between different builds + mySpeedGainProbability = ceil(mySpeedGainProbability * 100000.0) * 0.00001; + myKeepRightProbability = ceil(myKeepRightProbability * 100000.0) * 0.00001; +} + + +void +MSLCM_JE2013::changed(int dir) { + myOwnState = 0; + mySpeedGainProbability = 0; + myKeepRightProbability = 0; + if (myVehicle.getBestLaneOffset() == 0) { + // if we are not yet on our best lane there might still be unseen blockers + // (during patchSpeed) + myLeadingBlockerLength = 0; + myLeftSpace = 0; + } + myLookAheadSpeed = LOOK_AHEAD_MIN_SPEED; + myVSafes.clear(); + myDontBrake = false; + initLastLaneChangeOffset(dir); +} + + +int +MSLCM_JE2013::_wantsChange( + int laneOffset, + MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked) { + assert(laneOffset == 1 || laneOffset == -1); + const SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); + // compute bestLaneOffset + MSVehicle::LaneQ curr, neigh, best; + int bestLaneOffset = 0; + SUMOReal currentDist = 0; + SUMOReal neighDist = 0; + int currIdx = 0; + MSLane* prebLane = myVehicle.getLane(); + if (prebLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { + // internal edges are not kept inside the bestLanes structure + prebLane = prebLane->getLinkCont()[0]->getLane(); + } + for (int p = 0; p < (int) preb.size(); ++p) { + if (preb[p].lane == prebLane && p + laneOffset >= 0) { + assert(p + laneOffset < (int)preb.size()); + curr = preb[p]; + neigh = preb[p + laneOffset]; + currentDist = curr.length; + neighDist = neigh.length; + bestLaneOffset = curr.bestLaneOffset; + // VARIANT_13 (equalBest) + if (bestLaneOffset == 0 && preb[p + laneOffset].bestLaneOffset == 0) { + if (gDebugFlag2) { + std::cout << STEPS2TIME(currentTime) + << " veh=" << myVehicle.getID() + << " bestLaneOffsetOld=" << bestLaneOffset + << " bestLaneOffsetNew=" << laneOffset + << "\n"; + } + bestLaneOffset = laneOffset; + } + best = preb[p + bestLaneOffset]; + currIdx = p; + break; + } + } + // direction specific constants + const bool right = (laneOffset == -1); + const int lca = (right ? LCA_RIGHT : LCA_LEFT); + const int myLca = (right ? LCA_MRIGHT : LCA_MLEFT); + const int lcaCounter = (right ? LCA_LEFT : LCA_RIGHT); + const int myLcaCounter = (right ? LCA_MLEFT : LCA_MRIGHT); + const bool changeToBest = (right && bestLaneOffset < 0) || (!right && bestLaneOffset > 0); + // keep information about being a leader/follower + int ret = (myOwnState & 0xffff0000); + int req = 0; // the request to change or stay + + // VARIANT_5 (disableAMBACKBLOCKER1) + /* + if (leader.first != 0 + && (myOwnState & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0 + && (leader.first->getLaneChangeModel().getOwnState() & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0) { + + myOwnState &= (0xffffffff - LCA_AMBLOCKINGFOLLOWER_DONTBRAKE); + if (myVehicle.getSpeed() > SUMO_const_haltingSpeed) { + myOwnState |= LCA_AMBACKBLOCKER; + } else { + ret |= LCA_AMBACKBLOCKER; + myDontBrake = true; + } + } + */ + + if (gDebugFlag2) { + std::cout << STEPS2TIME(currentTime) + << " veh=" << myVehicle.getID() + << " firstBlocked=" << tryID(*firstBlocked) + << " lastBlocked=" << tryID(*lastBlocked) + << " neighLead=" << tryID(neighLead.first) + << " neighLeadGap=" << neighLead.second + << " neighFollow=" << tryID(neighFollow.first) + << " neighFollowGap=" << neighFollow.second + << "\n"; + } + + ret = slowDownForBlocked(lastBlocked, ret); + // VARIANT_14 (furtherBlock) + if (lastBlocked != firstBlocked) { + ret = slowDownForBlocked(firstBlocked, ret); + } + + + // we try to estimate the distance which is necessary to get on a lane + // we have to get on in order to keep our route + // we assume we need something that depends on our velocity + // and compare this with the free space on our wished lane + // + // if the free space is somehow less than the space we need, we should + // definitely try to get to the desired lane + // + // this rule forces our vehicle to change the lane if a lane changing is necessary soon + // lookAheadDistance: + // we do not want the lookahead distance to change all the time so we discrectize the speed a bit + + // VARIANT_18 (laHyst) + if (myVehicle.getSpeed() > myLookAheadSpeed) { + myLookAheadSpeed = myVehicle.getSpeed(); + } else { + myLookAheadSpeed = MAX2(LOOK_AHEAD_MIN_SPEED, + (LOOK_AHEAD_SPEED_MEMORY * myLookAheadSpeed + (1 - LOOK_AHEAD_SPEED_MEMORY) * myVehicle.getSpeed())); + } + //myLookAheadSpeed = myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle); + + //SUMOReal laDist = laSpeed > LOOK_FORWARD_SPEED_DIVIDER + // ? laSpeed * LOOK_FORWARD_FAR + // : laSpeed * LOOK_FORWARD_NEAR; + SUMOReal laDist = myLookAheadSpeed * (right ? LOOK_FORWARD_RIGHT : LOOK_FORWARD_LEFT); + laDist += myVehicle.getVehicleType().getLengthWithGap() * (SUMOReal) 2.; + // free space that is available for changing + //const SUMOReal neighSpeed = (neighLead.first != 0 ? neighLead.first->getSpeed() : + // neighFollow.first != 0 ? neighFollow.first->getSpeed() : + // best.lane->getSpeedLimit()); + // @note: while this lets vehicles change earlier into the correct direction + // it also makes the vehicles more "selfish" and prevents changes which are necessary to help others + + // VARIANT_15 (insideRoundabout) + int roundaboutEdgesAhead = 0; + for (std::vector::iterator it = curr.bestContinuations.begin(); it != curr.bestContinuations.end(); ++it) { + if ((*it) != 0 && (*it)->getEdge().isRoundabout()) { + roundaboutEdgesAhead += 1; + } else if (roundaboutEdgesAhead > 0) { + // only check the next roundabout + break; + } + } + int roundaboutEdgesAheadNeigh = 0; + for (std::vector::iterator it = neigh.bestContinuations.begin(); it != neigh.bestContinuations.end(); ++it) { + if ((*it) != 0 && (*it)->getEdge().isRoundabout()) { + roundaboutEdgesAheadNeigh += 1; + } else if (roundaboutEdgesAheadNeigh > 0) { + // only check the next roundabout + break; + } + } + if (roundaboutEdgesAhead > 1) { + currentDist += roundaboutEdgesAhead * ROUNDABOUT_DIST_BONUS; + neighDist += roundaboutEdgesAheadNeigh * ROUNDABOUT_DIST_BONUS; + } + if (roundaboutEdgesAhead > 0) { + if (gDebugFlag2) { + std::cout << " roundaboutEdgesAhead=" << roundaboutEdgesAhead << " roundaboutEdgesAheadNeigh=" << roundaboutEdgesAheadNeigh << "\n"; + } + } + + const SUMOReal usableDist = (currentDist - myVehicle.getPositionOnLane() - best.occupation * JAM_FACTOR); + //- (best.lane->getVehicleNumber() * neighSpeed)); // VARIANT 9 jfSpeed + const SUMOReal maxJam = MAX2(preb[currIdx + laneOffset].occupation, preb[currIdx].occupation); + const SUMOReal neighLeftPlace = MAX2((SUMOReal) 0, neighDist - myVehicle.getPositionOnLane() - maxJam); + + if (gDebugFlag2) { + std::cout << STEPS2TIME(currentTime) + << " veh=" << myVehicle.getID() + << " laSpeed=" << myLookAheadSpeed + << " laDist=" << laDist + << " currentDist=" << currentDist + << " usableDist=" << usableDist + << " bestLaneOffset=" << bestLaneOffset + << " best.length=" << best.length + << " maxJam=" << maxJam + << " neighLeftPlace=" << neighLeftPlace + << "\n"; + } + + if (changeToBest && bestLaneOffset == curr.bestLaneOffset + && currentDistDisallows(usableDist, bestLaneOffset, laDist)) { + /// @brief we urgently need to change lanes to follow our route + ret = ret | lca | LCA_STRATEGIC | LCA_URGENT; + } else { + // VARIANT_20 (noOvertakeRight) + if (!myAllowOvertakingRight && !right && !myVehicle.congested() && neighLead.first != 0) { + // check for slower leader on the left. we should not overtake but + // rather move left ourselves (unless congested) + MSVehicle* nv = neighLead.first; + if (nv->getSpeed() < myVehicle.getSpeed()) { + const SUMOReal vSafe = myCarFollowModel.followSpeed( + &myVehicle, myVehicle.getSpeed(), neighLead.second, nv->getSpeed(), nv->getCarFollowModel().getMaxDecel()); + myVSafes.push_back(vSafe); + if (vSafe < myVehicle.getSpeed()) { + mySpeedGainProbability += CHANGE_PROB_THRESHOLD_LEFT / 3; + } + if (gDebugFlag2) { + std::cout << STEPS2TIME(currentTime) + << " avoid overtaking on the right nv=" << nv->getID() + << " nvSpeed=" << nv->getSpeed() + << " mySpeedGainProbability=" << mySpeedGainProbability + << " plannedSpeed=" << myVSafes.back() + << "\n"; + } + } + } + + if (!changeToBest && (currentDistDisallows(neighLeftPlace, abs(bestLaneOffset) + 2, laDist))) { + // the opposite lane-changing direction should be done than the one examined herein + // we'll check whether we assume we could change anyhow and get back in time... + // + // this rule prevents the vehicle from moving in opposite direction of the best lane + // unless the way till the end where the vehicle has to be on the best lane + // is long enough + if (gDebugFlag2) { + std::cout << " veh=" << myVehicle.getID() << " could not change back and forth in time (1) neighLeftPlace=" << neighLeftPlace << "\n"; + } + ret = ret | LCA_STAY | LCA_STRATEGIC; + } else if (bestLaneOffset == 0 && (neighLeftPlace * 2. < laDist)) { + // the current lane is the best and a lane-changing would cause a situation + // of which we assume we will not be able to return to the lane we have to be on. + // this rule prevents the vehicle from leaving the current, best lane when it is + // close to this lane's end + if (gDebugFlag2) { + std::cout << " veh=" << myVehicle.getID() << " could not change back and forth in time (2) neighLeftPlace=" << neighLeftPlace << "\n"; + } + ret = ret | LCA_STAY | LCA_STRATEGIC; + } else if (bestLaneOffset == 0 + && (leader.first == 0 || !leader.first->isStopped()) + && neigh.bestContinuations.back()->getLinkCont().size() != 0 + && roundaboutEdgesAhead == 0 + && neighDist < TURN_LANE_DIST) { + // VARIANT_21 (stayOnBest) + // we do not want to leave the best lane for a lane which leads elsewhere + // unless our leader is stopped or we are approaching a roundabout + if (gDebugFlag2) { + std::cout << " veh=" << myVehicle.getID() << " does not want to leave the bestLane (neighDist=" << neighDist << ")\n"; + } + ret = ret | LCA_STAY | LCA_STRATEGIC; + } + } + // check for overriding TraCI requests + if (gDebugFlag2) { + std::cout << STEPS2TIME(currentTime) << " veh=" << myVehicle.getID() << " ret=" << ret; + } + ret = myVehicle.influenceChangeDecision(ret); + if ((ret & lcaCounter) != 0) { + // we are not interested in traci requests for the opposite direction here + ret &= ~(LCA_TRACI | lcaCounter | LCA_URGENT); + } + if (gDebugFlag2) { + std::cout << " retAfterInfluence=" << ret << "\n"; + } + + if ((ret & LCA_STAY) != 0) { + return ret; + } + if ((ret & LCA_URGENT) != 0) { + // prepare urgent lane change maneuver + // save the left space + myLeftSpace = currentDist - myVehicle.getPositionOnLane(); + if (changeToBest && abs(bestLaneOffset) > 1) { + // there might be a vehicle which needs to counter-lane-change one lane further and we cannot see it yet + if (gDebugFlag2) { + std::cout << " reserving space for unseen blockers\n"; + } + myLeadingBlockerLength = MAX2((SUMOReal)(right ? 20.0 : 40.0), myLeadingBlockerLength); + } + + // letting vehicles merge in at the end of the lane in case of counter-lane change, step#1 + // if there is a leader and he wants to change to the opposite direction + saveBlockerLength(neighLead.first, lcaCounter); + if (*firstBlocked != neighLead.first) { + saveBlockerLength(*firstBlocked, lcaCounter); + } + + const SUMOReal remainingSeconds = ((ret & LCA_TRACI) == 0 ? + MAX2((SUMOReal)STEPS2TIME(TS), myLeftSpace / MAX2(myLookAheadSpeed, NUMERICAL_EPS) / abs(bestLaneOffset) / URGENCY) : + myVehicle.getInfluencer().changeRequestRemainingSeconds(currentTime)); + const SUMOReal plannedSpeed = informLeader(msgPass, blocked, myLca, neighLead, remainingSeconds); + if (plannedSpeed >= 0) { + // maybe we need to deal with a blocking follower + informFollower(msgPass, blocked, myLca, neighFollow, remainingSeconds, plannedSpeed); + } + + if (gDebugFlag2) { + std::cout << STEPS2TIME(currentTime) + << " veh=" << myVehicle.getID() + << " myLeftSpace=" << myLeftSpace + << " remainingSeconds=" << remainingSeconds + << " plannedSpeed=" << plannedSpeed + << "\n"; + } + return ret; + } + + // VARIANT_15 + if (roundaboutEdgesAhead > 1) { + // try to use the inner lanes of a roundabout to increase throughput + // unless we are approaching the exit + if (lca == LCA_LEFT) { + req = ret | lca | LCA_COOPERATIVE; + } else { + req = ret | LCA_STAY | LCA_COOPERATIVE; + } + if (!cancelRequest(req)) { + return ret | req; + } + } + + // let's also regard the case where the vehicle is driving on a highway... + // in this case, we do not want to get to the dead-end of an on-ramp + if (right) { + if (bestLaneOffset == 0 && myVehicle.getLane()->getSpeedLimit() > 80. / 3.6 && myLookAheadSpeed > SUMO_const_haltingSpeed) { + if (gDebugFlag2) { + std::cout << " veh=" << myVehicle.getID() << " does not want to get stranded on the on-ramp of a highway\n"; + } + req = ret | LCA_STAY | LCA_STRATEGIC; + if (!cancelRequest(req)) { + return ret | req; + } + } + } + // -------- + + // -------- make place on current lane if blocking follower + //if (amBlockingFollowerPlusNB()) { + // std::cout << myVehicle.getID() << ", " << currentDistAllows(neighDist, bestLaneOffset, laDist) + // << " neighDist=" << neighDist + // << " currentDist=" << currentDist + // << "\n"; + //} + if (amBlockingFollowerPlusNB() + //&& ((myOwnState & myLcaCounter) == 0) // VARIANT_6 : counterNoHelp + && (changeToBest || currentDistAllows(neighDist, abs(bestLaneOffset) + 1, laDist))) { + + // VARIANT_2 (nbWhenChangingToHelp) + if (gDebugFlag2) { + std::cout << STEPS2TIME(currentTime) + << " veh=" << myVehicle.getID() + << " wantsChangeToHelp=" << (right ? "right" : "left") + << " state=" << myOwnState + << (((myOwnState & myLcaCounter) != 0) ? " (counter)" : "") + << "\n"; + } + req = ret | lca | LCA_COOPERATIVE | LCA_URGENT ;//| LCA_CHANGE_TO_HELP; + if (!cancelRequest(req)) { + return ret | req; + } + } + + // -------- + + + //// -------- security checks for krauss + //// (vsafe fails when gap<0) + //if ((blocked & LCA_BLOCKED) != 0) { + // return ret; + //} + //// -------- + + // -------- higher speed + //if ((congested(neighLead.first) && neighLead.second < 20) || predInteraction(leader.first)) { //!!! + // return ret; + //} + 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 { + // @todo: what if leader is below safe gap?!!! + neighLaneVSafe = MIN2(neighLaneVSafe, myCarFollowModel.followSpeed( + &myVehicle, myVehicle.getSpeed(), neighLead.second, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel())); + } + if (leader.first == 0) { + thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), currentDist, 0, 0)); + } else { + // @todo: what if leader is below safe gap?!!! + thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), leader.second, leader.first->getSpeed(), leader.first->getCarFollowModel().getMaxDecel())); + } + + const SUMOReal vMax = MIN2(myVehicle.getVehicleType().getMaxSpeed(), myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle)); + thisLaneVSafe = MIN2(thisLaneVSafe, vMax); + neighLaneVSafe = MIN2(neighLaneVSafe, vMax); + const SUMOReal relativeGain = (neighLaneVSafe - thisLaneVSafe) / MAX2(neighLaneVSafe, + RELGAIN_NORMALIZATION_MIN_SPEED); + + if (right) { + // ONLY FOR CHANGING TO THE RIGHT + if (thisLaneVSafe - 5 / 3.6 > neighLaneVSafe) { + // ok, the current lane is faster than the right one... + if (mySpeedGainProbability < 0) { + mySpeedGainProbability /= 2.0; + } + } else { + // ok, the current lane is not faster than the right one + mySpeedGainProbability -= relativeGain; + + // honor the obligation to keep right (Rechtsfahrgebot) + // XXX consider fast approaching followers on the current lane + //const SUMOReal vMax = myLookAheadSpeed; + const SUMOReal acceptanceTime = KEEP_RIGHT_ACCEPTANCE * vMax * MAX2((SUMOReal)1, myVehicle.getSpeed()) / myVehicle.getLane()->getSpeedLimit(); + SUMOReal fullSpeedGap = MAX2((SUMOReal)0, neighDist - myVehicle.getCarFollowModel().brakeGap(vMax)); + SUMOReal fullSpeedDrivingSeconds = MIN2(acceptanceTime, fullSpeedGap / vMax); + if (neighLead.first != 0 && neighLead.first->getSpeed() < vMax) { + fullSpeedGap = MAX2((SUMOReal)0, MIN2(fullSpeedGap, + neighLead.second - myVehicle.getCarFollowModel().getSecureGap( + vMax, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel()))); + fullSpeedDrivingSeconds = MIN2(fullSpeedDrivingSeconds, fullSpeedGap / (vMax - neighLead.first->getSpeed())); + } + const SUMOReal deltaProb = (CHANGE_PROB_THRESHOLD_RIGHT + * STEPS2TIME(DELTA_T) + * (fullSpeedDrivingSeconds / acceptanceTime) / KEEP_RIGHT_TIME); + myKeepRightProbability -= deltaProb; + + if (gDebugFlag2) { + std::cout << STEPS2TIME(currentTime) + << " veh=" << myVehicle.getID() + << " vMax=" << vMax + << " neighDist=" << neighDist + << " brakeGap=" << myVehicle.getCarFollowModel().brakeGap(myVehicle.getSpeed()) + << " leaderSpeed=" << (neighLead.first == 0 ? -1 : neighLead.first->getSpeed()) + << " secGap=" << (neighLead.first == 0 ? -1 : myVehicle.getCarFollowModel().getSecureGap( + myVehicle.getSpeed(), neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel())) + << " acceptanceTime=" << acceptanceTime + << " fullSpeedGap=" << fullSpeedGap + << " fullSpeedDrivingSeconds=" << fullSpeedDrivingSeconds + << " dProb=" << deltaProb + << "\n"; + } + if (myKeepRightProbability < -CHANGE_PROB_THRESHOLD_RIGHT) { + req = ret | lca | LCA_KEEPRIGHT; + if (!cancelRequest(req)) { + return ret | req; + } + } + } + + if (gDebugFlag2) { + std::cout << STEPS2TIME(currentTime) + << " veh=" << myVehicle.getID() + << " speed=" << myVehicle.getSpeed() + << " myKeepRightProbability=" << myKeepRightProbability + << " thisLaneVSafe=" << thisLaneVSafe + << " neighLaneVSafe=" << neighLaneVSafe + << " relativeGain=" << relativeGain + << " blocked=" << blocked + << "\n"; + } + + if (mySpeedGainProbability < -CHANGE_PROB_THRESHOLD_RIGHT + && neighDist / MAX2((SUMOReal) .1, myVehicle.getSpeed()) > 20.) { //./MAX2((SUMOReal) .1, myVehicle.getSpeed())) { // -.1 + req = ret | lca | LCA_SPEEDGAIN; + if (!cancelRequest(req)) { + return ret | req; + } + } + } else { + // ONLY FOR CHANGING TO THE LEFT + if (thisLaneVSafe > neighLaneVSafe) { + // this lane is better + if (mySpeedGainProbability > 0) { + mySpeedGainProbability /= 2.0; + } + } else { + // left lane is better + mySpeedGainProbability += relativeGain; + } + // VARIANT_19 (stayRight) + //if (neighFollow.first != 0) { + // MSVehicle* nv = neighFollow.first; + // const SUMOReal secGap = nv->getCarFollowModel().getSecureGap(nv->getSpeed(), myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel()); + // if (neighFollow.second < secGap * KEEP_RIGHT_HEADWAY) { + // // do not change left if it would inconvenience faster followers + // return ret | LCA_STAY | LCA_SPEEDGAIN; + // } + //} + if (mySpeedGainProbability > CHANGE_PROB_THRESHOLD_LEFT && neighDist / MAX2((SUMOReal) .1, myVehicle.getSpeed()) > 20.) { // .1 + req = ret | lca | LCA_SPEEDGAIN; + if (!cancelRequest(req)) { + return ret | req; + } + } + } + // -------- + if (changeToBest && bestLaneOffset == curr.bestLaneOffset + && (right ? mySpeedGainProbability < 0 : mySpeedGainProbability > 0)) { + // change towards the correct lane, speedwise it does not hurt + req = ret | lca | LCA_STRATEGIC; + if (!cancelRequest(req)) { + return ret | req; + } + } + if (gDebugFlag2) { + std::cout << STEPS2TIME(currentTime) + << " veh=" << myVehicle.getID() + << " mySpeedGainProbability=" << mySpeedGainProbability + << " myKeepRightProbability=" << myKeepRightProbability + << " thisLaneVSafe=" << thisLaneVSafe + << " neighLaneVSafe=" << neighLaneVSafe + << "\n"; + } + return ret; +} + + +int +MSLCM_JE2013::slowDownForBlocked(MSVehicle** blocked, int state) { + // if this vehicle is blocking someone in front, we maybe decelerate to let him in + if ((*blocked) != 0) { + SUMOReal gap = (*blocked)->getPositionOnLane() - (*blocked)->getVehicleType().getLength() - myVehicle.getPositionOnLane() - myVehicle.getVehicleType().getMinGap(); + if (gDebugFlag2) { + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " veh=" << myVehicle.getID() + << " blocked=" << tryID(*blocked) + << " gap=" << gap + << "\n"; + } + if (gap > POSITION_EPS) { + //const bool blockedWantsUrgentRight = (((*blocked)->getLaneChangeModel().getOwnState() & LCA_RIGHT != 0) + // && ((*blocked)->getLaneChangeModel().getOwnState() & LCA_URGENT != 0)); + + if (myVehicle.getSpeed() < ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel()) + //|| blockedWantsUrgentRight // VARIANT_10 (helpblockedRight) + ) { + if ((*blocked)->getSpeed() < SUMO_const_haltingSpeed) { + state |= LCA_AMBACKBLOCKER_STANDING; + } else { + state |= LCA_AMBACKBLOCKER; + } + myVSafes.push_back(myCarFollowModel.followSpeed( + &myVehicle, myVehicle.getSpeed(), + (SUMOReal)(gap - POSITION_EPS), (*blocked)->getSpeed(), + (*blocked)->getCarFollowModel().getMaxDecel())); + //(*blocked) = 0; // VARIANT_14 (furtherBlock) + } + } + } + return state; +} + + +void +MSLCM_JE2013::saveBlockerLength(MSVehicle* blocker, int lcaCounter) { + if (gDebugFlag2) { + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " veh=" << myVehicle.getID() + << " saveBlockerLength blocker=" << tryID(blocker) + << " bState=" << (blocker == 0 ? "None" : toString(blocker->getLaneChangeModel().getOwnState())) + << "\n"; + } + if (blocker != 0 && (blocker->getLaneChangeModel().getOwnState() & lcaCounter) != 0) { + // is there enough space in front of us for the blocker? + const SUMOReal potential = myLeftSpace - myVehicle.getCarFollowModel().brakeGap( + myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel(), 0); + if (blocker->getVehicleType().getLengthWithGap() <= potential) { + // save at least his length in myLeadingBlockerLength + myLeadingBlockerLength = MAX2(blocker->getVehicleType().getLengthWithGap(), myLeadingBlockerLength); + if (gDebugFlag2) { + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " veh=" << myVehicle.getID() + << " blocker=" << tryID(blocker) + << " saving myLeadingBlockerLength=" << myLeadingBlockerLength + << "\n"; + } + } else { + // we cannot save enough space for the blocker. It needs to save + // space for ego instead + if (gDebugFlag2) { + std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) + << " veh=" << myVehicle.getID() + << " blocker=" << tryID(blocker) + << " cannot save space=" << blocker->getVehicleType().getLengthWithGap() + << " potential=" << potential + << "\n"; + } + blocker->getLaneChangeModel().saveBlockerLength(myVehicle.getVehicleType().getLengthWithGap()); + } + } +} +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/lcmodels/MSLCM_JE2013.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSLCM_JE2013.h --- sumo-0.21.0+dfsg/src/microsim/lcmodels/MSLCM_JE2013.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSLCM_JE2013.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,197 @@ +/****************************************************************************/ +/// @file MSLCM_JE2013.h +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @author Laura Bieker +/// @date Fri, 08.10.2013 +/// @version $Id: MSLCM_JE2013.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A lane change model developed by J. Erdmann +// based on the model of D. Krajzewicz developed between 2004 and 2011 (MSLCM_DK2004) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 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 MSLCM_JE2013_h +#define MSLCM_JE2013_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include "MSAbstractLaneChangeModel.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSLCM_JE2013 + * @brief A lane change model developed by J. Erdmann + */ +class MSLCM_JE2013 : public MSAbstractLaneChangeModel { +public: + + enum MyLCAEnum { + LCA_AMBLOCKINGLEADER = 1 << 16, + LCA_AMBLOCKINGFOLLOWER = 1 << 17, + LCA_MRIGHT = 1 << 18, + LCA_MLEFT = 1 << 19, + // !!! never set LCA_UNBLOCK = 1 << 20, + LCA_AMBLOCKINGFOLLOWER_DONTBRAKE = 1 << 21, + // !!! never used LCA_AMBLOCKINGSECONDFOLLOWER = 1 << 22, + LCA_CHANGE_TO_HELP = 1 << 23, + // !!! never read LCA_KEEP1 = 1 << 24, + // !!! never used LCA_KEEP2 = 1 << 25, + LCA_AMBACKBLOCKER = 1 << 26, + LCA_AMBACKBLOCKER_STANDING = 1 << 27 + }; + + + MSLCM_JE2013(MSVehicle& v); + + virtual ~MSLCM_JE2013(); + + /** @brief Called to examine whether the vehicle wants to change + * using the given laneOffset. + * This method gets the information about the surrounding vehicles + * and whether another lane may be more preferable */ + int wantsChange( + int laneOffset, + MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked); + + void* inform(void* info, MSVehicle* sender); + + /** @brief Called to adapt the speed in order to allow a lane change. + * + * @param min The minimum resulting speed + * @param wanted The aspired speed of the car following model + * @param max The maximum resulting speed + * @param cfModel The model used + * @return the new speed of the vehicle as proposed by the lane changer + */ + SUMOReal patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, + const MSCFModel& cfModel); + /** helper function which contains the actual logic */ + SUMOReal _patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, + const MSCFModel& cfModel); + + void changed(int dir); + + void prepareStep(); + + +protected: + + /// @brief helper function for doing the actual work + int _wantsChange( + int laneOffset, + MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked); + + + /* @brief decide whether we will overtake or follow a blocking leader + * and inform it accordingly + * If we decide to follow, myVSafes will be extended + * returns the planned speed if following or -1 if overtaking */ + SUMOReal informLeader(MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, int dir, + const std::pair& neighLead, + SUMOReal remainingSeconds); + + /// @brief decide whether we will try cut in before the follower or allow to be overtaken + void informFollower(MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, int dir, + const std::pair& neighFollow, + SUMOReal remainingSeconds, + SUMOReal plannedSpeed); + + + /// @brief compute useful slowdowns for blocked vehicles + int slowDownForBlocked(MSVehicle** blocked, int state); + + /// @brief save space for vehicles which need to counter-lane-change + void saveBlockerLength(MSVehicle* blocker, int lcaCounter); + + /// @brief reserve space at the end of the lane to avoid dead locks + inline void saveBlockerLength(SUMOReal length) { + myLeadingBlockerLength = MAX2(length, myLeadingBlockerLength); + }; + + inline bool amBlockingLeader() { + return (myOwnState & LCA_AMBLOCKINGLEADER) != 0; + } + inline bool amBlockingFollower() { + return (myOwnState & LCA_AMBLOCKINGFOLLOWER) != 0; + } + inline bool amBlockingFollowerNB() { + return (myOwnState & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0; + } + inline bool amBlockingFollowerPlusNB() { + return (myOwnState & (LCA_AMBLOCKINGFOLLOWER | LCA_AMBLOCKINGFOLLOWER_DONTBRAKE)) != 0; + } + inline bool currentDistDisallows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) { + return dist / (abs(laneOffset)) < lookForwardDist; + } + inline bool currentDistAllows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) { + return dist / abs(laneOffset) > lookForwardDist; + } + + /// @brief information regarding save velocity (unused) and state flags of the ego vehicle + typedef std::pair Info; + + + +protected: + /// @brief a value for tracking the probability that a change to the offset with the same sign is beneficial + SUMOReal mySpeedGainProbability; + /* @brief a value for tracking the probability of following the/"Rechtsfahrgebot" + * A larger negative value indicates higher probability for moving to the + * right (as in mySpeedGainProbability) */ + SUMOReal myKeepRightProbability; + + SUMOReal myLeadingBlockerLength; + SUMOReal myLeftSpace; + + /*@brief the speed to use when computing the look-ahead distance for + * determining urgency of strategic lane changes */ + SUMOReal myLookAheadSpeed; + + std::vector myVSafes; + bool myDontBrake; + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/lcmodels/MSLCM_LC2013.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSLCM_LC2013.cpp --- sumo-0.21.0+dfsg/src/microsim/lcmodels/MSLCM_LC2013.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSLCM_LC2013.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,780 @@ +/****************************************************************************/ +/// @file MSLCM_LC2013.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Friedemann Wesner +/// @author Sascha Krieg +/// @author Michael Behrisch +/// @date Fri, 08.10.2013 +/// @version $Id: MSLCM_LC2013.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013 +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "MSLCM_LC2013.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + +//#define DEBUG_VEHICLE_GUI_SELECTION 1 +#ifdef DEBUG_VEHICLE_GUI_SELECTION +#include +#include +#include +#endif + + + +// =========================================================================== +// variable definitions +// =========================================================================== +// 80km/h will be the threshold for dividing between long/short foresight +#define LOOK_FORWARD_SPEED_DIVIDER (SUMOReal)14. + +#define LOOK_FORWARD_RIGHT (SUMOReal)10. +#define LOOK_FORWARD_LEFT (SUMOReal)20. + +#define JAM_FACTOR (SUMOReal)1. + +#define LCA_RIGHT_IMPATIENCE (SUMOReal)-1. +#define CUT_IN_LEFT_SPEED_THRESHOLD (SUMOReal)27. + +#define LOOK_AHEAD_MIN_SPEED (SUMOReal)0.0 +#define LOOK_AHEAD_SPEED_MEMORY (SUMOReal)0.9 +#define LOOK_AHEAD_SPEED_DECREMENT 6. + +#define HELP_DECEL_FACTOR (SUMOReal)1.0 + +#define HELP_OVERTAKE (SUMOReal)(10.0 / 3.6) +#define MIN_FALLBEHIND (SUMOReal)(14.0 / 3.6) + +#define URGENCY (SUMOReal)2.0 + +#define ROUNDABOUT_DIST_BONUS (SUMOReal)80.0 + +#define CHANGE_PROB_THRESHOLD_RIGHT (SUMOReal)2.0 +#define CHANGE_PROB_THRESHOLD_LEFT (SUMOReal)0.2 +#define KEEP_RIGHT_TIME (SUMOReal)5.0 // the number of seconds after which a vehicle should move to the right lane +#define KEEP_RIGHT_ACCEPTANCE (SUMOReal)2.0 // calibration factor for determining the desire to keep right + +#define RELGAIN_NORMALIZATION_MIN_SPEED (SUMOReal)10.0 + +// =========================================================================== +// member method definitions +// =========================================================================== +MSLCM_LC2013::MSLCM_LC2013(MSVehicle& v) : + MSAbstractLaneChangeModel(v), + mySpeedGainProbability(0), + myKeepRightProbability(0), + myLeadingBlockerLength(0), + myLeftSpace(0), + myLookAheadSpeed(LOOK_AHEAD_MIN_SPEED) +{} + +MSLCM_LC2013::~MSLCM_LC2013() { + changed(0); +} + + +int +MSLCM_LC2013::wantsChange( + int laneOffset, + MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked) { + const int result = _wantsChange(laneOffset, msgPass, blocked, leader, neighLead, neighFollow, neighLane, preb, lastBlocked, firstBlocked); + return result; +} + + +SUMOReal +MSLCM_LC2013::patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel& cfModel) { + const SUMOReal newSpeed = _patchSpeed(min, wanted, max, cfModel); + return newSpeed; +} + + +SUMOReal +MSLCM_LC2013::_patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel& cfModel) { + int state = myOwnState; + + // letting vehicles merge in at the end of the lane in case of counter-lane change, step#2 + SUMOReal MAGIC_offset = 1.; + // if we want to change and have a blocking leader and there is enough room for him in front of us + if (myLeadingBlockerLength != 0) { + SUMOReal space = myLeftSpace - myLeadingBlockerLength - MAGIC_offset - myVehicle.getVehicleType().getMinGap(); + if (space > 0) { + // compute speed for decelerating towards a place which allows the blocking leader to merge in in front + SUMOReal safe = cfModel.stopSpeed(&myVehicle, myVehicle.getSpeed(), space); + // if we are approaching this place + if (safe < wanted) { + // return this speed as the speed to use + return MAX2(min, safe); + } + } + } + + SUMOReal nVSafe = wanted; + bool gotOne = false; + for (std::vector::const_iterator i = myVSafes.begin(); i != myVSafes.end(); ++i) { + SUMOReal v = (*i); + if (v >= min && v <= max) { + nVSafe = MIN2(v, nVSafe); + gotOne = true; + } else { + } + } + + if (gotOne && !myDontBrake) { + return nVSafe; + } + + // check whether the vehicle is blocked + if ((state & LCA_WANTS_LANECHANGE) != 0 && (state & LCA_BLOCKED) != 0) { + if ((state & LCA_STRATEGIC) != 0) { + // necessary decelerations are controlled via vSafe. If there are + // none it means we should speed up + return (max + wanted) / (SUMOReal) 2.0; + } else if ((state & LCA_COOPERATIVE) != 0) { + // only minor adjustments in speed should be done + if ((state & LCA_BLOCKED_BY_LEADER) != 0) { + return (min + wanted) / (SUMOReal) 2.0; + } + if ((state & LCA_BLOCKED_BY_FOLLOWER) != 0) { + return (max + wanted) / (SUMOReal) 2.0; + } + } + } + + // accelerate if being a blocking leader or blocking follower not able to brake + // (and does not have to change lanes) + if ((state & LCA_AMBLOCKINGLEADER) != 0) { + return (max + wanted) / (SUMOReal) 2.0; + } + + if ((state & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0) { + } + if (myVehicle.getLane()->getEdge().getLanes().size() == 1) { + // remove chaning information if on a road with a single lane + changed(0); + } + return wanted; +} + + +void* +MSLCM_LC2013::inform(void* info, MSVehicle* /* sender */) { + Info* pinfo = (Info*) info; + myVSafes.push_back(pinfo->first); + myOwnState |= pinfo->second; + delete pinfo; + return (void*) true; +} + + +SUMOReal +MSLCM_LC2013::informLeader(MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, + int dir, + const std::pair& neighLead, + SUMOReal remainingSeconds) { + SUMOReal plannedSpeed = MIN2(myVehicle.getSpeed(), + myVehicle.getCarFollowModel().stopSpeed(&myVehicle, myVehicle.getSpeed(), myLeftSpace - myLeadingBlockerLength)); + for (std::vector::const_iterator i = myVSafes.begin(); i != myVSafes.end(); ++i) { + SUMOReal v = (*i); + if (v >= myVehicle.getSpeed() - ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel())) { + plannedSpeed = MIN2(plannedSpeed, v); + } + } + if ((blocked & LCA_BLOCKED_BY_LEADER) != 0) { + assert(neighLead.first != 0); + MSVehicle* nv = neighLead.first; + // decide whether we want to overtake the leader or follow it + const SUMOReal dv = plannedSpeed - nv->getSpeed(); + const SUMOReal overtakeDist = (neighLead.second // drive to back of follower + + nv->getVehicleType().getLengthWithGap() // drive to front of follower + + myVehicle.getVehicleType().getLength() // ego back reaches follower front + + nv->getCarFollowModel().getSecureGap( // save gap to follower + nv->getSpeed(), myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel())); + + if (dv < 0 + // overtaking on the right on an uncongested highway is forbidden (noOvertakeLCLeft) + || (dir == LCA_MLEFT && !myVehicle.congested() && !myAllowOvertakingRight) + // not enough space to overtake? + || myLeftSpace < overtakeDist + // not enough time to overtake? + || dv * remainingSeconds < overtakeDist) { + // cannot overtake + msgPass.informNeighLeader(new Info(-1, dir | LCA_AMBLOCKINGLEADER), &myVehicle); + // slow down smoothly to follow leader + const SUMOReal targetSpeed = myCarFollowModel.followSpeed( + &myVehicle, myVehicle.getSpeed(), neighLead.second, nv->getSpeed(), nv->getCarFollowModel().getMaxDecel()); + if (targetSpeed < myVehicle.getSpeed()) { + // slow down smoothly to follow leader + const SUMOReal decel = ACCEL2SPEED(MIN2(myVehicle.getCarFollowModel().getMaxDecel(), + MAX2(MIN_FALLBEHIND, (myVehicle.getSpeed() - targetSpeed) / remainingSeconds))); + const SUMOReal nextSpeed = MIN2(plannedSpeed, myVehicle.getSpeed() - decel); + myVSafes.push_back(nextSpeed); + return nextSpeed; + } else { + // leader is fast enough anyway + myVSafes.push_back(targetSpeed); + return plannedSpeed; + } + } else { + // overtaking, leader should not accelerate + msgPass.informNeighLeader(new Info(nv->getSpeed(), dir | LCA_AMBLOCKINGLEADER), &myVehicle); + return -1; + } + } else if (neighLead.first != 0) { // (remainUnblocked) + // we are not blocked now. make sure we stay far enough from the leader + MSVehicle* nv = neighLead.first; + const SUMOReal nextNVSpeed = nv->getSpeed() - HELP_OVERTAKE; // conservative + const SUMOReal dv = SPEED2DIST(myVehicle.getSpeed() - nextNVSpeed); + const SUMOReal targetSpeed = myCarFollowModel.followSpeed( + &myVehicle, myVehicle.getSpeed(), neighLead.second - dv, nextNVSpeed, nv->getCarFollowModel().getMaxDecel()); + myVSafes.push_back(targetSpeed); + return MIN2(targetSpeed, plannedSpeed); + } else { + // not overtaking + return plannedSpeed; + } +} + + +void +MSLCM_LC2013::informFollower(MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, + int dir, + const std::pair& neighFollow, + SUMOReal remainingSeconds, + SUMOReal plannedSpeed) { + if ((blocked & LCA_BLOCKED_BY_FOLLOWER) != 0) { + assert(neighFollow.first != 0); + MSVehicle* nv = neighFollow.first; + + // are we fast enough to cut in without any help? + if (plannedSpeed - nv->getSpeed() >= HELP_OVERTAKE) { + const SUMOReal neededGap = nv->getCarFollowModel().getSecureGap(nv->getSpeed(), plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel()); + if ((neededGap - neighFollow.second) / remainingSeconds < (plannedSpeed - nv->getSpeed())) { + // follower might even accelerate but not to much + msgPass.informNeighFollower(new Info(plannedSpeed - HELP_OVERTAKE, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); + return; + } + } + // decide whether we will request help to cut in before the follower or allow to be overtaken + + // PARAMETERS + // assume other vehicle will assume the equivalent of 1 second of + // maximum deceleration to help us (will probably be spread over + // multiple seconds) + // ----------- + const SUMOReal helpDecel = nv->getCarFollowModel().getMaxDecel() * HELP_DECEL_FACTOR ; + + // change in the gap between ego and blocker over 1 second (not STEP!) + const SUMOReal neighNewSpeed = MAX2((SUMOReal)0, nv->getSpeed() - ACCEL2SPEED(helpDecel)); + const SUMOReal neighNewSpeed1s = MAX2((SUMOReal)0, nv->getSpeed() - helpDecel); + const SUMOReal dv = plannedSpeed - neighNewSpeed1s; + // new gap between follower and self in case the follower does brake for 1s + const SUMOReal decelGap = neighFollow.second + dv; + const SUMOReal secureGap = nv->getCarFollowModel().getSecureGap(neighNewSpeed1s, plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel()); + if (decelGap > 0 && decelGap >= secureGap) { + // if the blocking neighbor brakes it could actually help + // how hard does it actually need to be? + const SUMOReal vsafe = MAX2(neighNewSpeed, nv->getCarFollowModel().followSpeed( + nv, nv->getSpeed(), neighFollow.second, plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel())); + msgPass.informNeighFollower(new Info(vsafe, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); + } else if (dv > 0 && dv * remainingSeconds > (secureGap - decelGap + POSITION_EPS)) { + // decelerating once is sufficient to open up a large enough gap in time + msgPass.informNeighFollower(new Info(neighNewSpeed, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); + } else { + SUMOReal vhelp = MAX2(nv->getSpeed(), myVehicle.getSpeed() + HELP_OVERTAKE); + //if (dir == LCA_MRIGHT && myVehicle.getWaitingSeconds() > LCA_RIGHT_IMPATIENCE && + // nv->getSpeed() > myVehicle.getSpeed()) { + if (nv->getSpeed() > myVehicle.getSpeed() && + ((dir == LCA_MRIGHT && myVehicle.getWaitingSeconds() > LCA_RIGHT_IMPATIENCE) + || (dir == LCA_MLEFT && plannedSpeed > CUT_IN_LEFT_SPEED_THRESHOLD) // VARIANT_22 (slowDownLeft) + )) { + // let the follower slow down to increase the likelyhood that later vehicles will be slow enough to help + // follower should still be fast enough to open a gap + vhelp = MAX2(neighNewSpeed, myVehicle.getSpeed() + HELP_OVERTAKE); + if ((nv->getSpeed() - myVehicle.getSpeed()) / helpDecel < remainingSeconds) { + msgPass.informNeighFollower(new Info(vhelp, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); + return; + } + } + msgPass.informNeighFollower(new Info(vhelp, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); + // this follower is supposed to overtake us. slow down smoothly to allow this + const SUMOReal overtakeDist = (neighFollow.second // follower reaches ego back + + myVehicle.getVehicleType().getLengthWithGap() // follower reaches ego front + + nv->getVehicleType().getLength() // follower back at ego front + + myVehicle.getCarFollowModel().getSecureGap( // follower has safe dist to ego + plannedSpeed, vhelp, nv->getCarFollowModel().getMaxDecel())); + // speed difference to create a sufficiently large gap + const SUMOReal needDV = overtakeDist / remainingSeconds; + // make sure the deceleration is not to strong + myVSafes.push_back(MAX2(vhelp - needDV, myVehicle.getSpeed() - ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel()))); + } + } +} + + +void +MSLCM_LC2013::prepareStep() { + // keep information about strategic change direction + myOwnState = (myOwnState & LCA_STRATEGIC) ? (myOwnState & LCA_WANTS_LANECHANGE) : 0; + myLeadingBlockerLength = 0; + myLeftSpace = 0; + myVSafes.clear(); + myDontBrake = false; + // truncate to work around numerical instability between different builds + mySpeedGainProbability = ceil(mySpeedGainProbability * 100000.0) * 0.00001; + myKeepRightProbability = ceil(myKeepRightProbability * 100000.0) * 0.00001; +} + + +void +MSLCM_LC2013::changed(int dir) { + myOwnState = 0; + mySpeedGainProbability = 0; + myKeepRightProbability = 0; + if (myVehicle.getBestLaneOffset() == 0) { + // if we are not yet on our best lane there might still be unseen blockers + // (during patchSpeed) + myLeadingBlockerLength = 0; + myLeftSpace = 0; + } + myLookAheadSpeed = LOOK_AHEAD_MIN_SPEED; + myVSafes.clear(); + myDontBrake = false; + initLastLaneChangeOffset(dir); +} + + +int +MSLCM_LC2013::_wantsChange( + int laneOffset, + MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked) { + assert(laneOffset == 1 || laneOffset == -1); + const SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); + // compute bestLaneOffset + MSVehicle::LaneQ curr, neigh, best; + int bestLaneOffset = 0; + SUMOReal currentDist = 0; + SUMOReal neighDist = 0; + int currIdx = 0; + MSLane* prebLane = myVehicle.getLane(); + if (prebLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { + // internal edges are not kept inside the bestLanes structure + prebLane = prebLane->getLinkCont()[0]->getLane(); + } + for (int p = 0; p < (int) preb.size(); ++p) { + if (preb[p].lane == prebLane && p + laneOffset >= 0) { + assert(p + laneOffset < (int)preb.size()); + curr = preb[p]; + neigh = preb[p + laneOffset]; + currentDist = curr.length; + neighDist = neigh.length; + bestLaneOffset = curr.bestLaneOffset; + if (bestLaneOffset == 0 && preb[p + laneOffset].bestLaneOffset == 0) { + bestLaneOffset = laneOffset; + } + best = preb[p + bestLaneOffset]; + currIdx = p; + break; + } + } + // direction specific constants + const bool right = (laneOffset == -1); + const int lca = (right ? LCA_RIGHT : LCA_LEFT); + const int myLca = (right ? LCA_MRIGHT : LCA_MLEFT); + const int lcaCounter = (right ? LCA_LEFT : LCA_RIGHT); + const bool changeToBest = (right && bestLaneOffset < 0) || (!right && bestLaneOffset > 0); + // keep information about being a leader/follower + int ret = (myOwnState & 0xffff0000); + int req = 0; // the request to change or stay + + ret = slowDownForBlocked(lastBlocked, ret); + if (lastBlocked != firstBlocked) { + ret = slowDownForBlocked(firstBlocked, ret); + } + + + // we try to estimate the distance which is necessary to get on a lane + // we have to get on in order to keep our route + // we assume we need something that depends on our velocity + // and compare this with the free space on our wished lane + // + // if the free space is somehow less than the space we need, we should + // definitely try to get to the desired lane + // + // this rule forces our vehicle to change the lane if a lane changing is necessary soon + // lookAheadDistance: + // we do not want the lookahead distance to change all the time so we discrectize the speed a bit + + if (myVehicle.getSpeed() > myLookAheadSpeed) { + myLookAheadSpeed = myVehicle.getSpeed(); + } else { + myLookAheadSpeed = MAX2(LOOK_AHEAD_MIN_SPEED, + (LOOK_AHEAD_SPEED_MEMORY * myLookAheadSpeed + (1 - LOOK_AHEAD_SPEED_MEMORY) * myVehicle.getSpeed())); + } + SUMOReal laDist = myLookAheadSpeed * (right ? LOOK_FORWARD_RIGHT : LOOK_FORWARD_LEFT); + laDist += myVehicle.getVehicleType().getLengthWithGap() * (SUMOReal) 2.; + // free space that is available for changing + //const SUMOReal neighSpeed = (neighLead.first != 0 ? neighLead.first->getSpeed() : + // neighFollow.first != 0 ? neighFollow.first->getSpeed() : + // best.lane->getSpeedLimit()); + // @note: while this lets vehicles change earlier into the correct direction + // it also makes the vehicles more "selfish" and prevents changes which are necessary to help others + + int roundaboutEdgesAhead = 0; + for (std::vector::iterator it = curr.bestContinuations.begin(); it != curr.bestContinuations.end(); ++it) { + if ((*it) != 0 && (*it)->getEdge().isRoundabout()) { + roundaboutEdgesAhead += 1; + } else if (roundaboutEdgesAhead > 0) { + // only check the next roundabout + break; + } + } + int roundaboutEdgesAheadNeigh = 0; + for (std::vector::iterator it = neigh.bestContinuations.begin(); it != neigh.bestContinuations.end(); ++it) { + if ((*it) != 0 && (*it)->getEdge().isRoundabout()) { + roundaboutEdgesAheadNeigh += 1; + } else if (roundaboutEdgesAheadNeigh > 0) { + // only check the next roundabout + break; + } + } + if (roundaboutEdgesAhead > 1) { + currentDist += roundaboutEdgesAhead * ROUNDABOUT_DIST_BONUS; + neighDist += roundaboutEdgesAheadNeigh * ROUNDABOUT_DIST_BONUS; + } + + const SUMOReal usableDist = (currentDist - myVehicle.getPositionOnLane() - best.occupation * JAM_FACTOR); + const SUMOReal maxJam = MAX2(preb[currIdx + laneOffset].occupation, preb[currIdx].occupation); + const SUMOReal neighLeftPlace = MAX2((SUMOReal) 0, neighDist - myVehicle.getPositionOnLane() - maxJam); + + if (changeToBest && bestLaneOffset == curr.bestLaneOffset + && currentDistDisallows(usableDist, bestLaneOffset, laDist)) { + /// @brief we urgently need to change lanes to follow our route + ret = ret | lca | LCA_STRATEGIC | LCA_URGENT; + } else { + + if (!myAllowOvertakingRight && !right && !myVehicle.congested() && neighLead.first != 0) { + // check for slower leader on the left. we should not overtake but + // rather move left ourselves (unless congested) + MSVehicle* nv = neighLead.first; + if (nv->getSpeed() < myVehicle.getSpeed()) { + const SUMOReal vSafe = myCarFollowModel.followSpeed( + &myVehicle, myVehicle.getSpeed(), neighLead.second, nv->getSpeed(), nv->getCarFollowModel().getMaxDecel()); + myVSafes.push_back(vSafe); + if (vSafe < myVehicle.getSpeed()) { + mySpeedGainProbability += CHANGE_PROB_THRESHOLD_LEFT / 3; + } + } + } + + if (!changeToBest && (currentDistDisallows(neighLeftPlace, abs(bestLaneOffset) + 2, laDist))) { + // the opposite lane-changing direction should be done than the one examined herein + // we'll check whether we assume we could change anyhow and get back in time... + // + // this rule prevents the vehicle from moving in opposite direction of the best lane + // unless the way till the end where the vehicle has to be on the best lane + // is long enough + ret = ret | LCA_STAY | LCA_STRATEGIC; + } else if (bestLaneOffset == 0 && (neighLeftPlace * 2. < laDist)) { + // the current lane is the best and a lane-changing would cause a situation + // of which we assume we will not be able to return to the lane we have to be on. + // this rule prevents the vehicle from leaving the current, best lane when it is + // close to this lane's end + ret = ret | LCA_STAY | LCA_STRATEGIC; + } + } + // check for overriding TraCI requests + ret = myVehicle.influenceChangeDecision(ret); + if ((ret & lcaCounter) != 0) { + // we are not interested in traci requests for the opposite direction here + ret &= ~(LCA_TRACI | lcaCounter | LCA_URGENT); + } + + if ((ret & LCA_STAY) != 0) { + return ret; + } + if ((ret & LCA_URGENT) != 0) { + // prepare urgent lane change maneuver + // save the left space + myLeftSpace = currentDist - myVehicle.getPositionOnLane(); + if (changeToBest && abs(bestLaneOffset) > 1) { + // there might be a vehicle which needs to counter-lane-change one lane further and we cannot see it yet + myLeadingBlockerLength = MAX2((SUMOReal)(right ? 20.0 : 40.0), myLeadingBlockerLength); + } + + // letting vehicles merge in at the end of the lane in case of counter-lane change, step#1 + // if there is a leader and he wants to change to the opposite direction + saveBlockerLength(neighLead.first, lcaCounter); + if (*firstBlocked != neighLead.first) { + saveBlockerLength(*firstBlocked, lcaCounter); + } + + const SUMOReal remainingSeconds = ((ret & LCA_TRACI) == 0 ? + MAX2((SUMOReal)STEPS2TIME(TS), myLeftSpace / MAX2(myLookAheadSpeed, NUMERICAL_EPS) / abs(bestLaneOffset) / URGENCY) : + myVehicle.getInfluencer().changeRequestRemainingSeconds(currentTime)); + const SUMOReal plannedSpeed = informLeader(msgPass, blocked, myLca, neighLead, remainingSeconds); + if (plannedSpeed >= 0) { + // maybe we need to deal with a blocking follower + informFollower(msgPass, blocked, myLca, neighFollow, remainingSeconds, plannedSpeed); + } + + return ret; + } + + if (roundaboutEdgesAhead > 1) { + // try to use the inner lanes of a roundabout to increase throughput + // unless we are approaching the exit + if (lca == LCA_LEFT) { + req = ret | lca | LCA_COOPERATIVE; + } else { + req = ret | LCA_STAY | LCA_COOPERATIVE; + } + if (!cancelRequest(req)) { + return ret | req; + } + } + + // let's also regard the case where the vehicle is driving on a highway... + // in this case, we do not want to get to the dead-end of an on-ramp + if (right) { + if (bestLaneOffset == 0 && myVehicle.getLane()->getSpeedLimit() > 80. / 3.6 && myLookAheadSpeed > SUMO_const_haltingSpeed) { + req = ret | LCA_STAY | LCA_STRATEGIC; + if (!cancelRequest(req)) { + return ret | req; + } + } + } + // -------- + + // -------- make place on current lane if blocking follower + //if (amBlockingFollowerPlusNB()) { + // std::cout << myVehicle.getID() << ", " << currentDistAllows(neighDist, bestLaneOffset, laDist) + // << " neighDist=" << neighDist + // << " currentDist=" << currentDist + // << "\n"; + //} + if (amBlockingFollowerPlusNB() + && (changeToBest || currentDistAllows(neighDist, abs(bestLaneOffset) + 1, laDist))) { + + req = ret | lca | LCA_COOPERATIVE | LCA_URGENT ;//| LCA_CHANGE_TO_HELP; + if (!cancelRequest(req)) { + return ret | req; + } + } + + // -------- + + + //// -------- security checks for krauss + //// (vsafe fails when gap<0) + //if ((blocked & LCA_BLOCKED) != 0) { + // return ret; + //} + //// -------- + + // -------- higher speed + //if ((congested(neighLead.first) && neighLead.second < 20) || predInteraction(leader.first)) { //!!! + // return ret; + //} + 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 { + // @todo: what if leader is below safe gap?!!! + neighLaneVSafe = MIN2(neighLaneVSafe, myCarFollowModel.followSpeed( + &myVehicle, myVehicle.getSpeed(), neighLead.second, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel())); + } + if (leader.first == 0) { + thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), currentDist, 0, 0)); + } else { + // @todo: what if leader is below safe gap?!!! + thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), leader.second, leader.first->getSpeed(), leader.first->getCarFollowModel().getMaxDecel())); + } + + const SUMOReal vMax = MIN2(myVehicle.getVehicleType().getMaxSpeed(), myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle)); + thisLaneVSafe = MIN2(thisLaneVSafe, vMax); + neighLaneVSafe = MIN2(neighLaneVSafe, vMax); + const SUMOReal relativeGain = (neighLaneVSafe - thisLaneVSafe) / MAX2(neighLaneVSafe, + RELGAIN_NORMALIZATION_MIN_SPEED); + + if (right) { + // ONLY FOR CHANGING TO THE RIGHT + if (thisLaneVSafe - 5 / 3.6 > neighLaneVSafe) { + // ok, the current lane is faster than the right one... + if (mySpeedGainProbability < 0) { + mySpeedGainProbability /= 2.0; + //myKeepRightProbability /= 2.0; + } + } else { + // ok, the current lane is not faster than the right one + mySpeedGainProbability -= relativeGain; + + // honor the obligation to keep right (Rechtsfahrgebot) + // XXX consider fast approaching followers on the current lane + //const SUMOReal vMax = myLookAheadSpeed; + const SUMOReal acceptanceTime = KEEP_RIGHT_ACCEPTANCE * vMax * MAX2((SUMOReal)1, myVehicle.getSpeed()) / myVehicle.getLane()->getSpeedLimit(); + SUMOReal fullSpeedGap = MAX2((SUMOReal)0, neighDist - myVehicle.getCarFollowModel().brakeGap(vMax)); + SUMOReal fullSpeedDrivingSeconds = MIN2(acceptanceTime, fullSpeedGap / vMax); + if (neighLead.first != 0 && neighLead.first->getSpeed() < vMax) { + fullSpeedGap = MAX2((SUMOReal)0, MIN2(fullSpeedGap, + neighLead.second - myVehicle.getCarFollowModel().getSecureGap( + vMax, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel()))); + fullSpeedDrivingSeconds = MIN2(fullSpeedDrivingSeconds, fullSpeedGap / (vMax - neighLead.first->getSpeed())); + } + const SUMOReal deltaProb = (CHANGE_PROB_THRESHOLD_RIGHT + * STEPS2TIME(DELTA_T) + * (fullSpeedDrivingSeconds / acceptanceTime) / KEEP_RIGHT_TIME); + myKeepRightProbability -= deltaProb; + + if (gDebugFlag2) { + std::cout << STEPS2TIME(currentTime) + << " veh=" << myVehicle.getID() + << " vMax=" << vMax + << " neighDist=" << neighDist + << " brakeGap=" << myVehicle.getCarFollowModel().brakeGap(myVehicle.getSpeed()) + << " leaderSpeed=" << (neighLead.first == 0 ? -1 : neighLead.first->getSpeed()) + << " secGap=" << (neighLead.first == 0 ? -1 : myVehicle.getCarFollowModel().getSecureGap( + myVehicle.getSpeed(), neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel())) + << " acceptanceTime=" << acceptanceTime + << " fullSpeedGap=" << fullSpeedGap + << " fullSpeedDrivingSeconds=" << fullSpeedDrivingSeconds + << " dProb=" << deltaProb + << "\n"; + } + if (myKeepRightProbability < -CHANGE_PROB_THRESHOLD_RIGHT) { + req = ret | lca | LCA_KEEPRIGHT; + if (!cancelRequest(req)) { + return ret | req; + } + } + } + + if (mySpeedGainProbability < -CHANGE_PROB_THRESHOLD_RIGHT + && neighDist / MAX2((SUMOReal) .1, myVehicle.getSpeed()) > 20.) { //./MAX2((SUMOReal) .1, myVehicle.getSpeed())) { // -.1 + req = ret | lca | LCA_SPEEDGAIN; + if (!cancelRequest(req)) { + return ret | req; + } + } + } else { + // ONLY FOR CHANGING TO THE LEFT + if (thisLaneVSafe > neighLaneVSafe) { + // this lane is better + if (mySpeedGainProbability > 0) { + mySpeedGainProbability /= 2.0; + } + } else { + // left lane is better + mySpeedGainProbability += relativeGain; + } + if (mySpeedGainProbability > CHANGE_PROB_THRESHOLD_LEFT && neighDist / MAX2((SUMOReal) .1, myVehicle.getSpeed()) > 20.) { // .1 + req = ret | lca | LCA_SPEEDGAIN; + if (!cancelRequest(req)) { + return ret | req; + } + } + } + // -------- + if (changeToBest && bestLaneOffset == curr.bestLaneOffset + && (right ? mySpeedGainProbability < 0 : mySpeedGainProbability > 0)) { + // change towards the correct lane, speedwise it does not hurt + req = ret | lca | LCA_STRATEGIC; + if (!cancelRequest(req)) { + return ret | req; + } + } + + return ret; +} + + +int +MSLCM_LC2013::slowDownForBlocked(MSVehicle** blocked, int state) { + // if this vehicle is blocking someone in front, we maybe decelerate to let him in + if ((*blocked) != 0) { + SUMOReal gap = (*blocked)->getPositionOnLane() - (*blocked)->getVehicleType().getLength() - myVehicle.getPositionOnLane() - myVehicle.getVehicleType().getMinGap(); + if (gap > POSITION_EPS) { + if (myVehicle.getSpeed() < ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel())) { + if ((*blocked)->getSpeed() < SUMO_const_haltingSpeed) { + state |= LCA_AMBACKBLOCKER_STANDING; + } else { + state |= LCA_AMBACKBLOCKER; + } + myVSafes.push_back(myCarFollowModel.followSpeed( + &myVehicle, myVehicle.getSpeed(), + (SUMOReal)(gap - POSITION_EPS), (*blocked)->getSpeed(), + (*blocked)->getCarFollowModel().getMaxDecel())); + } + } + } + return state; +} + + +void +MSLCM_LC2013::saveBlockerLength(MSVehicle* blocker, int lcaCounter) { + if (blocker != 0 && (blocker->getLaneChangeModel().getOwnState() & lcaCounter) != 0) { + // is there enough space in front of us for the blocker? + const SUMOReal potential = myLeftSpace - myVehicle.getCarFollowModel().brakeGap( + myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel(), 0); + if (blocker->getVehicleType().getLengthWithGap() <= potential) { + // save at least his length in myLeadingBlockerLength + myLeadingBlockerLength = MAX2(blocker->getVehicleType().getLengthWithGap(), myLeadingBlockerLength); + } else { + // we cannot save enough space for the blocker. It needs to save + // space for ego instead + blocker->getLaneChangeModel().saveBlockerLength(myVehicle.getVehicleType().getLengthWithGap()); + } + } +} +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/lcmodels/MSLCM_LC2013.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSLCM_LC2013.h --- sumo-0.21.0+dfsg/src/microsim/lcmodels/MSLCM_LC2013.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/lcmodels/MSLCM_LC2013.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,199 @@ +/****************************************************************************/ +/// @file MSLCM_LC2013.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Friedemann Wesner +/// @author Sascha Krieg +/// @author Michael Behrisch +/// @date Fri, 08.10.2013 +/// @version $Id: MSLCM_LC2013.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013 +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 MSLCM_LC2013_h +#define MSLCM_LC2013_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include "MSAbstractLaneChangeModel.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSLCM_LC2013 + * @brief A lane change model developed by D. Krajzewicz, J. Erdmann + * et al. between 2004 and 2013 + */ +class MSLCM_LC2013 : public MSAbstractLaneChangeModel { +public: + + enum MyLCAEnum { + LCA_AMBLOCKINGLEADER = 1 << 16, + LCA_AMBLOCKINGFOLLOWER = 1 << 17, + LCA_MRIGHT = 1 << 18, + LCA_MLEFT = 1 << 19, + // !!! never set LCA_UNBLOCK = 1 << 20, + LCA_AMBLOCKINGFOLLOWER_DONTBRAKE = 1 << 21, + // !!! never used LCA_AMBLOCKINGSECONDFOLLOWER = 1 << 22, + LCA_CHANGE_TO_HELP = 1 << 23, + // !!! never read LCA_KEEP1 = 1 << 24, + // !!! never used LCA_KEEP2 = 1 << 25, + LCA_AMBACKBLOCKER = 1 << 26, + LCA_AMBACKBLOCKER_STANDING = 1 << 27 + }; + + + MSLCM_LC2013(MSVehicle& v); + + virtual ~MSLCM_LC2013(); + + /** @brief Called to examine whether the vehicle wants to change + * using the given laneOffset. + * This method gets the information about the surrounding vehicles + * and whether another lane may be more preferable */ + int wantsChange( + int laneOffset, + MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked); + + void* inform(void* info, MSVehicle* sender); + + /** @brief Called to adapt the speed in order to allow a lane change. + * + * @param min The minimum resulting speed + * @param wanted The aspired speed of the car following model + * @param max The maximum resulting speed + * @param cfModel The model used + * @return the new speed of the vehicle as proposed by the lane changer + */ + SUMOReal patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, + const MSCFModel& cfModel); + /** helper function which contains the actual logic */ + SUMOReal _patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, + const MSCFModel& cfModel); + + void changed(int dir); + + void prepareStep(); + + +protected: + + /// @brief helper function for doing the actual work + int _wantsChange( + int laneOffset, + MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, + const std::pair& leader, + const std::pair& neighLead, + const std::pair& neighFollow, + const MSLane& neighLane, + const std::vector& preb, + MSVehicle** lastBlocked, + MSVehicle** firstBlocked); + + + /* @brief decide whether we will overtake or follow a blocking leader + * and inform it accordingly + * If we decide to follow, myVSafes will be extended + * returns the planned speed if following or -1 if overtaking */ + SUMOReal informLeader(MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, int dir, + const std::pair& neighLead, + SUMOReal remainingSeconds); + + /// @brief decide whether we will try cut in before the follower or allow to be overtaken + void informFollower(MSAbstractLaneChangeModel::MSLCMessager& msgPass, + int blocked, int dir, + const std::pair& neighFollow, + SUMOReal remainingSeconds, + SUMOReal plannedSpeed); + + + /// @brief compute useful slowdowns for blocked vehicles + int slowDownForBlocked(MSVehicle** blocked, int state); + + /// @brief save space for vehicles which need to counter-lane-change + void saveBlockerLength(MSVehicle* blocker, int lcaCounter); + + /// @brief reserve space at the end of the lane to avoid dead locks + inline void saveBlockerLength(SUMOReal length) { + myLeadingBlockerLength = MAX2(length, myLeadingBlockerLength); + }; + + inline bool amBlockingLeader() { + return (myOwnState & LCA_AMBLOCKINGLEADER) != 0; + } + inline bool amBlockingFollower() { + return (myOwnState & LCA_AMBLOCKINGFOLLOWER) != 0; + } + inline bool amBlockingFollowerNB() { + return (myOwnState & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0; + } + inline bool amBlockingFollowerPlusNB() { + return (myOwnState & (LCA_AMBLOCKINGFOLLOWER | LCA_AMBLOCKINGFOLLOWER_DONTBRAKE)) != 0; + } + inline bool currentDistDisallows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) { + return dist / (abs(laneOffset)) < lookForwardDist; + } + inline bool currentDistAllows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) { + return dist / abs(laneOffset) > lookForwardDist; + } + + /// @brief information regarding save velocity (unused) and state flags of the ego vehicle + typedef std::pair Info; + + + +protected: + /// @brief a value for tracking the probability that a change to the offset with the same sign is beneficial + SUMOReal mySpeedGainProbability; + /* @brief a value for tracking the probability of following the/"Rechtsfahrgebot" + * A larger negative value indicates higher probability for moving to the + * right (as in mySpeedGainProbability) */ + SUMOReal myKeepRightProbability; + + SUMOReal myLeadingBlockerLength; + SUMOReal myLeftSpace; + + /*@brief the speed to use when computing the look-ahead distance for + * determining urgency of strategic lane changes */ + SUMOReal myLookAheadSpeed; + + std::vector myVSafes; + bool myDontBrake; + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/logging/CastingFunctionBinding.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/logging/CastingFunctionBinding.h --- sumo-0.21.0+dfsg/src/microsim/logging/CastingFunctionBinding.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/logging/CastingFunctionBinding.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Christian Roessel /// @author Sascha Krieg /// @date Fri, 29.04.2005 -/// @version $Id: CastingFunctionBinding.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: CastingFunctionBinding.h 18095 2015-03-17 09:39:00Z behrisch $ /// -// »missingDescription« +// Function type template /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -47,33 +47,40 @@ /// Type of the function to execute. typedef O(T::* Operation)() const; - CastingFunctionBinding(T* source, Operation operation) : + CastingFunctionBinding(T* source, Operation operation, const R scale = 1) : mySource(source), - myOperation(operation) {} + myOperation(operation), + myScale(scale) {} /// Destructor. ~CastingFunctionBinding() {} R getValue() const { - return (R)(mySource->*myOperation)(); + return myScale * (R)(mySource->*myOperation)(); } ValueSource* copy() const { - return new CastingFunctionBinding(mySource, myOperation); + return new CastingFunctionBinding(mySource, myOperation, myScale); } ValueSource* makeSUMORealReturningCopy() const { - return new CastingFunctionBinding(mySource, myOperation); + return new CastingFunctionBinding(mySource, myOperation, myScale); } -protected: - private: /// The object the action is directed to. T* mySource; /// The object's operation to perform. Operation myOperation; + + /// The scale to apply. + const R myScale; + +private: + /// @brief invalidated assignment operator + CastingFunctionBinding& operator=(const CastingFunctionBinding&); + }; diff -Nru sumo-0.21.0+dfsg/src/microsim/logging/FuncBinding_IntParam.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/logging/FuncBinding_IntParam.h --- sumo-0.21.0+dfsg/src/microsim/logging/FuncBinding_IntParam.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/logging/FuncBinding_IntParam.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: FuncBinding_IntParam.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: FuncBinding_IntParam.h 18095 2015-03-17 09:39:00Z behrisch $ /// -// �missingDescription� +// �Function type template /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/logging/FuncBinding_StringParam.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/logging/FuncBinding_StringParam.h --- sumo-0.21.0+dfsg/src/microsim/logging/FuncBinding_StringParam.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/logging/FuncBinding_StringParam.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Sascha Krieg /// @date Fri, 29.04.2005 -/// @version $Id: FuncBinding_StringParam.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: FuncBinding_StringParam.h 18095 2015-03-17 09:39:00Z behrisch $ /// -// »missingDescription« +// Function type template /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/logging/FunctionBinding.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/logging/FunctionBinding.h --- sumo-0.21.0+dfsg/src/microsim/logging/FunctionBinding.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/logging/FunctionBinding.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: FunctionBinding.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: FunctionBinding.h 18095 2015-03-17 09:39:00Z behrisch $ /// -// »missingDescription« +// Function type template /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -50,23 +50,24 @@ /// Type of the function to execute. typedef R(T::* Operation)() const; - FunctionBinding(T* const source, Operation operation) : + FunctionBinding(T* const source, Operation operation, const R scale = 1) : mySource(source), - myOperation(operation) {} + myOperation(operation), + myScale(scale) {} /// Destructor. ~FunctionBinding() {} R getValue() const { - return (mySource->*myOperation)(); + return myScale * (mySource->*myOperation)(); } ValueSource* copy() const { - return new FunctionBinding(mySource, myOperation); + return new FunctionBinding(mySource, myOperation, myScale); } ValueSource* makeSUMORealReturningCopy() const { - return new CastingFunctionBinding(mySource, myOperation); + return new CastingFunctionBinding(mySource, myOperation, myScale); } private: @@ -75,6 +76,14 @@ /// The object's operation to perform. Operation myOperation; + + /// The scale to apply. + const R myScale; + +private: + /// @brief invalidated assignment operator + FunctionBinding& operator=(const FunctionBinding&); + }; diff -Nru sumo-0.21.0+dfsg/src/microsim/logging/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/logging/Makefile.in --- sumo-0.21.0+dfsg/src/microsim/logging/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/logging/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -146,6 +146,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -156,7 +158,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/microsim/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/Makefile.am --- sumo-0.21.0+dfsg/src/microsim/Makefile.am 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -2,7 +2,9 @@ libmicrosim_a_SOURCES = MSBitSetLogic.h \ MSBaseVehicle.cpp MSBaseVehicle.h \ -MSAbstractLaneChangeModel.h MSAbstractLaneChangeModel.cpp \ +MSCModel_NonInteracting.h MSCModel_NonInteracting.cpp \ +MSContainer.cpp MSContainer.h \ +MSContainerControl.cpp MSContainerControl.h \ MSEdge.cpp MSEdge.h MSEdgeControl.cpp MSEdgeControl.h \ MSEdgeWeightsStorage.cpp MSEdgeWeightsStorage.h \ MSEventControl.cpp MSEventControl.h \ @@ -12,14 +14,11 @@ MSJunction.cpp MSJunction.h \ MSJunctionControl.cpp MSJunctionControl.h \ MSJunctionLogic.cpp MSJunctionLogic.h MSLane.cpp MSLane.h \ -MSLCM_DK2008.cpp MSLCM_DK2008.h \ -MSLCM_LC2013.cpp MSLCM_LC2013.h \ -MSLCM_JE2013.cpp MSLCM_JE2013.h \ MSLaneChanger.cpp MSLaneChanger.h \ MSLink.cpp MSLink.h MSLinkCont.cpp MSLinkCont.h \ MSLogicJunction.cpp MSLogicJunction.h MSMoveReminder.cpp MSMoveReminder.h \ MSNet.cpp MSNet.h MSNoLogicJunction.cpp MSNoLogicJunction.h \ -MSPerson.cpp MSPerson.h MSPersonControl.cpp MSPersonControl.h \ +MSPersonControl.cpp MSPersonControl.h \ MSRightOfWayJunction.cpp MSRightOfWayJunction.h \ MSRoute.cpp MSRoute.h MSRouteHandler.cpp MSRouteHandler.h \ MSVehicle.cpp MSVehicle.h \ @@ -27,9 +26,7 @@ MSVehicleControl.cpp MSVehicleControl.h \ MSVehicleTransfer.cpp MSVehicleTransfer.h \ MSVehicleType.cpp MSVehicleType.h \ -MSPModel.cpp MSPModel.h \ -MSPModel_Striping.cpp MSPModel_Striping.h \ -MSPModel_NonInteracting.cpp MSPModel_NonInteracting.h \ MSStateHandler.h MSStateHandler.cpp -SUBDIRS = actions cfmodels devices logging output traffic_lights trigger +SUBDIRS = actions cfmodels devices lcmodels logging output pedestrians \ +traffic_lights trigger diff -Nru sumo-0.21.0+dfsg/src/microsim/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/Makefile.in --- sumo-0.21.0+dfsg/src/microsim/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -99,23 +99,21 @@ libmicrosim_a_AR = $(AR) $(ARFLAGS) libmicrosim_a_LIBADD = am_libmicrosim_a_OBJECTS = MSBaseVehicle.$(OBJEXT) \ - MSAbstractLaneChangeModel.$(OBJEXT) MSEdge.$(OBJEXT) \ + MSCModel_NonInteracting.$(OBJEXT) MSContainer.$(OBJEXT) \ + MSContainerControl.$(OBJEXT) MSEdge.$(OBJEXT) \ MSEdgeControl.$(OBJEXT) MSEdgeWeightsStorage.$(OBJEXT) \ MSEventControl.$(OBJEXT) MSFrame.$(OBJEXT) MSGlobals.$(OBJEXT) \ MSInsertionControl.$(OBJEXT) MSInternalJunction.$(OBJEXT) \ MSJunction.$(OBJEXT) MSJunctionControl.$(OBJEXT) \ MSJunctionLogic.$(OBJEXT) MSLane.$(OBJEXT) \ - MSLCM_DK2008.$(OBJEXT) MSLCM_LC2013.$(OBJEXT) \ - MSLCM_JE2013.$(OBJEXT) MSLaneChanger.$(OBJEXT) \ - MSLink.$(OBJEXT) MSLinkCont.$(OBJEXT) \ + MSLaneChanger.$(OBJEXT) MSLink.$(OBJEXT) MSLinkCont.$(OBJEXT) \ MSLogicJunction.$(OBJEXT) MSMoveReminder.$(OBJEXT) \ - MSNet.$(OBJEXT) MSNoLogicJunction.$(OBJEXT) MSPerson.$(OBJEXT) \ + MSNet.$(OBJEXT) MSNoLogicJunction.$(OBJEXT) \ MSPersonControl.$(OBJEXT) MSRightOfWayJunction.$(OBJEXT) \ MSRoute.$(OBJEXT) MSRouteHandler.$(OBJEXT) MSVehicle.$(OBJEXT) \ MSVehicleContainer.$(OBJEXT) MSVehicleControl.$(OBJEXT) \ MSVehicleTransfer.$(OBJEXT) MSVehicleType.$(OBJEXT) \ - MSPModel.$(OBJEXT) MSPModel_Striping.$(OBJEXT) \ - MSPModel_NonInteracting.$(OBJEXT) MSStateHandler.$(OBJEXT) + MSStateHandler.$(OBJEXT) libmicrosim_a_OBJECTS = $(am_libmicrosim_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -279,6 +277,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -289,7 +289,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -386,7 +385,9 @@ noinst_LIBRARIES = libmicrosim.a libmicrosim_a_SOURCES = MSBitSetLogic.h \ MSBaseVehicle.cpp MSBaseVehicle.h \ -MSAbstractLaneChangeModel.h MSAbstractLaneChangeModel.cpp \ +MSCModel_NonInteracting.h MSCModel_NonInteracting.cpp \ +MSContainer.cpp MSContainer.h \ +MSContainerControl.cpp MSContainerControl.h \ MSEdge.cpp MSEdge.h MSEdgeControl.cpp MSEdgeControl.h \ MSEdgeWeightsStorage.cpp MSEdgeWeightsStorage.h \ MSEventControl.cpp MSEventControl.h \ @@ -396,14 +397,11 @@ MSJunction.cpp MSJunction.h \ MSJunctionControl.cpp MSJunctionControl.h \ MSJunctionLogic.cpp MSJunctionLogic.h MSLane.cpp MSLane.h \ -MSLCM_DK2008.cpp MSLCM_DK2008.h \ -MSLCM_LC2013.cpp MSLCM_LC2013.h \ -MSLCM_JE2013.cpp MSLCM_JE2013.h \ MSLaneChanger.cpp MSLaneChanger.h \ MSLink.cpp MSLink.h MSLinkCont.cpp MSLinkCont.h \ MSLogicJunction.cpp MSLogicJunction.h MSMoveReminder.cpp MSMoveReminder.h \ MSNet.cpp MSNet.h MSNoLogicJunction.cpp MSNoLogicJunction.h \ -MSPerson.cpp MSPerson.h MSPersonControl.cpp MSPersonControl.h \ +MSPersonControl.cpp MSPersonControl.h \ MSRightOfWayJunction.cpp MSRightOfWayJunction.h \ MSRoute.cpp MSRoute.h MSRouteHandler.cpp MSRouteHandler.h \ MSVehicle.cpp MSVehicle.h \ @@ -411,12 +409,11 @@ MSVehicleControl.cpp MSVehicleControl.h \ MSVehicleTransfer.cpp MSVehicleTransfer.h \ MSVehicleType.cpp MSVehicleType.h \ -MSPModel.cpp MSPModel.h \ -MSPModel_Striping.cpp MSPModel_Striping.h \ -MSPModel_NonInteracting.cpp MSPModel_NonInteracting.h \ MSStateHandler.h MSStateHandler.cpp -SUBDIRS = actions cfmodels devices logging output traffic_lights trigger +SUBDIRS = actions cfmodels devices lcmodels logging output pedestrians \ +traffic_lights trigger + all: all-recursive .SUFFIXES: @@ -466,8 +463,10 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSAbstractLaneChangeModel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBaseVehicle.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCModel_NonInteracting.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSContainer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSContainerControl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSEdge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSEdgeControl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSEdgeWeightsStorage.Po@am__quote@ @@ -479,9 +478,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSJunction.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSJunctionControl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSJunctionLogic.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLCM_DK2008.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLCM_JE2013.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLCM_LC2013.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLane.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLaneChanger.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSLink.Po@am__quote@ @@ -490,10 +486,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSMoveReminder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSNet.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSNoLogicJunction.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPModel.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPModel_NonInteracting.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPModel_Striping.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPerson.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPersonControl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRightOfWayJunction.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRoute.Po@am__quote@ diff -Nru sumo-0.21.0+dfsg/src/microsim/MSAbstractLaneChangeModel.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSAbstractLaneChangeModel.cpp --- sumo-0.21.0+dfsg/src/microsim/MSAbstractLaneChangeModel.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSAbstractLaneChangeModel.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,213 +0,0 @@ -/****************************************************************************/ -/// @file MSAbstractLaneChangeModel.h -/// @author Daniel Krajzewicz -/// @author Friedemann Wesner -/// @author Sascha Krieg -/// @author Michael Behrisch -/// @author Jakob Erdmann -/// @date Fri, 29.04.2005 -/// @version $Id: MSAbstractLaneChangeModel.cpp 16560 2014-06-09 20:54:15Z behrisch $ -/// -// Interface for lane-change models -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 "MSAbstractLaneChangeModel.h" -#include "MSLCM_DK2008.h" -#include "MSLCM_LC2013.h" -#include "MSLCM_JE2013.h" -#include "MSNet.h" -#include "MSEdge.h" -#include "MSLane.h" -#include "MSGlobals.h" - -/* ------------------------------------------------------------------------- - * static members - * ----------------------------------------------------------------------- */ -bool MSAbstractLaneChangeModel::myAllowOvertakingRight(false); - -/* ------------------------------------------------------------------------- - * MSAbstractLaneChangeModel-methods - * ----------------------------------------------------------------------- */ - -void -MSAbstractLaneChangeModel::initGlobalOptions(const OptionsCont& oc) { - myAllowOvertakingRight = oc.getBool("lanechange.overtake-right"); -} - - -MSAbstractLaneChangeModel* -MSAbstractLaneChangeModel::build(LaneChangeModel lcm, MSVehicle& v) { - switch (lcm) { - case LCM_DK2008: - return new MSLCM_DK2008(v); - case LCM_LC2013: - return new MSLCM_LC2013(v); - case LCM_JE2013: - return new MSLCM_JE2013(v); - default: - throw ProcessError("Lane change model '" + toString(lcm) + "' not implemented"); - } -} - - -MSAbstractLaneChangeModel::MSAbstractLaneChangeModel(MSVehicle& v) : - myVehicle(v), - myOwnState(0), - myLastLaneChangeOffset(0), - myLaneChangeCompletion(1.0), - myLaneChangeDirection(0), - myLaneChangeMidpointPassed(false), - myAlreadyMoved(false), - myShadowLane(0), - myHaveShadow(false), - myCarFollowModel(v.getCarFollowModel()) { -} - - -MSAbstractLaneChangeModel::~MSAbstractLaneChangeModel() { - if (myShadowLane != 0 && myHaveShadow) { - myShadowLane->removeVehicle(&myVehicle, MSMoveReminder::NOTIFICATION_VAPORIZED, false); - } -} - - -bool -MSAbstractLaneChangeModel::congested(const MSVehicle* const neighLeader) { - if (neighLeader == 0) { - return false; - } - // 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()->getSpeedLimit() <= 70.0 / 3.6) || (neighLeader->getLane()->getSpeedLimit() <= 70.0 / 3.6)) { - - return false; - } - if (myVehicle.congested() && neighLeader->congested()) { - return true; - } - return false; -} - - -bool -MSAbstractLaneChangeModel::predInteraction(const MSVehicle* const leader) { - if (leader == 0) { - return false; - } - // let's check it on highways only - if (leader->getSpeed() < (80.0 / 3.6)) { - return false; - } - SUMOReal gap = leader->getPositionOnLane() - leader->getVehicleType().getLength() - myVehicle.getVehicleType().getMinGap() - myVehicle.getPositionOnLane(); - return gap < myCarFollowModel.interactionGap(&myVehicle, leader->getSpeed()); -} - - -bool -MSAbstractLaneChangeModel::startLaneChangeManeuver(MSLane* source, MSLane* target, int direction) { - target->enteredByLaneChange(&myVehicle); - if (MSGlobals::gLaneChangeDuration > DELTA_T) { - myLaneChangeCompletion = 0; - myShadowLane = target; - myHaveShadow = true; - myLaneChangeMidpointPassed = false; - myLaneChangeDirection = direction; - continueLaneChangeManeuver(false); - return true; - } else { - myVehicle.leaveLane(MSMoveReminder::NOTIFICATION_LANE_CHANGE); - source->leftByLaneChange(&myVehicle); - myVehicle.enterLaneAtLaneChange(target); - myLastLaneChangeOffset = 0; - changed(); - return false; - } -} - - -void -MSAbstractLaneChangeModel::continueLaneChangeManeuver(bool moved) { - if (moved && myHaveShadow) { - // move shadow to next lane - removeLaneChangeShadow(); - const int shadowDirection = myLaneChangeMidpointPassed ? -myLaneChangeDirection : myLaneChangeDirection; - myShadowLane = myVehicle.getLane()->getParallelLane(shadowDirection); - if (myShadowLane == 0) { - // abort lane change - WRITE_WARNING("Vehicle '" + myVehicle.getID() + "' could not finish continuous lane change (lane disappeared) time=" + - time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); - endLaneChangeManeuver(); - return; - } - myHaveShadow = true; - } - myLaneChangeCompletion += (SUMOReal)DELTA_T / (SUMOReal)MSGlobals::gLaneChangeDuration; - if (!myLaneChangeMidpointPassed && myLaneChangeCompletion >= - myVehicle.getLane()->getWidth() / (myVehicle.getLane()->getWidth() + myShadowLane->getWidth())) { - // maneuver midpoint reached, swap myLane and myShadowLane - myLaneChangeMidpointPassed = true; - MSLane* tmp = myVehicle.getLane(); - myVehicle.leaveLane(MSMoveReminder::NOTIFICATION_LANE_CHANGE); - myVehicle.enterLaneAtLaneChange(myShadowLane); - myShadowLane = tmp; - if (myVehicle.fixPosition()) { - WRITE_WARNING("vehicle '" + myVehicle.getID() + "' set back by " + toString(myVehicle.getPositionOnLane() - myVehicle.getLane()->getLength()) + - "m when changing lanes on lane '" + myVehicle.getLane()->getID() + " time=" + - time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); - } - myLastLaneChangeOffset = 0; - changed(); - myAlreadyMoved = true; - } - // remove shadow as soon as the vehicle leaves the original lane geometrically - if (myLaneChangeMidpointPassed && myHaveShadow) { - const SUMOReal sourceHalfWidth = myShadowLane->getWidth() / 2.0; - const SUMOReal targetHalfWidth = myVehicle.getLane()->getWidth() / 2.0; - if (myLaneChangeCompletion * (sourceHalfWidth + targetHalfWidth) - myVehicle.getVehicleType().getWidth() / 2.0 > sourceHalfWidth) { - removeLaneChangeShadow(); - } - } - // finish maneuver - if (!isChangingLanes()) { - assert(myLaneChangeMidpointPassed); - endLaneChangeManeuver(); - } -} - - -void -MSAbstractLaneChangeModel::removeLaneChangeShadow() { - if (myShadowLane != 0 && myHaveShadow) { - myShadowLane->removeVehicle(&myVehicle, MSMoveReminder::NOTIFICATION_LANE_CHANGE); - myHaveShadow = false; - } -} - - -bool -MSAbstractLaneChangeModel::cancelRequest(int state) { - int ret = myVehicle.influenceChangeDecision(state); - return ret != state; -} diff -Nru sumo-0.21.0+dfsg/src/microsim/MSAbstractLaneChangeModel.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSAbstractLaneChangeModel.h --- sumo-0.21.0+dfsg/src/microsim/MSAbstractLaneChangeModel.h 2014-05-26 22:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSAbstractLaneChangeModel.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,363 +0,0 @@ -/****************************************************************************/ -/// @file MSAbstractLaneChangeModel.h -/// @author Daniel Krajzewicz -/// @author Friedemann Wesner -/// @author Sascha Krieg -/// @author Michael Behrisch -/// @author Jakob Erdmann -/// @date Fri, 29.04.2005 -/// @version $Id: MSAbstractLaneChangeModel.h 16429 2014-05-26 12:51:27Z namdre $ -/// -// Interface for lane-change models -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 MSAbstractLaneChangeModel_h -#define MSAbstractLaneChangeModel_h - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include "MSVehicle.h" -class MSLane; - -// =========================================================================== -// used enumeration -// =========================================================================== -/** @enum LaneChangeAction - * @brief A try to store the state of a vehicle's lane-change wish in an int - */ -enum LaneChangeAction { - /// @name currently wanted lane-change action - /// @{ - - /// @brief No action desired - LCA_NONE = 0, - /// @brief Needs to stay on the current lane - LCA_STAY = 1 << 0, - /// @brief Wants go to the left - LCA_LEFT = 1 << 1, - /// @brief Wants go to the right - LCA_RIGHT = 1 << 2, - - /// @brief The action is needed to follow the route (navigational lc) - LCA_STRATEGIC = 1 << 3, - /// @brief The action is done to help someone else - LCA_COOPERATIVE = 1 << 4, - /// @brief The action is due to the wish to be faster (tactical lc) - LCA_SPEEDGAIN = 1 << 5, - /// @brief The action is due to the default of keeping right "Rechtsfahrgebot" - LCA_KEEPRIGHT = 1 << 6, - /// @brief The action is due to a TraCI request - LCA_TRACI = 1 << 7, - - /// @brief The action is urgent (to be defined by lc-model) - LCA_URGENT = 1 << 8, - - LCA_WANTS_LANECHANGE = LCA_LEFT | LCA_RIGHT, - LCA_WANTS_LANECHANGE_OR_STAY = LCA_WANTS_LANECHANGE | LCA_STAY, - /// @} - - /// @name External state - /// @{ - - /// @brief The vehicle is blocked by left leader - LCA_BLOCKED_BY_LEFT_LEADER = 1 << 9, - /// @brief The vehicle is blocked by left follower - LCA_BLOCKED_BY_LEFT_FOLLOWER = 1 << 10, - - /// @brief The vehicle is blocked by right leader - LCA_BLOCKED_BY_RIGHT_LEADER = 1 << 11, - /// @brief The vehicle is blocked by right follower - LCA_BLOCKED_BY_RIGHT_FOLLOWER = 1 << 12, - - // The vehicle is blocked being overlapping - LCA_OVERLAPPING = 1 << 13, - - LCA_BLOCKED_LEFT = LCA_BLOCKED_BY_LEFT_LEADER | LCA_BLOCKED_BY_LEFT_FOLLOWER, - LCA_BLOCKED_RIGHT = LCA_BLOCKED_BY_RIGHT_LEADER | LCA_BLOCKED_BY_RIGHT_FOLLOWER, - LCA_BLOCKED_BY_LEADER = LCA_BLOCKED_BY_LEFT_LEADER | LCA_BLOCKED_BY_RIGHT_LEADER, - LCA_BLOCKED_BY_FOLLOWER = LCA_BLOCKED_BY_LEFT_FOLLOWER | LCA_BLOCKED_BY_RIGHT_FOLLOWER, - LCA_BLOCKED = LCA_BLOCKED_LEFT | LCA_BLOCKED_RIGHT - - /// @} - -}; - - - - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class MSAbstractLaneChangeModel - * @brief Interface for lane-change models - */ -class MSAbstractLaneChangeModel { -public: - - /** @class MSLCMessager - * @brief A class responsible for exchanging messages between cars involved in lane-change interaction - */ - class MSLCMessager { - public: - /** @brief Constructor - * @param[in] leader The leader on the informed vehicle's lane - * @param[in] neighLead The leader on the lane the vehicle want to change to - * @param[in] neighFollow The follower on the lane the vehicle want to change to - */ - MSLCMessager(MSVehicle* leader, MSVehicle* neighLead, MSVehicle* neighFollow) - : myLeader(leader), myNeighLeader(neighLead), - myNeighFollower(neighFollow) { } - - - /// @brief Destructor - ~MSLCMessager() { } - - - /** @brief Informs the leader on the same lane - * @param[in] info The information to pass - * @param[in] sender The sending vehicle (the lane changing vehicle) - * @return Something!? - */ - void* informLeader(void* info, MSVehicle* sender) { - assert(myLeader != 0); - return myLeader->getLaneChangeModel().inform(info, sender); - } - - - /** @brief Informs the leader on the desired lane - * @param[in] info The information to pass - * @param[in] sender The sending vehicle (the lane changing vehicle) - * @return Something!? - */ - void* informNeighLeader(void* info, MSVehicle* sender) { - assert(myNeighLeader != 0); - return myNeighLeader->getLaneChangeModel().inform(info, sender); - } - - - /** @brief Informs the follower on the desired lane - * @param[in] info The information to pass - * @param[in] sender The sending vehicle (the lane changing vehicle) - * @return Something!? - */ - void* informNeighFollower(void* info, MSVehicle* sender) { - assert(myNeighFollower != 0); - return myNeighFollower->getLaneChangeModel().inform(info, sender); - } - - - private: - /// @brief The leader on the informed vehicle's lane - MSVehicle* myLeader; - /// @brief The leader on the lane the vehicle want to change to - MSVehicle* myNeighLeader; - /// @brief The follower on the lane the vehicle want to change to - MSVehicle* myNeighFollower; - - }; - - /// @brief init global model parameters - void static initGlobalOptions(const OptionsCont& oc); - - /** @brief Factory method for instantiating new lane changing models - * @param[in] lcm The type of model to build - * @param[in] vehicle The vehicle for which this model shall be built - */ - static MSAbstractLaneChangeModel* build(LaneChangeModel lcm, MSVehicle& vehicle); - - /** @brief Constructor - * @param[in] v The vehicle this lane-changer belongs to - */ - MSAbstractLaneChangeModel(MSVehicle& v); - - /// @brief Destructor - virtual ~MSAbstractLaneChangeModel(); - - inline int getOwnState() const { - return myOwnState; - } - - inline void setOwnState(int state) { - myOwnState = state; - } - - virtual void prepareStep() { } - - /** @brief Called to examine whether the vehicle wants to change - * using the given laneOffset. - * This method gets the information about the surrounding vehicles - * and whether another lane may be more preferable */ - virtual int wantsChange( - int laneOffset, - MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked) = 0; - - virtual void* inform(void* info, MSVehicle* sender) = 0; - - /** @brief Called to adapt the speed in order to allow a lane change. - * - * It is guaranteed that min<=wanted<=max, but the implementation needs - * to make sure that the return value is between min and max. - * - * @param min The minimum resulting speed - * @param wanted The aspired speed of the car following model - * @param max The maximum resulting speed - * @param cfModel The model used - * @return the new speed of the vehicle as proposed by the lane changer - */ - virtual SUMOReal patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, - const MSCFModel& cfModel) = 0; - - virtual void changed() = 0; - - void unchanged() { - myLastLaneChangeOffset += DELTA_T; - } - - /** @brief Returns the lane the vehicles shadow is on during continuouss lane change - * @return The vehicle's shadow lane - */ - MSLane* getShadowLane() const { - return myShadowLane; - } - - - inline SUMOTime getLastLaneChangeOffset() const { - return myLastLaneChangeOffset; - } - - - /// @brief return whether the vehicle passed the midpoint of a continuous lane change maneuver - inline bool isLaneChangeMidpointPassed() const { - return myLaneChangeMidpointPassed; - } - - /// @brief return whether the vehicle passed the midpoint of a continuous lane change maneuver - inline SUMOReal getLaneChangeCompletion() const { - return myLaneChangeCompletion; - } - - /// @brief return true if the vehicle currently performs a lane change maneuver - inline bool isChangingLanes() const { - return myLaneChangeCompletion < (1 - NUMERICAL_EPS); - } - - /// @brief return the direction of the current lane change maneuver - inline int getLaneChangeDirection() const { - return myLaneChangeDirection; - } - - /// @brief reset the flag whether a vehicle already moved to false - inline bool alreadyMoved() const { - return myAlreadyMoved; - } - - /// @brief reset the flag whether a vehicle already moved to false - void resetMoved() { - myAlreadyMoved = false; - } - - - /// @brief start the lane change maneuver and return whether it continues - bool startLaneChangeManeuver(MSLane* source, MSLane* target, int direction); - - - /* @brief continue the lane change maneuver - * @param[in] moved Whether the vehicle has moved to a new lane - */ - void continueLaneChangeManeuver(bool moved); - - /* @brief finish the lane change maneuver - */ - inline void endLaneChangeManeuver() { - removeLaneChangeShadow(); - myLaneChangeCompletion = 1; - myShadowLane = 0; - } - - /// @brief remove the shadow copy of a lane change maneuver - void removeLaneChangeShadow(); - - /// @brief reserve space at the end of the lane to avoid dead locks - virtual void saveBlockerLength(SUMOReal length) { - UNUSED_PARAMETER(length); - }; - -protected: - virtual bool congested(const MSVehicle* const neighLeader); - - virtual bool predInteraction(const MSVehicle* const leader); - - /// @brief whether the influencer cancels the given request - bool cancelRequest(int state); - - -protected: - /// @brief The vehicle this lane-changer belongs to - MSVehicle& myVehicle; - - /// @brief The current state of the vehicle - int myOwnState; - - /// @brief information how long ago the vehicle has performed a lane-change - SUMOTime myLastLaneChangeOffset; - - /// @brief progress of the lane change maneuver 0:started, 1:complete - SUMOReal myLaneChangeCompletion; - - /// @brief direction of the lane change maneuver -1 means right, 1 means left - int myLaneChangeDirection; - - /// @brief whether myLane has already been set to the target of the lane-change maneuver - bool myLaneChangeMidpointPassed; - - /// @brief whether the vehicle has already moved this step - bool myAlreadyMoved; - - /// @brief The lane the vehicle shadow is on during a continuous lane change - MSLane* myShadowLane; - - /// Wether a vehicle shadow exists - bool myHaveShadow; - - /// @brief The vehicle's car following model - const MSCFModel& myCarFollowModel; - - /// @brief whether overtaking on the right is permitted - static bool myAllowOvertakingRight; - -private: - /// @brief Invalidated assignment operator - MSAbstractLaneChangeModel& operator=(const MSAbstractLaneChangeModel& s); -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/microsim/MSBaseVehicle.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSBaseVehicle.cpp --- sumo-0.21.0+dfsg/src/microsim/MSBaseVehicle.cpp 2014-03-07 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSBaseVehicle.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Mon, 8 Nov 2010 -/// @version $Id: MSBaseVehicle.cpp 15869 2014-03-07 14:45:34Z namdre $ +/// @version $Id: MSBaseVehicle.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A base class for vehicle implementations /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,6 +36,7 @@ #include #include #include +#include "MSGlobals.h" #include "MSVehicleType.h" #include "MSEdge.h" #include "MSLane.h" @@ -43,6 +44,7 @@ #include "MSBaseVehicle.h" #include "MSNet.h" #include "devices/MSDevice.h" +#include "devices/MSDevice_Routing.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -59,7 +61,8 @@ // =========================================================================== // method definitions // =========================================================================== -MSBaseVehicle::MSBaseVehicle(SUMOVehicleParameter* pars, const MSRoute* route, const MSVehicleType* type, const SUMOReal speedFactor) : +MSBaseVehicle::MSBaseVehicle(SUMOVehicleParameter* pars, const MSRoute* route, + const MSVehicleType* type, const SUMOReal speedFactor) : myParameter(pars), myRoute(route), myType(type), @@ -80,7 +83,9 @@ myMoveReminders.push_back(std::make_pair(*dev, 0.)); } myRoute->addReference(); - calculateArrivalPos(); + if (!pars->wasSet(VEHPARS_FORCE_REROUTE)) { + calculateArrivalPos(); + } } MSBaseVehicle::~MSBaseVehicle() { @@ -130,28 +135,43 @@ void -MSBaseVehicle::reroute(SUMOTime t, SUMOAbstractRouter& router, bool withTaz) { +MSBaseVehicle::reroute(SUMOTime t, SUMOAbstractRouter& router, const bool onInit, const bool withTaz) { // check whether to reroute - std::vector edges; - if (withTaz && MSEdge::dictionary(myParameter->fromTaz + "-source") && MSEdge::dictionary(myParameter->toTaz + "-sink")) { - router.compute(MSEdge::dictionary(myParameter->fromTaz + "-source"), MSEdge::dictionary(myParameter->toTaz + "-sink"), this, t, edges); - if (edges.size() >= 2) { - edges.erase(edges.begin()); + const MSEdge* source = withTaz && onInit ? MSEdge::dictionary(myParameter->fromTaz + "-source") : getRerouteOrigin(); + if (source == 0) { + source = getRerouteOrigin(); + } + const MSEdge* sink = withTaz ? MSEdge::dictionary(myParameter->toTaz + "-sink") : myRoute->getLastEdge(); + if (sink == 0) { + sink = myRoute->getLastEdge(); + } + ConstMSEdgeVector edges; + const ConstMSEdgeVector stops = getStopEdges(); + for (MSRouteIterator s = stops.begin(); s != stops.end(); ++s) { + if (*s != source) { + // !!! need to adapt t here + router.compute(source, *s, this, t, edges); + source = *s; edges.pop_back(); } - } else { - router.compute(getRerouteOrigin(), myRoute->getLastEdge(), this, t, edges); } - if (edges.empty()) { - WRITE_WARNING("No route for vehicle '" + getID() + "' found."); - return; + router.compute(source, sink, this, t, edges); + if (!edges.empty() && edges.front()->getPurpose() == MSEdge::EDGEFUNCTION_DISTRICT) { + edges.erase(edges.begin()); } - replaceRouteEdges(edges, withTaz); + if (!edges.empty() && edges.back()->getPurpose() == MSEdge::EDGEFUNCTION_DISTRICT) { + edges.pop_back(); + } + replaceRouteEdges(edges, onInit); } bool -MSBaseVehicle::replaceRouteEdges(MSEdgeVector& edges, bool onInit) { +MSBaseVehicle::replaceRouteEdges(ConstMSEdgeVector& edges, bool onInit) { + if (edges.empty()) { + WRITE_WARNING("No route for vehicle '" + getID() + "' found."); + return false; + } // build a new id, first std::string id = getID(); if (id[0] != '!') { @@ -168,15 +188,33 @@ } const int oldSize = (int)edges.size(); edges.insert(edges.begin(), myRoute->begin(), myCurrEdge); + if (edges == myRoute->getEdges()) { + return true; + } const RGBColor& c = myRoute->getColor(); MSRoute* newRoute = new MSRoute(id, edges, false, &c == &RGBColor::DEFAULT_COLOR ? 0 : new RGBColor(c), myRoute->getStops()); +#ifdef HAVE_FOX + MSDevice_Routing::lock(); +#endif if (!MSRoute::dictionary(id, newRoute)) { +#ifdef HAVE_FOX + MSDevice_Routing::unlock(); +#endif delete newRoute; return false; } +#ifdef HAVE_FOX + MSDevice_Routing::unlock(); +#endif if (!replaceRoute(newRoute, onInit, (int)edges.size() - oldSize)) { newRoute->addReference(); +#ifdef HAVE_FOX + MSDevice_Routing::lock(); +#endif newRoute->release(); +#ifdef HAVE_FOX + MSDevice_Routing::unlock(); +#endif return false; } return true; @@ -217,6 +255,9 @@ MSBaseVehicle::addPerson(MSPerson* /*person*/) { } +void +MSBaseVehicle::addContainer(MSContainer* /*container*/) { +} bool MSBaseVehicle::hasValidRoute(std::string& msg) const { @@ -342,6 +383,29 @@ } +void +MSBaseVehicle::addStops(const bool ignoreStopErrors) { + for (std::vector::const_iterator i = myParameter->stops.begin(); i != myParameter->stops.end(); ++i) { + std::string errorMsg; + if (!addStop(*i, errorMsg) && !ignoreStopErrors) { + throw ProcessError(errorMsg); + } + if (errorMsg != "") { + WRITE_WARNING(errorMsg); + } + } + for (std::vector::const_iterator i = myRoute->getStops().begin(); i != myRoute->getStops().end(); ++i) { + std::string errorMsg; + if (!addStop(*i, errorMsg) && !ignoreStopErrors) { + throw ProcessError(errorMsg); + } + if (errorMsg != "") { + WRITE_WARNING(errorMsg); + } + } +} + + #ifdef _DEBUG void MSBaseVehicle::initMoveReminderOutput(const OptionsCont& oc) { diff -Nru sumo-0.21.0+dfsg/src/microsim/MSBaseVehicle.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSBaseVehicle.h --- sumo-0.21.0+dfsg/src/microsim/MSBaseVehicle.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSBaseVehicle.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 8 Nov 2010 -/// @version $Id: MSBaseVehicle.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSBaseVehicle.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A base class for vehicle implementations /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,17 +35,11 @@ #include #include #include -#include +#include #include #include "MSRoute.h" #include "MSMoveReminder.h" - - -// =========================================================================== -// class declarations -// =========================================================================== -class SUMOVehicleParameter; -class MSVehicleType; +#include "MSVehicleType.h" // =========================================================================== @@ -64,7 +58,8 @@ * @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, const SUMOReal speedFactor); + MSBaseVehicle(SUMOVehicleParameter* pars, const MSRoute* route, + const MSVehicleType* type, const SUMOReal speedFactor); /// @brief Destructor @@ -97,6 +92,13 @@ } + /** @brief Returns the vehicle's access class + * @return The vehicle's access class + */ + inline SUMOVehicleClass getVClass() const { + return myType->getParameter().vehicleClass; + } + /** @brief Returns the maximum speed * @return The vehicle's maximum speed */ @@ -137,6 +139,14 @@ } + /** @brief Returns an iterator pointing to the current edge in this vehicles route + * @return The current route pointer + */ + const MSRouteIterator& getCurrentRouteEdge() const { + return myCurrEdge; + } + + /** @brief Performs a rerouting using the given router * * Tries to find a new route between the current edge and the destination edge, first. @@ -146,7 +156,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, const bool onInit = false, const bool withTaz = false); /** @brief Replaces the current route by the given edges @@ -159,7 +169,7 @@ * @param[in] simTime The time at which the route was replaced * @return Whether the new route was accepted */ - bool replaceRouteEdges(MSEdgeVector& edges, bool onInit = false); + bool replaceRouteEdges(ConstMSEdgeVector& edges, bool onInit = false); /** @brief Returns the vehicle's acceleration @@ -172,7 +182,7 @@ /** @brief Returns the slope of the road at vehicle's position * * This default implementation returns always 0. - * @return The acceleration + * @return The slope */ virtual SUMOReal getSlope() const; @@ -233,6 +243,15 @@ */ virtual void addPerson(MSPerson* person); + + /** @brief Adds a container to this vehicle + * + * The default implementation does nothing since containers are not supported by default + * + * @param[in] container The person to add + */ + virtual void addContainer(MSContainer* container); + /** @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 @@ -275,7 +294,7 @@ /** @brief Returns the precomputed factor by which the driver wants to be faster than the speed limit * @return Speed limit factor */ - inline void setChosenSpeedFactor(SUMOReal factor) { + inline void setChosenSpeedFactor(const SUMOReal factor) { myChosenSpeedFactor = factor; } @@ -291,11 +310,25 @@ //@} + /** @brief Adds stops to the built vehicle + * + * This code needs to be separated from the MSBaseVehicle constructor + * since it is not allowed to call virtual functions from a constructor + * + * @param[in] ignoreStopErrors whether invalid stops trigger a warning only + */ + void addStops(const bool ignoreStopErrors); + + protected: /** @brief (Re-)Calculates the arrival position from the vehicle parameters */ void calculateArrivalPos(); + /** @brief Returns the list of still pending stop edges + */ + virtual const ConstMSEdgeVector getStopEdges() const = 0; + protected: /// @brief This Vehicle's parameter. const SUMOVehicleParameter* myParameter; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSBitSetLogic.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSBitSetLogic.h --- sumo-0.21.0+dfsg/src/microsim/MSBitSetLogic.h 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSBitSetLogic.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSBitSetLogic.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSBitSetLogic.h 18095 2015-03-17 09:39:00Z behrisch $ /// -// »missingDescription« +// Container for holding a right-of-way matrix /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSCModel_NonInteracting.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSCModel_NonInteracting.cpp --- sumo-0.21.0+dfsg/src/microsim/MSCModel_NonInteracting.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSCModel_NonInteracting.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,158 @@ +/****************************************************************************/ +/// @file MSCModel_NonInteracting.h +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Tue, 29 July 2014 +/// @version $Id: MSCModel_NonInteracting.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// The container following model for tranship (prototype) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 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 "MSCModel_NonInteracting.h" + +// =========================================================================== +// static members +// =========================================================================== +MSCModel_NonInteracting* MSCModel_NonInteracting::myModel(0); + + +// named constants +const int CState::FORWARD(1); +const int CState::BACKWARD(-1); +const int CState::UNDEFINED_DIRECTION(0); +const SUMOReal CState::LATERAL_OFFSET(0); + +// =========================================================================== +// MSCModel_NonInteracting method definitions +// =========================================================================== + +MSCModel_NonInteracting::MSCModel_NonInteracting(MSNet* net) : + myNet(net) { + assert(myNet != 0); +} + + +MSCModel_NonInteracting::~MSCModel_NonInteracting() { +} + +MSCModel_NonInteracting* +MSCModel_NonInteracting::getModel() { + if (myModel == 0) { + MSNet* net = MSNet::getInstance(); + myModel = new MSCModel_NonInteracting(net); + } + return myModel; +} + +CState* +MSCModel_NonInteracting::add(MSContainer* container, MSContainer::MSContainerStage_Tranship* stage, SUMOTime now) { + CState* state = new CState(); + const SUMOTime firstEdgeDuration = state->computeTranshipTime(0, *stage, now); + myNet->getBeginOfTimestepEvents()->addEvent(new MoveToNextEdge(container, *stage), + now + firstEdgeDuration, MSEventControl::ADAPT_AFTER_EXECUTION); + return state; +} + + +void +MSCModel_NonInteracting::cleanup() { + if (myModel != 0) { + delete myModel; + myModel = 0; + } +} + + +SUMOTime +MSCModel_NonInteracting::MoveToNextEdge::execute(SUMOTime currentTime) { + CState* state = myParent.getContainerState(); + const MSEdge* old = myParent.getEdge(); + const bool arrived = myParent.moveToNextEdge(myContainer, currentTime); + if (arrived) { + // tranship finished. clean up state + delete state; + return 0; + } else { + return state->computeTranshipTime(old, myParent, currentTime); + } +} + + +SUMOReal +CState::getEdgePos(const MSContainer::MSContainerStage_Tranship&, SUMOTime now) const { + return myCurrentBeginPos + (myCurrentEndPos - myCurrentBeginPos) / myCurrentDuration * (now - myLastEntryTime); +} + + +Position +CState::getPosition(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const { + const SUMOReal dist = myCurrentBeginPosition.distanceTo2D(myCurrentEndPosition); //distance between begin and end position of this tranship stage + SUMOReal pos = MIN2(STEPS2TIME(now - myLastEntryTime) * stage.getMaxSpeed(), dist); //the containerd shall not go beyond its end position + return PositionVector::positionAtOffset2D(myCurrentBeginPosition, myCurrentEndPosition, pos, 0); +} + + +SUMOReal +CState::getAngle(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const { + //todo: change angle by 90 degree + SUMOReal angle = stage.getEdgeAngle(stage.getEdge(), getEdgePos(stage, now)) + (myCurrentEndPos < myCurrentBeginPos ? 180 : 0); + if (angle > 180) { + angle -= 360; + } + return angle; +} + + +SUMOReal +CState::getSpeed(const MSContainer::MSContainerStage_Tranship& stage) const { + return stage.getMaxSpeed(); +} + + +SUMOTime +CState::computeTranshipTime(const MSEdge* /* prev */, const MSContainer::MSContainerStage_Tranship& stage, SUMOTime currentTime) { + myLastEntryTime = currentTime; + + myCurrentBeginPos = stage.getDepartPos(); + myCurrentEndPos = stage.getArrivalPos(); + + const MSLane* fromLane = stage.getFromEdge()->getLanes().front(); //the lane the container starts from during its tranship stage + myCurrentBeginPosition = stage.getLanePosition(fromLane, myCurrentBeginPos, LATERAL_OFFSET); + const MSLane* toLane = stage.getToEdge()->getLanes().front(); //the lane the container ends during its tranship stage + myCurrentEndPosition = stage.getLanePosition(toLane, myCurrentEndPos, LATERAL_OFFSET); + + myCurrentDuration = MAX2((SUMOTime)1, TIME2STEPS(fabs(myCurrentEndPosition.distanceTo(myCurrentBeginPosition)) / stage.getMaxSpeed())); + return myCurrentDuration; +} + + + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/MSCModel_NonInteracting.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSCModel_NonInteracting.h --- sumo-0.21.0+dfsg/src/microsim/MSCModel_NonInteracting.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSCModel_NonInteracting.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,137 @@ +/****************************************************************************/ +/// @file MSCModel_NonInteracting.h +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Tue, 29 July 2014 +/// @version $Id: MSCModel_NonInteracting.h 18096 2015-03-17 09:50:59Z behrisch $ +/// +// The container following model for tranship (prototype) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 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 MSCModel_NonInteracting_h +#define MSCModel_NonInteracting_h + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSNet; +class MSLink; +class MSLane; +class MSJunction; +class CState; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSCModel_NonInteracting + * @brief The container following model for tranship + * + */ +class MSCModel_NonInteracting { +public: + + /// @brief Constructor (it should not be necessary to construct more than one instance) + MSCModel_NonInteracting(MSNet* net); + + ~MSCModel_NonInteracting(); + + static MSCModel_NonInteracting* getModel(); + + /// @brief remove state at simulation end + static void cleanup(); + + /// @brief register the given container as a transhiped container + CState* add(MSContainer* container, MSContainer::MSContainerStage_Tranship* stage, SUMOTime now); + +private: + static MSCModel_NonInteracting* myModel; + +private: + class MoveToNextEdge : public Command { + public: + MoveToNextEdge(MSContainer* container, MSContainer::MSContainerStage_Tranship& tranship) : myParent(tranship), myContainer(container) {} + ~MoveToNextEdge() {} + SUMOTime execute(SUMOTime currentTime); + + private: + MSContainer::MSContainerStage_Tranship& myParent; + MSContainer* myContainer; + private: + /// @brief Invalidated assignment operator. + MoveToNextEdge& operator=(const MoveToNextEdge&); + }; + + +private: + /// @brief the net to which to issue moveToNextEdge commands + MSNet* myNet; + +}; + +class CState { +public: + CState() {}; + + ~CState() {}; + + // @brief walking directions + static const int FORWARD; + static const int BACKWARD; + static const int UNDEFINED_DIRECTION; + + /// @brief the offset for computing container positions when being transhiped + static const SUMOReal LATERAL_OFFSET; + + /// @brief return the offset from the start of the current edge measured in its natural direction + SUMOReal getEdgePos(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const; + /// @brief return the network coordinate of the container + Position getPosition(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const; + /// @brief return the direction in which the container heading to + SUMOReal getAngle(const MSContainer::MSContainerStage_Tranship& stage, SUMOTime now) const; + /// @brief return the current speed of the container + SUMOReal getSpeed(const MSContainer::MSContainerStage_Tranship& stage) const; + /// @brief compute tranship time on edge and update state members + SUMOTime computeTranshipTime(const MSEdge* prev, const MSContainer::MSContainerStage_Tranship& stage, SUMOTime currentTime); + + +private: + SUMOTime myLastEntryTime; + SUMOTime myCurrentDuration; + SUMOReal myCurrentBeginPos; + SUMOReal myCurrentEndPos; + Position myCurrentBeginPosition; //the position the container is moving from during its tranship stage + Position myCurrentEndPosition; //the position the container is moving to during its tranship stage + +}; + + +#endif /* MSCModel_NonInteracting_h */ + diff -Nru sumo-0.21.0+dfsg/src/microsim/MSContainerControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSContainerControl.cpp --- sumo-0.21.0+dfsg/src/microsim/MSContainerControl.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSContainerControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,239 @@ +/****************************************************************************/ +/// @file MSContainerControl.cpp +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Mon, 16 Jun 2014 +/// @version $Id: MSContainerControl.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// Stores all containers in the net and handles their waiting for cars. +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "MSNet.h" +#include "MSEdge.h" +#include "MSContainer.h" +//#include "MSVehicle.h" +#include "MSContainerControl.h" +#include +#include + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +MSContainerControl::MSContainerControl() {} + + +MSContainerControl::~MSContainerControl() { + for (std::map::iterator i = myContainers.begin(); i != myContainers.end(); ++i) { + delete(*i).second; + } + myContainers.clear(); + myWaiting4Vehicle.clear(); +} + + +bool +MSContainerControl::add(const std::string& id, MSContainer* container) { + if (myContainers.find(id) == myContainers.end()) { + myContainers[id] = container; + return true; + } + return false; +} + + +void +MSContainerControl::erase(MSContainer* container) { + const std::string& id = container->getID(); + if (OptionsCont::getOptions().isSet("tripinfo-output")) { + OutputDevice& od = OutputDevice::getDeviceByOption("tripinfo-output"); + od.openTag("containerinfo").writeAttr("id", id).writeAttr("depart", time2string(container->getDesiredDepart())); + container->tripInfoOutput(od); + od.closeTag(); + } + if (OptionsCont::getOptions().isSet("vehroute-output")) { + OutputDevice& od = OutputDevice::getDeviceByOption("vehroute-output"); + od.openTag("container").writeAttr("id", id).writeAttr("depart", time2string(container->getDesiredDepart())).writeAttr("arrival", time2string(MSNet::getInstance()->getCurrentTimeStep())); + container->routeOutput(od); + od.closeTag(); + od << "\n"; + } + const std::map::iterator i = myContainers.find(id); + if (i != myContainers.end()) { + delete i->second; + myContainers.erase(i); + } +} + + +void +MSContainerControl::setDeparture(const SUMOTime time, MSContainer* container) { + const SUMOTime step = time % DELTA_T == 0 ? time : (time / DELTA_T + 1) * DELTA_T; + if (myWaiting4Departure.find(step) == myWaiting4Departure.end()) { + myWaiting4Departure[step] = ContainerVector(); + } + myWaiting4Departure[step].push_back(container); +} + + +void +MSContainerControl::setWaitEnd(const SUMOTime time, MSContainer* container) { + const SUMOTime step = time % DELTA_T == 0 ? time : (time / DELTA_T + 1) * DELTA_T; + if (myWaitingUntil.find(step) == myWaitingUntil.end()) { + myWaitingUntil[step] = ContainerVector(); + } + myWaitingUntil[step].push_back(container); +} + + +void +MSContainerControl::checkWaitingContainers(MSNet* net, const SUMOTime time) { + while (myWaiting4Departure.find(time) != myWaiting4Departure.end()) { + const ContainerVector& containers = myWaiting4Departure[time]; + // we cannot use an iterator here because there might be additions to the vector while proceeding + for (size_t i = 0; i < containers.size(); ++i) { + if (!containers[i]->proceed(net, time)) { + erase(containers[i]); + } + } + myWaiting4Departure.erase(time); + } + while (myWaitingUntil.find(time) != myWaitingUntil.end()) { + const ContainerVector& containers = myWaitingUntil[time]; + // we cannot use an iterator here because there might be additions to the vector while proceeding + for (size_t i = 0; i < containers.size(); ++i) { + if (!containers[i]->proceed(net, time)) { + erase(containers[i]); + } + } + myWaitingUntil.erase(time); + } +} + + +void +MSContainerControl::addWaiting(const MSEdge* const edge, MSContainer* container) { + if (myWaiting4Vehicle.find(edge) == myWaiting4Vehicle.end()) { + myWaiting4Vehicle[edge] = std::vector(); + } + myWaiting4Vehicle[edge].push_back(container); +} + + +//bool +//MSContainerControl::isWaiting4Vehicle(const MSEdge* const edge, MSContainer* /* p */) const { +// return myWaiting4Vehicle.find(edge) != myWaiting4Vehicle.end(); +//} + + +bool +MSContainerControl::loadAnyWaiting(MSEdge* edge, MSVehicle* vehicle, MSVehicle::Stop* stop) { + bool ret = false; + if (myWaiting4Vehicle.find(edge) != myWaiting4Vehicle.end()) { + ContainerVector& waitContainers = myWaiting4Vehicle[edge]; + for (ContainerVector::iterator i = waitContainers.begin(); i != waitContainers.end();) { + const std::string& line = vehicle->getParameter().line == "" ? vehicle->getParameter().id : vehicle->getParameter().line; + SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); + if ((*i)->isWaitingFor(line) && vehicle->getVehicleType().getContainerCapacity() > vehicle->getContainerNumber() + && stop->timeToLoadNextContainer <= currentTime + && stop->startPos <= (*i)->getEdgePos() && (*i)->getEdgePos() <= stop->endPos) { + edge->removeContainer(*i); + vehicle->addContainer(*i); + //if the time a container needs to get loaded on the vehicle extends the duration of the stop of the vehicle extend + //the duration by setting it to the loading duration of the container + const SUMOTime loadingDuration = vehicle->getVehicleType().getLoadingDuration(); + if (loadingDuration >= stop->duration) { + stop->duration = loadingDuration; + } + //update the time point at which the next container can be loaded on the vehicle + stop->timeToLoadNextContainer = currentTime + loadingDuration; + + static_cast((*i)->getCurrentStage())->setVehicle(vehicle); + i = waitContainers.erase(i); + ret = true; + } else { + ++i; + } + } + if (waitContainers.size() == 0) { + myWaiting4Vehicle.erase(myWaiting4Vehicle.find(edge)); + } + } + return ret; +} + +bool +MSContainerControl::hasContainers() const { + return !myContainers.empty(); +} + + +bool +MSContainerControl::hasNonWaiting() const { + return !myWaiting4Departure.empty() || !myWaitingUntil.empty() || !myTranship.empty(); +} + + +void +MSContainerControl::setTranship(MSContainer* c) { + myTranship[c->getID()] = c; +} + + +void +MSContainerControl::unsetTranship(MSContainer* c) { + std::map::iterator i = myTranship.find(c->getID()); + if (i != myTranship.end()) { + myTranship.erase(i); + } +} + + +void +MSContainerControl::abortWaiting() { + for (std::map::const_iterator i = myWaiting4Vehicle.begin(); i != myWaiting4Vehicle.end(); ++i) { + const MSEdge* edge = (*i).first; + const ContainerVector& pv = (*i).second; + for (ContainerVector::const_iterator j = pv.begin(); j != pv.end(); ++j) { + MSContainer* p = (*j); + edge->removeContainer(p); + WRITE_WARNING("Container " + p->getID() + " aborted waiting for a transport that will never come."); + erase(p); + } + } +} + + +MSContainer* +MSContainerControl::buildContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainer::MSContainerPlan* plan) const { + return new MSContainer(pars, vtype, plan); +} + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/MSContainerControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSContainerControl.h --- sumo-0.21.0+dfsg/src/microsim/MSContainerControl.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSContainerControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,145 @@ +/****************************************************************************/ +/// @file MSContainerControl.h +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Mon, 16 Jun 2014 +/// @version $Id: MSContainerControl.h 18096 2015-03-17 09:50:59Z behrisch $ +/// +// Stores all containers in the net and handles their waiting for cars. +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 MSContainerControl_h +#define MSContainerControl_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include "MSContainer.h" +#include "MSVehicle.h" + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSNet; +class MSVehicle; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * + * @class MSContainerControl + * The class is used to handle containers who are not using a transportation + * system but are waiting. Both is processed by waiting + * for the arrival time / the time the waiting is over. + */ +class MSContainerControl { +public: + + typedef std::vector ContainerVector; + + /// constructor + MSContainerControl(); + + /// destructor + virtual ~MSContainerControl(); + + /// adds a single container, returns false if an id clash occured + bool add(const std::string& id, MSContainer* container); + + /// removes a single container + virtual void erase(MSContainer* container); + + /// sets the arrival time for a waiting container + void setDeparture(SUMOTime time, MSContainer* container); + + /// sets the arrival time for a waiting container + void setWaitEnd(SUMOTime time, MSContainer* container); + + /// checks whether any containers waiting time is over + void checkWaitingContainers(MSNet* net, const SUMOTime time); + + /// adds a container to the list of containers waiting for a vehicle on the specified edge + void addWaiting(const MSEdge* edge, MSContainer* container); + + /** @brief load any applicable containers + * Loads any container that is waiting on that edge for the given vehicle and removes them from myWaiting + * @param[in] the edge on which the loading should take place + * @param[in] the vehicle which is taking on containers + * @return Whether any containers have been loaded + */ + bool loadAnyWaiting(MSEdge* edge, MSVehicle* vehicle, MSVehicle::Stop* stop); + + /// checks whether any container waits to finish her plan + bool hasContainers() const; + + /// checks whether any container is still engaged in walking / stopping + bool hasNonWaiting() const; + + /// aborts the plan for any container that is still waiting for a ride + void abortWaiting(); + + + /** @brief Builds a new container + * @param[in] pars The parameter + * @param[in] vtype The type (reusing vehicle type container here) + * @param[in] plan This container's plan + */ + virtual MSContainer* buildContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainer::MSContainerPlan* plan) const; + + /// adds a container to myTranship + void setTranship(MSContainer* c); + + /// removes a container from myTranship + void unsetTranship(MSContainer* c); +// +// /// @brief returns whether the the given container is waiting for a vehicle on the given edge +// bool isWaiting4Vehicle(const MSEdge* const edge, MSContainer* p) const; +// +// const std::map& getContainers() const { +// return myContainers; +// } +// +private: + /// all containers by id + std::map myContainers; + + /// all containers being transhiped + std::map myTranship; + + /// @brief Containers waiting for departure + std::map myWaiting4Departure; + + /// the lists of walking / stopping containers + std::map myWaitingUntil; + + /// the lists of waiting containers + std::map myWaiting4Vehicle; +// +}; + + +#endif + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/MSContainer.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSContainer.cpp --- sumo-0.21.0+dfsg/src/microsim/MSContainer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSContainer.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,563 @@ +/****************************************************************************/ +/// @file MSContainer.cpp +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Thu, 12 Jun 2014 +/// @version $Id: MSContainer.cpp 18129 2015-03-24 13:18:25Z behrisch $ +/// +// The class for modelling container-movements +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "MSNet.h" +#include "MSEdge.h" +#include "MSLane.h" +#include "MSContainer.h" +#include "microsim/trigger/MSContainerStop.h" +#include "MSContainerControl.h" +#include "MSInsertionControl.h" +#include "MSVehicle.h" +#include "MSCModel_NonInteracting.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + +/* ------------------------------------------------------------------------- + * static member definitions + * ----------------------------------------------------------------------- */ +const SUMOReal MSContainer::ROADSIDE_OFFSET(3); + +// =========================================================================== +// method definitions +// =========================================================================== +/* ------------------------------------------------------------------------- + * MSContainer::MSContainerStage - methods + * ----------------------------------------------------------------------- */ +MSContainer::MSContainerStage::MSContainerStage(const MSEdge& destination, StageType type) + : myDestination(destination), myDeparted(-1), myArrived(-1), myType(type) {} + +MSContainer::MSContainerStage::~MSContainerStage() {} + +const MSEdge& +MSContainer::MSContainerStage::getDestination() const { + return myDestination; +} + +void +MSContainer::MSContainerStage::setDeparted(SUMOTime now) { + if (myDeparted < 0) { + myDeparted = now; + } +} + +void +MSContainer::MSContainerStage::setArrived(SUMOTime now) { + myArrived = now; +} + +bool +MSContainer::MSContainerStage::isWaitingFor(const std::string& /*line*/) const { + return false; +} + +Position +MSContainer::MSContainerStage::getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const { + return getLanePosition(e->getLanes()[0], at, offset); +} + +Position +MSContainer::MSContainerStage::getLanePosition(const MSLane* lane, SUMOReal at, SUMOReal offset) const { + return lane->getShape().positionAtOffset(lane->interpolateLanePosToGeometryPos(at), offset); +} + +SUMOReal +MSContainer::MSContainerStage::getEdgeAngle(const MSEdge* e, SUMOReal at) const { + PositionVector shp = e->getLanes()[0]->getShape(); + return -shp.rotationDegreeAtOffset(at); +} + + + +/* ------------------------------------------------------------------------- + * MSContainer::MSContainerStage_Driving - methods + * ----------------------------------------------------------------------- */ +MSContainer::MSContainerStage_Driving::MSContainerStage_Driving(const MSEdge& destination, + MSContainerStop* toCS, const std::vector& lines) + : MSContainerStage(destination, DRIVING), myLines(lines.begin(), lines.end()), + myVehicle(0), myDestinationContainerStop(toCS) {} + + +MSContainer::MSContainerStage_Driving::~MSContainerStage_Driving() {} + +void +MSContainer::MSContainerStage_Driving::proceed(MSNet* net, MSContainer* container, SUMOTime now, + MSEdge* previousEdge, const SUMOReal at) { + myWaitingEdge = previousEdge; + myWaitingPos = at; + myWaitingSince = now; + SUMOVehicle* availableVehicle = net->getVehicleControl().getWaitingVehicle(previousEdge, myLines, myWaitingPos, container->getID()); + if (availableVehicle != 0 && availableVehicle->getParameter().departProcedure == DEPART_CONTAINER_TRIGGERED) { + myVehicle = availableVehicle; + previousEdge->removeContainer(container); + myVehicle->addContainer(container); + net->getInsertionControl().add(myVehicle); + net->getVehicleControl().removeWaiting(previousEdge, myVehicle); + net->getVehicleControl().unregisterOneWaitingForContainer(); + } else { + net->getContainerControl().addWaiting(previousEdge, container); + previousEdge->addContainer(container); + } +} + +const MSEdge* +MSContainer::MSContainerStage_Driving::getEdge() const { + if (myVehicle != 0) { + return myVehicle->getEdge(); + } + return myWaitingEdge; +} + + +const MSEdge* +MSContainer::MSContainerStage_Driving::getFromEdge() const { + return myWaitingEdge; +} + + +SUMOReal +MSContainer::MSContainerStage_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()->getLength()); + } + return myWaitingPos; +} + +Position +MSContainer::MSContainerStage_Driving::getPosition(SUMOTime /* now */) const { + if (myVehicle != 0) { + /// @bug this fails while vehicle is driving across a junction + return myVehicle->getEdge()->getLanes()[0]->getShape().positionAtOffset(myVehicle->getPositionOnLane()); + } + return getEdgePosition(myWaitingEdge, myWaitingPos, ROADSIDE_OFFSET); +} + +SUMOReal +MSContainer::MSContainerStage_Driving::getAngle(SUMOTime /* now */) const { + if (myVehicle != 0) { + MSVehicle* veh = dynamic_cast(myVehicle); + if (veh != 0) { + return veh->getAngle(); + } else { + return 0; + } + } + return getEdgeAngle(myWaitingEdge, myWaitingPos) + 90; +} + +bool +MSContainer::MSContainerStage_Driving::isWaitingFor(const std::string& line) const { + return myLines.count(line) > 0; +} + +bool +MSContainer::MSContainerStage_Driving::isWaiting4Vehicle() const { + return myVehicle == 0; +} + +SUMOTime +MSContainer::MSContainerStage_Driving::getWaitingTime(SUMOTime now) const { + return isWaiting4Vehicle() ? now - myWaitingSince : 0; +} + +SUMOReal +MSContainer::MSContainerStage_Driving::getSpeed() const { + return myVehicle == 0 ? 0 : myVehicle->getSpeed(); +} + +std::string +MSContainer::MSContainerStage_Driving::getStageDescription() const { + return isWaiting4Vehicle() ? "waiting for " + joinToString(myLines, ",") : "transport"; +} + +MSContainerStop* +MSContainer::MSContainerStage_Driving::getDepartContainerStop() const { + return myDepartContainerStop; +} + +void +MSContainer::MSContainerStage_Driving::tripInfoOutput(OutputDevice& os) const { + os.openTag("transport").writeAttr("depart", time2string(myDeparted)).writeAttr("arrival", time2string(myArrived)).closeTag(); +} + +void +MSContainer::MSContainerStage_Driving::routeOutput(OutputDevice& os) const { + os.openTag("transport").writeAttr(SUMO_ATTR_FROM, getFromEdge()->getID()).writeAttr(SUMO_ATTR_TO, getDestination().getID()); + os.writeAttr(SUMO_ATTR_LINES, myLines).closeTag(); +} + +void +MSContainer::MSContainerStage_Driving::beginEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const { + os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", container.getID()).writeAttr("link", getEdge()->getID()).closeTag(); +} + +void +MSContainer::MSContainerStage_Driving::endEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const { + os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", container.getID()).writeAttr("link", getEdge()->getID()).closeTag(); +} + + + +/* ------------------------------------------------------------------------- + * MSContainer::MSContainerStage_Waiting - methods + * ----------------------------------------------------------------------- */ +MSContainer::MSContainerStage_Waiting::MSContainerStage_Waiting(const MSEdge& destination, + SUMOTime duration, SUMOTime until, SUMOReal pos, const std::string& actType) : + MSContainerStage(destination, WAITING), + myWaitingDuration(duration), + myWaitingUntil(until), + myActType(actType), + myStartPos(pos) { + myStartPos = SUMOVehicleParameter::interpretEdgePos( + myStartPos, myDestination.getLength(), SUMO_ATTR_DEPARTPOS, "container stopping at " + myDestination.getID()); +} + +MSContainer::MSContainerStage_Waiting::~MSContainerStage_Waiting() {} + +const MSEdge* +MSContainer::MSContainerStage_Waiting::getEdge() const { + return &myDestination; +} + +const MSEdge* +MSContainer::MSContainerStage_Waiting::getFromEdge() const { + return &myDestination; +} + +SUMOReal +MSContainer::MSContainerStage_Waiting::getEdgePos(SUMOTime /* now */) const { + return myStartPos; +} + +SUMOTime +MSContainer::MSContainerStage_Waiting::getUntil() const { + return myWaitingUntil; +} + +Position +MSContainer::MSContainerStage_Waiting::getPosition(SUMOTime /* now */) const { + return getEdgePosition(&myDestination, myStartPos, ROADSIDE_OFFSET); +} + +SUMOReal +MSContainer::MSContainerStage_Waiting::getAngle(SUMOTime /* now */) const { + return getEdgeAngle(&myDestination, myStartPos) - 180; +} + +SUMOTime +MSContainer::MSContainerStage_Waiting::getWaitingTime(SUMOTime now) const { + return now - myWaitingStart; +} + +SUMOReal +MSContainer::MSContainerStage_Waiting::getSpeed() const { + return 0; +} + +MSContainerStop* +MSContainer::MSContainerStage_Waiting::getDepartContainerStop() const { + return myCurrentContainerStop; +} + +void +MSContainer::MSContainerStage_Waiting::proceed(MSNet* net, MSContainer* container, SUMOTime now, + MSEdge* previousEdge, const SUMOReal /* at */) { + previousEdge->addContainer(container); + myWaitingStart = now; + const SUMOTime until = MAX3(now, now + myWaitingDuration, myWaitingUntil); + net->getContainerControl().setWaitEnd(until, container); +} + +void +MSContainer::MSContainerStage_Waiting::tripInfoOutput(OutputDevice& os) const { + os.openTag("stop").writeAttr("arrival", time2string(myArrived)).closeTag(); +} + +void +MSContainer::MSContainerStage_Waiting::routeOutput(OutputDevice& os) const { + os.openTag("stop").writeAttr(SUMO_ATTR_LANE, getDestination().getID()); + if (myWaitingDuration >= 0) { + os.writeAttr(SUMO_ATTR_DURATION, time2string(myWaitingDuration)); + } + if (myWaitingUntil >= 0) { + os.writeAttr(SUMO_ATTR_UNTIL, time2string(myWaitingUntil)); + } + os.closeTag(); +} + +void +MSContainer::MSContainerStage_Waiting::beginEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const { + os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actstart " + myActType) + .writeAttr("agent", container.getID()).writeAttr("link", getEdge()->getID()).closeTag(); +} + +void +MSContainer::MSContainerStage_Waiting::endEventOutput(const MSContainer& container, SUMOTime t, OutputDevice& os) const { + os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actend " + myActType).writeAttr("agent", container.getID()) + .writeAttr("link", getEdge()->getID()).closeTag(); +} + +/* ------------------------------------------------------------------------- + * MSContainer::MSContainerStage_Tranship - methods + * ----------------------------------------------------------------------- */ +MSContainer::MSContainerStage_Tranship::MSContainerStage_Tranship(const std::vector& route, + MSContainerStop* toCS, + SUMOReal speed, + SUMOReal departPos, SUMOReal arrivalPos) : + MSContainerStage(*route.back(), TRANSHIP), myRoute(route), + myDestinationContainerStop(toCS), + mySpeed(speed), myContainerState(0), myCurrentInternalEdge(0) { + myDepartPos = SUMOVehicleParameter::interpretEdgePos( + departPos, myRoute.front()->getLength(), SUMO_ATTR_DEPARTPOS, "container getting transhipped from " + myRoute.front()->getID()); + myArrivalPos = SUMOVehicleParameter::interpretEdgePos( + arrivalPos, myRoute.back()->getLength(), SUMO_ATTR_ARRIVALPOS, "container getting transhipped to " + myRoute.back()->getID()); +} + +MSContainer::MSContainerStage_Tranship::~MSContainerStage_Tranship() { +} + +void +MSContainer::MSContainerStage_Tranship::proceed(MSNet* /* net */, MSContainer* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at) { + previousEdge->removeContainer(container); + myRouteStep = myRoute.end() - 1; //define that the container is already on its destination edge + MSNet::getInstance()->getContainerControl().setTranship(container); + if (at >= 0) { + myDepartPos = at; + } + myContainerState = MSCModel_NonInteracting::getModel()->add(container, this, now); + ((MSEdge*) *myRouteStep)->addContainer(container); +} + +const MSEdge* +MSContainer::MSContainerStage_Tranship::getEdge() const { + if (myCurrentInternalEdge != 0) { + return myCurrentInternalEdge; + } else { + return *myRouteStep; + } +} + +const MSEdge* +MSContainer::MSContainerStage_Tranship::getFromEdge() const { + return myRoute.front(); +} + +const MSEdge* +MSContainer::MSContainerStage_Tranship::getToEdge() const { + return myRoute.back(); +} + +SUMOReal +MSContainer::MSContainerStage_Tranship::getEdgePos(SUMOTime now) const { + return myContainerState->getEdgePos(*this, now); +} + +Position +MSContainer::MSContainerStage_Tranship::getPosition(SUMOTime now) const { + return myContainerState->getPosition(*this, now); +} + +SUMOReal +MSContainer::MSContainerStage_Tranship::getAngle(SUMOTime now) const { + return myContainerState->getAngle(*this, now); +} + +SUMOTime +MSContainer::MSContainerStage_Tranship::getWaitingTime(SUMOTime /* now */) const { + return 0; +} + +SUMOReal +MSContainer::MSContainerStage_Tranship::getSpeed() const { + return myContainerState->getSpeed(*this); +} + +MSContainerStop* +MSContainer::MSContainerStage_Tranship::getDepartContainerStop() const { + return myDepartContainerStop; +} + +void +MSContainer::MSContainerStage_Tranship::tripInfoOutput(OutputDevice& os) const { + os.openTag("tranship").writeAttr("arrival", time2string(myArrived)).closeTag(); +} + + +void +MSContainer::MSContainerStage_Tranship::routeOutput(OutputDevice& os) const { + os.openTag("tranship").writeAttr(SUMO_ATTR_EDGES, myRoute); + os.writeAttr(SUMO_ATTR_SPEED, mySpeed); + os.closeTag(); +} + + +void +MSContainer::MSContainerStage_Tranship::beginEventOutput(const MSContainer& c, SUMOTime t, OutputDevice& os) const { + os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "departure") + .writeAttr("agent", c.getID()).writeAttr("link", myRoute.front()->getID()).closeTag(); +} + + +void +MSContainer::MSContainerStage_Tranship::endEventOutput(const MSContainer& c, SUMOTime t, OutputDevice& os) const { + os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival") + .writeAttr("agent", c.getID()).writeAttr("link", myRoute.back()->getID()).closeTag(); +} + +bool +MSContainer::MSContainerStage_Tranship::moveToNextEdge(MSContainer* container, SUMOTime currentTime, MSEdge* nextInternal) { + ((MSEdge*)getEdge())->removeContainer(container); + if (myRouteStep == myRoute.end() - 1) { + MSNet::getInstance()->getContainerControl().unsetTranship(container); + if (myDestinationContainerStop != 0) { + myDestinationContainerStop->addContainer(container); //jakob + } + if (!container->proceed(MSNet::getInstance(), currentTime)) { + MSNet::getInstance()->getContainerControl().erase(container); + } + return true; + } else { + if (nextInternal == 0) { + ++myRouteStep; + myCurrentInternalEdge = 0; + } else { + myCurrentInternalEdge = nextInternal; + } + ((MSEdge*) getEdge())->addContainer(container); + return false; + } +} + +/* ------------------------------------------------------------------------- + * MSContainer - methods + * ----------------------------------------------------------------------- */ +MSContainer::MSContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainerPlan* plan) + : myParameter(pars), myVType(vtype), myPlan(plan) { + myStep = myPlan->begin(); + lastDestination = &(myPlan->back())->getDestination(); +} + +MSContainer::~MSContainer() { + for (MSContainerPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) { + delete *i; + } + delete myPlan; + delete myParameter; +} + +const std::string& +MSContainer::getID() const { + return myParameter->id; +} + +bool +MSContainer::proceed(MSNet* net, SUMOTime time) { + MSEdge* arrivedAt = (MSEdge*)(*myStep)->getEdge(); + SUMOReal atPos = (*myStep)->getEdgePos(time); + (*myStep)->setArrived(time); + myStep++; + if (myStep != myPlan->end()) { + (*myStep)->proceed(net, this, time, arrivedAt, atPos); + return true; + } else { + arrivedAt->removeContainer(this); + return false; + } +} + +SUMOTime +MSContainer::getDesiredDepart() const { + return myParameter->depart; +} + +void +MSContainer::setDeparted(SUMOTime now) { + (*myStep)->setDeparted(now); +} + +SUMOReal +MSContainer::getEdgePos() const { + return (*myStep)->getEdgePos(MSNet::getInstance()->getCurrentTimeStep()); +} + +Position +MSContainer::getPosition() const { + return (*myStep)->getPosition(MSNet::getInstance()->getCurrentTimeStep()); +} + +SUMOReal +MSContainer::getAngle() const { + return (*myStep)->getAngle(MSNet::getInstance()->getCurrentTimeStep()); +} + +SUMOReal +MSContainer::getWaitingSeconds() const { + return STEPS2TIME((*myStep)->getWaitingTime(MSNet::getInstance()->getCurrentTimeStep())); +} + +SUMOReal +MSContainer::getSpeed() const { + return (*myStep)->getSpeed(); +} + +MSContainerStop* +MSContainer::getDepartContainerStop() const { + return (*myStep)->getDepartContainerStop(); +} + +void +MSContainer::tripInfoOutput(OutputDevice& os) const { + for (MSContainerPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) { + (*i)->tripInfoOutput(os); + } +} + +void +MSContainer::routeOutput(OutputDevice& os) const { + MSContainerPlan::const_iterator i = myPlan->begin(); + if ((*i)->getStageType() == WAITING && getDesiredDepart() == static_cast(*i)->getUntil()) { + ++i; + } + for (; i != myPlan->end(); ++i) { + (*i)->routeOutput(os); + } +} + + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/MSContainer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSContainer.h --- sumo-0.21.0+dfsg/src/microsim/MSContainer.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSContainer.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,697 @@ +/****************************************************************************/ +/// @file MSContainer.h +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Thu, 12 Jun 2014 +/// @version $Id: MSContainer.h 18129 2015-03-24 13:18:25Z behrisch $ +/// +// The class for modelling container-movements +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 MSContainer_h +#define MSContainer_h + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSNet; +class MSEdge; +class MSLane; +class OutputDevice; +class SUMOVehicleParameter; +class MSContainerStop; +class SUMOVehicle; +class MSVehicleType; +class MSCModel_NonInteracting; +class CState; + +//typedef std::vector MSEdgeVector; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSContainer + * + * The class holds a simulated container together with its movement stages + */ + + +class MSContainer { +public: + enum StageType { + DRIVING = 0, + WAITING = 1, + TRANSHIP = 2 + }; + + /// @brief the offset for computing container positions when standing at an edge + static const SUMOReal ROADSIDE_OFFSET; + + + /** + * The "abstract" class for a single stage of a container movement + * Contains the destination of the current movement step + */ + class MSContainerStage { + public: + /// constructor + MSContainerStage(const MSEdge& destination, StageType type); + + /// destructor + virtual ~MSContainerStage(); + + /// returns the destination edge + const MSEdge& getDestination() const; + + /// Returns the current edge + virtual const MSEdge* getEdge() const = 0; + virtual const MSEdge* getFromEdge() const = 0; + virtual SUMOReal getEdgePos(SUMOTime now) const = 0; + + /// returns the position of the container + virtual Position getPosition(SUMOTime now) const = 0; + + /// returns the angle of the container + virtual SUMOReal getAngle(SUMOTime now) const = 0; + + /// + StageType getStageType() const { + return myType; + } + + /// @brief return string representation of the current stage + virtual std::string getStageDescription() const = 0; + + /// proceeds to the next step + virtual void proceed(MSNet* net, MSContainer* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at) = 0; + + /// logs end of the step + void setDeparted(SUMOTime now); + + /// logs end of the step + void setArrived(SUMOTime now); + + /// Whether the container waits for a vehicle of the line specified. + virtual bool isWaitingFor(const std::string& line) const; + + /// @brief Whether the container waits for a vehicle + virtual bool isWaiting4Vehicle() const { + return false; + } + + /// @brief the time this container spent waiting + virtual SUMOTime getWaitingTime(SUMOTime now) const = 0; + + /// @brief the speed of the container + virtual SUMOReal getSpeed() const = 0; + + /// @brief get position on edge e at length at with orthogonal offset + Position getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const; + + /// @brief get position on lane at length at with orthogonal offset + Position getLanePosition(const MSLane* lane, SUMOReal at, SUMOReal offset) const; + + /// @brief get angle of the edge at a certain position + SUMOReal getEdgeAngle(const MSEdge* e, SUMOReal at) const; + + /* @brief Return the current ContainerStop or the destination containe stop + * + * returns the current container stop if the stage=Waiting and the + * container stop from wich the container departs if stage=Driving + */ + virtual MSContainerStop* getDepartContainerStop() const = 0; + + /** @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 on writing vehroute output + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void routeOutput(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 MSContainer& container, 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 MSContainer& container, SUMOTime t, OutputDevice& os) const = 0; + + protected: + /// the next edge to reach by getting transported + const MSEdge& myDestination; + + /// the time at which this stage started + SUMOTime myDeparted; + + /// the time at which this stage ended + SUMOTime myArrived; + + /// The type of this stage + StageType myType; + + private: + /// @brief Invalidated copy constructor. + MSContainerStage(const MSContainerStage&); + + /// @brief Invalidated assignment operator. + MSContainerStage& operator=(const MSContainerStage&); + + }; + + /** + * A "real" stage performing the travelling by a transport system + * A container is in this stage if it is on a ride or if its waiting for a ride. + * The given route will be chosen. The travel time is computed by the simulation + */ + class MSContainerStage_Driving : public MSContainerStage { + public: + /// constructor + MSContainerStage_Driving(const MSEdge& destination, MSContainerStop* toCS, + const std::vector& lines); + + /// destructor + ~MSContainerStage_Driving(); + + /// proceeds to the next step + virtual void proceed(MSNet* net, MSContainer* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at); + + /// Returns the current edge + const MSEdge* getEdge() const; + const MSEdge* getFromEdge() const; + SUMOReal getEdgePos(SUMOTime now) const; + + /// + Position getPosition(SUMOTime now) const; + + /// @brief the angle of the vehicle or the angle of the edge + 90deg + SUMOReal getAngle(SUMOTime now) const; + + /// @brief returns the stage description as a string + std::string getStageDescription() const; + + /// Whether the container waits for a vehicle of the line specified. + bool isWaitingFor(const std::string& line) const; + + /// @brief Whether the container waits for a vehicle + bool isWaiting4Vehicle() const; + + /// @brief time spent waiting for a ride + SUMOTime getWaitingTime(SUMOTime now) const; + + /** @brief the speed of the container + * + * If the container is still waiting for a ride zero will be returned. + * If the container is on a ride the speed of the corresponding vehicle + * will be returned. + */ + SUMOReal getSpeed() const; + + /// @brief returns the container stop from which the container departs + MSContainerStop* getDepartContainerStop() const; + + /// @brief assign a vehicle to the container + void setVehicle(SUMOVehicle* v) { + myVehicle = v; + } + + /** @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 on writing vehroute output + * + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void routeOutput(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 MSContainer& container, 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 MSContainer& container, SUMOTime t, OutputDevice& os) const; + + private: + /// the lines to choose from + const std::set myLines; + + /// @brief The taken vehicle + SUMOVehicle* myVehicle; + + /// @brief The destination container stop + MSContainerStop* myDestinationContainerStop; + + /// @brief The container stop from which the container departs + MSContainerStop* myDepartContainerStop; + + SUMOReal myWaitingPos; + + /// @brief The time since which this container is waiting for a ride + SUMOTime myWaitingSince; + + const MSEdge* myWaitingEdge; + + private: + /// @brief Invalidated copy constructor. + MSContainerStage_Driving(const MSContainerStage_Driving&); + + /// @brief Invalidated assignment operator. + MSContainerStage_Driving& operator=(const MSContainerStage_Driving&); + + }; + + /** + * A "real" stage performing a waiting over the specified time + * A container is in this stage if it is not on a ride or waiting for a ride, e.g. + * if it is stored, or if gets filled or emptied. + */ + class MSContainerStage_Waiting : public MSContainerStage { + public: + /// constructor + MSContainerStage_Waiting(const MSEdge& destination, + SUMOTime duration, SUMOTime until, SUMOReal pos, const std::string& actType); + + /// destructor + ~MSContainerStage_Waiting(); + + /// Returns the current edge + const MSEdge* getEdge() const; + + /// Returns the current edge + const MSEdge* getFromEdge() const; + + SUMOReal getEdgePos(SUMOTime now) const; + + /// Returns time until the container waits + SUMOTime getUntil() const; + + Position getPosition(SUMOTime now) const; + + /// @brief the angle of the edge minus 90deg + SUMOReal getAngle(SUMOTime now) const; + + SUMOTime getWaitingTime(SUMOTime now) const; + + /// Returns the speed of the container which is always zero in that stage + SUMOReal getSpeed() const; + + /// Returns the current stage description as a string + std::string getStageDescription() const { + return "waiting (" + myActType + ")"; + } + + /* @brief returns the container stop at which the container is waiting + * + * this method was added to have a method 'getDepartContainerStop' + * for MSContainer. + */ + MSContainerStop* getDepartContainerStop() const; + + /// proceeds to the next step + virtual void proceed(MSNet* net, MSContainer* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at); + + /** @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 on writing vehroute output + * + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void routeOutput(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 MSContainer& container, 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 MSContainer& container, SUMOTime t, OutputDevice& os) const; + + private: + /// the time the container is waiting + SUMOTime myWaitingDuration; + + /// the time until the container is waiting + SUMOTime myWaitingUntil; + + /// the time the container started waiting + SUMOTime myWaitingStart; + + /// @brief The type of activity + std::string myActType; + + SUMOReal myStartPos; + + /// @brief the container stop at which the container is waiting + MSContainerStop* myCurrentContainerStop; + + + private: + /// @brief Invalidated copy constructor. + MSContainerStage_Waiting(const MSContainerStage_Waiting&); + + /// @brief Invalidated assignment operator. + MSContainerStage_Waiting& operator=(const MSContainerStage_Waiting&); + + }; + + /** + * A "real" stage performing the tranship of a container + * A container is in this stage if it gets transhipred between two stops that are + * assumed to be connected. + */ + class MSContainerStage_Tranship : public MSContainerStage { + friend class MSCModel_NonInteracting; + + public: + /// constructor + MSContainerStage_Tranship(const std::vector& route, MSContainerStop* toCS, SUMOReal speed, SUMOReal departPos, SUMOReal arrivalPos); + + /// destructor + ~MSContainerStage_Tranship(); + + /// proceeds to the next step + virtual void proceed(MSNet* net, MSContainer* container, SUMOTime now, MSEdge* previousEdge, const SUMOReal at); + + /// Returns the current edge + const MSEdge* getEdge() const; + + /// Returns first edge of the containers route + const MSEdge* getFromEdge() const; + + /// Returns last edge of the containers route + const MSEdge* getToEdge() const; + + /// Returns the offset from the start of the current edge measured in its natural direction + SUMOReal getEdgePos(SUMOTime now) const; + + /// Returns the position of the container + Position getPosition(SUMOTime now) const; + + /// Returns the angle of the container + SUMOReal getAngle(SUMOTime now) const; + + /// Returns the time the container spent waiting + SUMOTime getWaitingTime(SUMOTime now) const; + + /// Returns the speed of the container + SUMOReal getSpeed() const; + + /// Returns the current stage description as a string + std::string getStageDescription() const { + return "tranship"; + } + + /// @brief returns the container stop from which the container departs + MSContainerStop* getDepartContainerStop() 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; + + /** @brief Called on writing vehroute output + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void routeOutput(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 MSContainer& c, 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 MSContainer& c, SUMOTime t, OutputDevice& os) const; + + /// @brief move forward and return whether the container arrived + bool moveToNextEdge(MSContainer* container, SUMOTime currentTime, MSEdge* nextInternal = 0); + + + /// @brief accessors to be used by MSCModel_NonInteracting + inline SUMOReal getMaxSpeed() const { + return mySpeed; + } + + inline SUMOReal getDepartPos() const { + return myDepartPos; + } + + inline SUMOReal getArrivalPos() const { + return myArrivalPos; + } + + inline const MSEdge* getNextRouteEdge() const { + return myRouteStep == myRoute.end() - 1 ? 0 : *(myRouteStep + 1); + } + + CState* getContainerState() const { + return myContainerState; + } + + private: + /// @brief The route of the container + std::vector myRoute; + + /// @brief current step + std::vector::iterator myRouteStep; + + /// @brief the depart position + SUMOReal myDepartPos; + + /// @brief the arrival position + SUMOReal myArrivalPos; + + /// @brief the destination container stop + MSContainerStop* myDestinationContainerStop; + + /// @brief The container stop from which the container departs + MSContainerStop* myDepartContainerStop; + + /// @brief the speed of the container + SUMOReal mySpeed; + + /// @brief state that is to be manipulated by MSCModel + CState* myContainerState; + + /// @brief The current internal edge this container is on or 0 + MSEdge* myCurrentInternalEdge; + + private: + /// @brief Invalidated copy constructor. + MSContainerStage_Tranship(const MSContainerStage_Tranship&); + + /// @brief Invalidated assignment operator. + MSContainerStage_Tranship& operator=(const MSContainerStage_Tranship&); + + }; + +public: + /// the structure holding the plan of a container + typedef std::vector MSContainerPlan; + + /// the last destination of the route of the container + const MSEdge* lastDestination; + +protected: + /// the plan of the container + const SUMOVehicleParameter* myParameter; + + /// @brief This container's type. (mainly used for drawing related information + /// Note sure if it is really necessary + const MSVehicleType* myVType; + + /// the plan of the container + MSContainerPlan* myPlan; + + /// the iterator over the route + MSContainerPlan::iterator myStep; + + /// @brief Whether events shall be written + bool myWriteEvents; + +public: + /// constructor + MSContainer(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSContainerPlan* plan); + + /// destructor + virtual ~MSContainer(); + + /// returns the container id + const std::string& getID() const; + + /* @brief proceeds to the next step of the route, + * @return Whether the containers plan continues */ + bool proceed(MSNet* net, SUMOTime time); + + /// Returns the desired departure time. + SUMOTime getDesiredDepart() const; + + /// logs depart time of the current stage + void setDeparted(SUMOTime now); + + /// Returns the current destination. + const MSEdge& getDestination() const { + return (*myStep)->getDestination(); + } + + /// Returns the destination after the current destination. + const MSEdge& getNextDestination() const { + return (*(myStep + 1))->getDestination(); + } + + /// @brief Returns the current edge + const MSEdge* getEdge() const { + return (*myStep)->getEdge(); + } + + /// @brief Returns the departure edge + const MSEdge* getFromEdge() const { + return (*myStep)->getFromEdge(); + } + + /// @brief Return the position on the edge + virtual SUMOReal getEdgePos() const; + + /// @brief Return the Network coordinate of the container + virtual Position getPosition() const; + + /// @brief return the current angle of the container + virtual SUMOReal getAngle() const; + + /// @brief the time this container spent waiting in seconds + virtual SUMOReal getWaitingSeconds() const; + + /// @brief the current speed of the container + virtual SUMOReal getSpeed() const; + + /// @brief the current stage type of the container + StageType getCurrentStageType() const { + return (*myStep)->getStageType(); + } + + /// Returns the current stage description as a string + std::string getCurrentStageDescription() const { + return (*myStep)->getStageDescription(); + } + + /// @brief Return the current stage + MSContainerStage* getCurrentStage() const { + return *myStep; + } + + /* @brief Return the current ContainerStop or the destination containe stop + * + * returns the current container stop if the stage=Waiting and the + * container stop from wich the container departs if stage=Driving + */ + virtual MSContainerStop* getDepartContainerStop() const; + + + /** @brief Called on writing tripinfo output + * + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + void tripInfoOutput(OutputDevice& os) const; + + /** @brief Called on writing vehroute output + * + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + void routeOutput(OutputDevice& os) const; + + /// Whether the container waits for a vehicle of the line specified. + bool isWaitingFor(const std::string& line) const { + return (*myStep)->isWaitingFor(line); + } + + /// Whether the container waits for a vehicle + bool isWaiting4Vehicle() const { + return (*myStep)->isWaiting4Vehicle(); + } + + const SUMOVehicleParameter& getParameter() const { + return *myParameter; + } + + inline const MSVehicleType& getVehicleType() const { + return *myVType; + } + +private: + /// @brief Invalidated copy constructor. + MSContainer(const MSContainer&); + + /// @brief Invalidated assignment operator. + MSContainer& operator=(const MSContainer&); + +}; + + +#endif + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/MSEdgeControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEdgeControl.cpp --- sumo-0.21.0+dfsg/src/microsim/MSEdgeControl.cpp 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEdgeControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 09 Apr 2001 -/// @version $Id: MSEdgeControl.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSEdgeControl.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Stores edges and lanes, performs moving of vehicle /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -179,7 +179,7 @@ std::vector MSEdgeControl::getEdgeNames() const { std::vector ret; - for (std::vector::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) { + for (MSEdgeVector::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) { ret.push_back((*i)->getID()); } return ret; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSEdgeControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEdgeControl.h --- sumo-0.21.0+dfsg/src/microsim/MSEdgeControl.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEdgeControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 09 Apr 2001 -/// @version $Id: MSEdgeControl.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSEdgeControl.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Stores edges and lanes, performs moving of vehicle /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -52,6 +52,7 @@ class MSLane; class OutputDevice; +typedef std::vector MSEdgeVector; // =========================================================================== // class definitions @@ -71,9 +72,6 @@ * in "patchActiveLanes". */ class MSEdgeControl { -public: - /// @brief Container for edges. - typedef std::vector< MSEdge* > EdgeCont; public: /** @brief Constructor @@ -158,7 +156,7 @@ * @return the container storing one-lane edges * @todo Check: Is this secure? */ - const std::vector& getEdges() const { + const MSEdgeVector& getEdges() const { return myEdges; } @@ -205,7 +203,7 @@ private: /// @brief Loaded edges - std::vector myEdges; + MSEdgeVector myEdges; /// @brief Definition of a container about a lane's number of vehicles and neighbors typedef std::vector LaneUsageVector; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSEdge.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEdge.cpp --- sumo-0.21.0+dfsg/src/microsim/MSEdge.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEdge.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -8,12 +8,12 @@ /// @author Michael Behrisch /// @author Sascha Krieg /// @date Tue, 06 Mar 2001 -/// @version $Id: MSEdge.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSEdge.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // A road/street connecting two junctions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -40,11 +40,13 @@ #include #include #include "MSEdge.h" +#include "MSJunction.h" #include "MSLane.h" #include "MSLaneChanger.h" #include "MSGlobals.h" #include "MSVehicle.h" -#include "MSPerson.h" +#include +#include "MSContainer.h" #include "MSEdgeWeightsStorage.h" #ifdef HAVE_INTERNAL @@ -62,7 +64,7 @@ // static member definitions // =========================================================================== MSEdge::DictType MSEdge::myDict; -std::vector MSEdge::myEdges; +MSEdgeVector MSEdge::myEdges; // =========================================================================== @@ -71,13 +73,18 @@ MSEdge::MSEdge(const std::string& id, int numericalID, const EdgeBasicFunction function, const std::string& streetName, - const std::string& edgeType) : + const std::string& edgeType, + int priority) : Named(id), myNumericalID(numericalID), myLanes(0), myLaneChanger(0), myFunction(function), myVaporizationRequests(0), myLastFailedInsertionTime(-1), myFromJunction(0), myToJunction(0), myStreetName(streetName), myEdgeType(edgeType), + myPriority(priority), + myLength(-1.), + myEmptyTraveltime(-1.), + myAmDelayed(false), myAmRoundabout(false) {} @@ -97,11 +104,14 @@ void -MSEdge::initialize(std::vector* lanes) { - assert(myFunction == EDGEFUNCTION_DISTRICT || lanes != 0); +MSEdge::initialize(const std::vector* lanes) { + assert(lanes != 0); myLanes = lanes; - if (myLanes && myLanes->size() > 1) { - myLaneChanger = new MSLaneChanger(myLanes, OptionsCont::getOptions().getBool("lanechange.allow-swap")); + if (!lanes->empty()) { + recalcCache(); + if (myLanes->size() > 1) { + myLaneChanger = new MSLaneChanger(myLanes, OptionsCont::getOptions().getBool("lanechange.allow-swap")); + } } if (myFunction == EDGEFUNCTION_DISTRICT) { myCombinedPermissions = SVCAll; @@ -109,31 +119,16 @@ } -bool -MSEdge::laneChangeAllowed() const { - if (myLanes == 0 || myLanes->size() < 2) { - return false; - } - if (myFunction != EDGEFUNCTION_INTERNAL) { - return true; - } - // allow changing only if all links leading to this internal lane have priority - for (std::vector::iterator it = myLanes->begin(); it != myLanes->end(); ++it) { - MSLane* pred = (*it)->getLogicalPredecessorLane(); - MSLink* link = MSLinkContHelper::getConnectingLink(*pred, **it); - assert(link != 0); - if (!link->havePriority()) { - return false; - } - } - return true; +void MSEdge::recalcCache() { + myLength = myLanes->front()->getLength(); + myEmptyTraveltime = myLength / MAX2(getSpeedLimit(), NUMERICAL_EPS); } void MSEdge::closeBuilding() { myAllowed[0] = new std::vector(); - for (std::vector::iterator i = myLanes->begin(); i != myLanes->end(); ++i) { + for (std::vector::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) { myAllowed[0]->push_back(*i); const MSLinkCont& lc = (*i)->getLinkCont(); for (MSLinkCont::const_iterator j = lc.begin(); j != lc.end(); ++j) { @@ -144,8 +139,8 @@ if (std::find(mySuccessors.begin(), mySuccessors.end(), &to) == mySuccessors.end()) { mySuccessors.push_back(&to); } - if (std::find(to.myPredeccesors.begin(), to.myPredeccesors.end(), this) == to.myPredeccesors.end()) { - to.myPredeccesors.push_back(this); + if (std::find(to.myPredecessors.begin(), to.myPredecessors.end(), this) == to.myPredecessors.end()) { + to.myPredecessors.push_back(this); } // if (myAllowed.find(&to) == myAllowed.end()) { @@ -157,8 +152,8 @@ toL = (*j)->getViaLane(); if (toL != 0) { MSEdge& to = toL->getEdge(); - if (std::find(to.myPredeccesors.begin(), to.myPredeccesors.end(), this) == to.myPredeccesors.end()) { - to.myPredeccesors.push_back(this); + if (std::find(to.myPredecessors.begin(), to.myPredecessors.end(), this) == to.myPredecessors.end()) { + to.myPredecessors.push_back(this); } } #endif @@ -179,10 +174,11 @@ } } myClassedAllowed.clear(); + myClassesSuccessorMap.clear(); // rebuild myMinimumPermissions and myCombinedPermissions myMinimumPermissions = SVCAll; myCombinedPermissions = 0; - for (std::vector::iterator i = myLanes->begin(); i != myLanes->end(); ++i) { + for (std::vector::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) { myMinimumPermissions &= (*i)->getPermissions(); myCombinedPermissions |= (*i)->getPermissions(); } @@ -299,11 +295,12 @@ } MSLane* res = 0; if (allowed != 0) { - unsigned int noCars = INT_MAX; + SUMOReal leastOccupancy = std::numeric_limits::max();; for (std::vector::const_iterator i = allowed->begin(); i != allowed->end(); ++i) { - if ((*i)->getVehicleNumber() < noCars) { + const SUMOReal occupancy = (*i)->getBruttoOccupancy(); + if (occupancy < leastOccupancy) { res = (*i); - noCars = (*i)->getVehicleNumber(); + leastOccupancy = occupancy; } } } @@ -312,7 +309,7 @@ MSLane* -MSEdge::getDepartLane(const MSVehicle& veh) const { +MSEdge::getDepartLane(MSVehicle& veh) const { switch (veh.getParameter().departLaneProcedure) { case DEPART_LANE_GIVEN: if ((int) myLanes->size() <= veh.getParameter().departLane || !(*myLanes)[veh.getParameter().departLane]->allowsVehicleClass(veh.getVehicleType().getVehicleClass())) { @@ -330,6 +327,7 @@ return getFreeLane(allowedLanes(**(veh.getRoute().begin() + 1)), veh.getVehicleType().getVehicleClass()); } case DEPART_LANE_BEST_FREE: { + veh.updateBestLanes(false, myLanes->front()); const std::vector& bl = veh.getBestLanes(); SUMOReal bestLength = -1; for (std::vector::const_iterator i = bl.begin(); i != bl.end(); ++i) { @@ -348,6 +346,13 @@ return ret; } case DEPART_LANE_DEFAULT: + case DEPART_LANE_FIRST_ALLOWED: + for (std::vector::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) { + if ((*i)->allowsVehicleClass(veh.getVehicleType().getVehicleClass())) { + return *i; + } + } + return 0; default: break; } @@ -359,14 +364,24 @@ bool -MSEdge::insertVehicle(SUMOVehicle& v, SUMOTime time) const { - // when vaporizing, no vehicles are inserted... +MSEdge::insertVehicle(SUMOVehicle& v, SUMOTime time, const bool checkOnly) const { + // when vaporizing, no vehicles are inserted, but checking needs to be successful to trigger removal if (isVaporizing()) { - return false; + return checkOnly; + } + const SUMOVehicleParameter& pars = v.getParameter(); + const MSVehicleType& type = v.getVehicleType(); + if (pars.departSpeedProcedure == DEPART_SPEED_GIVEN && pars.departSpeed > getVehicleMaxSpeed(&v)) { + if (type.getSpeedDeviation() > 0 && pars.departSpeed <= type.getSpeedFactor() * getSpeedLimit() * (2 * type.getSpeedDeviation() + 1.)) { + WRITE_WARNING("Choosing new speed factor for vehicle '" + pars.id + "' to match departure speed."); + v.setChosenSpeedFactor(type.computeChosenSpeedDeviation(0, pars.departSpeed / (type.getSpeedFactor() * getSpeedLimit()))); + } else { + throw ProcessError("Departure speed for vehicle '" + pars.id + + "' is too high for the departure edge '" + getID() + "'."); + } } #ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { - const SUMOVehicleParameter& pars = v.getParameter(); SUMOReal pos = 0.0; switch (pars.departPosProcedure) { case DEPART_POS_GIVEN: @@ -393,17 +408,46 @@ MEVehicle* veh = static_cast(&v); if (pars.departPosProcedure == DEPART_POS_FREE) { while (segment != 0 && !result) { - result = segment->initialise(veh, time); + if (checkOnly) { + result = segment->hasSpaceFor(veh, time, true); + } else { + result = segment->initialise(veh, time); + } segment = segment->getNextSegment(); } } else { - result = segment->initialise(veh, time); + if (checkOnly) { + result = segment->hasSpaceFor(veh, time, true); + } else { + result = segment->initialise(veh, time); + } } return result; } #else UNUSED_PARAMETER(time); #endif + if (checkOnly) { + if (v.getEdge()->getPurpose() == MSEdge::EDGEFUNCTION_DISTRICT) { + return true; + } + switch (v.getParameter().departLaneProcedure) { + case DEPART_LANE_GIVEN: + case DEPART_LANE_DEFAULT: + case DEPART_LANE_FIRST_ALLOWED: { + const SUMOReal occupancy = getDepartLane(static_cast(v))->getBruttoOccupancy(); + return occupancy == (SUMOReal)0 || occupancy * myLength + v.getVehicleType().getLengthWithGap() <= myLength; + } + default: + for (std::vector::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) { + const SUMOReal occupancy = (*i)->getBruttoOccupancy(); + if (occupancy == (SUMOReal)0 || occupancy * myLength + v.getVehicleType().getLengthWithGap() <= myLength) { + return true; + } + } + } + return false; + } MSLane* insertionLane = getDepartLane(static_cast(v)); return insertionLane != 0 && insertionLane->insertVehicle(static_cast(v)); } @@ -411,9 +455,21 @@ void MSEdge::changeLanes(SUMOTime t) { - if (laneChangeAllowed()) { - myLaneChanger->laneChange(t); + if (myLaneChanger == 0) { + return; } + if (myFunction == EDGEFUNCTION_INTERNAL) { + // allow changing only if all links leading to this internal lane have priority + for (std::vector::const_iterator it = myLanes->begin(); it != myLanes->end(); ++it) { + MSLane* pred = (*it)->getLogicalPredecessorLane(); + MSLink* link = MSLinkContHelper::getConnectingLink(*pred, **it); + assert(link != 0); + if (!link->havePriority()) { + return; + } + } + } + myLaneChanger->laneChange(t); } @@ -444,6 +500,9 @@ SUMOReal MSEdge::getCurrentTravelTime(SUMOReal minSpeed) const { assert(minSpeed > 0); + if (!myAmDelayed) { + return myEmptyTraveltime; + } SUMOReal v = 0; #ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { @@ -457,15 +516,14 @@ v /= (SUMOReal) segments; } else { #endif - for (std::vector::iterator i = myLanes->begin(); i != myLanes->end(); ++i) { + for (std::vector::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) { v += (*i)->getMeanSpeed(); } v /= (SUMOReal) myLanes->size(); #ifdef HAVE_INTERNAL } #endif - v = MAX2(minSpeed, v); - return getLength() / v; + return getLength() / MAX2(minSpeed, v); } @@ -533,7 +591,7 @@ void -MSEdge::parseEdgesList(const std::string& desc, std::vector& into, +MSEdge::parseEdgesList(const std::string& desc, ConstMSEdgeVector& into, const std::string& rid) { if (desc[0] == BinaryFormatter::BF_ROUTE) { std::istringstream in(desc, std::ios::binary); @@ -548,7 +606,7 @@ void -MSEdge::parseEdgesList(const std::vector& desc, std::vector& into, +MSEdge::parseEdgesList(const std::vector& desc, ConstMSEdgeVector& into, const std::string& rid) { for (std::vector::const_iterator i = desc.begin(); i != desc.end(); ++i) { const MSEdge* edge = MSEdge::dictionary(*i); @@ -565,7 +623,7 @@ SUMOReal MSEdge::getDistanceTo(const MSEdge* other) const { if (getLanes().size() > 0 && other->getLanes().size() > 0) { - return getLanes()[0]->getShape()[-1].distanceTo2D(other->getLanes()[0]->getShape()[0]); + return getToJunction()->getPosition().distanceTo2D(other->getFromJunction()->getPosition()); } else { return 0; // optimism is just right for astar } @@ -573,12 +631,6 @@ SUMOReal -MSEdge::getLength() const { - return getLanes()[0]->getLength(); -} - - -SUMOReal MSEdge::getSpeedLimit() const { // @note lanes might have different maximum speeds in theory return getLanes()[0]->getSpeedLimit(); @@ -600,6 +652,14 @@ } +std::vector +MSEdge::getSortedContainers(SUMOTime timestep) const { + std::vector result(myContainers.begin(), myContainers.end()); + sort(result.begin(), result.end(), container_by_position_sorter(timestep)); + return result; +} + + int MSEdge::person_by_offset_sorter::operator()(const MSPerson* const p1, const MSPerson* const p2) const { const SUMOReal pos1 = p1->getCurrentStage()->getEdgePos(myTime); @@ -610,5 +670,37 @@ return p1->getID() < p2->getID(); } +int +MSEdge::container_by_position_sorter::operator()(const MSContainer* const c1, const MSContainer* const c2) const { + const SUMOReal pos1 = c1->getCurrentStage()->getEdgePos(myTime); + const SUMOReal pos2 = c2->getCurrentStage()->getEdgePos(myTime); + if (pos1 != pos2) { + return pos1 < pos2; + } + return c1->getID() < c2->getID(); +} + +const MSEdgeVector& +MSEdge::getSuccessors(SUMOVehicleClass vClass) const { + if (vClass == SVC_IGNORING) { + return mySuccessors; + } + ClassesSuccesorMap::const_iterator i = myClassesSuccessorMap.find(vClass); + if (i != myClassesSuccessorMap.end()) { + // can use cached value + return i->second; + } else { + // this vClass is requested for the first time. rebuild all succesors + for (MSEdgeVector::const_iterator it = mySuccessors.begin(); it != mySuccessors.end(); ++it) { + const std::vector* allowed = allowedLanes(*it, vClass); + if (allowed == 0 || allowed->size() > 0) { + myClassesSuccessorMap[vClass].push_back(*it); + } + } + return myClassesSuccessorMap[vClass]; + } +} + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/MSEdge.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEdge.h --- sumo-0.21.0+dfsg/src/microsim/MSEdge.h 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEdge.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 12 Mar 2001 -/// @version $Id: MSEdge.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSEdge.h 18096 2015-03-17 09:50:59Z behrisch $ /// // A road/street connecting two junctions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,10 +41,11 @@ #include #include #include -#include +#include #include #include #include +#include "MSNet.h" #include "MSVehicleType.h" @@ -59,6 +60,8 @@ class MSLane; class MSPerson; class MSJunction; +class MSEdge; +class MSContainer; // =========================================================================== @@ -71,6 +74,10 @@ * A single connection between two junctions. * Holds lanes which are reponsible for vehicle movements. */ + +typedef std::vector MSEdgeVector; +typedef std::vector ConstMSEdgeVector; + class MSEdge : public Named, public Parameterised { public: /** @@ -117,7 +124,8 @@ * @param[in] function A basic type of the edge * @param[in] streetName The street name for that edge */ - MSEdge(const std::string& id, int numericalID, const EdgeBasicFunction function, const std::string& streetName = "", const std::string& edgeType = ""); + MSEdge(const std::string& id, int numericalID, const EdgeBasicFunction function, + const std::string& streetName, const std::string& edgeType, int priority); /// @brief Destructor. @@ -129,7 +137,12 @@ * @param[in] allowed Information which edges may be reached from which lanes * @param[in] lanes List of this edge's lanes */ - void initialize(std::vector* lanes); + void initialize(const std::vector* lanes); + + + /** @brief Recalculates the cached values + */ + void recalcCache(); /// @todo Has to be called after all edges were built and all connections were set...; Still, is not very nice @@ -181,6 +194,13 @@ */ std::vector getSortedPersons(SUMOTime timestep) const; + + /** @brief Returns this edge's containers sorted by pos + * + * @return This edge's containers sorted by pos + */ + std::vector getSortedContainers(SUMOTime timestep) const; + /** @brief Get the allowed lanes to reach the destination-edge. * * If there is no such edge, get 0. Then you are on the wrong edge. @@ -234,7 +254,7 @@ /** @brief Returns the numerical id of the edge * @return This edge's numerical id */ - int getNumericalID() const { + inline int getNumericalID() const { return myNumericalID; } @@ -250,6 +270,12 @@ const std::string& getEdgeType() const { return myEdgeType; } + + /** @brief Returns the priority of the edge + */ + int getPriority() const { + return myPriority; + } /// @} @@ -257,36 +283,62 @@ /// @name Access to succeeding/predecessing edges /// @{ - /** @brief Returns the list of edges which may be reached from this edge - * @return Edges reachable from this edge + /** @brief Adds an edge to the list of edges which may be reached from this edge and to the incoming of the other edge + * + * This is mainly used by the taz (district) parsing + * @param[in] edge The edge to add */ - void addFollower(MSEdge* edge) { + void addSuccessor(MSEdge* edge) { mySuccessors.push_back(edge); + edge->myPredecessors.push_back(this); } /** @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 { - return myPredeccesors; + const MSEdgeVector& getIncomingEdges() const { + return myPredecessors; } /** @brief Returns the number of edges that may be reached from this edge * @return The number of following edges */ - unsigned int getNoFollowing() const { + unsigned int getNumSuccessors() const { return (unsigned int) mySuccessors.size(); } - /** @brief Returns the n-th of the following edges - * @param[in] n The index within following edges of the edge to return - * @return The n-th of the following edges + /** @brief Returns the following edges */ - const MSEdge* getFollower(unsigned int n) const { - return mySuccessors[n]; + const MSEdgeVector& getSuccessors() const { + return mySuccessors; + } + + + /** @brief Returns the following edges, restricted by vClass + * @param[in] vClass The vClass for which to restrict the successors + * @return The eligible following edges + */ + const MSEdgeVector& getSuccessors(SUMOVehicleClass vClass) const; + + + /** @brief Returns the number of edges this edge is connected to + * + * @return The number of edges following this edge + */ + unsigned int getNumPredecessors() const { + return (unsigned int) myPredecessors.size(); + } + + + /** @brief Returns the edge at the given position from the list of reachable edges + * @param[in] pos The position of the list within the list of approached + * @return The following edge, stored at position pos + */ + const MSEdgeVector& getPredecessors() const { + return myPredecessors; } @@ -351,7 +403,7 @@ * @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 minSpeed = 0.00001) const; + SUMOReal getCurrentTravelTime(const SUMOReal minSpeed = NUMERICAL_EPS) const; /// @brief returns the minimum travel time for the given vehicle @@ -364,6 +416,18 @@ } + /** @brief Returns the travel time for the given edge + * + * @param[in] edge The edge for which the travel time shall be retrieved + * @param[in] veh The vehicle for which the travel time on this edge shall be retrieved + * @param[in] time The time for which the travel time shall be returned [s] + * @return The traveltime needed by the given vehicle to pass the edge at the given time + */ + static inline SUMOReal getTravelTimeStatic(const MSEdge* const edge, const SUMOVehicle* const veh, SUMOReal time) { + return MSNet::getInstance()->getTravelTime(edge, veh, time); + } + + /// @name Methods releated to vehicle insertion /// @{ @@ -373,14 +437,17 @@ * In dependance to this, the proper lane is chosen. * * Insertion itself is done by calling the chose lane's "insertVehicle" - * method. + * method but only if the checkOnly argument is false. The check needs + * to be certain only in the negative case (if false is returned, there + * is no way this vehicle would be inserted). * * @param[in] v The vehicle to insert * @param[in] time The current simulation time + * @param[in] checkOnly whether we perform only the check without actually inserting * @return Whether the vehicle could be inserted * @see MSLane::insertVehicle */ - bool insertVehicle(SUMOVehicle& v, SUMOTime time) const; + bool insertVehicle(SUMOVehicle& v, SUMOTime time, const bool checkOnly = false) const; /** @brief Finds the emptiest lane allowing the vehicle class @@ -410,7 +477,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(MSVehicle& veh) const; /** @brief Returns the last time a vehicle could not be inserted @@ -448,6 +515,10 @@ return (myCombinedPermissions & svc) != svc; } + inline SVCPermissions getPermissions() const { + return myCombinedPermissions; + } + void rebuildAllowedLanes(); @@ -461,7 +532,9 @@ /** @brief return the length of the edge * @return The edge's length */ - SUMOReal getLength() const; + inline SUMOReal getLength() const { + return myLength; + } /** @brief Returns the speed limit of the edge @@ -491,6 +564,19 @@ } } + /// @brief Add a container to myContainers + virtual void addContainer(MSContainer* container) const { + myContainers.insert(container); + } + + /// @brief Remove container from myContainers + virtual void removeContainer(MSContainer* container) const { + std::set::iterator i = myContainers.find(container); + if (i != myContainers.end()) { + myContainers.erase(i); + } + } + inline bool isRoundabout() const { return myAmRoundabout; } @@ -499,8 +585,9 @@ myAmRoundabout = true; } - /// @brief whether lane changing may be performed on this edge - bool laneChangeAllowed() const; + void markDelayed() const { + myAmDelayed = true; + } /** @brief Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary. Otherwise @@ -538,7 +625,7 @@ * @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, + static void parseEdgesList(const std::string& desc, ConstMSEdgeVector& into, const std::string& rid); @@ -548,7 +635,7 @@ * @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, + static void parseEdgesList(const std::vector& desc, ConstMSEdgeVector& into, const std::string& rid); /// @} @@ -570,7 +657,7 @@ }; /** @class person_by_offset_sorter - * @brief Sorts edges by their ids + * @brief Sorts persons by their positions */ class person_by_offset_sorter { public: @@ -583,6 +670,20 @@ SUMOTime myTime; }; + /** @class container_by_position_sorter + * @brief Sorts containers by their positions + */ + class container_by_position_sorter { + public: + /// @brief constructor + explicit container_by_position_sorter(SUMOTime timestep): myTime(timestep) { } + + /// @brief comparing operator + int operator()(const MSContainer* const c1, const MSContainer* const c2) const; + private: + SUMOTime myTime; + }; + /** @brief Get the allowed lanes to reach the destination-edge. * @@ -601,10 +702,10 @@ protected: /// @brief This edge's numerical id - int myNumericalID; + const 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; + const std::vector* myLanes; /// @brief This member will do the lane-change MSLaneChanger* myLaneChanger; @@ -619,10 +720,10 @@ mutable SUMOTime myLastFailedInsertionTime; /// @brief The succeeding edges - std::vector mySuccessors; + MSEdgeVector mySuccessors; /// @brief The preceeding edges - std::vector myPredeccesors; + MSEdgeVector myPredecessors; /// @brief the junctions for this edge MSJunction* myFromJunction; @@ -631,6 +732,9 @@ /// @brief Persons on the edge (only for drawing) mutable std::set myPersons; + /// @brief Containers on the edge + mutable std::set myContainers; + /// @name Storages for allowed lanes (depending on vehicle classes) /// @{ @@ -653,6 +757,18 @@ /// @brief the type of the edge (optionally used during network creation) std::string myEdgeType; + /// @brief the priority of the edge (used during network creation) + const int myPriority; + + /// @brief the length of the edge (cached value for speedup) + SUMOReal myLength; + + /// @brief the traveltime on the empty edge (cached value for speedup) + SUMOReal myEmptyTraveltime; + + /// @brief whether this edge had a vehicle with less than max speed on it + mutable bool myAmDelayed; + /// @brief whether this edge belongs to a roundabout bool myAmRoundabout; @@ -670,10 +786,13 @@ /** @brief Static list of edges * @deprecated Move to MSEdgeControl, make non-static */ - static std::vector myEdges; + static MSEdgeVector myEdges; /// @} + /// @brief The successors available for a given vClass + typedef std::map ClassesSuccesorMap; + mutable ClassesSuccesorMap myClassesSuccessorMap; private: /// @brief Invalidated copy constructor. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSEdgeWeightsStorage.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEdgeWeightsStorage.cpp --- sumo-0.21.0+dfsg/src/microsim/MSEdgeWeightsStorage.cpp 2014-04-02 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEdgeWeightsStorage.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date 02.11.2009 -/// @version $Id: MSEdgeWeightsStorage.cpp 16099 2014-04-02 07:41:36Z behrisch $ +/// @version $Id: MSEdgeWeightsStorage.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A storage for edge travel times and efforts /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSEdgeWeightsStorage.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEdgeWeightsStorage.h --- sumo-0.21.0+dfsg/src/microsim/MSEdgeWeightsStorage.h 2014-04-02 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEdgeWeightsStorage.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 02.11.2009 -/// @version $Id: MSEdgeWeightsStorage.h 16099 2014-04-02 07:41:36Z behrisch $ +/// @version $Id: MSEdgeWeightsStorage.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A storage for edge travel times and efforts /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSEventControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEventControl.cpp --- sumo-0.21.0+dfsg/src/microsim/MSEventControl.cpp 2014-04-01 22:02:06.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEventControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Matthias Heppner /// @date Mon, 12 Mar 2001 -/// @version $Id: MSEventControl.cpp 16092 2014-04-01 08:32:31Z namdre $ +/// @version $Id: MSEventControl.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Stores time-dependant events and executes them at the proper time /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSEventControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEventControl.h --- sumo-0.21.0+dfsg/src/microsim/MSEventControl.h 2014-02-22 23:02:20.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSEventControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Matthias Heppner /// @date Mon, 12 Mar 2001 -/// @version $Id: MSEventControl.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSEventControl.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Stores time-dependant events and executes them at the proper time /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSFrame.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSFrame.cpp --- sumo-0.21.0+dfsg/src/microsim/MSFrame.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSFrame.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -8,12 +8,12 @@ /// @author Mario Krumnow /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSFrame.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSFrame.cpp 18103 2015-03-18 12:05:24Z namdre $ /// // Sets and checks options for microsim; inits global outputs and settings /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -51,7 +50,7 @@ #include #include #include -#include +#include #include #include #include @@ -79,6 +78,7 @@ oc.addOptionSubTopic("Output"); oc.addOptionSubTopic("Time"); oc.addOptionSubTopic("Processing"); + oc.addOptionSubTopic("Routing"); SystemFrame::addReportOptions(oc); // fill this subtopic, too @@ -112,11 +112,18 @@ oc.doRegister("netstate-dump", new Option_FileName()); oc.addSynonyme("netstate-dump", "ndump"); oc.addSynonyme("netstate-dump", "netstate"); + oc.addSynonyme("netstate-dump", "netstate-output"); oc.addDescription("netstate-dump", "Output", "Save complete network states into FILE"); oc.doRegister("netstate-dump.empty-edges", new Option_Bool(false)); oc.addSynonyme("netstate-dump.empty-edges", "netstate.empty-edges"); + oc.addSynonyme("netstate-dump.empty-edges", "netstate-output.empty-edges"); 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("netstate-dump.precision", new Option_Integer(OUTPUT_ACCURACY)); + oc.addSynonyme("netstate-dump.precision", "netstate.precision"); + oc.addSynonyme("netstate-dump.precision", "netstate-output.precision"); + oc.addSynonyme("netstate-dump.precision", "dump-precision", true); + oc.addDescription("netstate-dump.precision", "Output", "Write positions and speeds with the given precision (default 2)"); oc.doRegister("emission-output", new Option_FileName()); @@ -139,14 +146,15 @@ oc.doRegister("summary-output", new Option_FileName()); oc.addSynonyme("summary-output", "summary"); - oc.addSynonyme("summary-output", "emissions-output", true); - oc.addSynonyme("summary-output", "emissions", true); oc.addDescription("summary-output", "Output", "Save aggregated vehicle departure info into FILE"); oc.doRegister("tripinfo-output", new Option_FileName()); oc.addSynonyme("tripinfo-output", "tripinfo"); oc.addDescription("tripinfo-output", "Output", "Save single vehicle trip info into FILE"); + oc.doRegister("tripinfo-output.write-unfinished", new Option_Bool(false)); + oc.addDescription("tripinfo-output.write-unfinished", "Output", "Write tripinfo output for vehicles which have not arrived at simulation end"); + oc.doRegister("vehroute-output", new Option_FileName()); oc.addSynonyme("vehroute-output", "vehroutes"); oc.addDescription("vehroute-output", "Output", "Save single vehicle route info into FILE"); @@ -163,6 +171,14 @@ oc.addSynonyme("vehroute-output.sorted", "vehroutes.sorted"); oc.addDescription("vehroute-output.sorted", "Output", "Sorts the output by departure time"); + oc.doRegister("vehroute-output.dua", new Option_Bool(false)); + oc.addSynonyme("vehroute-output.dua", "vehroutes.dua"); + oc.addDescription("vehroute-output.dua", "Output", "Write the output in the duarouter alternatives style"); + + oc.doRegister("vehroute-output.intended-depart", new Option_Bool(false)); + oc.addSynonyme("vehroute-output.intended-depart", "vehroutes.intended-depart"); + oc.addDescription("vehroute-output.intended-depart", "Output", "Write the output with the intended instead of the real departure time"); + 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"); @@ -213,7 +229,7 @@ #endif oc.doRegister("ignore-accidents", new Option_Bool(false)); - oc.addDescription("ignore-accidents", "Processing", "Do not check whether accidents occure more deeply"); + oc.addDescription("ignore-accidents", "Processing", "Do not check whether accidents occur"); oc.doRegister("ignore-route-errors", new Option_Bool(false)); oc.addDescription("ignore-route-errors", "Processing", "Do not check whether routes are connected"); @@ -228,7 +244,7 @@ oc.doRegister("time-to-teleport", new Option_String("300", "TIME")); oc.addDescription("time-to-teleport", "Processing", "Specify how long a vehicle may wait until being teleported, defaults to 300, non-positive values disable teleporting"); oc.doRegister("time-to-teleport.highways", new Option_String("0", "TIME")); - oc.addDescription("time-to-teleport.highways", "Processing", "The teleport time on highways"); + oc.addDescription("time-to-teleport.highways", "Processing", "The waiting time after which vehicles on a fast road (speed > 69m/s) are teleported if they are on a non-continuing lane"); oc.doRegister("max-depart-delay", new Option_String("-1", "TIME")); oc.addDescription("max-depart-delay", "Processing", "How long vehicles wait for departure before being skipped, defaults to -1 which means vehicles are never skipped"); @@ -251,9 +267,6 @@ oc.doRegister("lanechange.overtake-right", new Option_Bool(false)); oc.addDescription("lanechange.overtake-right", "Processing", "Whether overtaking on the right on motorways is permitted"); - oc.doRegister("routing-algorithm", new Option_String("dijkstra")); - oc.addDescription("routing-algorithm", "Processing", - "Select among routing algorithms ['dijkstra', 'astar']"); // pedestrian model oc.doRegister("pedestrian.model", new Option_String("striping")); oc.addDescription("pedestrian.model", "Processing", "Select among pedestrian models ['nonInteracting', 'striping']"); @@ -264,10 +277,19 @@ oc.doRegister("pedestrian.striping.dawdling", new Option_Float(0.2)); oc.addDescription("pedestrian.striping.dawdling", "Processing", "factor for random slow-downs [0,1] for use with model 'striping'"); + oc.doRegister("pedestrian.striping.jamtime", new Option_String("300", "TIME")); + oc.addDescription("pedestrian.striping.jamtime", "Processing", "Time in seconds after which pedestrians start squeezing through a jam when using model 'striping' (non-positive values disable squeezing)"); + + // generic routing options + oc.doRegister("routing-algorithm", new Option_String("dijkstra")); + oc.addDescription("routing-algorithm", "Routing", + "Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']"); + oc.doRegister("weights.random-factor", new Option_Float()); + oc.addDescription("weights.random-factor", "Routing", "Edge weights for routing are dynamically disturbed by a random factor between [1,FLOAT]"); + // devices oc.addOptionSubTopic("Emissions"); - std::string plp = getenv("PHEMLIGHT_PATH") == 0 ? "./PHEMlight/" : std::string(getenv("PHEMLIGHT_PATH")); - oc.doRegister("phemlight-path", new Option_FileName(plp)); + oc.doRegister("phemlight-path", new Option_FileName("./PHEMlight/")); oc.addDescription("phemlight-path", "Emissions", "Determines where to load PHEMlight definitions from."); oc.addOptionSubTopic("Communication"); @@ -308,12 +330,14 @@ oc.addDescription("meso-taujj", "Mesoscopic", "Factor for calculating the jam-jam headway time"); 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.doRegister("meso-multi-queue", new Option_Bool(true)); 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-overtaking", new Option_Bool(false)); + oc.addDescription("meso-overtaking", "Mesoscopic", "Enable mesoscopic overtaking"); 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 @@ -456,6 +480,7 @@ #ifdef HAVE_INTERNAL MSGlobals::gUseMesoSim = oc.getBool("mesosim"); MSGlobals::gMesoLimitedJunctionControl = oc.getBool("meso-junction-control.limited"); + MSGlobals::gMesoOvertaking = oc.getBool("meso-overtaking"); if (MSGlobals::gUseMesoSim) { MSGlobals::gUsingInternalLanes = false; } diff -Nru sumo-0.21.0+dfsg/src/microsim/MSFrame.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSFrame.h --- sumo-0.21.0+dfsg/src/microsim/MSFrame.h 2014-04-29 22:02:43.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSFrame.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSFrame.h 16282 2014-04-29 16:05:03Z behrisch $ +/// @version $Id: MSFrame.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for microsim; inits global outputs and settings /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSGlobals.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSGlobals.cpp --- sumo-0.21.0+dfsg/src/microsim/MSGlobals.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSGlobals.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date late summer 2003 -/// @version $Id: MSGlobals.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSGlobals.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Some static variables for faster access /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -58,6 +58,7 @@ #ifdef HAVE_INTERNAL bool MSGlobals::gUseMesoSim; bool MSGlobals::gMesoLimitedJunctionControl; +bool MSGlobals::gMesoOvertaking; MELoop* MSGlobals::gMesoNet; #else const bool MSGlobals::gUseMesoSim = false; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSGlobals.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSGlobals.h --- sumo-0.21.0+dfsg/src/microsim/MSGlobals.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSGlobals.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date late summer 2003 -/// @version $Id: MSGlobals.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSGlobals.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some static variables for faster access /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -92,6 +92,9 @@ /** Information whether limited junction control shall be used */ static bool gMesoLimitedJunctionControl; + /** Information whether overtaking is enabled in the mesoscopic simulation */ + static bool gMesoOvertaking; + /// mesoscopic simulation infrastructure static MELoop* gMesoNet; #else diff -Nru sumo-0.21.0+dfsg/src/microsim/MSInsertionControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSInsertionControl.cpp --- sumo-0.21.0+dfsg/src/microsim/MSInsertionControl.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSInsertionControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 12 Mar 2001 -/// @version $Id: MSInsertionControl.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSInsertionControl.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Inserts vehicles into the network when their departure time is reached /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,10 +36,13 @@ #include #include #include +#include +#include "MSGlobals.h" #include "MSInsertionControl.h" #include "MSVehicle.h" #include "MSLane.h" #include "MSEdge.h" +#include "MSRouteHandler.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -69,8 +72,11 @@ } -void -MSInsertionControl::add(SUMOVehicleParameter* pars) { +bool +MSInsertionControl::add(SUMOVehicleParameter* const pars) { + if (myFlowIDs.count(pars->id) > 0) { + return false; + } Flow flow; flow.pars = pars; flow.isVolatile = pars->departLaneProcedure == DEPART_LANE_RANDOM || @@ -96,51 +102,37 @@ } flow.vehicle = 0; myFlows.push_back(flow); + myFlowIDs.insert(pars->id); + return true; } unsigned int MSInsertionControl::emitVehicles(SUMOTime time) { - checkPrevious(time); // check whether any vehicles shall be emitted within this time step - if (!myAllVeh.anyWaitingFor(time) && myRefusedEmits1.empty() && myRefusedEmits2.empty() && myFlows.empty()) { + const bool havePreChecked = MSDevice_Routing::isEnabled(); + if (myPendingEmits.empty() || (havePreChecked && myEmitCandidates.empty())) { return 0; } - unsigned int noEmitted = 0; + unsigned int numEmitted = 0; // we use buffering for the refused emits to save time // for this, we have two lists; one contains previously refused emits, the second // will be used to append those vehicles that will not be able to depart in this // time step - assert(myRefusedEmits1.size() == 0 || myRefusedEmits2.size() == 0); - MSVehicleContainer::VehicleVector& refusedEmits = - myRefusedEmits1.size() == 0 ? myRefusedEmits1 : myRefusedEmits2; - MSVehicleContainer::VehicleVector& previousRefused = - myRefusedEmits2.size() == 0 ? myRefusedEmits1 : myRefusedEmits2; + MSVehicleContainer::VehicleVector refusedEmits; // go through the list of previously refused vehicles, first MSVehicleContainer::VehicleVector::const_iterator veh; - for (veh = previousRefused.begin(); veh != previousRefused.end(); veh++) { - noEmitted += tryInsert(time, *veh, refusedEmits); - } - // clear previously refused vehicle container - previousRefused.clear(); - - // Insert vehicles from myTrips into the net until the next vehicle's - // departure time is greater than the current time. - // Retrieve the list of vehicles to emit within this time step - - noEmitted += checkFlows(time, refusedEmits); - while (myAllVeh.anyWaitingFor(time)) { - const MSVehicleContainer::VehicleVector& next = myAllVeh.top(); - // go through the list and try to emit - for (veh = next.begin(); veh != next.end(); veh++) { - noEmitted += tryInsert(time, *veh, refusedEmits); + for (veh = myPendingEmits.begin(); veh != myPendingEmits.end(); veh++) { + if (havePreChecked && (myEmitCandidates.count(*veh) == 0)) { + refusedEmits.push_back(*veh); + } else { + numEmitted += tryInsert(time, *veh, refusedEmits); } - // let the MSVehicleContainer clear the vehicles - myAllVeh.pop(); } - // Return the number of emitted vehicles - return noEmitted; + myEmitCandidates.clear(); + myPendingEmits = refusedEmits; + return numEmitted; } @@ -150,7 +142,7 @@ assert(veh->getParameter().depart < time + DELTA_T); const MSEdge& edge = *veh->getEdge(); if ((!myCheckEdgesOnce || edge.getLastFailedInsertionTime() != time) && edge.insertVehicle(*veh, time)) { - // Successful emission. + // Successful insertion checkFlowWait(veh); veh->onDepart(); return 1; @@ -189,23 +181,33 @@ void -MSInsertionControl::checkPrevious(SUMOTime time) { - // check to which list append to - MSVehicleContainer::VehicleVector& previousRefused = - myRefusedEmits2.size() == 0 ? myRefusedEmits1 : myRefusedEmits2; - while (!myAllVeh.isEmpty() && myAllVeh.topTime() < time) { +MSInsertionControl::checkCandidates(SUMOTime time, const bool preCheck) { + while (myAllVeh.anyWaitingBefore(time + DELTA_T)) { const MSVehicleContainer::VehicleVector& top = myAllVeh.top(); - copy(top.begin(), top.end(), back_inserter(previousRefused)); + copy(top.begin(), top.end(), back_inserter(myPendingEmits)); myAllVeh.pop(); } + if (preCheck) { + MSVehicleContainer::VehicleVector::const_iterator veh; + for (veh = myPendingEmits.begin(); veh != myPendingEmits.end(); veh++) { + SUMOVehicle* const v = *veh; + const MSEdge* const edge = v->getEdge(); + if ((!myCheckEdgesOnce || edge->getLastFailedInsertionTime() != time) && edge->insertVehicle(*v, time, true)) { + myEmitCandidates.insert(v); + } else { + MSDevice_Routing* dev = static_cast(v->getDevice(typeid(MSDevice_Routing))); + if (dev != 0) { + dev->skipRouting(time); + } + } + } + } } -unsigned int -MSInsertionControl::checkFlows(SUMOTime time, - MSVehicleContainer::VehicleVector& refusedEmits) { +void +MSInsertionControl::determineCandidates(SUMOTime time) { MSVehicleControl& vehControl = MSNet::getInstance()->getVehicleControl(); - unsigned int noEmitted = 0; for (std::vector::iterator i = myFlows.begin(); i != myFlows.end();) { SUMOVehicleParameter* pars = i->pars; if (!i->isVolatile && i->vehicle != 0 && pars->repetitionProbability < 0) { @@ -213,44 +215,38 @@ //std::cout << SIMTIME << " volatile=" << i->isVolatile << " veh=" << i->vehicle << "\n"; continue; } - bool emitByProb = pars->repetitionProbability > 0 && RandHelper::rand() < (pars->repetitionProbability * TS); - //std::cout << emitByProb << "\n"; - //std::cout << SIMTIME - // << " flow=" << pars->id - // << " rDo=" << pars->repetitionsDone - // << " rN=" << pars->repetitionNumber - // << " rDe=" << pars->depart - // << " rRo=" << pars->repetitionOffset - // << " rPo=" << pars->repetitionProbability - // << " emit=" << emitByProb - // << "\n"; - while (pars->repetitionsDone < pars->repetitionNumber && - ((pars->repetitionProbability < 0 && pars->depart + pars->repetitionsDone * pars->repetitionOffset < time + DELTA_T) - || emitByProb)) { - emitByProb = false; + bool tryEmitByProb = pars->repetitionProbability > 0; + while ((pars->repetitionProbability < 0 + && pars->repetitionsDone < pars->repetitionNumber + && pars->depart + pars->repetitionsDone * pars->repetitionOffset < time + DELTA_T) + || (tryEmitByProb + && pars->depart < time + DELTA_T + && pars->repetitionEnd > time + // only call rand if all other conditions are met + && RandHelper::rand() < (pars->repetitionProbability * TS)) + ) { + tryEmitByProb = false; // only emit one per step SUMOVehicleParameter* newPars = new SUMOVehicleParameter(*pars); newPars->id = pars->id + "." + toString(i->index); - newPars->depart = static_cast(pars->depart + pars->repetitionsDone * pars->repetitionOffset); + newPars->depart = pars->repetitionProbability > 0 ? time : (SUMOTime)(pars->depart + pars->repetitionsDone * pars->repetitionOffset); pars->repetitionsDone++; // try to build the vehicle if (vehControl.getVehicle(newPars->id) == 0) { const MSRoute* route = MSRoute::dictionary(pars->routeid); - const MSVehicleType* vtype = vehControl.getVType(pars->vtypeid); - i->vehicle = vehControl.buildVehicle(newPars, route, vtype); + const MSVehicleType* vtype = vehControl.getVType(pars->vtypeid, MSRouteHandler::getParsingRNG()); + i->vehicle = vehControl.buildVehicle(newPars, route, vtype, false); unsigned int quota = vehControl.getQuota(); if (quota > 0) { vehControl.addVehicle(newPars->id, i->vehicle); - noEmitted += tryInsert(time, i->vehicle, refusedEmits); + add(i->vehicle); i->index++; - if (quota == 1 && !i->isVolatile && i->vehicle != 0) { - break; - } while (--quota > 0) { - SUMOVehicleParameter* newPars = new SUMOVehicleParameter(*pars); - newPars->id = pars->id + "." + toString(pars->repetitionsDone); - i->vehicle = vehControl.buildVehicle(newPars, route, vtype); - vehControl.addVehicle(newPars->id, i->vehicle); - noEmitted += tryInsert(time, i->vehicle, refusedEmits); + SUMOVehicleParameter* quotaPars = new SUMOVehicleParameter(*pars); + quotaPars->id = pars->id + "." + toString(i->index); + quotaPars->depart = pars->repetitionProbability > 0 ? time : (SUMOTime)(pars->depart + pars->repetitionsDone * pars->repetitionOffset); + i->vehicle = vehControl.buildVehicle(quotaPars, route, vtype, false); + vehControl.addVehicle(quotaPars->id, i->vehicle); + add(i->vehicle); i->index++; } } else { @@ -265,7 +261,7 @@ throw ProcessError("Another vehicle with the id '" + newPars->id + "' exists."); } } - if (pars->repetitionsDone == pars->repetitionNumber) { + if (pars->repetitionsDone == pars->repetitionNumber || (pars->repetitionProbability > 0 && pars->repetitionEnd <= time)) { i = myFlows.erase(i); MSRoute::checkDist(pars->routeid); delete pars; @@ -273,13 +269,13 @@ ++i; } } - return noEmitted; + checkCandidates(time, MSDevice_Routing::isEnabled()); } unsigned int MSInsertionControl::getWaitingVehicleNo() const { - return (unsigned int)(myRefusedEmits1.size() + myRefusedEmits2.size()); + return (unsigned int)myPendingEmits.size(); } @@ -296,21 +292,12 @@ void MSInsertionControl::clearPendingVehicles(std::string& route) { - //clear out the refused vehicle lists, deleting the vehicles entirely + //clear out the refused vehicle list, deleting the vehicles entirely MSVehicleContainer::VehicleVector::iterator veh; - for (veh = myRefusedEmits1.begin(); veh != myRefusedEmits1.end();) { - if ((*veh)->getRoute().getID() == route || route == "") { - myVehicleControl.deleteVehicle(*veh, true); - veh = myRefusedEmits1.erase(veh); - } else { - ++veh; - } - } - - for (veh = myRefusedEmits2.begin(); veh != myRefusedEmits2.end();) { + for (veh = myPendingEmits.begin(); veh != myPendingEmits.end();) { if ((*veh)->getRoute().getID() == route || route == "") { myVehicleControl.deleteVehicle(*veh, true); - veh = myRefusedEmits2.erase(veh); + veh = myPendingEmits.erase(veh); } else { ++veh; } diff -Nru sumo-0.21.0+dfsg/src/microsim/MSInsertionControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSInsertionControl.h --- sumo-0.21.0+dfsg/src/microsim/MSInsertionControl.h 2014-04-29 22:02:42.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSInsertionControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 12 Mar 2001 -/// @version $Id: MSInsertionControl.h 16282 2014-04-29 16:05:03Z behrisch $ +/// @version $Id: MSInsertionControl.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Inserts vehicles into the network when their departure time is reached /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -110,8 +110,9 @@ /** @brief Adds parameter for a vehicle flow for departure * * @param[in] flow The flow to add for later insertion + * @return whether it could be added (no other flow with the same id was present) */ - void add(SUMOVehicleParameter* pars); + bool add(SUMOVehicleParameter* const pars); /** @brief Returns the number of waiting vehicles @@ -139,6 +140,13 @@ void clearPendingVehicles(std::string& route); + /** @brief Checks for all vehicles whether they can be emitted + * + * @param[in] time The current simulation time + */ + void determineCandidates(SUMOTime time); + + private: /** @brief Tries to emit the vehicle * @@ -170,17 +178,7 @@ * @param[in] time The current simulation time * @todo recheck */ - void checkPrevious(SUMOTime time); - - - /** @brief Checks for all vehicles coming from flows whether they can be emitted - * - * @param[in] time The current simulation time - * @param[in] refusedEmits Container to insert vehicles that could not be emitted into - * @return The number of emitted vehicles - */ - unsigned int checkFlows(SUMOTime time, - MSVehicleContainer::VehicleVector& refusedEmits); + void checkCandidates(SUMOTime time, const bool preCheck); private: @@ -191,7 +189,10 @@ MSVehicleContainer myAllVeh; /// @brief Buffers for vehicles that could not be inserted - MSVehicleContainer::VehicleVector myRefusedEmits1, myRefusedEmits2; + MSVehicleContainer::VehicleVector myPendingEmits; + + /// @brief Buffer for vehicles that may be inserted in the current step + std::set myEmitCandidates; /// @brief Set of vehicles which shall not be inserted anymore std::set myAbortedEmits; @@ -213,6 +214,9 @@ /// @brief Container for periodical vehicle parameters std::vector myFlows; + /// @brief Cache for periodical vehicle ids for quicker checking + std::set myFlowIDs; + /// @brief The maximum waiting time; vehicles waiting longer are deleted (-1: no deletion) SUMOTime myMaxDepartDelay; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSInternalJunction.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSInternalJunction.cpp --- sumo-0.21.0+dfsg/src/microsim/MSInternalJunction.cpp 2014-05-21 22:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSInternalJunction.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Wed, 12 Dez 2001 -/// @version $Id: MSInternalJunction.cpp 16404 2014-05-21 10:14:33Z namdre $ +/// @version $Id: MSInternalJunction.cpp 18153 2015-03-26 08:19:10Z namdre $ /// // junction. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -32,7 +32,9 @@ #endif #include "MSInternalJunction.h" +#include "MSRightOfWayJunction.h" #include "MSLane.h" +#include "MSEdge.h" #include "MSJunctionLogic.h" #include #include @@ -48,11 +50,12 @@ // =========================================================================== #ifdef HAVE_INTERNAL_LANES MSInternalJunction::MSInternalJunction(const std::string& id, + SumoXMLNodeType type, const Position& position, const PositionVector& shape, std::vector incoming, std::vector internal) - : MSLogicJunction(id, position, shape, incoming, internal) {} + : MSLogicJunction(id, type, position, shape, incoming, internal) {} @@ -66,14 +69,26 @@ } // the first lane in the list of incoming lanes is special. It defines the // link that needs to do all the checking for this internal junction - assert(myIncomingLanes[0]->getLinkCont().size() == 1); - MSLink* thisLink = myIncomingLanes[0]->getLinkCont()[0]; + const MSLane* specialLane = myIncomingLanes[0]; + assert(specialLane->getLinkCont().size() == 1); + MSLink* thisLink = specialLane->getLinkCont()[0]; + const MSRightOfWayJunction* parent = dynamic_cast(specialLane->getEdge().getToJunction()); + assert(parent != 0); + const int ownLinkIndex = specialLane->getIncomingLanes()[0].viaLink->getIndex(); + const MSLogicJunction::LinkFoes& foeLinks = parent->getLogic()->getFoesFor(ownLinkIndex); // 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) { + const int foeIndex = (*i)->getIncomingLanes()[0].viaLink->getIndex(); + if (foeLinks.test(foeIndex)) { + // only respect vehicles before internal junctions if they + // have priority (see the analogous foeLinks.test() when + // initializing myLinkFoeInternalLanes in MSRightOfWayJunction + myInternalLaneFoes.push_back(*i); + } myInternalLaneFoes.push_back((*q)->getViaLane()); } else { myInternalLaneFoes.push_back(*i); diff -Nru sumo-0.21.0+dfsg/src/microsim/MSInternalJunction.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSInternalJunction.h --- sumo-0.21.0+dfsg/src/microsim/MSInternalJunction.h 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSInternalJunction.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSInternalJunction.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSInternalJunction.h 18095 2015-03-17 09:39:00Z behrisch $ /// // junction. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -66,7 +66,7 @@ * @param[in] incoming The incoming lanes * @param[in] internal The internal lanes */ - MSInternalJunction(const std::string& id, const Position& position, + MSInternalJunction(const std::string& id, SumoXMLNodeType type, const Position& position, const PositionVector& shape, std::vector incoming, std::vector internal); diff -Nru sumo-0.21.0+dfsg/src/microsim/MSJunctionControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSJunctionControl.cpp --- sumo-0.21.0+dfsg/src/microsim/MSJunctionControl.cpp 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSJunctionControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 06 Mar 2001 -/// @version $Id: MSJunctionControl.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSJunctionControl.cpp 18168 2015-03-27 13:28:26Z behrisch $ /// // Container for junctions; performs operations on all stored junctions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -32,6 +32,7 @@ #include "MSJunctionControl.h" #include "MSJunction.h" +#include "MSInternalJunction.h" #include #ifdef CHECK_MEMORY_LEAKS @@ -53,9 +54,24 @@ void MSJunctionControl::postloadInitContainer() { const std::vector& junctions = buildAndGetStaticVector(); +#ifdef HAVE_INTERNAL_LANES + // initialize normal junctions before internal junctions + // (to allow calling getIndex() during initialization of internal junction links) + for (std::vector::const_iterator i = junctions.begin(); i != junctions.end(); ++i) { + if (dynamic_cast(*i) == 0) { + (*i)->postloadInit(); + } + } + for (std::vector::const_iterator i = junctions.begin(); i != junctions.end(); ++i) { + if (dynamic_cast(*i) != 0) { + (*i)->postloadInit(); + } + } +#else for (std::vector::const_iterator i = junctions.begin(); i != junctions.end(); ++i) { (*i)->postloadInit(); } +#endif } diff -Nru sumo-0.21.0+dfsg/src/microsim/MSJunctionControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSJunctionControl.h --- sumo-0.21.0+dfsg/src/microsim/MSJunctionControl.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSJunctionControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 12 Mar 2001 -/// @version $Id: MSJunctionControl.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSJunctionControl.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Container for junctions; performs operations on all stored junctions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSJunction.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSJunction.cpp --- sumo-0.21.0+dfsg/src/microsim/MSJunction.cpp 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSJunction.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSJunction.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSJunction.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The base class for an intersection /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -49,9 +49,9 @@ // =========================================================================== // member method definition // =========================================================================== -MSJunction::MSJunction(const std::string& id, const Position& position, +MSJunction::MSJunction(const std::string& id, SumoXMLNodeType type, const Position& position, const PositionVector& shape) - : Named(id), myPosition(position), myShape(shape) {} + : Named(id), myType(type), myPosition(position), myShape(shape) {} MSJunction::~MSJunction() {} diff -Nru sumo-0.21.0+dfsg/src/microsim/MSJunction.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSJunction.h --- sumo-0.21.0+dfsg/src/microsim/MSJunction.h 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSJunction.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSJunction.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSJunction.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The base class for an intersection /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,6 +41,7 @@ #include #include #include +#include class MSVehicle; @@ -48,6 +49,8 @@ class MSLane; class MSEdge; +typedef std::vector ConstMSEdgeVector; + // =========================================================================== // class definitions // =========================================================================== @@ -62,7 +65,9 @@ * @param[in] position The position of the junction * @param[in] shape The shape of the junction */ - MSJunction(const std::string& id, const Position& position, + MSJunction(const std::string& id, + SumoXMLNodeType type, + const Position& position, const PositionVector& shape); @@ -94,11 +99,11 @@ return myEmptyLanes; } - inline const std::vector& getIncoming() const { + inline const ConstMSEdgeVector& getIncoming() const { return myIncoming; } - inline const std::vector& getOutgoing() const { + inline const ConstMSEdgeVector& getOutgoing() const { return myOutgoing; } @@ -110,7 +115,16 @@ myOutgoing.push_back(edge); } + /// @brief return the type of this Junction + SumoXMLNodeType getType() const { + return myType; + } + + protected: + /// @brief Tye type of this junction + SumoXMLNodeType myType; + /// @brief The position of the junction Position myPosition; @@ -122,9 +136,9 @@ /// @brief incoming edges - std::vector myIncoming; + ConstMSEdgeVector myIncoming; /// @brief outgoing edges - std::vector myOutgoing; + ConstMSEdgeVector myOutgoing; /// @brief definition of the static dictionary type typedef std::map DictType; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSJunctionLogic.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSJunctionLogic.cpp --- sumo-0.21.0+dfsg/src/microsim/MSJunctionLogic.cpp 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSJunctionLogic.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSJunctionLogic.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSJunctionLogic.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // kinds of logic-implementations. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSJunctionLogic.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSJunctionLogic.h --- sumo-0.21.0+dfsg/src/microsim/MSJunctionLogic.h 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSJunctionLogic.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Sascha Krieg /// @date Wed, 12 Dez 2001 -/// @version $Id: MSJunctionLogic.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSJunctionLogic.h 18095 2015-03-17 09:39:00Z behrisch $ /// // kinds of logic-implementations. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLaneChanger.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLaneChanger.cpp --- sumo-0.21.0+dfsg/src/microsim/MSLaneChanger.cpp 2014-06-02 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLaneChanger.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Friedemann Wesner /// @author Jakob Erdmann /// @date Fri, 01 Feb 2002 -/// @version $Id: MSLaneChanger.cpp 16445 2014-06-02 08:01:04Z namdre $ +/// @version $Id: MSLaneChanger.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Performs lane changing of vehicles /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #ifdef CHECK_MEMORY_LEAKS @@ -60,13 +60,13 @@ // =========================================================================== // member method definitions // =========================================================================== -MSLaneChanger::MSLaneChanger(std::vector* lanes, bool allowSwap) +MSLaneChanger::MSLaneChanger(const std::vector* lanes, bool allowSwap) : myAllowsSwap(allowSwap) { assert(lanes->size() > 1); // Fill the changer with the lane-data. myChanger.reserve(lanes->size()); - for (std::vector::iterator lane = lanes->begin(); lane != lanes->end(); ++lane) { + for (std::vector::const_iterator lane = lanes->begin(); lane != lanes->end(); ++lane) { ChangeElem ce; ce.follow = 0; ce.lead = 0; @@ -91,7 +91,6 @@ // Finally, the change-result has to be given back to the lanes. initChanger(); while (vehInChanger()) { - bool haveChanged = change(); updateChanger(haveChanged); } @@ -206,13 +205,16 @@ if (myAllowsSwap && ((state1 & (LCA_URGENT)) != 0 || (state2 & (LCA_URGENT)) != 0)) { // get the direction ... ChangerIt target; + int direction = 0; if ((state1 & (LCA_URGENT)) != 0) { // ... wants to go right target = myCandi - 1; + direction = -1; } if ((state2 & (LCA_URGENT)) != 0) { // ... wants to go left target = myCandi + 1; + direction = 1; } MSVehicle* prohibitor = target->lead; if (target->hoppedVeh != 0) { @@ -259,8 +261,8 @@ vehicle->enterLaneAtLaneChange(target->lane); prohibitor->enterLaneAtLaneChange(myCandi->lane); // mark lane change - vehicle->getLaneChangeModel().changed(); - prohibitor->getLaneChangeModel().changed(); + vehicle->getLaneChangeModel().changed(direction); + prohibitor->getLaneChangeModel().changed(-direction); (myCandi)->dens += prohibitor->getVehicleType().getLengthWithGap(); (target)->dens += vehicle->getVehicleType().getLengthWithGap(); return true; @@ -337,7 +339,7 @@ MSLaneChanger::getRealLeader(const ChangerIt& target) const { // get the leading vehicle on the lane to change to MSVehicle* neighLead = target->lead; - // check whether the hopped vehicle got the leader + // check whether the hopped vehicle became the leader if (target->hoppedVeh != 0) { SUMOReal hoppedPos = target->hoppedVeh->getPositionOnLane(); if (hoppedPos > veh(myCandi)->getPositionOnLane() && (neighLead == 0 || neighLead->getPositionOnLane() > hoppedPos)) { @@ -368,7 +370,7 @@ std::pair MSLaneChanger::getRealFollower(const ChangerIt& target) const { MSVehicle* neighFollow = veh(target); - // check whether the hopped vehicle got the follower + // check whether the hopped vehicle became the follower if (target->hoppedVeh != 0) { SUMOReal hoppedPos = target->hoppedVeh->getPositionOnLane(); if (hoppedPos <= veh(myCandi)->getPositionOnLane() && (neighFollow == 0 || neighFollow->getPositionOnLane() < hoppedPos)) { @@ -376,17 +378,14 @@ } } if (neighFollow == 0) { - 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 - SUMOReal dist = speed * speed / (2.*4.) + SPEED2DIST(speed); - dist = MIN2(dist, (SUMOReal) 500.); MSVehicle* candi = veh(myCandi); - return target->lane->getFollowerOnConsecutive(dist, candi->getSpeed(), candi->getPositionOnLane() - candi->getVehicleType().getLength(), candi->getCarFollowModel().getMaxDecel()); + return target->lane->getFollowerOnConsecutive( + candi->getPositionOnLane() - candi->getVehicleType().getLength(), + candi->getSpeed(), candi->getCarFollowModel().getMaxDecel()); } 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()); } } @@ -500,6 +499,22 @@ int state = blocked | vehicle->getLaneChangeModel().wantsChange( laneOffset, msg, blocked, leader, neighLead, neighFollow, *(target->lane), preb, &(myCandi->lastBlocked), &(myCandi->firstBlocked)); + if (blocked == 0 && (state & LCA_WANTS_LANECHANGE) != 0 && neighLead.first != 0) { + // do are more carefull (but expensive) check to ensure that a + // safety-critical leader is not being overloocked + const SUMOReal seen = myCandi->lane->getLength() - vehicle->getPositionOnLane(); + const SUMOReal speed = vehicle->getSpeed(); + const SUMOReal dist = vehicle->getCarFollowModel().brakeGap(speed) + vehicle->getVehicleType().getMinGap(); + const MSLane* targetLane = (myCandi + laneOffset)->lane; + if (seen < dist) { + std::pair neighLead2 = targetLane->getCriticalLeader(dist, seen, speed, *vehicle); + if (neighLead2.first != 0 && neighLead2.first != neighLead.first + && (neighLead2.second < vehicle->getCarFollowModel().getSecureGap( + vehicle->getSpeed(), neighLead2.first->getSpeed(), neighLead2.first->getCarFollowModel().getMaxDecel()))) { + state |= blockedByLeader; + } + } + } #ifndef NO_TRACI // let TraCI influence the wish to change lanes and the security to take //const int oldstate = state; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLaneChanger.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLaneChanger.h --- sumo-0.21.0+dfsg/src/microsim/MSLaneChanger.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLaneChanger.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Fri, 01 Feb 2002 -/// @version $Id: MSLaneChanger.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSLaneChanger.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Performs lane changing of vehicles /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -55,7 +55,7 @@ class MSLaneChanger { public: /// Constructor - MSLaneChanger(std::vector* lanes, bool allowSwap); + MSLaneChanger(const std::vector* lanes, bool allowSwap); /// Destructor. ~MSLaneChanger(); diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLane.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLane.cpp --- sumo-0.21.0+dfsg/src/microsim/MSLane.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLane.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -9,12 +9,12 @@ /// @author Christoph Sommer /// @author Mario Krumnow /// @date Mon, 05 Mar 2001 -/// @version $Id: MSLane.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSLane.cpp 18108 2015-03-19 11:11:30Z behrisch $ /// // Representation of a lane in the micro simulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -38,8 +38,8 @@ #include #include #include "MSVehicle.h" -#include "MSPModel.h" -#include "MSAbstractLaneChangeModel.h" +#include +#include #include "MSNet.h" #include "MSVehicleType.h" #include "MSEdge.h" @@ -134,6 +134,7 @@ } myBruttoVehicleLengthSum += veh->getVehicleType().getLengthWithGap(); myNettoVehicleLengthSum += veh->getVehicleType().getLength(); + myEdge->markDelayed(); if (wasInactive) { MSNet::getInstance()->getEdgeControl().gotActive(this); } @@ -142,6 +143,8 @@ bool MSLane::pWagGenericInsertion(MSVehicle& veh, SUMOReal mspeed, SUMOReal maxPos, SUMOReal minPos) { + veh.setTentativeLaneAndPosition(this, maxPos); + veh.updateBestLanes(false, this); SUMOReal xIn = maxPos; SUMOReal vIn = mspeed; SUMOReal leaderDecel; @@ -168,7 +171,8 @@ SUMOReal x = 0; for (int i = 0; i <= 10; i++) { x = 0.5 * (x1 + x2); - SUMOReal vSafe = veh.getCarFollowModel().followSpeed(&veh, vHlp, xIn - x, vIn, leaderDecel); + veh.setTentativeLaneAndPosition(this, x); + SUMOReal vSafe = veh.getCarFollowModel().insertionFollowSpeed(&veh, vHlp, xIn - x, vIn, leaderDecel); if (vSafe < vHlp) { x2 = x; } else { @@ -187,6 +191,8 @@ bool MSLane::pWagSimpleInsertion(MSVehicle& veh, SUMOReal mspeed, SUMOReal maxPos, SUMOReal minPos) { + veh.setTentativeLaneAndPosition(this, maxPos); + veh.updateBestLanes(false, this); SUMOReal xIn = maxPos; SUMOReal vIn = mspeed; if (myVehicles.size() != 0) { @@ -219,7 +225,7 @@ bool MSLane::maxSpeedGapInsertion(MSVehicle& veh, SUMOReal mspeed) { if (myVehicles.size() == 0) { - return isInsertionSuccess(&veh, mspeed, myLength / 2, true); + return isInsertionSuccess(&veh, mspeed, myLength / 2, true, MSMoveReminder::NOTIFICATION_DEPARTED); } // go through the lane, look for free positions (starting after the last vehicle) MSLane::VehCont::iterator predIt = myVehicles.begin(); @@ -269,23 +275,39 @@ MSLane::freeInsertion(MSVehicle& veh, SUMOReal mspeed, MSMoveReminder::Notification notification) { bool adaptableSpeed = true; + // try to insert teleporting vehicles fully on this lane + const SUMOReal minPos = (notification == MSMoveReminder::NOTIFICATION_TELEPORT ? + MIN2(myLength, veh.getVehicleType().getLength()) : 0); + if (myVehicles.size() == 0) { - if (isInsertionSuccess(&veh, mspeed, 0, adaptableSpeed, notification)) { - return true; + // ensure sufficient gap to followers on predecessor lanes + const SUMOReal backOffset = minPos - veh.getVehicleType().getLength(); + const SUMOReal missingRearGap = getMissingRearGap(backOffset, mspeed, veh.getCarFollowModel().getMaxDecel()); + if (missingRearGap > 0) { + if (minPos + missingRearGap <= myLength) { + // @note. The rear gap is tailored to mspeed. If it changes due + // to a leader vehicle (on subsequent lanes) insertion will + // still fail. Under the right combination of acceleration and + // deceleration values there might be another insertion + // positions that would be successful be we do not look for it. + return isInsertionSuccess(&veh, mspeed, minPos + missingRearGap, adaptableSpeed, notification); + } else { + return false; + } + } else { + return isInsertionSuccess(&veh, mspeed, minPos, adaptableSpeed, notification); } + } else { // check whether the vehicle can be put behind the last one if there is such MSVehicle* leader = myVehicles.back(); - SUMOReal leaderPos = leader->getPositionOnLane() - leader->getVehicleType().getLength(); - SUMOReal speed = mspeed; - if (adaptableSpeed) { - speed = leader->getSpeed(); - } - SUMOReal frontGapNeeded = veh.getCarFollowModel().getSecureGap(speed, leader->getSpeed(), leader->getCarFollowModel().getMaxDecel()) + veh.getVehicleType().getMinGap(); - if (leaderPos - frontGapNeeded >= 0) { - SUMOReal tspeed = MIN2(veh.getCarFollowModel().followSpeed(&veh, mspeed, frontGapNeeded, leader->getSpeed(), leader->getCarFollowModel().getMaxDecel()), mspeed); + const SUMOReal leaderPos = leader->getPositionOnLane() - leader->getVehicleType().getLength(); + const SUMOReal speed = adaptableSpeed ? leader->getSpeed() : mspeed; + const SUMOReal frontGapNeeded = veh.getCarFollowModel().getSecureGap(speed, leader->getSpeed(), leader->getCarFollowModel().getMaxDecel()) + veh.getVehicleType().getMinGap(); + if (leaderPos >= frontGapNeeded) { + const SUMOReal tspeed = MIN2(veh.getCarFollowModel().insertionFollowSpeed(&veh, mspeed, frontGapNeeded, leader->getSpeed(), leader->getCarFollowModel().getMaxDecel()), mspeed); // check whether we can insert our vehicle behind the last vehicle on the lane - if (isInsertionSuccess(&veh, tspeed, 0, adaptableSpeed, notification)) { + if (isInsertionSuccess(&veh, tspeed, minPos, adaptableSpeed, notification)) { return true; } } @@ -319,7 +341,7 @@ 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) { + if (frontMax > minPos && backMin + POSITION_EPS < frontMax) { // try to insert vehicle (should be always ok) if (isInsertionSuccess(&veh, speed, backMin + POSITION_EPS, adaptableSpeed, notification)) { return true; @@ -375,7 +397,7 @@ for (unsigned int i = 0; i < 10; i++) { // we will try some random positions ... pos = RandHelper::rand(getLength()); - if (isInsertionSuccess(&veh, speed, pos, patchSpeed)) { + if (isInsertionSuccess(&veh, speed, pos, patchSpeed, MSMoveReminder::NOTIFICATION_DEPARTED)) { return true; } } @@ -398,7 +420,7 @@ break; } // try to insert - return isInsertionSuccess(&veh, speed, pos, patchSpeed); + return isInsertionSuccess(&veh, speed, pos, patchSpeed, MSMoveReminder::NOTIFICATION_DEPARTED); } @@ -430,7 +452,8 @@ aVehicle->getID() + "'. Inserting at lane end instead."); pos = myLength; } - aVehicle->updateBestLanes(true, this); + aVehicle->setTentativeLaneAndPosition(this, pos); + aVehicle->updateBestLanes(false, this); const MSCFModel& cfModel = aVehicle->getCarFollowModel(); const std::vector& bestLaneConts = aVehicle->getBestLanesContinuation(this); std::vector::const_iterator ri = bestLaneConts.begin(); @@ -441,7 +464,7 @@ unsigned int nRouteSuccs = 1; MSLane* currentLane = this; MSLane* nextLane = this; - SUMOTime arrivalTime = MSNet::getInstance()->getCurrentTimeStep() + TIME2STEPS(seen / MAX2(speed, NUMERICAL_EPS)); + SUMOTime arrivalTime = MSNet::getInstance()->getCurrentTimeStep() + TIME2STEPS(seen / MAX2(speed, SUMO_const_haltingSpeed)); while (seen < dist && ri != bestLaneConts.end()) { // get the next link used... MSLinkCont::const_iterator link = succLinkSec(*aVehicle, nRouteSuccs, *currentLane, bestLaneConts); @@ -449,7 +472,7 @@ if (¤tLane->getEdge() == r.getLastEdge()) { // reached the end of the route if (aVehicle->getParameter().arrivalSpeedProcedure == ARRIVAL_SPEED_GIVEN) { - if (checkFailure(aVehicle, speed, dist, cfModel.freeSpeed(aVehicle, speed, seen, aVehicle->getParameter().arrivalSpeed), + if (checkFailure(aVehicle, speed, dist, cfModel.freeSpeed(aVehicle, speed, seen, aVehicle->getParameter().arrivalSpeed, true), patchSpeed, "arrival speed too low")) { // we may not drive with the given velocity - we cannot match the specified arrival speed return false; @@ -488,30 +511,29 @@ nextLane = (*link)->getViaLaneOrLane(); // check how next lane effects the journey if (nextLane != 0) { - arrivalTime += TIME2STEPS(nextLane->getLength() / MAX2(speed, NUMERICAL_EPS)); + // check leader on next lane SUMOReal gap = 0; - MSVehicle* leader = currentLane->getPartialOccupator(); + MSVehicle* leader = nextLane->getLastVehicle(); if (leader != 0) { - gap = seen + currentLane->getPartialOccupatorEnd() - currentLane->getLength() - aVehicle->getVehicleType().getMinGap(); + gap = seen + leader->getPositionOnLane() - leader->getVehicleType().getLength() - aVehicle->getVehicleType().getMinGap(); } else { - // check leader on next lane - leader = nextLane->getLastVehicle(); + leader = nextLane->getPartialOccupator(); if (leader != 0) { - gap = seen + leader->getPositionOnLane() - leader->getVehicleType().getLength() - aVehicle->getVehicleType().getMinGap(); + gap = seen + nextLane->getPartialOccupatorEnd() - aVehicle->getVehicleType().getMinGap(); } } if (leader != 0) { if (gap < 0) { return false; } - const SUMOReal nspeed = cfModel.followSpeed(aVehicle, speed, gap, leader->getSpeed(), leader->getCarFollowModel().getMaxDecel()); + const SUMOReal nspeed = cfModel.insertionFollowSpeed(aVehicle, speed, gap, leader->getSpeed(), leader->getCarFollowModel().getMaxDecel()); if (checkFailure(aVehicle, speed, dist, nspeed, patchSpeed, "")) { // we may not drive with the given velocity - we crash into the leader return false; } } // check next lane's maximum velocity - const SUMOReal nspeed = cfModel.freeSpeed(aVehicle, speed, seen, nextLane->getVehicleMaxSpeed(aVehicle)); + const SUMOReal nspeed = cfModel.freeSpeed(aVehicle, speed, seen, nextLane->getVehicleMaxSpeed(aVehicle), true); if (nspeed < speed) { if (patchSpeed) { speed = nspeed; @@ -526,15 +548,14 @@ // 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 / MAX2(speed, NUMERICAL_EPS)); - const SUMOTime leaveTime = arrivalTime + TIME2STEPS((*link)->getLength() * speed); + const SUMOTime leaveTime = (*link)->getLeaveTime(arrivalTime, speed, speed, aVehicle->getVehicleType().getLength()); if ((*link)->hasApproachingFoe(arrivalTime, leaveTime, speed, cfModel.getMaxDecel())) { - if (checkFailure(aVehicle, speed, dist, cfModel.followSpeed(aVehicle, speed, seen, 0, 0), - patchSpeed, "")) { + if (checkFailure(aVehicle, speed, dist, cfModel.stopSpeed(aVehicle, speed, seen), patchSpeed, "")) { // we may not drive with the given velocity - we crash at the junction return false; } } + arrivalTime += TIME2STEPS(nextLane->getLength() / MAX2(speed, NUMERICAL_EPS)); seen += nextLane->getLength(); currentLane = nextLane; #ifdef HAVE_INTERNAL_LANES @@ -550,14 +571,24 @@ } // get the pointer to the vehicle next in front of the given position + MSVehicle* leader = 0; + SUMOReal gap = 0; MSLane::VehCont::iterator predIt = find_if(myVehicles.begin(), myVehicles.end(), bind2nd(VehPosition(), pos)); if (predIt != myVehicles.end()) { - // ok, there is one (a leader) - MSVehicle* leader = *predIt; - SUMOReal frontGapNeeded = cfModel.getSecureGap(speed, leader->getSpeed(), leader->getCarFollowModel().getMaxDecel()); - SUMOReal gap = MSVehicle::gap(leader->getPositionOnLane(), leader->getVehicleType().getLength(), pos + aVehicle->getVehicleType().getMinGap()); - if (gap < frontGapNeeded) { - // too close to the leader on this lane + leader = *predIt; + gap = MSVehicle::gap(leader->getPositionOnLane(), leader->getVehicleType().getLength(), pos + aVehicle->getVehicleType().getMinGap()); + } + if (leader == 0 && getPartialOccupator() != 0) { + leader = getPartialOccupator(); + gap = getPartialOccupatorEnd() - pos - aVehicle->getVehicleType().getMinGap(); + } + if (leader != 0) { + if (gap < 0) { + return false; + } + const SUMOReal nspeed = cfModel.insertionFollowSpeed(aVehicle, speed, gap, leader->getSpeed(), leader->getCarFollowModel().getMaxDecel()); + if (checkFailure(aVehicle, speed, dist, nspeed, patchSpeed, "")) { + // we may not drive with the given velocity - we crash into the leader return false; } } @@ -574,22 +605,11 @@ } } else { // 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()); + const SUMOReal missingRearGap = getMissingRearGap(backOffset, speed, aVehicle->getCarFollowModel().getMaxDecel()); if (missingRearGap > 0) { // too close to a follower - 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; - } + return false; } } // may got negative while adaptation @@ -613,11 +633,7 @@ SUMOReal MSLane::setPartialOccupation(MSVehicle* v, SUMOReal leftVehicleLength) { myInlappingVehicle = v; - if (leftVehicleLength > myLength) { - myInlappingVehicleEnd = 0; - } else { - myInlappingVehicleEnd = myLength - leftVehicleLength; - } + myInlappingVehicleEnd = myLength - leftVehicleLength; return myLength; } @@ -626,8 +642,8 @@ MSLane::resetPartialOccupation(MSVehicle* v) { if (v == myInlappingVehicle) { myInlappingVehicleEnd = 10000; + myInlappingVehicle = 0; } - myInlappingVehicle = 0; } @@ -665,52 +681,60 @@ void MSLane::detectCollisions(SUMOTime timestep, const std::string& stage) { - if (myVehicles.size() < 2) { + if (myVehicles.size() == 0) { return; } VehCont::iterator lastVeh = myVehicles.end() - 1; for (VehCont::iterator veh = myVehicles.begin(); veh != lastVeh;) { VehCont::iterator pred = veh + 1; - if ((*veh)->hasInfluencer() && (*veh)->getInfluencer().isVTDControlled()) { + if ((*veh)->hasInfluencer() && (*veh)->getInfluencer().isVTDAffected(timestep)) { ++veh; continue; } - if ((*pred)->hasInfluencer() && (*pred)->getInfluencer().isVTDControlled()) { + if ((*pred)->hasInfluencer() && (*pred)->getInfluencer().isVTDAffected(timestep)) { ++veh; continue; } SUMOReal gap = (*pred)->getPositionOnLane() - (*pred)->getVehicleType().getLength() - (*veh)->getPositionOnLane() - (*veh)->getVehicleType().getMinGap(); if (gap < -NUMERICAL_EPS) { - MSVehicle* vehV = *veh; - if (vehV->getLane() == this) { - WRITE_WARNING("Teleporting vehicle '" + vehV->getID() + "'; collision with '" - + (*pred)->getID() + "', lane='" + getID() + "', gap=" + toString(gap) - + ", time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + " stage=" + stage + "."); - MSNet::getInstance()->getVehicleControl().registerCollision(); - myBruttoVehicleLengthSum -= vehV->getVehicleType().getLengthWithGap(); - myNettoVehicleLengthSum -= vehV->getVehicleType().getLength(); - MSVehicleTransfer::getInstance()->add(timestep, vehV); - veh = myVehicles.erase(veh); // remove current vehicle - lastVeh = myVehicles.end() - 1; - if (veh == myVehicles.end()) { - break; - } - } else { - WRITE_WARNING("Shadow of vehicle '" + vehV->getID() + "'; collision with '" - + (*pred)->getID() + "', lane='" + getID() + "', gap=" + toString(gap) - + ", time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + " stage=" + stage + "."); - veh = myVehicles.erase(veh); // remove current vehicle - lastVeh = myVehicles.end() - 1; - vehV->getLaneChangeModel().endLaneChangeManeuver(); - if (veh == myVehicles.end()) { - break; - } + handleCollision(timestep, stage, *veh, *pred, gap); + veh = myVehicles.erase(veh); // remove current vehicle + lastVeh = myVehicles.end() - 1; + if (veh == myVehicles.end()) { + break; } } else { ++veh; } } + MSVehicle* predV = getPartialOccupator(); + if (predV != 0) { + SUMOReal gap = getPartialOccupatorEnd() - (*lastVeh)->getPositionOnLane() - (*lastVeh)->getVehicleType().getMinGap(); + if (gap < -NUMERICAL_EPS) { + handleCollision(timestep, stage, *lastVeh, predV, gap); + myVehicles.erase(lastVeh); + } + } +} + + +void +MSLane::handleCollision(SUMOTime timestep, const std::string& stage, MSVehicle* collider, MSVehicle* victim, const SUMOReal gap) { + if (collider->getLane() == this) { + WRITE_WARNING("Teleporting vehicle '" + collider->getID() + "'; collision with '" + + victim->getID() + "', lane='" + getID() + "', gap=" + toString(gap) + + ", time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + " stage=" + stage + "."); + MSNet::getInstance()->getVehicleControl().registerCollision(); + myBruttoVehicleLengthSum -= collider->getVehicleType().getLengthWithGap(); + myNettoVehicleLengthSum -= collider->getVehicleType().getLength(); + MSVehicleTransfer::getInstance()->add(timestep, collider); + } else { + WRITE_WARNING("Shadow of vehicle '" + collider->getID() + "'; collision with '" + + victim->getID() + "', lane='" + getID() + "', gap=" + toString(gap) + + ", time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + " stage=" + stage + "."); + collider->getLaneChangeModel().endLaneChangeManeuver(); + } } @@ -817,7 +841,7 @@ MSLane::getInternalFollower() const { const MSEdge* e = myEdge; while (e->getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { - e = e->getFollower(0); + e = e->getSuccessors()[0]; } return e; } @@ -909,6 +933,7 @@ myVehicles.insert(myVehicles.begin(), veh); myBruttoVehicleLengthSum += veh->getVehicleType().getLengthWithGap(); myNettoVehicleLengthSum += veh->getVehicleType().getLength(); + myEdge->markDelayed(); } myVehBuffer.clear(); return wasInactive && myVehicles.size() != 0; @@ -926,6 +951,10 @@ return i == myLinks.end(); } +bool +MSLane::isEmpty() const { + return (myVehicles.empty() && myInlappingVehicle == 0); +} MSVehicle* MSLane::getLastVehicle() const { @@ -936,7 +965,7 @@ } -const MSVehicle* +MSVehicle* MSLane::getFirstVehicle() const { if (myVehicles.size() == 0) { return 0; @@ -1000,6 +1029,20 @@ void +MSLane::setMaxSpeed(SUMOReal val) { + myMaxSpeed = val; + myEdge->recalcCache(); +} + + +void +MSLane::setLength(SUMOReal val) { + myLength = val; + myEdge->recalcCache(); +} + + +void MSLane::swapAfterLaneChange(SUMOTime) { myVehicles = myTmpVehicles; myTmpVehicles.clear(); @@ -1044,6 +1087,10 @@ MSEdge* approachingEdge = &lane->getEdge(); if (myApproachingLanes.find(approachingEdge) == myApproachingLanes.end()) { myApproachingLanes[approachingEdge] = std::vector(); + } else if (approachingEdge->getPurpose() != MSEdge::EDGEFUNCTION_INTERNAL) { + // whenever a normal edge connects twice, there is a corresponding + // internal edge wich connects twice, one warning is sufficient + WRITE_WARNING("Lane '" + getID() + "' is approached multiple times from edge '" + approachingEdge->getID() + "'. This may cause collisions."); } myApproachingLanes[approachingEdge].push_back(lane); } @@ -1075,61 +1122,66 @@ SUMOReal MSLane::getMissingRearGap( - SUMOReal dist, SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const { + 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 + // search and check for the vehicle with the largest missing rear gap within + // relevant range 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(), v), 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); + std::pair followerInfo = getFollowerOnConsecutive(backOffset, leaderSpeed, leaderMaxDecel); + MSVehicle* v = followerInfo.first; + if (v != 0) { + result = v->getCarFollowModel().getSecureGap(v->getSpeed(), leaderSpeed, leaderMaxDecel) - followerInfo.second; } return result; } +SUMOReal +MSLane::getMaximumBrakeDist() const { + const MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl(); + const SUMOReal maxSpeed = getSpeedLimit() * vc.getMaxSpeedFactor(); + // this is an upper bound on the actual braking distance (see ticket #860) + return maxSpeed * maxSpeed * 0.5 / vc.getMinDeceleration(); +} + + std::pair -MSLane::getFollowerOnConsecutive(SUMOReal dist, SUMOReal leaderSpeed, - SUMOReal backOffset, SUMOReal leaderMaxDecel) const { +MSLane::getFollowerOnConsecutive( + SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const { // do a tree search among all follower lanes and check for the most // important vehicle (the one requiring the largest reargap) + // to get a safe bound on the necessary search depth, we need to consider the maximum speed and minimum + // deceleration of potential follower vehicles + SUMOReal dist = getMaximumBrakeDist() - backOffset; + std::pair result(static_cast(0), -1); - SUMOReal missingRearGapMax = 0; + SUMOReal missingRearGapMax = -std::numeric_limits::max(); 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(); + dist = MAX2(dist, next->getMaximumBrakeDist() - backOffset); + MSVehicle* v = 0; + SUMOReal agap = 0; + if (next->getPartialOccupator() != 0) { + // the front of v is already on divergent trajectory from the ego vehicle + // for which this method is called (in the context of MSLaneChanger). + // Therefore, technically v is not a follower but only an obstruction and + // the gap is not between the front of v and the back of ego + // but rather between the flank of v and the back of ego. + agap = (*i).length - next->getLength() + backOffset - next->getPartialOccupator()->getVehicleType().getMinGap(); + if (agap < 0) { + // Only if ego overlaps we treat v as if it were a real follower + v = next->getPartialOccupator(); + } + } + if (v == 0 && next->getFirstVehicle() != 0) { + v = next->getFirstVehicle(); + agap = (*i).length - v->getPositionOnLane() + backOffset - v->getVehicleType().getMinGap(); + } + if (v != 0) { const SUMOReal missingRearGap = v->getCarFollowModel().getSecureGap(v->getSpeed(), leaderSpeed, leaderMaxDecel) - agap; if (missingRearGap > missingRearGapMax) { missingRearGapMax = missingRearGap; @@ -1176,7 +1228,7 @@ // get the next link used MSLinkCont::const_iterator link = succLinkSec(veh, view, *nextLane, bestLaneConts); if (nextLane->isLinkEnd(link) || !(*link)->opened(arrivalTime, speed, speed, veh.getVehicleType().getLength(), - veh.getImpatience(), veh.getCarFollowModel().getMaxDecel(), 0) || (*link)->getState() == LINKSTATE_TL_RED) { + veh.getImpatience(), veh.getCarFollowModel().getMaxDecel(), 0) || (*link)->haveRed()) { break; } #ifdef HAVE_INTERNAL_LANES @@ -1222,15 +1274,94 @@ } +std::pair +MSLane::getCriticalLeader(SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle& veh) const { + const std::vector& bestLaneConts = veh.getBestLanesContinuation(this); + std::pair result = std::make_pair(static_cast(0), -1); + SUMOReal safeSpeed = std::numeric_limits::max(); + unsigned int view = 1; + // loop over following lanes + // @note: we don't check the partial occupator for this lane since it was + // already checked in MSLaneChanger::getRealLeader() + const MSLane* nextLane = this; + SUMOTime arrivalTime = MSNet::getInstance()->getCurrentTimeStep() + TIME2STEPS(seen / MAX2(speed, NUMERICAL_EPS)); + do { + // get the next link used + MSLinkCont::const_iterator link = succLinkSec(veh, view, *nextLane, bestLaneConts); + if (nextLane->isLinkEnd(link) || !(*link)->opened(arrivalTime, speed, speed, veh.getVehicleType().getLength(), + veh.getImpatience(), veh.getCarFollowModel().getMaxDecel(), 0) || (*link)->haveRed()) { + return result; + } +#ifdef HAVE_INTERNAL_LANES + // check for link leaders + const MSLink::LinkLeaders linkLeaders = (*link)->getLeaderInfo(seen, veh.getVehicleType().getMinGap()); + for (MSLink::LinkLeaders::const_iterator it = linkLeaders.begin(); it != linkLeaders.end(); ++it) { + const MSVehicle* leader = (*it).vehAndGap.first; + if (leader != 0 && leader != result.first) { + // XXX ignoring pedestrians here! + // XXX ignoring the fact that the link leader may alread by following us + // XXX ignoring the fact that we may drive up to the crossing point + const SUMOReal tmpSpeed = veh.getSafeFollowSpeed((*it).vehAndGap, seen, nextLane, (*it).distToCrossing); + if (tmpSpeed < safeSpeed) { + safeSpeed = tmpSpeed; + result = (*it).vehAndGap; + } + } + } + bool nextInternal = (*link)->getViaLane() != 0; +#endif + nextLane = (*link)->getViaLaneOrLane(); + if (nextLane == 0) { + break; + } + MSVehicle* leader = nextLane->getLastVehicle(); + if (leader != 0 && leader != result.first) { + const SUMOReal gap = seen + leader->getPositionOnLane() - leader->getVehicleType().getLength() - veh.getVehicleType().getMinGap(); + const SUMOReal tmpSpeed = veh.getCarFollowModel().insertionFollowSpeed(leader, speed, gap, leader->getSpeed(), leader->getCarFollowModel().getMaxDecel()); + if (tmpSpeed < safeSpeed) { + safeSpeed = tmpSpeed; + result = std::make_pair(leader, gap); + } + } else { + leader = nextLane->getPartialOccupator(); + if (leader != 0 && leader != result.first) { + const SUMOReal gap = seen + nextLane->getPartialOccupatorEnd() - veh.getVehicleType().getMinGap(); + const SUMOReal tmpSpeed = veh.getCarFollowModel().insertionFollowSpeed(leader, speed, gap, leader->getSpeed(), leader->getCarFollowModel().getMaxDecel()); + if (tmpSpeed < safeSpeed) { + safeSpeed = tmpSpeed; + result = std::make_pair(leader, gap); + } + } + } + if (nextLane->getVehicleMaxSpeed(&veh) < speed) { + dist = veh.getCarFollowModel().brakeGap(nextLane->getVehicleMaxSpeed(&veh)); + } + seen += nextLane->getLength(); + if (seen <= dist) { + // delaying the update of arrivalTime and making it conditional to avoid possible integer overflows + arrivalTime += TIME2STEPS(nextLane->getLength() / MAX2(speed, NUMERICAL_EPS)); + } +#ifdef HAVE_INTERNAL_LANES + if (!nextInternal) { + view++; + } +#else + view++; +#endif + } while (seen <= dist); + return result; +} + + MSLane* MSLane::getLogicalPredecessorLane() const { if (myLogicalPredecessorLane != 0) { return myLogicalPredecessorLane; } if (myLogicalPredecessorLane == 0) { - std::vector pred = myEdge->getIncomingEdges(); + MSEdgeVector pred = myEdge->getIncomingEdges(); // get only those edges which connect to this lane - for (std::vector::iterator i = pred.begin(); i != pred.end();) { + for (MSEdgeVector::iterator i = pred.begin(); i != pred.end();) { std::vector::const_iterator j = find_if(myIncomingLanes.begin(), myIncomingLanes.end(), edge_finder(*i)); if (j == myIncomingLanes.end()) { i = pred.erase(i); @@ -1499,7 +1630,7 @@ for (std::vector::const_iterator it = vehIds.begin(); it != vehIds.end(); ++it) { MSVehicle* v = dynamic_cast(vc.getVehicle(*it)); assert(v != 0); - v->updateBestLanes(true, this); + v->updateBestLanes(false, this); incorporateVehicle(v, v->getPositionOnLane(), v->getSpeed(), myVehicles.end(), MSMoveReminder::NOTIFICATION_JUNCTION); } diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLane.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLane.h --- sumo-0.21.0+dfsg/src/microsim/MSLane.h 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLane.h 2015-04-17 05:44:20.000000000 +0000 @@ -8,12 +8,12 @@ /// @author Michael Behrisch /// @author Mario Krumnow /// @date Mon, 12 Mar 2001 -/// @version $Id: MSLane.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSLane.h 18096 2015-03-17 09:50:59Z behrisch $ /// // Representation of a lane in the micro simulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include "MSLinkCont.h" @@ -192,9 +192,9 @@ * @return Whether the vehicle could be inserted * @see MSVehicle::enterLaneAtInsertion */ - virtual bool isInsertionSuccess(MSVehicle* vehicle, SUMOReal speed, SUMOReal pos, - bool recheckNextLanes, - MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED); + bool isInsertionSuccess(MSVehicle* vehicle, SUMOReal speed, SUMOReal pos, + bool recheckNextLanes, + MSMoveReminder::Notification notification); bool checkFailure(MSVehicle* aVehicle, SUMOReal& speed, SUMOReal& dist, const SUMOReal nspeed, const bool patchSpeed, const std::string errorMsg) const; bool pWagGenericInsertion(MSVehicle& veh, SUMOReal speed, SUMOReal maxPos, SUMOReal minPos); @@ -439,14 +439,15 @@ return myVehicles.empty(); } - void setMaxSpeed(SUMOReal val) { - myMaxSpeed = val; - } - - void setLength(SUMOReal val) { - myLength = val; - } + /** @brief Sets a new maximum speed for the lane (used by TraCI and MSCalibrator) + * @param[in] val the new speed in m/s + */ + void setMaxSpeed(SUMOReal val); + /** @brief Sets a new length for the lane (used by TraCI only) + * @param[in] val the new length in m + */ + void setLength(SUMOReal val); /** @brief Returns the lane's edge * @return This lane's edge @@ -533,11 +534,13 @@ of the list of links (is not valid) */ bool isLinkEnd(MSLinkCont::iterator& i); - /// returns the last vehicle - virtual MSVehicle* getLastVehicle() const; - virtual const MSVehicle* getFirstVehicle() const; - + /** Returns the information whether the lane is has no vehicle and no + partial occupation*/ + bool isEmpty() const; + /// returns the last vehicle + MSVehicle* getLastVehicle() const; + MSVehicle* getFirstVehicle() const; /* @brief remove the vehicle from this lane @@ -589,16 +592,16 @@ - std::pair getFollowerOnConsecutive(SUMOReal dist, - SUMOReal leaderSpeed, SUMOReal backOffset, SUMOReal predMaxDecel) const; + /// @brief return the follower with the largest missing rear gap among all predecessor lanes (within dist) + std::pair getFollowerOnConsecutive( + SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) 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; + SUMOReal getMissingRearGap(SUMOReal backOffset, SUMOReal leaderSpeed, SUMOReal leaderMaxDecel) const; - /** @brief Returns the leader and the distance to him + /** @brief Returns the immediate leader and the distance to him * * Goes along the vehicle's estimated used lanes (bestLaneConts). For each link, * it is determined whether the vehicle will pass it. If so, the subsequent lane @@ -624,6 +627,26 @@ SUMOReal speed, const MSVehicle& veh, const std::vector& bestLaneConts) const; + /** @brief Returns the most dangerous leader and the distance to him + * + * Goes along the vehicle's estimated used lanes (bestLaneConts). For each link, + * it is determined whether the ego vehicle will pass it. If so, the subsequent lane + * is investigated. Check all lanes up to the stopping distance of ego. + * Return the leader vehicle (and the gap) which puts the biggest speed constraint on ego. + * + * If no leading vehicle was found, <0, -1> is returned. + * + * Pretty slow, as it has to go along lanes. + * + * @param[in] dist The distance to investigate + * @param[in] seen The already seen place (normally the place in front on own lane) + * @param[in] speed The speed of the vehicle used for determining whether a subsequent link will be opened at arrival time + * @param[in] veh The (ego) vehicle for which the information shall be computed + * @return + */ + std::pair getCriticalLeader(SUMOReal dist, SUMOReal seen, SUMOReal speed, const MSVehicle& veh) const; + + MSLane* getLogicalPredecessorLane() const; /// @brief get the state of the link from the logical predecessor to this lane @@ -766,6 +789,12 @@ MSMoveReminder::Notification notification = MSMoveReminder::NOTIFICATION_DEPARTED); + /// @brief issue warning and add the vehicle to MSVehicleTransfer + void handleCollision(SUMOTime timestep, const std::string& stage, MSVehicle* collider, MSVehicle* victim, const SUMOReal gap); + + /// @brief compute maximum braking distance on this lane + SUMOReal getMaximumBrakeDist() const; + protected: /// Unique numerical ID (set on reading by netload) size_t myNumericalID; @@ -783,10 +812,10 @@ SUMOReal myLength; /// Lane width [m] - SUMOReal myWidth; + const SUMOReal myWidth; /// The lane's edge, for routing only. - MSEdge* myEdge; + MSEdge* const myEdge; /// Lane-wide speedlimit [m/s] SUMOReal myMaxSpeed; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLCM_DK2008.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLCM_DK2008.cpp --- sumo-0.21.0+dfsg/src/microsim/MSLCM_DK2008.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLCM_DK2008.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,680 +0,0 @@ -/****************************************************************************/ -/// @file MSLCM_DK2008.cpp -/// @author Daniel Krajzewicz -/// @author Friedemann Wesner -/// @author Sascha Krieg -/// @author Michael Behrisch -/// @author Jakob Erdmann -/// @date Tue, 29.05.2005 -/// @version $Id: MSLCM_DK2008.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// A lane change model developed by D. Krajzewicz between 2004 and 2010 -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 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 "MSEdge.h" -#include "MSLane.h" -#include "MSNet.h" -#include "MSLCM_DK2008.h" - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - -//#define DEBUG_VEHICLE_GUI_SELECTION 1 -#ifdef DEBUG_VEHICLE_GUI_SELECTION -#include -#include -#include -#endif - - - -// =========================================================================== -// variable definitions -// =========================================================================== -// 80km/h will be the threshold for dividing between long/short foresight -#define LOOK_FORWARD_SPEED_DIVIDER 14. - -#define LOOK_FORWARD_FAR 15. -#define LOOK_FORWARD_NEAR 5. - - - -#define JAM_FACTOR 2. -#define JAM_FACTOR2 1. - - -// =========================================================================== -// member method definitions -// =========================================================================== -MSLCM_DK2008::MSLCM_DK2008(MSVehicle& v) - : MSAbstractLaneChangeModel(v), - myChangeProbability(0), - myLeadingBlockerLength(0), myLeftSpace(0) {} - -MSLCM_DK2008::~MSLCM_DK2008() { - changed(); -} - -int -MSLCM_DK2008::wantsChange( - int laneOffset, - MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked) { - UNUSED_PARAMETER(firstBlocked); - return (laneOffset == -1 ? - wantsChangeToRight(msgPass, blocked, leader, neighLead, neighFollow, neighLane, preb, lastBlocked, firstBlocked) - : wantsChangeToLeft(msgPass, blocked, leader, neighLead, neighFollow, neighLane, preb, lastBlocked, firstBlocked)); - -} - - -int -MSLCM_DK2008::wantsChangeToRight(MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked) { - UNUSED_PARAMETER(firstBlocked); -#ifdef DEBUG_VEHICLE_GUI_SELECTION - if (gSelected.isSelected(GLO_VEHICLE, static_cast(&myVehicle)->getGlID())) { - int bla = 0; - } -#endif - MSVehicle::LaneQ curr, best; - int bestLaneOffset = 0; - SUMOReal currentDist = 0; - SUMOReal neighDist = 0; - SUMOReal neighExtDist = 0; - SUMOReal currExtDist = 0; - int currIdx = 0; - MSLane* prebLane = myVehicle.getLane(); - if (prebLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { - // internal edges are not kept inside the bestLanes structure - prebLane = prebLane->getLinkCont()[0]->getLane(); - } - for (int p = 0; p < (int) preb.size(); ++p) { - if (preb[p].lane == prebLane && p > 0) { - curr = preb[p]; - bestLaneOffset = curr.bestLaneOffset; - currentDist = curr.length; - currExtDist = curr.lane->getLength(); - neighDist = preb[p - 1].length; - neighExtDist = preb[p - 1].lane->getLength(); - best = preb[p + bestLaneOffset]; - currIdx = p; - break; - } - } - - // keep information about being a leader/follower - int ret = (myOwnState & 0xffff0000); - - if (leader.first != 0 - && - (myOwnState & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0 - && - (leader.first->getLaneChangeModel().getOwnState()&LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0) { - - myOwnState &= (0xffffffff - LCA_AMBLOCKINGFOLLOWER_DONTBRAKE); - if (myVehicle.getSpeed() > SUMO_const_haltingSpeed) { - myOwnState |= LCA_AMBACKBLOCKER; - } else { - ret |= LCA_AMBACKBLOCKER; - myDontBrake = true; - } - } - - // process information about the last blocked vehicle - // if this vehicle is blocking someone in front, we maybe decelerate to let him in - if ((*lastBlocked) != 0) { - SUMOReal gap = (*lastBlocked)->getPositionOnLane() - (*lastBlocked)->getVehicleType().getLength() - myVehicle.getPositionOnLane() - myVehicle.getVehicleType().getMinGap(); - if (gap > 0.1) { - if (myVehicle.getSpeed() < ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel())) { - if ((*lastBlocked)->getSpeed() < SUMO_const_haltingSpeed) { - ret |= LCA_AMBACKBLOCKER_STANDING; - } else { - ret |= LCA_AMBACKBLOCKER; - } - myVSafes.push_back(myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), (SUMOReal)(gap - 0.1), (*lastBlocked)->getSpeed(), (*lastBlocked)->getCarFollowModel().getMaxDecel())); - (*lastBlocked) = 0; - } - return ret; - } - } - - // we try to estimate the distance which is necessary to get on a lane - // we have to get on in order to keep our route - // we assume we need something that depends on our velocity - // and compare this with the free space on our wished lane - // - // if the free space is somehow less than the space we need, we should - // definitely try to get to the desired lane - // - // this rule forces our vehicle to change the lane if a lane changing is necessary soon - SUMOReal rv = myVehicle.getSpeed() > LOOK_FORWARD_SPEED_DIVIDER - ? myVehicle.getSpeed() * (SUMOReal) LOOK_FORWARD_FAR - : myVehicle.getSpeed() * (SUMOReal) LOOK_FORWARD_NEAR; - rv += myVehicle.getVehicleType().getLengthWithGap() * (SUMOReal) 2.; - - SUMOReal tdist = currentDist - myVehicle.getPositionOnLane() - best.occupation * (SUMOReal) JAM_FACTOR2; - - // assert(best.length > curr.length); - // XXX if (curr.length != best.length) && ... - if (fabs(best.length - curr.length) > MIN2((SUMOReal) .1, best.lane->getLength()) && bestLaneOffset < 0 && currentDistDisallows(tdist/*currentDist*/, bestLaneOffset, rv)) { - informBlocker(msgPass, blocked, LCA_MRIGHT, neighLead, neighFollow); - if (neighLead.second > 0 && neighLead.second > leader.second) { - myVSafes.push_back(myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighLead.second, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel()) - (SUMOReal) 0.5); - } - - // letting vehicles merge in at the end of the lane in case of counter-lane change, step#1, right - // if there is a leader and he wants to change to left (we want to change to right) - if (neighLead.first != 0 && (neighLead.first->getLaneChangeModel().getOwnState()&LCA_LEFT) != 0) { - // save at least his length in myLeadingBlockerLength - myLeadingBlockerLength = MAX2(neighLead.first->getVehicleType().getLengthWithGap(), myLeadingBlockerLength); - // save the left space - myLeftSpace = currentDist - myVehicle.getPositionOnLane(); - } - // - - return ret | LCA_RIGHT | LCA_STRATEGIC | LCA_URGENT; - } - - - // the opposite lane-changing direction should be done than the one examined herein - // we'll check whether we assume we could change anyhow and get back in time... - // - // this rule prevents the vehicle from moving in opposite direction of the best lane - // unless the way till the end where the vehicle has to be on the best lane - // is long enough - SUMOReal maxJam = MAX2(preb[currIdx - 1].occupation, preb[currIdx].occupation); - SUMOReal neighLeftPlace = MAX2((SUMOReal) 0, neighDist - myVehicle.getPositionOnLane() - maxJam); - if (bestLaneOffset >= 0 && (currentDistDisallows(neighLeftPlace, bestLaneOffset + 2, rv))) { - // ...we will not change the lane if not - return ret | LCA_STAY | LCA_STRATEGIC; - } - - - // if the current lane is the best and a lane-changing would cause a situation - // of which we assume we will not be able to return to the lane we have to be on... - // - // this rule prevents the vehicle from leaving the current, best lane when it is - // close to this lane's end - if (currExtDist > neighExtDist && (neighLeftPlace * 2. < rv/*||currE[currIdx+1].lengthgetVehicleMaxSpeed(&myVehicle) > 80. / 3.6) { - return ret | LCA_STAY | LCA_STRATEGIC; - } - // -------- - - // -------- make place on current lane if blocking follower - if (amBlockingFollowerPlusNB() - && - (currentDistAllows(neighDist, bestLaneOffset, rv) || neighDist >= currentDist)) { - - return ret | LCA_RIGHT | LCA_COOPERATIVE | LCA_URGENT; - } - // -------- - - - // -------- security checks for krauss - // (vsafe fails when gap<0) - if ((blocked & LCA_BLOCKED) != 0) { - return ret; - } - // -------- - - // -------- higher speed - if ((congested(neighLead.first) && neighLead.second < 20) || predInteraction(leader.first)) { //!!! - return ret; - } - 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 { - // @todo: what if leader is below safe gap?!!! - neighLaneVSafe = MIN2(neighLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighLead.second, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel())); - } - if (leader.first == 0) { - thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), currentDist, 0, 0)); - } else { - // @todo: what if leader is below safe gap?!!! - thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), leader.second, leader.first->getSpeed(), leader.first->getCarFollowModel().getMaxDecel())); - } - - thisLaneVSafe = MIN2(thisLaneVSafe, myVehicle.getVehicleType().getMaxSpeed()); - neighLaneVSafe = MIN2(neighLaneVSafe, myVehicle.getVehicleType().getMaxSpeed()); - if (thisLaneVSafe - neighLaneVSafe > 5. / 3.6) { - // ok, the current lane is faster than the right one... - if (myChangeProbability < 0) { - myChangeProbability /= 2.0; - } - } else { - // ok, the right lane is faster than the current - myChangeProbability -= (SUMOReal)((neighLaneVSafe - thisLaneVSafe) / (myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle))); - } - - // let's recheck the "Rechtsfahrgebot" - SUMOReal vmax = MIN2(myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle), myVehicle.getVehicleType().getMaxSpeed()); - vmax -= (SUMOReal)(5. / 2.6); - if (neighLaneVSafe >= vmax) { - myChangeProbability -= (SUMOReal)((neighLaneVSafe - vmax) / (vmax)); - } - - if (myChangeProbability < -2 && neighDist / MAX2((SUMOReal) .1, myVehicle.getSpeed()) > 20.) { //./MAX2((SUMOReal) .1, myVehicle.getSpeed())) { // -.1 - return ret | LCA_RIGHT | LCA_SPEEDGAIN; - } - // -------- - - return ret; -} - - -int -MSLCM_DK2008::wantsChangeToLeft(MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked) { - UNUSED_PARAMETER(firstBlocked); -#ifdef DEBUG_VEHICLE_GUI_SELECTION - if (gSelected.isSelected(GLO_VEHICLE, static_cast(&myVehicle)->getGlID())) { - int bla = 0; - } -#endif - MSVehicle::LaneQ curr, best; - int bestLaneOffset = 0; - SUMOReal currentDist = 0; - SUMOReal neighDist = 0; - SUMOReal neighExtDist = 0; - SUMOReal currExtDist = 0; - int currIdx = 0; - MSLane* prebLane = myVehicle.getLane(); - if (prebLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { - // internal edges are not kept inside the bestLanes structure - prebLane = prebLane->getLinkCont()[0]->getLane(); - } - for (int p = 0; p < (int) preb.size(); ++p) { - if (preb[p].lane == prebLane) { - curr = preb[p]; - bestLaneOffset = curr.bestLaneOffset; - currentDist = curr.length; - currExtDist = curr.lane->getLength(); - neighDist = preb[p + 1].length; - neighExtDist = preb[p + 1].lane->getLength(); - best = preb[p + bestLaneOffset]; - currIdx = p; - break; - } - } - // keep information about being a leader/follower - int ret = (myOwnState & 0xffff0000); - - // ?!!! - if (leader.first != 0 - && - (myOwnState & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0 - && - (leader.first->getLaneChangeModel().getOwnState()&LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0) { - - myOwnState &= (0xffffffff - LCA_AMBLOCKINGFOLLOWER_DONTBRAKE); - if (myVehicle.getSpeed() > SUMO_const_haltingSpeed) { - myOwnState |= LCA_AMBACKBLOCKER; - } else { - ret |= LCA_AMBACKBLOCKER; - myDontBrake = true; - } - } - - // process information about the last blocked vehicle - // if this vehicle is blocking someone in front, we maybe decelerate to let him in - if ((*lastBlocked) != 0) { - SUMOReal gap = (*lastBlocked)->getPositionOnLane() - (*lastBlocked)->getVehicleType().getLength() - myVehicle.getPositionOnLane() - myVehicle.getVehicleType().getMinGap(); - if (gap > 0.1) { - if (myVehicle.getSpeed() < ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel())) { - if ((*lastBlocked)->getSpeed() < SUMO_const_haltingSpeed) { - ret |= LCA_AMBACKBLOCKER_STANDING; - } else { - ret |= LCA_AMBACKBLOCKER; - } - myVSafes.push_back(myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), (SUMOReal)(gap - 0.1), (*lastBlocked)->getSpeed(), (*lastBlocked)->getCarFollowModel().getMaxDecel())); - (*lastBlocked) = 0; - } - return ret; - } - } - - // we try to estimate the distance which is necessary to get on a lane - // we have to get on in order to keep our route - // we assume we need something that depends on our velocity - // and compare this with the free space on our wished lane - // - // if the free space is somehow less than the space we need, we should - // definitely try to get to the desired lane - // - // this rule forces our vehicle to change the lane if a lane changing is necessary soon - SUMOReal lv = myVehicle.getSpeed() > LOOK_FORWARD_SPEED_DIVIDER - ? myVehicle.getSpeed() * (SUMOReal) LOOK_FORWARD_FAR - : myVehicle.getSpeed() * (SUMOReal) LOOK_FORWARD_NEAR; - lv += myVehicle.getVehicleType().getLengthWithGap() * (SUMOReal) 2.; - - - SUMOReal tdist = currentDist - myVehicle.getPositionOnLane() - best.occupation * (SUMOReal) JAM_FACTOR2; - if (fabs(best.length - curr.length) > MIN2((SUMOReal) .1, best.lane->getLength()) && bestLaneOffset > 0 - && - currentDistDisallows(tdist/*currentDist*/, bestLaneOffset, lv)) { - informBlocker(msgPass, blocked, LCA_MLEFT, neighLead, neighFollow); - if (neighLead.second > 0 && neighLead.second > leader.second) { - myVSafes.push_back(myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighLead.second, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel()) - (SUMOReal) 0.5); - } - - // letting vehicles merge in at the end of the lane in case of counter-lane change, step#1, left - // if there is a leader and he wants to change to right (we want to change to left) - if (neighLead.first != 0 && (neighLead.first->getLaneChangeModel().getOwnState()&LCA_RIGHT) != 0) { - // save at least his length in myLeadingBlockerLength - myLeadingBlockerLength = MAX2(neighLead.first->getVehicleType().getLengthWithGap(), myLeadingBlockerLength); - // save the left space - myLeftSpace = currentDist - myVehicle.getPositionOnLane(); - } - // - - return ret | LCA_LEFT | LCA_STRATEGIC | LCA_URGENT; - } - - // the opposite lane-changing direction should be rather done, not - // the one examined herein - // we'll check whether we assume we could change anyhow and get back in time... - // - // this rule prevents the vehicle from moving in opposite direction of the best lane - // unless the way till the end where the vehicle has to be on the best lane - // is long enough - SUMOReal maxJam = MAX2(preb[currIdx + 1].occupation, preb[currIdx].occupation); - SUMOReal neighLeftPlace = MAX2((SUMOReal) 0, neighDist - myVehicle.getPositionOnLane() - maxJam); - if (bestLaneOffset <= 0 && (currentDistDisallows(neighLeftPlace, bestLaneOffset - 2, lv))) { - // ...we will not change the lane if not - return ret | LCA_STAY | LCA_STRATEGIC; - } - - - // if the current lane is the best and a lane-changing would cause a situation - // of which we assume we will not be able to return to the lane we have to be on... - // - // this rule prevents the vehicle from leaving the current, best lane when it is - // close to this lane's end - if (currExtDist > neighExtDist && (neighLeftPlace * 2. < lv/*||currE[currIdx+1].length80./3.6) { - return ret; - } - */ - - - /* - // if the current lane is the - if(bestLaneOffset==0&&(neighDist==0||curr.seenVehicles2*JAM_FACTOR>=neighExtDist-curr.length)) { - return ret; - } - */ - // -------- - - // -------- make place on current lane if blocking follower - if (amBlockingFollowerPlusNB() - && - (currentDistAllows(neighDist, bestLaneOffset, lv) || neighDist >= currentDist)) { - - return ret | LCA_LEFT | LCA_COOPERATIVE | LCA_URGENT; - } - // -------- - - // -------- security checks for krauss - // (vsafe fails when gap<0) - if ((blocked & LCA_BLOCKED) != 0) { - return ret; - } - - // -------- higher speed - if ((congested(neighLead.first) && neighLead.second < 20) || predInteraction(leader.first)) { //!!! - return ret; - } - 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 { - // @todo: what if leader is below safe gap?!!! - neighLaneVSafe = MIN2(neighLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighLead.second, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel())); - } - if (leader.first == 0) { - thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), currentDist, 0, 0)); - } else { - // @todo: what if leader is below safe gap?!!! - thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), leader.second, leader.first->getSpeed(), leader.first->getCarFollowModel().getMaxDecel())); - } - thisLaneVSafe = MIN2(thisLaneVSafe, myVehicle.getVehicleType().getMaxSpeed()); - neighLaneVSafe = MIN2(neighLaneVSafe, myVehicle.getVehicleType().getMaxSpeed()); - if (thisLaneVSafe > neighLaneVSafe) { - // this lane is better - if (myChangeProbability > 0) { - myChangeProbability /= 2.0; - } - } else { - // right lane is better - 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; - } - // -------- - - return ret; -} - - -SUMOReal -MSLCM_DK2008::patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel& cfModel) { -#ifdef DEBUG_VEHICLE_GUI_SELECTION - if (gSelected.isSelected(GLO_VEHICLE, static_cast(&myVehicle)->getGlID())) { - int bla = 0; - } -#endif - int state = myOwnState; - - // letting vehicles merge in at the end of the lane in case of counter-lane change, step#2 - SUMOReal MAGIC_offset = 1.; - // if we want to change and have a blocking leader and there is enough room for him in front of us - if (myLeadingBlockerLength != 0) { - SUMOReal space = myLeftSpace - myLeadingBlockerLength - MAGIC_offset - myVehicle.getVehicleType().getMinGap(); - if (space > 0) { - // compute speed for decelerating towards a place which allows the blocking leader to merge in in front - SUMOReal safe = cfModel.stopSpeed(&myVehicle, myVehicle.getSpeed(), space); - // if we are approaching this place - if (safe < wanted) { - // return this speed as the speed to use - return MAX2(min, safe); - } - } - } - - // just to make sure to be notified about lane chaning end - if (myVehicle.getLane()->getEdge().getLanes().size() == 1 || myVehicle.getLane()->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { - // remove chaning information if on a road with a single lane - changed(); - return wanted; - } - - SUMOReal nVSafe = wanted; - bool gotOne = false; - for (std::vector::const_iterator i = myVSafes.begin(); i != myVSafes.end(); ++i) { - SUMOReal v = (*i); - if (v >= min && v <= max) { - nVSafe = MIN2(v, nVSafe); - gotOne = true; - } - } - - // check whether the vehicle is blocked - if ((state & LCA_WANTS_LANECHANGE) != 0) { - if (gotOne && !myDontBrake) { - return nVSafe; - } - // check whether the vehicle maybe has to be swapped with one of - // the blocking vehicles - if ((state & LCA_BLOCKED) != 0) { - if ((state & LCA_BLOCKED_BY_LEADER) != 0) { - // if interacting with leader and not too slow - return (min + wanted) / (SUMOReal) 2.0; - } - if ((state & LCA_BLOCKED_BY_FOLLOWER) != 0) { - return (max + wanted) / (SUMOReal) 2.0; - } - return (min + wanted) / (SUMOReal) 2.0; - } - } - - - // decelerate if being a blocking follower - // (and does not have to change lanes) - if ((state & LCA_AMBLOCKINGFOLLOWER) != 0) { - if (fabs(max - myVehicle.getCarFollowModel().maxNextSpeed(myVehicle.getSpeed(), &myVehicle)) < 0.001 && min == 0) { // !!! was standing - return 0; - } - return (min + wanted) / (SUMOReal) 2.0; - } - if ((state & LCA_AMBACKBLOCKER) != 0) { - if (max <= myVehicle.getCarFollowModel().maxNextSpeed(myVehicle.getSpeed(), &myVehicle) && min == 0) { // !!! was standing - return min; - } - } - if ((state & LCA_AMBACKBLOCKER_STANDING) != 0) { - return min; - } - // accelerate if being a blocking leader or blocking follower not able to brake - // (and does not have to change lanes) - if ((state & LCA_AMBLOCKINGLEADER) != 0) { - return (max + wanted) / (SUMOReal) 2.0; - } - if ((state & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0) { - if (max <= myVehicle.getCarFollowModel().maxNextSpeed(myVehicle.getSpeed(), &myVehicle) && min == 0) { // !!! was standing - return wanted; - } - return (min + wanted) / (SUMOReal) 2.0; - } - return wanted; -} - - -void* -MSLCM_DK2008::inform(void* info, MSVehicle* /*sender*/) { - Info* pinfo = (Info*) info; - //myOwnState &= 0xffffffff; // reset all bits of MyLCAEnum but only those - myOwnState |= pinfo->second; - delete pinfo; - return (void*) true; -} - - -void -MSLCM_DK2008::changed() { - myOwnState = 0; - myLastLaneChangeOffset = 0; - myChangeProbability = 0; - myLeadingBlockerLength = 0; - myLeftSpace = 0; - myVSafes.clear(); - myDontBrake = false; -} - - -void -MSLCM_DK2008::informBlocker(MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int& blocked, - int dir, - const std::pair& neighLead, - const std::pair& neighFollow) { - if ((blocked & LCA_BLOCKED_BY_FOLLOWER) != 0) { - assert(neighFollow.first != 0); - MSVehicle* nv = neighFollow.first; - SUMOReal decelGap = - neighFollow.second - + SPEED2DIST(myVehicle.getSpeed()) * (SUMOReal) 2.0 - - MAX2(nv->getSpeed() - (SUMOReal) ACCEL2DIST(nv->getCarFollowModel().getMaxDecel()) * (SUMOReal) 2.0, (SUMOReal) 0); - if (neighFollow.second > 0 && decelGap > 0 && decelGap >= nv->getCarFollowModel().getSecureGap(nv->getSpeed(), myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel())) { - SUMOReal vsafe = myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighFollow.second, neighFollow.first->getSpeed(), neighFollow.first->getCarFollowModel().getMaxDecel()); - msgPass.informNeighFollower(new Info(vsafe, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); - } else { - SUMOReal vsafe = neighFollow.second <= 0 ? 0 : myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), neighFollow.second, neighFollow.first->getSpeed(), neighFollow.first->getCarFollowModel().getMaxDecel()); - msgPass.informNeighFollower(new Info(vsafe, dir | LCA_AMBLOCKINGFOLLOWER_DONTBRAKE), &myVehicle); - } - } - if ((blocked & LCA_BLOCKED_BY_LEADER) != 0) { - if (neighLead.first != 0 && neighLead.second > 0) { - msgPass.informNeighLeader(new Info(0, dir | LCA_AMBLOCKINGLEADER), &myVehicle); - } - } -} - - -void -MSLCM_DK2008::prepareStep() { - myOwnState = 0; - myLeadingBlockerLength = 0; - myLeftSpace = 0; - myVSafes.clear(); - myDontBrake = false; - // truncate myChangeProbability to work around numerical instability between different builds - myChangeProbability = ceil(myChangeProbability * 100000.0) * 0.00001; -} - - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLCM_DK2008.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLCM_DK2008.h --- sumo-0.21.0+dfsg/src/microsim/MSLCM_DK2008.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLCM_DK2008.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,172 +0,0 @@ -/****************************************************************************/ -/// @file MSLCM_DK2008.h -/// @author Daniel Krajzewicz -/// @author Friedemann Wesner -/// @author Sascha Krieg -/// @author Michael Behrisch -/// @author Jakob Erdmann -/// @date Fri, 29.04.2005 -/// @version $Id: MSLCM_DK2008.h 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// A lane change model developed by D. Krajzewicz between 2004 and 2010 -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 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 MSLCM_DK2008_h -#define MSLCM_DK2008_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class MSLCM_DK2008 - * @brief A lane change model developed by D. Krajzewicz between 2004 and 2010 - */ -class MSLCM_DK2008 : public MSAbstractLaneChangeModel { -public: - - enum MyLCAEnum { - LCA_AMBLOCKINGLEADER = 1 << 16, - LCA_AMBLOCKINGFOLLOWER = 1 << 17, - LCA_MRIGHT = 1 << 18, - LCA_MLEFT = 1 << 19, - // !!! never set LCA_UNBLOCK = 1 << 20, - LCA_AMBLOCKINGFOLLOWER_DONTBRAKE = 1 << 21, - // !!! never used LCA_AMBLOCKINGSECONDFOLLOWER = 1 << 22, - - // !!! never read LCA_KEEP1 = 1 << 24, - // !!! never used LCA_KEEP2 = 1 << 25, - LCA_AMBACKBLOCKER = 1 << 26, - LCA_AMBACKBLOCKER_STANDING = 1 << 27 - }; - - MSLCM_DK2008(MSVehicle& v); - - virtual ~MSLCM_DK2008(); - - /** @brief Called to examine whether the vehicle wants to change - * using the given laneOffset. - * This method gets the information about the surrounding vehicles - * and whether another lane may be more preferable */ - int wantsChange( - int laneOffset, - MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked); - - virtual void* inform(void* info, MSVehicle* sender); - - /** @brief Called to adapt the speed in order to allow a lane change. - * - * @param min The minimum resulting speed - * @param wanted The aspired speed of the car following model - * @param max The maximum resulting speed - * @param cfModel The model used - * @return the new speed of the vehicle as proposed by the lane changer - */ - virtual SUMOReal patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, - const MSCFModel& cfModel); - - virtual void changed(); - - virtual void prepareStep(); - - -protected: - /** @brief Called to examine whether the vehicle wants to change to right - This method gets the information about the surrounding vehicles - 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 MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked); - - /** @brief Called to examine whether the vehicle wants to change to left - This method gets the information about the surrounding vehicles - 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 MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked); - - void informBlocker(MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int& blocked, int dir, - const std::pair& neighLead, - const std::pair& neighFollow); - - inline bool amBlockingLeader() { - return (myOwnState & LCA_AMBLOCKINGLEADER) != 0; - } - inline bool amBlockingFollower() { - return (myOwnState & LCA_AMBLOCKINGFOLLOWER) != 0; - } - inline bool amBlockingFollowerNB() { - return (myOwnState & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0; - } - inline bool amBlockingFollowerPlusNB() { - return (myOwnState & (LCA_AMBLOCKINGFOLLOWER | LCA_AMBLOCKINGFOLLOWER_DONTBRAKE)) != 0; - } - inline bool currentDistDisallows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) { - return dist / (abs(laneOffset)) < lookForwardDist; - } - inline bool currentDistAllows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) { - return dist / abs(laneOffset) > lookForwardDist; - } - - typedef std::pair Info; - - - -protected: - SUMOReal myChangeProbability; - - SUMOReal myLeadingBlockerLength; - SUMOReal myLeftSpace; - - std::vector myVSafes; - bool myDontBrake; - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLCM_JE2013.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLCM_JE2013.cpp --- sumo-0.21.0+dfsg/src/microsim/MSLCM_JE2013.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLCM_JE2013.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1189 +0,0 @@ -/****************************************************************************/ -/// @file MSLCM_JE2013.h -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @author Laura Bieker -/// @date Fri, 08.10.2013 -/// @version $Id: MSLCM_JE2013.cpp 16560 2014-06-09 20:54:15Z behrisch $ -/// -// A lane change model developed by J. Erdmann -// based on the model of D. Krajzewicz developed between 2004 and 2011 (MSLCM_DK2004) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 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 "MSEdge.h" -#include "MSLane.h" -#include "MSNet.h" -#include "MSLCM_JE2013.h" - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - -//#define DEBUG_VEHICLE_GUI_SELECTION 1 -#ifdef DEBUG_VEHICLE_GUI_SELECTION -#include -#include -#include -#endif - - - -// =========================================================================== -// variable definitions -// =========================================================================== -// 80km/h will be the threshold for dividing between long/short foresight -#define LOOK_FORWARD_SPEED_DIVIDER (SUMOReal)14. - -// VARIANT_1 (lf*2) -//#define LOOK_FORWARD_FAR 30. -//#define LOOK_FORWARD_NEAR 10. - -#define LOOK_FORWARD_RIGHT (SUMOReal)10. -#define LOOK_FORWARD_LEFT (SUMOReal)20. - -#define JAM_FACTOR (SUMOReal)1. -//#define JAM_FACTOR 2. // VARIANT_8 (makes vehicles more focused but also more "selfish") - -#define LCA_RIGHT_IMPATIENCE (SUMOReal)-1. -#define CUT_IN_LEFT_SPEED_THRESHOLD (SUMOReal)27. - -#define LOOK_AHEAD_MIN_SPEED (SUMOReal)0.0 -#define LOOK_AHEAD_SPEED_MEMORY (SUMOReal)0.9 -#define LOOK_AHEAD_SPEED_DECREMENT 6. - -#define HELP_DECEL_FACTOR (SUMOReal)1.0 - -#define HELP_OVERTAKE (SUMOReal)(10.0 / 3.6) -#define MIN_FALLBEHIND (SUMOReal)(14.0 / 3.6) - -#define KEEP_RIGHT_HEADWAY (SUMOReal)2.0 - -#define URGENCY (SUMOReal)2.0 - -#define ROUNDABOUT_DIST_BONUS (SUMOReal)100.0 - -#define CHANGE_PROB_THRESHOLD_RIGHT (SUMOReal)2.0 -#define CHANGE_PROB_THRESHOLD_LEFT (SUMOReal)0.2 -#define KEEP_RIGHT_TIME (SUMOReal)5.0 // the number of seconds after which a vehicle should move to the right lane -#define KEEP_RIGHT_ACCEPTANCE (SUMOReal)2.0 // calibration factor for determining the desire to keep right - -#define RELGAIN_NORMALIZATION_MIN_SPEED (SUMOReal)10.0 - -#define TURN_LANE_DIST (SUMOReal)200.0 // the distance at which a lane leading elsewhere is considered to be a turn-lane that must be avoided - -//#define DEBUG_COND (myVehicle.getID() == "pkw22806" || myVehicle.getID() == "pkw22823") -//#define DEBUG_COND (myVehicle.getID() == "pkw150478" || myVehicle.getID() == "pkw150494" || myVehicle.getID() == "pkw150289") -//#define DEBUG_COND (myVehicle.getID() == "A" || myVehicle.getID() == "B") // fail change to left -//#define DEBUG_COND (myVehicle.getID() == "Costa_12_13") // test stops_overtaking -#define DEBUG_COND false - -// debug function -std::string -tryID(const MSVehicle* v) { - return v == 0 ? "NULL" : v->getID(); -} - - -// =========================================================================== -// member method definitions -// =========================================================================== -MSLCM_JE2013::MSLCM_JE2013(MSVehicle& v) : - MSAbstractLaneChangeModel(v), - mySpeedGainProbability(0), - myKeepRightProbability(0), - myLeadingBlockerLength(0), - myLeftSpace(0), - myLookAheadSpeed(LOOK_AHEAD_MIN_SPEED) -{} - -MSLCM_JE2013::~MSLCM_JE2013() { - changed(); -} - - -int -MSLCM_JE2013::wantsChange( - int laneOffset, - MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked) { - gDebugFlag2 = DEBUG_COND; - - if (gDebugFlag2) { - std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - << " veh=" << myVehicle.getID() - << " lane=" << myVehicle.getLane()->getID() - << " pos=" << myVehicle.getPositionOnLane() - << " speed=" << myVehicle.getSpeed() - << " considerChangeTo=" << (laneOffset == -1 ? "right" : "left") - << "\n"; - } - - const int result = _wantsChange(laneOffset, msgPass, blocked, leader, neighLead, neighFollow, neighLane, preb, lastBlocked, firstBlocked); - if (gDebugFlag2) { - if (result & LCA_WANTS_LANECHANGE) { - std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - << " veh=" << myVehicle.getID() - << " wantsChangeTo=" << (laneOffset == -1 ? "right" : "left") - << ((result & LCA_URGENT) ? " (urgent)" : "") - << ((result & LCA_CHANGE_TO_HELP) ? " (toHelp)" : "") - << ((result & LCA_STRATEGIC) ? " (strat)" : "") - << ((result & LCA_COOPERATIVE) ? " (coop)" : "") - << ((result & LCA_SPEEDGAIN) ? " (speed)" : "") - << ((result & LCA_KEEPRIGHT) ? " (keepright)" : "") - << ((result & LCA_TRACI) ? " (traci)" : "") - << ((blocked & LCA_BLOCKED) ? " (blocked)" : "") - << ((blocked & LCA_OVERLAPPING) ? " (overlap)" : "") - << "\n"; - } - } - gDebugFlag2 = false; - return result; -} - - -SUMOReal -MSLCM_JE2013::patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel& cfModel) { - gDebugFlag1 = DEBUG_COND; - - const SUMOReal newSpeed = _patchSpeed(min, wanted, max, cfModel); - if (gDebugFlag1) { - const std::string patched = (wanted != newSpeed ? " patched=" + toString(newSpeed) : ""); - std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - << " veh=" << myVehicle.getID() - << " lane=" << myVehicle.getLane()->getID() - << " pos=" << myVehicle.getPositionOnLane() - << " v=" << myVehicle.getSpeed() - << " wanted=" << wanted - << patched - << "\n"; - } - gDebugFlag1 = false; - return newSpeed; -} - - -SUMOReal -MSLCM_JE2013::_patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel& cfModel) { - - const SUMOReal time = STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()); - - int state = myOwnState; - - // letting vehicles merge in at the end of the lane in case of counter-lane change, step#2 - SUMOReal MAGIC_offset = 1.; - // if we want to change and have a blocking leader and there is enough room for him in front of us - if (myLeadingBlockerLength != 0) { - SUMOReal space = myLeftSpace - myLeadingBlockerLength - MAGIC_offset - myVehicle.getVehicleType().getMinGap(); - if (gDebugFlag1) { - std::cout << time << " veh=" << myVehicle.getID() << " myLeadingBlockerLength=" << myLeadingBlockerLength << " space=" << space << "\n"; - } - if (space > 0) { - // compute speed for decelerating towards a place which allows the blocking leader to merge in in front - SUMOReal safe = cfModel.stopSpeed(&myVehicle, myVehicle.getSpeed(), space); - // if we are approaching this place - if (safe < wanted) { - // return this speed as the speed to use - if (gDebugFlag1) { - std::cout << time << " veh=" << myVehicle.getID() << " slowing down for leading blocker" << (safe + NUMERICAL_EPS < min ? " (not enough)" : "") << "\n"; - } - return MAX2(min, safe); - } - } - } - - SUMOReal nVSafe = wanted; - bool gotOne = false; - for (std::vector::const_iterator i = myVSafes.begin(); i != myVSafes.end(); ++i) { - SUMOReal v = (*i); - if (v >= min && v <= max) { - nVSafe = MIN2(v, nVSafe); - gotOne = true; - if (gDebugFlag1) { - std::cout << time << " veh=" << myVehicle.getID() << " got nVSafe=" << nVSafe << "\n"; - } - } else { - if (v < min) { - if (gDebugFlag1) { - std::cout << time << " veh=" << myVehicle.getID() << " ignoring low nVSafe=" << v << " min=" << min << "\n"; - } - } else { - if (gDebugFlag1) { - std::cout << time << " veh=" << myVehicle.getID() << " ignoring high nVSafe=" << v << " max=" << max << "\n"; - } - } - } - } - - if (gotOne && !myDontBrake) { - if (gDebugFlag1) { - std::cout << time << " veh=" << myVehicle.getID() << " got vSafe\n"; - } - return nVSafe; - } - - // check whether the vehicle is blocked - if ((state & LCA_WANTS_LANECHANGE) != 0 && (state & LCA_BLOCKED) != 0) { - if ((state & LCA_STRATEGIC) != 0) { - // necessary decelerations are controlled via vSafe. If there are - // none it means we should speed up - if (gDebugFlag1) { - std::cout << time << " veh=" << myVehicle.getID() << " LCA_WANTS_LANECHANGE (strat, no vSafe)\n"; - } - return (max + wanted) / (SUMOReal) 2.0; - } else if ((state & LCA_COOPERATIVE) != 0) { - // only minor adjustments in speed should be done - if ((state & LCA_BLOCKED_BY_LEADER) != 0) { - if (gDebugFlag1) { - std::cout << time << " veh=" << myVehicle.getID() << " LCA_BLOCKED_BY_LEADER (coop)\n"; - } - return (min + wanted) / (SUMOReal) 2.0; - } - if ((state & LCA_BLOCKED_BY_FOLLOWER) != 0) { - if (gDebugFlag1) { - std::cout << time << " veh=" << myVehicle.getID() << " LCA_BLOCKED_BY_FOLLOWER (coop)\n"; - } - return (max + wanted) / (SUMOReal) 2.0; - } - //} else { // VARIANT_16 - // // only accelerations should be performed - // if ((state & LCA_BLOCKED_BY_FOLLOWER) != 0) { - // if (gDebugFlag1) std::cout << time << " veh=" << myVehicle.getID() << " LCA_BLOCKED_BY_FOLLOWER\n"; - // return (max + wanted) / (SUMOReal) 2.0; - // } - } - } - - /* - // decelerate if being a blocking follower - // (and does not have to change lanes) - if ((state & LCA_AMBLOCKINGFOLLOWER) != 0) { - if (fabs(max - myVehicle.getCarFollowModel().maxNextSpeed(myVehicle.getSpeed(), &myVehicle)) < 0.001 && min == 0) { // !!! was standing - if (gDebugFlag1) std::cout << time << " veh=" << myVehicle.getID() << " LCA_AMBLOCKINGFOLLOWER (standing)\n"; - return 0; - } - if (gDebugFlag1) std::cout << time << " veh=" << myVehicle.getID() << " LCA_AMBLOCKINGFOLLOWER\n"; - - //return min; // VARIANT_3 (brakeStrong) - return (min + wanted) / (SUMOReal) 2.0; - } - if ((state & LCA_AMBACKBLOCKER) != 0) { - if (max <= myVehicle.getCarFollowModel().maxNextSpeed(myVehicle.getSpeed(), &myVehicle) && min == 0) { // !!! was standing - if (gDebugFlag1) std::cout << time << " veh=" << myVehicle.getID() << " LCA_AMBACKBLOCKER (standing)\n"; - //return min; VARIANT_9 (backBlockVSafe) - return nVSafe; - } - } - if ((state & LCA_AMBACKBLOCKER_STANDING) != 0) { - if (gDebugFlag1) std::cout << time << " veh=" << myVehicle.getID() << " LCA_AMBACKBLOCKER_STANDING\n"; - //return min; - return nVSafe; - } - */ - - // accelerate if being a blocking leader or blocking follower not able to brake - // (and does not have to change lanes) - if ((state & LCA_AMBLOCKINGLEADER) != 0) { - if (gDebugFlag1) { - std::cout << time << " veh=" << myVehicle.getID() << " LCA_AMBLOCKINGLEADER\n"; - } - return (max + wanted) / (SUMOReal) 2.0; - } - - if ((state & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0) { - if (gDebugFlag1) { - std::cout << time << " veh=" << myVehicle.getID() << " LCA_AMBLOCKINGFOLLOWER_DONTBRAKE\n"; - } - /* - // VARIANT_4 (dontbrake) - if (max <= myVehicle.getCarFollowModel().maxNextSpeed(myVehicle.getSpeed(), &myVehicle) && min == 0) { // !!! was standing - return wanted; - } - return (min + wanted) / (SUMOReal) 2.0; - */ - } - if (myVehicle.getLane()->getEdge().getLanes().size() == 1) { - // remove chaning information if on a road with a single lane - changed(); - } - return wanted; -} - - -void* -MSLCM_JE2013::inform(void* info, MSVehicle* sender) { - Info* pinfo = (Info*) info; - if (pinfo->first >= 0) { - myVSafes.push_back(pinfo->first); - } - //myOwnState &= 0xffffffff; // reset all bits of MyLCAEnum but only those - myOwnState |= pinfo->second; - if (gDebugFlag2 || DEBUG_COND) { - std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - << " veh=" << myVehicle.getID() - << " informedBy=" << sender->getID() - << " info=" << pinfo->second - << " vSafe=" << pinfo->first - << "\n"; - } - delete pinfo; - return (void*) true; -} - - -SUMOReal -MSLCM_JE2013::informLeader(MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, - int dir, - const std::pair& neighLead, - SUMOReal remainingSeconds) { - SUMOReal plannedSpeed = MIN2(myVehicle.getSpeed(), - myVehicle.getCarFollowModel().stopSpeed(&myVehicle, myVehicle.getSpeed(), myLeftSpace - myLeadingBlockerLength)); - for (std::vector::const_iterator i = myVSafes.begin(); i != myVSafes.end(); ++i) { - SUMOReal v = (*i); - if (v >= myVehicle.getSpeed() - ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel())) { - plannedSpeed = MIN2(plannedSpeed, v); - } - } - if (gDebugFlag2) { - std::cout << " informLeader speed=" << myVehicle.getSpeed() << " planned=" << plannedSpeed << "\n"; - } - - if ((blocked & LCA_BLOCKED_BY_LEADER) != 0) { - assert(neighLead.first != 0); - MSVehicle* nv = neighLead.first; - if (gDebugFlag2) std::cout << " blocked by leader nv=" << nv->getID() << " nvSpeed=" << nv->getSpeed() << " needGap=" - << myVehicle.getCarFollowModel().getSecureGap(myVehicle.getSpeed(), nv->getSpeed(), nv->getCarFollowModel().getMaxDecel()) << "\n"; - // decide whether we want to overtake the leader or follow it - const SUMOReal dv = plannedSpeed - nv->getSpeed(); - const SUMOReal overtakeDist = (neighLead.second // drive to back of follower - + nv->getVehicleType().getLengthWithGap() // drive to front of follower - + myVehicle.getVehicleType().getLength() // ego back reaches follower front - + nv->getCarFollowModel().getSecureGap( // save gap to follower - nv->getSpeed(), myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel())); - - if (dv < 0 - // overtaking on the right on an uncongested highway is forbidden (noOvertakeLCLeft) - || (dir == LCA_MLEFT && !myVehicle.congested()) - // not enough space to overtake? - || myLeftSpace < overtakeDist - // not enough time to overtake? - || dv * remainingSeconds < overtakeDist) { - // cannot overtake - msgPass.informNeighLeader(new Info(-1, dir | LCA_AMBLOCKINGLEADER), &myVehicle); - // slow down smoothly to follow leader - const SUMOReal targetSpeed = myCarFollowModel.followSpeed( - &myVehicle, myVehicle.getSpeed(), neighLead.second, nv->getSpeed(), nv->getCarFollowModel().getMaxDecel()); - if (targetSpeed < myVehicle.getSpeed()) { - // slow down smoothly to follow leader - const SUMOReal decel = ACCEL2SPEED(MIN2(myVehicle.getCarFollowModel().getMaxDecel(), - MAX2(MIN_FALLBEHIND, (myVehicle.getSpeed() - targetSpeed) / remainingSeconds))); - const SUMOReal nextSpeed = MIN2(plannedSpeed, myVehicle.getSpeed() - decel); - if (gDebugFlag2) { - std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - << " cannot overtake leader nv=" << nv->getID() - << " dv=" << dv - << " remainingSeconds=" << remainingSeconds - << " targetSpeed=" << targetSpeed - << " nextSpeed=" << nextSpeed - << "\n"; - } - myVSafes.push_back(nextSpeed); - return nextSpeed; - } else { - // leader is fast enough anyway - if (gDebugFlag2) { - std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - << " cannot overtake fast leader nv=" << nv->getID() - << " dv=" << dv - << " remainingSeconds=" << remainingSeconds - << " targetSpeed=" << targetSpeed - << "\n"; - } - myVSafes.push_back(targetSpeed); - return plannedSpeed; - } - } else { - if (gDebugFlag2) { - std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - << " wants to overtake leader nv=" << nv->getID() - << " dv=" << dv - << " remainingSeconds=" << remainingSeconds - << " currentGap=" << neighLead.second - << " secureGap=" << nv->getCarFollowModel().getSecureGap(nv->getSpeed(), myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel()) - << "\n"; - } - // overtaking, leader should not accelerate - msgPass.informNeighLeader(new Info(nv->getSpeed(), dir | LCA_AMBLOCKINGLEADER), &myVehicle); - return -1; - } - } else if (neighLead.first != 0) { // (remainUnblocked) - // we are not blocked now. make sure we stay far enough from the leader - MSVehicle* nv = neighLead.first; - const SUMOReal nextNVSpeed = nv->getSpeed() - HELP_OVERTAKE; // conservative - const SUMOReal dv = SPEED2DIST(myVehicle.getSpeed() - nextNVSpeed); - const SUMOReal targetSpeed = myCarFollowModel.followSpeed( - &myVehicle, myVehicle.getSpeed(), neighLead.second - dv, nextNVSpeed, nv->getCarFollowModel().getMaxDecel()); - myVSafes.push_back(targetSpeed); - if (gDebugFlag2) { - std::cout << " not blocked by leader nv=" << nv->getID() - << " nvSpeed=" << nv->getSpeed() - << " gap=" << neighLead.second - << " nextGap=" << neighLead.second - dv - << " needGap=" << myVehicle.getCarFollowModel().getSecureGap(myVehicle.getSpeed(), nv->getSpeed(), nv->getCarFollowModel().getMaxDecel()) - << " targetSpeed=" << targetSpeed - << "\n"; - } - return MIN2(targetSpeed, plannedSpeed); - } else { - // not overtaking - return plannedSpeed; - } -} - - -void -MSLCM_JE2013::informFollower(MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, - int dir, - const std::pair& neighFollow, - SUMOReal remainingSeconds, - SUMOReal plannedSpeed) { - if ((blocked & LCA_BLOCKED_BY_FOLLOWER) != 0) { - assert(neighFollow.first != 0); - MSVehicle* nv = neighFollow.first; - if (gDebugFlag2) std::cout << " blocked by follower nv=" << nv->getID() << " nvSpeed=" << nv->getSpeed() << " needGap=" - << nv->getCarFollowModel().getSecureGap(nv->getSpeed(), myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel()) << "\n"; - - // are we fast enough to cut in without any help? - if (plannedSpeed - nv->getSpeed() >= HELP_OVERTAKE) { - const SUMOReal neededGap = nv->getCarFollowModel().getSecureGap(nv->getSpeed(), plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel()); - if ((neededGap - neighFollow.second) / remainingSeconds < (plannedSpeed - nv->getSpeed())) { - if (gDebugFlag2) { - std::cout << " wants to cut in before nv=" << nv->getID() << " without any help neededGap=" << neededGap << "\n"; - } - // follower might even accelerate but not to much - msgPass.informNeighFollower(new Info(plannedSpeed - HELP_OVERTAKE, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); - return; - } - } - // decide whether we will request help to cut in before the follower or allow to be overtaken - - // PARAMETERS - // assume other vehicle will assume the equivalent of 1 second of - // maximum deceleration to help us (will probably be spread over - // multiple seconds) - // ----------- - const SUMOReal helpDecel = nv->getCarFollowModel().getMaxDecel() * HELP_DECEL_FACTOR ; - - // change in the gap between ego and blocker over 1 second (not STEP!) - const SUMOReal neighNewSpeed = MAX2((SUMOReal)0, nv->getSpeed() - ACCEL2SPEED(helpDecel)); - const SUMOReal neighNewSpeed1s = MAX2((SUMOReal)0, nv->getSpeed() - helpDecel); - const SUMOReal dv = plannedSpeed - neighNewSpeed1s; - // new gap between follower and self in case the follower does brake for 1s - const SUMOReal decelGap = neighFollow.second + dv; - const SUMOReal secureGap = nv->getCarFollowModel().getSecureGap(neighNewSpeed1s, plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel()); - if (gDebugFlag2) { - std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - << " egoV=" << myVehicle.getSpeed() - << " egoNV=" << plannedSpeed - << " nvNewSpeed=" << neighNewSpeed - << " nvNewSpeed1s=" << neighNewSpeed1s - << " deltaGap=" << dv - << " decelGap=" << decelGap - << " secGap=" << secureGap - << "\n"; - } - if (decelGap > 0 && decelGap >= secureGap) { - // if the blocking neighbor brakes it could actually help - // how hard does it actually need to be? - const SUMOReal vsafe = MAX2(neighNewSpeed, nv->getCarFollowModel().followSpeed( - nv, nv->getSpeed(), neighFollow.second, plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel())); - msgPass.informNeighFollower(new Info(vsafe, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); - if (gDebugFlag2) { - std::cout << " wants to cut in before nv=" << nv->getID() << "\n"; - } - } else if (dv > 0 && dv * remainingSeconds > (secureGap - decelGap + POSITION_EPS)) { - // decelerating once is sufficient to open up a large enough gap in time - msgPass.informNeighFollower(new Info(neighNewSpeed, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); - if (gDebugFlag2) { - std::cout << " wants to cut in before nv=" << nv->getID() << " (eventually)\n"; - } - } else { - SUMOReal vhelp = MAX2(nv->getSpeed(), myVehicle.getSpeed() + HELP_OVERTAKE); - if (nv->getSpeed() > myVehicle.getSpeed() && - ((dir == LCA_MRIGHT && myVehicle.getWaitingSeconds() > LCA_RIGHT_IMPATIENCE) - || (dir == LCA_MLEFT && plannedSpeed > CUT_IN_LEFT_SPEED_THRESHOLD) // VARIANT_22 (slowDownLeft) - )) { - // let the follower slow down to increase the likelyhood that later vehicles will be slow enough to help - // follower should still be fast enough to open a gap - vhelp = MAX2(neighNewSpeed, myVehicle.getSpeed() + HELP_OVERTAKE); - if (gDebugFlag2) { - std::cout << " wants right follower to slow down a bit\n"; - } - if ((nv->getSpeed() - myVehicle.getSpeed()) / helpDecel < remainingSeconds) { - if (gDebugFlag2) { - std::cout << " wants to cut in before right follower nv=" << nv->getID() << " (eventually)\n"; - } - msgPass.informNeighFollower(new Info(vhelp, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); - return; - } - } - msgPass.informNeighFollower(new Info(vhelp, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); - // this follower is supposed to overtake us. slow down smoothly to allow this - const SUMOReal overtakeDist = (neighFollow.second // follower reaches ego back - + myVehicle.getVehicleType().getLengthWithGap() // follower reaches ego front - + nv->getVehicleType().getLength() // follower back at ego front - + myVehicle.getCarFollowModel().getSecureGap( // follower has safe dist to ego - plannedSpeed, vhelp, nv->getCarFollowModel().getMaxDecel())); - // speed difference to create a sufficiently large gap - const SUMOReal needDV = overtakeDist / remainingSeconds; - // make sure the deceleration is not to strong - myVSafes.push_back(MAX2(vhelp - needDV, myVehicle.getSpeed() - ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel()))); - - if (gDebugFlag2) { - std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - << " veh=" << myVehicle.getID() - << " wants to be overtaken by=" << nv->getID() - << " overtakeDist=" << overtakeDist - << " vneigh=" << nv->getSpeed() - << " vhelp=" << vhelp - << " needDV=" << needDV - << " vsafe=" << myVSafes.back() - << "\n"; - } - } - } -} - - -void -MSLCM_JE2013::prepareStep() { - myOwnState = 0; - myLeadingBlockerLength = 0; - myLeftSpace = 0; - myVSafes.clear(); - myDontBrake = false; - // truncate to work around numerical instability between different builds - mySpeedGainProbability = ceil(mySpeedGainProbability * 100000.0) * 0.00001; - myKeepRightProbability = ceil(myKeepRightProbability * 100000.0) * 0.00001; -} - - -void -MSLCM_JE2013::changed() { - myOwnState = 0; - myLastLaneChangeOffset = 0; - mySpeedGainProbability = 0; - myKeepRightProbability = 0; - if (myVehicle.getBestLaneOffset() == 0) { - // if we are not yet on our best lane there might still be unseen blockers - // (during patchSpeed) - myLeadingBlockerLength = 0; - myLeftSpace = 0; - } - myLookAheadSpeed = LOOK_AHEAD_MIN_SPEED; - myVSafes.clear(); - myDontBrake = false; -} - - -int -MSLCM_JE2013::_wantsChange( - int laneOffset, - MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked) { - assert(laneOffset == 1 || laneOffset == -1); - const SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); - // compute bestLaneOffset - MSVehicle::LaneQ curr, neigh, best; - int bestLaneOffset = 0; - SUMOReal currentDist = 0; - SUMOReal neighDist = 0; - int currIdx = 0; - MSLane* prebLane = myVehicle.getLane(); - if (prebLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { - // internal edges are not kept inside the bestLanes structure - prebLane = prebLane->getLinkCont()[0]->getLane(); - } - for (int p = 0; p < (int) preb.size(); ++p) { - if (preb[p].lane == prebLane && p + laneOffset >= 0) { - assert(p + laneOffset < (int)preb.size()); - curr = preb[p]; - neigh = preb[p + laneOffset]; - currentDist = curr.length; - neighDist = neigh.length; - bestLaneOffset = curr.bestLaneOffset; - // VARIANT_13 (equalBest) - if (bestLaneOffset == 0 && preb[p + laneOffset].bestLaneOffset == 0) { - if (gDebugFlag2) { - std::cout << STEPS2TIME(currentTime) - << " veh=" << myVehicle.getID() - << " bestLaneOffsetOld=" << bestLaneOffset - << " bestLaneOffsetNew=" << laneOffset - << "\n"; - } - bestLaneOffset = laneOffset; - } - best = preb[p + bestLaneOffset]; - currIdx = p; - break; - } - } - // direction specific constants - const bool right = (laneOffset == -1); - const int lca = (right ? LCA_RIGHT : LCA_LEFT); - const int myLca = (right ? LCA_MRIGHT : LCA_MLEFT); - const int lcaCounter = (right ? LCA_LEFT : LCA_RIGHT); - const int myLcaCounter = (right ? LCA_MLEFT : LCA_MRIGHT); - const bool changeToBest = (right && bestLaneOffset < 0) || (!right && bestLaneOffset > 0); - // keep information about being a leader/follower - int ret = (myOwnState & 0xffff0000); - int req = 0; // the request to change or stay - - // VARIANT_5 (disableAMBACKBLOCKER1) - /* - if (leader.first != 0 - && (myOwnState & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0 - && (leader.first->getLaneChangeModel().getOwnState() & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0) { - - myOwnState &= (0xffffffff - LCA_AMBLOCKINGFOLLOWER_DONTBRAKE); - if (myVehicle.getSpeed() > SUMO_const_haltingSpeed) { - myOwnState |= LCA_AMBACKBLOCKER; - } else { - ret |= LCA_AMBACKBLOCKER; - myDontBrake = true; - } - } - */ - - if (gDebugFlag2) { - std::cout << STEPS2TIME(currentTime) - << " veh=" << myVehicle.getID() - << " firstBlocked=" << tryID(*firstBlocked) - << " lastBlocked=" << tryID(*lastBlocked) - << " neighLead=" << tryID(neighLead.first) - << " neighLeadGap=" << neighLead.second - << " neighFollow=" << tryID(neighFollow.first) - << " neighFollowGap=" << neighFollow.second - << "\n"; - } - - ret = slowDownForBlocked(lastBlocked, ret); - // VARIANT_14 (furtherBlock) - if (lastBlocked != firstBlocked) { - ret = slowDownForBlocked(firstBlocked, ret); - } - - - // we try to estimate the distance which is necessary to get on a lane - // we have to get on in order to keep our route - // we assume we need something that depends on our velocity - // and compare this with the free space on our wished lane - // - // if the free space is somehow less than the space we need, we should - // definitely try to get to the desired lane - // - // this rule forces our vehicle to change the lane if a lane changing is necessary soon - // lookAheadDistance: - // we do not want the lookahead distance to change all the time so we discrectize the speed a bit - - // VARIANT_18 (laHyst) - if (myVehicle.getSpeed() > myLookAheadSpeed) { - myLookAheadSpeed = myVehicle.getSpeed(); - } else { - myLookAheadSpeed = MAX2(LOOK_AHEAD_MIN_SPEED, - (LOOK_AHEAD_SPEED_MEMORY * myLookAheadSpeed + (1 - LOOK_AHEAD_SPEED_MEMORY) * myVehicle.getSpeed())); - } - //myLookAheadSpeed = myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle); - - //SUMOReal laDist = laSpeed > LOOK_FORWARD_SPEED_DIVIDER - // ? laSpeed * LOOK_FORWARD_FAR - // : laSpeed * LOOK_FORWARD_NEAR; - SUMOReal laDist = myLookAheadSpeed * (right ? LOOK_FORWARD_RIGHT : LOOK_FORWARD_LEFT); - laDist += myVehicle.getVehicleType().getLengthWithGap() * (SUMOReal) 2.; - // free space that is available for changing - //const SUMOReal neighSpeed = (neighLead.first != 0 ? neighLead.first->getSpeed() : - // neighFollow.first != 0 ? neighFollow.first->getSpeed() : - // best.lane->getSpeedLimit()); - // @note: while this lets vehicles change earlier into the correct direction - // it also makes the vehicles more "selfish" and prevents changes which are necessary to help others - - // VARIANT_15 (insideRoundabout) - int roundaboutEdgesAhead = 0; - for (std::vector::iterator it = curr.bestContinuations.begin(); it != curr.bestContinuations.end(); ++it) { - if ((*it) != 0 && (*it)->getEdge().isRoundabout()) { - roundaboutEdgesAhead += 1; - } else if (roundaboutEdgesAhead > 0) { - // only check the next roundabout - break; - } - } - int roundaboutEdgesAheadNeigh = 0; - for (std::vector::iterator it = neigh.bestContinuations.begin(); it != neigh.bestContinuations.end(); ++it) { - if ((*it) != 0 && (*it)->getEdge().isRoundabout()) { - roundaboutEdgesAheadNeigh += 1; - } else if (roundaboutEdgesAheadNeigh > 0) { - // only check the next roundabout - break; - } - } - if (roundaboutEdgesAhead > 1) { - currentDist += roundaboutEdgesAhead * ROUNDABOUT_DIST_BONUS; - neighDist += roundaboutEdgesAheadNeigh * ROUNDABOUT_DIST_BONUS; - } - if (roundaboutEdgesAhead > 0) { - if (gDebugFlag2) { - std::cout << " roundaboutEdgesAhead=" << roundaboutEdgesAhead << " roundaboutEdgesAheadNeigh=" << roundaboutEdgesAheadNeigh << "\n"; - } - } - - const SUMOReal usableDist = (currentDist - myVehicle.getPositionOnLane() - best.occupation * JAM_FACTOR); - //- (best.lane->getVehicleNumber() * neighSpeed)); // VARIANT 9 jfSpeed - const SUMOReal maxJam = MAX2(preb[currIdx + laneOffset].occupation, preb[currIdx].occupation); - const SUMOReal neighLeftPlace = MAX2((SUMOReal) 0, neighDist - myVehicle.getPositionOnLane() - maxJam); - - if (gDebugFlag2) { - std::cout << STEPS2TIME(currentTime) - << " veh=" << myVehicle.getID() - << " laSpeed=" << myLookAheadSpeed - << " laDist=" << laDist - << " currentDist=" << currentDist - << " usableDist=" << usableDist - << " bestLaneOffset=" << bestLaneOffset - << " best.length=" << best.length - << " maxJam=" << maxJam - << " neighLeftPlace=" << neighLeftPlace - << "\n"; - } - - if (changeToBest && bestLaneOffset == curr.bestLaneOffset - && currentDistDisallows(usableDist, bestLaneOffset, laDist)) { - /// @brief we urgently need to change lanes to follow our route - ret = ret | lca | LCA_STRATEGIC | LCA_URGENT; - } else { - // VARIANT_20 (noOvertakeRight) - if (!myAllowOvertakingRight && !right && !myVehicle.congested() && neighLead.first != 0) { - // check for slower leader on the left. we should not overtake but - // rather move left ourselves (unless congested) - MSVehicle* nv = neighLead.first; - if (nv->getSpeed() < myVehicle.getSpeed()) { - myVSafes.push_back(myCarFollowModel.followSpeed( - &myVehicle, myVehicle.getSpeed(), neighLead.second, nv->getSpeed(), nv->getCarFollowModel().getMaxDecel())); - if (nv->getSpeed() + 5 / 3.6 < myVehicle.getSpeed()) { - mySpeedGainProbability += CHANGE_PROB_THRESHOLD_LEFT / 3; - } - if (gDebugFlag2) { - std::cout << STEPS2TIME(currentTime) - << " avoid overtaking on the right nv=" << nv->getID() - << " nvSpeed=" << nv->getSpeed() - << " mySpeedGainProbability=" << mySpeedGainProbability - << " plannedSpeed=" << myVSafes.back() - << "\n"; - } - } - } - - if (!changeToBest && (currentDistDisallows(neighLeftPlace, abs(bestLaneOffset) + 2, laDist))) { - // the opposite lane-changing direction should be done than the one examined herein - // we'll check whether we assume we could change anyhow and get back in time... - // - // this rule prevents the vehicle from moving in opposite direction of the best lane - // unless the way till the end where the vehicle has to be on the best lane - // is long enough - if (gDebugFlag2) { - std::cout << " veh=" << myVehicle.getID() << " could not change back and forth in time (1) neighLeftPlace=" << neighLeftPlace << "\n"; - } - ret = ret | LCA_STAY | LCA_STRATEGIC; - } else if (bestLaneOffset == 0 && (neighLeftPlace * 2. < laDist)) { - // the current lane is the best and a lane-changing would cause a situation - // of which we assume we will not be able to return to the lane we have to be on. - // this rule prevents the vehicle from leaving the current, best lane when it is - // close to this lane's end - if (gDebugFlag2) { - std::cout << " veh=" << myVehicle.getID() << " could not change back and forth in time (2) neighLeftPlace=" << neighLeftPlace << "\n"; - } - ret = ret | LCA_STAY | LCA_STRATEGIC; - } else if (bestLaneOffset == 0 - && (leader.first == 0 || !leader.first->isStopped()) - && neigh.bestContinuations.back()->getLinkCont().size() != 0 - && roundaboutEdgesAhead == 0 - && neighDist < TURN_LANE_DIST) { - // VARIANT_21 (stayOnBest) - // we do not want to leave the best lane for a lane which leads elsewhere - // unless our leader is stopped or we are approaching a roundabout - if (gDebugFlag2) { - std::cout << " veh=" << myVehicle.getID() << " does not want to leave the bestLane (neighDist=" << neighDist << ")\n"; - } - ret = ret | LCA_STAY | LCA_STRATEGIC; - } - } - // check for overriding TraCI requests - if (gDebugFlag2) { - std::cout << STEPS2TIME(currentTime) << " veh=" << myVehicle.getID() << " ret=" << ret; - } - ret = myVehicle.influenceChangeDecision(ret); - if ((ret & lcaCounter) != 0) { - // we are not interested in traci requests for the opposite direction here - ret &= ~(LCA_TRACI | lcaCounter | LCA_URGENT); - } - if (gDebugFlag2) { - std::cout << " retAfterInfluence=" << ret << "\n"; - } - - if ((ret & LCA_STAY) != 0) { - return ret; - } - if ((ret & LCA_URGENT) != 0) { - // prepare urgent lane change maneuver - // save the left space - myLeftSpace = currentDist - myVehicle.getPositionOnLane(); - if (changeToBest && abs(bestLaneOffset) > 1) { - // there might be a vehicle which needs to counter-lane-change one lane further and we cannot see it yet - if (gDebugFlag2) { - std::cout << " reserving space for unseen blockers\n"; - } - myLeadingBlockerLength = MAX2((SUMOReal)(right ? 20.0 : 40.0), myLeadingBlockerLength); - } - - // letting vehicles merge in at the end of the lane in case of counter-lane change, step#1 - // if there is a leader and he wants to change to the opposite direction - saveBlockerLength(neighLead.first, lcaCounter); - if (*firstBlocked != neighLead.first) { - saveBlockerLength(*firstBlocked, lcaCounter); - } - - const SUMOReal remainingSeconds = ((ret & LCA_TRACI) == 0 ? - MAX2((SUMOReal)STEPS2TIME(TS), myLeftSpace / MAX2(myLookAheadSpeed, NUMERICAL_EPS) / abs(bestLaneOffset) / URGENCY) : - myVehicle.getInfluencer().changeRequestRemainingSeconds(currentTime)); - const SUMOReal plannedSpeed = informLeader(msgPass, blocked, myLca, neighLead, remainingSeconds); - if (plannedSpeed >= 0) { - // maybe we need to deal with a blocking follower - informFollower(msgPass, blocked, myLca, neighFollow, remainingSeconds, plannedSpeed); - } - - if (gDebugFlag2) { - std::cout << STEPS2TIME(currentTime) - << " veh=" << myVehicle.getID() - << " myLeftSpace=" << myLeftSpace - << " remainingSeconds=" << remainingSeconds - << " plannedSpeed=" << plannedSpeed - << "\n"; - } - return ret; - } - - // VARIANT_15 - if (roundaboutEdgesAhead > 1) { - // try to use the inner lanes of a roundabout to increase throughput - // unless we are approaching the exit - if (lca == LCA_LEFT) { - req = ret | lca | LCA_COOPERATIVE; - } else { - req = ret | LCA_STAY | LCA_COOPERATIVE; - } - if (!cancelRequest(req)) { - return ret | req; - } - } - - // let's also regard the case where the vehicle is driving on a highway... - // in this case, we do not want to get to the dead-end of an on-ramp - if (right) { - if (bestLaneOffset == 0 && myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle) > 80. / 3.6 && myLookAheadSpeed > SUMO_const_haltingSpeed) { - if (gDebugFlag2) { - std::cout << " veh=" << myVehicle.getID() << " does not want to get stranded on the on-ramp of a highway\n"; - } - req = ret | LCA_STAY | LCA_STRATEGIC; - if (!cancelRequest(req)) { - return ret | req; - } - } - } - // -------- - - // -------- make place on current lane if blocking follower - //if (amBlockingFollowerPlusNB()) { - // std::cout << myVehicle.getID() << ", " << currentDistAllows(neighDist, bestLaneOffset, laDist) - // << " neighDist=" << neighDist - // << " currentDist=" << currentDist - // << "\n"; - //} - if (amBlockingFollowerPlusNB() - //&& ((myOwnState & myLcaCounter) == 0) // VARIANT_6 : counterNoHelp - && (changeToBest || currentDistAllows(neighDist, abs(bestLaneOffset) + 1, laDist))) { - - // VARIANT_2 (nbWhenChangingToHelp) - if (gDebugFlag2) { - std::cout << STEPS2TIME(currentTime) - << " veh=" << myVehicle.getID() - << " wantsChangeToHelp=" << (right ? "right" : "left") - << " state=" << myOwnState - << (((myOwnState & myLcaCounter) != 0) ? " (counter)" : "") - << "\n"; - } - req = ret | lca | LCA_COOPERATIVE | LCA_URGENT ;//| LCA_CHANGE_TO_HELP; - if (!cancelRequest(req)) { - return ret | req; - } - } - - // -------- - - - //// -------- security checks for krauss - //// (vsafe fails when gap<0) - //if ((blocked & LCA_BLOCKED) != 0) { - // return ret; - //} - //// -------- - - // -------- higher speed - //if ((congested(neighLead.first) && neighLead.second < 20) || predInteraction(leader.first)) { //!!! - // return ret; - //} - 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 { - // @todo: what if leader is below safe gap?!!! - neighLaneVSafe = MIN2(neighLaneVSafe, myCarFollowModel.followSpeed( - &myVehicle, myVehicle.getSpeed(), neighLead.second, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel())); - } - if (leader.first == 0) { - thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), currentDist, 0, 0)); - } else { - // @todo: what if leader is below safe gap?!!! - thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), leader.second, leader.first->getSpeed(), leader.first->getCarFollowModel().getMaxDecel())); - } - - const SUMOReal vMax = MIN2(myVehicle.getVehicleType().getMaxSpeed(), myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle)); - thisLaneVSafe = MIN2(thisLaneVSafe, vMax); - neighLaneVSafe = MIN2(neighLaneVSafe, vMax); - const SUMOReal relativeGain = (neighLaneVSafe - thisLaneVSafe) / MAX2(neighLaneVSafe, - RELGAIN_NORMALIZATION_MIN_SPEED); - - if (right) { - // ONLY FOR CHANGING TO THE RIGHT - if (thisLaneVSafe - 5 / 3.6 > neighLaneVSafe) { - // ok, the current lane is faster than the right one... - if (mySpeedGainProbability < 0) { - mySpeedGainProbability /= 2.0; - } - } else { - // ok, the current lane is not faster than the right one - mySpeedGainProbability -= relativeGain; - - // honor the obligation to keep right (Rechtsfahrgebot) - // XXX consider fast approaching followers on the current lane - //const SUMOReal vMax = myLookAheadSpeed; - const SUMOReal acceptanceTime = KEEP_RIGHT_ACCEPTANCE * vMax * MAX2((SUMOReal)1, myVehicle.getSpeed()) / myVehicle.getLane()->getSpeedLimit(); - SUMOReal fullSpeedGap = MAX2((SUMOReal)0, neighDist - myVehicle.getCarFollowModel().brakeGap(vMax)); - SUMOReal fullSpeedDrivingSeconds = MIN2(acceptanceTime, fullSpeedGap / vMax); - if (neighLead.first != 0 && neighLead.first->getSpeed() < vMax) { - fullSpeedGap = MAX2((SUMOReal)0, MIN2(fullSpeedGap, - neighLead.second - myVehicle.getCarFollowModel().getSecureGap( - vMax, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel()))); - fullSpeedDrivingSeconds = MIN2(fullSpeedDrivingSeconds, fullSpeedGap / (vMax - neighLead.first->getSpeed())); - } - const SUMOReal deltaProb = (CHANGE_PROB_THRESHOLD_RIGHT - * STEPS2TIME(DELTA_T) - * (fullSpeedDrivingSeconds / acceptanceTime) / KEEP_RIGHT_TIME); - myKeepRightProbability -= deltaProb; - - if (gDebugFlag2) { - std::cout << STEPS2TIME(currentTime) - << " veh=" << myVehicle.getID() - << " vMax=" << vMax - << " neighDist=" << neighDist - << " brakeGap=" << myVehicle.getCarFollowModel().brakeGap(myVehicle.getSpeed()) - << " leaderSpeed=" << (neighLead.first == 0 ? -1 : neighLead.first->getSpeed()) - << " secGap=" << (neighLead.first == 0 ? -1 : myVehicle.getCarFollowModel().getSecureGap( - myVehicle.getSpeed(), neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel())) - << " acceptanceTime=" << acceptanceTime - << " fullSpeedGap=" << fullSpeedGap - << " fullSpeedDrivingSeconds=" << fullSpeedDrivingSeconds - << " dProb=" << deltaProb - << "\n"; - } - if (myKeepRightProbability < -CHANGE_PROB_THRESHOLD_RIGHT) { - req = ret | lca | LCA_KEEPRIGHT; - if (!cancelRequest(req)) { - return ret | req; - } - } - } - - if (gDebugFlag2) { - std::cout << STEPS2TIME(currentTime) - << " veh=" << myVehicle.getID() - << " speed=" << myVehicle.getSpeed() - << " myKeepRightProbability=" << myKeepRightProbability - << " thisLaneVSafe=" << thisLaneVSafe - << " neighLaneVSafe=" << neighLaneVSafe - << " relativeGain=" << relativeGain - << " blocked=" << blocked - << "\n"; - } - - if (mySpeedGainProbability < -CHANGE_PROB_THRESHOLD_RIGHT - && neighDist / MAX2((SUMOReal) .1, myVehicle.getSpeed()) > 20.) { //./MAX2((SUMOReal) .1, myVehicle.getSpeed())) { // -.1 - req = ret | lca | LCA_SPEEDGAIN; - if (!cancelRequest(req)) { - return ret | req; - } - } - } else { - // ONLY FOR CHANGING TO THE LEFT - if (thisLaneVSafe > neighLaneVSafe) { - // this lane is better - if (mySpeedGainProbability > 0) { - mySpeedGainProbability /= 2.0; - } - } else { - // left lane is better - mySpeedGainProbability += relativeGain; - } - // VARIANT_19 (stayRight) - //if (neighFollow.first != 0) { - // MSVehicle* nv = neighFollow.first; - // const SUMOReal secGap = nv->getCarFollowModel().getSecureGap(nv->getSpeed(), myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel()); - // if (neighFollow.second < secGap * KEEP_RIGHT_HEADWAY) { - // // do not change left if it would inconvenience faster followers - // return ret | LCA_STAY | LCA_SPEEDGAIN; - // } - //} - if (mySpeedGainProbability > CHANGE_PROB_THRESHOLD_LEFT && neighDist / MAX2((SUMOReal) .1, myVehicle.getSpeed()) > 20.) { // .1 - req = ret | lca | LCA_SPEEDGAIN; - if (!cancelRequest(req)) { - return ret | req; - } - } - } - // -------- - if (changeToBest && bestLaneOffset == curr.bestLaneOffset - && (right ? mySpeedGainProbability < 0 : mySpeedGainProbability > 0)) { - // change towards the correct lane, speedwise it does not hurt - req = ret | lca | LCA_STRATEGIC; - if (!cancelRequest(req)) { - return ret | req; - } - } - if (gDebugFlag2) { - std::cout << STEPS2TIME(currentTime) - << " veh=" << myVehicle.getID() - << " mySpeedGainProbability=" << mySpeedGainProbability - << " myKeepRightProbability=" << myKeepRightProbability - << " thisLaneVSafe=" << thisLaneVSafe - << " neighLaneVSafe=" << neighLaneVSafe - << "\n"; - } - return ret; -} - - -int -MSLCM_JE2013::slowDownForBlocked(MSVehicle** blocked, int state) { - // if this vehicle is blocking someone in front, we maybe decelerate to let him in - if ((*blocked) != 0) { - SUMOReal gap = (*blocked)->getPositionOnLane() - (*blocked)->getVehicleType().getLength() - myVehicle.getPositionOnLane() - myVehicle.getVehicleType().getMinGap(); - if (gDebugFlag2) { - std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - << " veh=" << myVehicle.getID() - << " blocked=" << tryID(*blocked) - << " gap=" << gap - << "\n"; - } - if (gap > POSITION_EPS) { - //const bool blockedWantsUrgentRight = (((*blocked)->getLaneChangeModel().getOwnState() & LCA_RIGHT != 0) - // && ((*blocked)->getLaneChangeModel().getOwnState() & LCA_URGENT != 0)); - - if (myVehicle.getSpeed() < ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel()) - //|| blockedWantsUrgentRight // VARIANT_10 (helpblockedRight) - ) { - if ((*blocked)->getSpeed() < SUMO_const_haltingSpeed) { - state |= LCA_AMBACKBLOCKER_STANDING; - } else { - state |= LCA_AMBACKBLOCKER; - } - myVSafes.push_back(myCarFollowModel.followSpeed( - &myVehicle, myVehicle.getSpeed(), - (SUMOReal)(gap - POSITION_EPS), (*blocked)->getSpeed(), - (*blocked)->getCarFollowModel().getMaxDecel())); - //(*blocked) = 0; // VARIANT_14 (furtherBlock) - } - } - } - return state; -} - - -void -MSLCM_JE2013::saveBlockerLength(MSVehicle* blocker, int lcaCounter) { - if (blocker != 0 && (blocker->getLaneChangeModel().getOwnState() & lcaCounter) != 0) { - // is there enough space in front of us for the blocker? - const SUMOReal potential = myLeftSpace - myVehicle.getCarFollowModel().brakeGap( - myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel(), 0); - if (blocker->getVehicleType().getLengthWithGap() <= potential) { - // save at least his length in myLeadingBlockerLength - myLeadingBlockerLength = MAX2(blocker->getVehicleType().getLengthWithGap(), myLeadingBlockerLength); - if (gDebugFlag2) { - std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - << " veh=" << myVehicle.getID() - << " blocker=" << tryID(blocker) - << " saving myLeadingBlockerLength=" << myLeadingBlockerLength - << "\n"; - } - } else { - // we cannot save enough space for the blocker. It needs to save - // space for ego instead - if (gDebugFlag2) { - std::cout << STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()) - << " veh=" << myVehicle.getID() - << " blocker=" << tryID(blocker) - << " cannot save space=" << blocker->getVehicleType().getLengthWithGap() - << "\n"; - } - blocker->getLaneChangeModel().saveBlockerLength(myVehicle.getVehicleType().getLengthWithGap()); - } - } -} -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLCM_JE2013.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLCM_JE2013.h --- sumo-0.21.0+dfsg/src/microsim/MSLCM_JE2013.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLCM_JE2013.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,197 +0,0 @@ -/****************************************************************************/ -/// @file MSLCM_JE2013.h -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @author Laura Bieker -/// @date Fri, 08.10.2013 -/// @version $Id: MSLCM_JE2013.h 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// A lane change model developed by J. Erdmann -// based on the model of D. Krajzewicz developed between 2004 and 2011 (MSLCM_DK2004) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 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 MSLCM_JE2013_h -#define MSLCM_JE2013_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class MSLCM_JE2013 - * @brief A lane change model developed by J. Erdmann - */ -class MSLCM_JE2013 : public MSAbstractLaneChangeModel { -public: - - enum MyLCAEnum { - LCA_AMBLOCKINGLEADER = 1 << 16, - LCA_AMBLOCKINGFOLLOWER = 1 << 17, - LCA_MRIGHT = 1 << 18, - LCA_MLEFT = 1 << 19, - // !!! never set LCA_UNBLOCK = 1 << 20, - LCA_AMBLOCKINGFOLLOWER_DONTBRAKE = 1 << 21, - // !!! never used LCA_AMBLOCKINGSECONDFOLLOWER = 1 << 22, - LCA_CHANGE_TO_HELP = 1 << 23, - // !!! never read LCA_KEEP1 = 1 << 24, - // !!! never used LCA_KEEP2 = 1 << 25, - LCA_AMBACKBLOCKER = 1 << 26, - LCA_AMBACKBLOCKER_STANDING = 1 << 27 - }; - - - MSLCM_JE2013(MSVehicle& v); - - virtual ~MSLCM_JE2013(); - - /** @brief Called to examine whether the vehicle wants to change - * using the given laneOffset. - * This method gets the information about the surrounding vehicles - * and whether another lane may be more preferable */ - int wantsChange( - int laneOffset, - MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked); - - void* inform(void* info, MSVehicle* sender); - - /** @brief Called to adapt the speed in order to allow a lane change. - * - * @param min The minimum resulting speed - * @param wanted The aspired speed of the car following model - * @param max The maximum resulting speed - * @param cfModel The model used - * @return the new speed of the vehicle as proposed by the lane changer - */ - SUMOReal patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, - const MSCFModel& cfModel); - /** helper function which contains the actual logic */ - SUMOReal _patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, - const MSCFModel& cfModel); - - void changed(); - - void prepareStep(); - - -protected: - - /// @brief helper function for doing the actual work - int _wantsChange( - int laneOffset, - MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked); - - - /* @brief decide whether we will overtake or follow a blocking leader - * and inform it accordingly - * If we decide to follow, myVSafes will be extended - * returns the planned speed if following or -1 if overtaking */ - SUMOReal informLeader(MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, int dir, - const std::pair& neighLead, - SUMOReal remainingSeconds); - - /// @brief decide whether we will try cut in before the follower or allow to be overtaken - void informFollower(MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, int dir, - const std::pair& neighFollow, - SUMOReal remainingSeconds, - SUMOReal plannedSpeed); - - - /// @brief compute useful slowdowns for blocked vehicles - int slowDownForBlocked(MSVehicle** blocked, int state); - - /// @brief save space for vehicles which need to counter-lane-change - void saveBlockerLength(MSVehicle* blocker, int lcaCounter); - - /// @brief reserve space at the end of the lane to avoid dead locks - inline void saveBlockerLength(SUMOReal length) { - myLeadingBlockerLength = MAX2(length, myLeadingBlockerLength); - }; - - inline bool amBlockingLeader() { - return (myOwnState & LCA_AMBLOCKINGLEADER) != 0; - } - inline bool amBlockingFollower() { - return (myOwnState & LCA_AMBLOCKINGFOLLOWER) != 0; - } - inline bool amBlockingFollowerNB() { - return (myOwnState & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0; - } - inline bool amBlockingFollowerPlusNB() { - return (myOwnState & (LCA_AMBLOCKINGFOLLOWER | LCA_AMBLOCKINGFOLLOWER_DONTBRAKE)) != 0; - } - inline bool currentDistDisallows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) { - return dist / (abs(laneOffset)) < lookForwardDist; - } - inline bool currentDistAllows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) { - return dist / abs(laneOffset) > lookForwardDist; - } - - /// @brief information regarding save velocity (unused) and state flags of the ego vehicle - typedef std::pair Info; - - - -protected: - /// @brief a value for tracking the probability that a change to the offset with the same sign is beneficial - SUMOReal mySpeedGainProbability; - /* @brief a value for tracking the probability of following the/"Rechtsfahrgebot" - * A larger negative value indicates higher probability for moving to the - * right (as in mySpeedGainProbability) */ - SUMOReal myKeepRightProbability; - - SUMOReal myLeadingBlockerLength; - SUMOReal myLeftSpace; - - /*@brief the speed to use when computing the look-ahead distance for - * determining urgency of strategic lane changes */ - SUMOReal myLookAheadSpeed; - - std::vector myVSafes; - bool myDontBrake; - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLCM_LC2013.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLCM_LC2013.cpp --- sumo-0.21.0+dfsg/src/microsim/MSLCM_LC2013.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLCM_LC2013.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,780 +0,0 @@ -/****************************************************************************/ -/// @file MSLCM_LC2013.h -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Friedemann Wesner -/// @author Sascha Krieg -/// @author Michael Behrisch -/// @date Fri, 08.10.2013 -/// @version $Id: MSLCM_LC2013.cpp 16560 2014-06-09 20:54:15Z behrisch $ -/// -// A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013 -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 "MSEdge.h" -#include "MSLane.h" -#include "MSNet.h" -#include "MSLCM_LC2013.h" - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - -//#define DEBUG_VEHICLE_GUI_SELECTION 1 -#ifdef DEBUG_VEHICLE_GUI_SELECTION -#include -#include -#include -#endif - - - -// =========================================================================== -// variable definitions -// =========================================================================== -// 80km/h will be the threshold for dividing between long/short foresight -#define LOOK_FORWARD_SPEED_DIVIDER (SUMOReal)14. - -#define LOOK_FORWARD_RIGHT (SUMOReal)10. -#define LOOK_FORWARD_LEFT (SUMOReal)20. - -#define JAM_FACTOR (SUMOReal)1. - -#define LCA_RIGHT_IMPATIENCE (SUMOReal)-1. -#define CUT_IN_LEFT_SPEED_THRESHOLD (SUMOReal)27. - -#define LOOK_AHEAD_MIN_SPEED (SUMOReal)0.0 -#define LOOK_AHEAD_SPEED_MEMORY (SUMOReal)0.9 -#define LOOK_AHEAD_SPEED_DECREMENT 6. - -#define HELP_DECEL_FACTOR (SUMOReal)1.0 - -#define HELP_OVERTAKE (SUMOReal)(10.0 / 3.6) -#define MIN_FALLBEHIND (SUMOReal)(14.0 / 3.6) - -#define KEEP_RIGHT_HEADWAY (SUMOReal)2.0 - -#define URGENCY (SUMOReal)2.0 - -#define ROUNDABOUT_DIST_BONUS (SUMOReal)80.0 - -#define CHANGE_PROB_THRESHOLD_RIGHT (SUMOReal)2.0 -#define CHANGE_PROB_THRESHOLD_LEFT (SUMOReal)0.2 -#define KEEP_RIGHT_TIME (SUMOReal)5.0 // the number of seconds after which a vehicle should move to the right lane -#define KEEP_RIGHT_ACCEPTANCE (SUMOReal)2.0 // calibration factor for determining the desire to keep right - -#define RELGAIN_NORMALIZATION_MIN_SPEED (SUMOReal)10.0 - -// =========================================================================== -// member method definitions -// =========================================================================== -MSLCM_LC2013::MSLCM_LC2013(MSVehicle& v) : - MSAbstractLaneChangeModel(v), - mySpeedGainProbability(0), - myKeepRightProbability(0), - myLeadingBlockerLength(0), - myLeftSpace(0), - myLookAheadSpeed(LOOK_AHEAD_MIN_SPEED) -{} - -MSLCM_LC2013::~MSLCM_LC2013() { - changed(); -} - - -int -MSLCM_LC2013::wantsChange( - int laneOffset, - MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked) { - const int result = _wantsChange(laneOffset, msgPass, blocked, leader, neighLead, neighFollow, neighLane, preb, lastBlocked, firstBlocked); - return result; -} - - -SUMOReal -MSLCM_LC2013::patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel& cfModel) { - const SUMOReal newSpeed = _patchSpeed(min, wanted, max, cfModel); - return newSpeed; -} - - -SUMOReal -MSLCM_LC2013::_patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel& cfModel) { - int state = myOwnState; - - // letting vehicles merge in at the end of the lane in case of counter-lane change, step#2 - SUMOReal MAGIC_offset = 1.; - // if we want to change and have a blocking leader and there is enough room for him in front of us - if (myLeadingBlockerLength != 0) { - SUMOReal space = myLeftSpace - myLeadingBlockerLength - MAGIC_offset - myVehicle.getVehicleType().getMinGap(); - if (space > 0) { - // compute speed for decelerating towards a place which allows the blocking leader to merge in in front - SUMOReal safe = cfModel.stopSpeed(&myVehicle, myVehicle.getSpeed(), space); - // if we are approaching this place - if (safe < wanted) { - // return this speed as the speed to use - return MAX2(min, safe); - } - } - } - - SUMOReal nVSafe = wanted; - bool gotOne = false; - for (std::vector::const_iterator i = myVSafes.begin(); i != myVSafes.end(); ++i) { - SUMOReal v = (*i); - if (v >= min && v <= max) { - nVSafe = MIN2(v, nVSafe); - gotOne = true; - } else { - } - } - - if (gotOne && !myDontBrake) { - return nVSafe; - } - - // check whether the vehicle is blocked - if ((state & LCA_WANTS_LANECHANGE) != 0 && (state & LCA_BLOCKED) != 0) { - if ((state & LCA_STRATEGIC) != 0) { - // necessary decelerations are controlled via vSafe. If there are - // none it means we should speed up - return (max + wanted) / (SUMOReal) 2.0; - } else if ((state & LCA_COOPERATIVE) != 0) { - // only minor adjustments in speed should be done - if ((state & LCA_BLOCKED_BY_LEADER) != 0) { - return (min + wanted) / (SUMOReal) 2.0; - } - if ((state & LCA_BLOCKED_BY_FOLLOWER) != 0) { - return (max + wanted) / (SUMOReal) 2.0; - } - } - } - - // accelerate if being a blocking leader or blocking follower not able to brake - // (and does not have to change lanes) - if ((state & LCA_AMBLOCKINGLEADER) != 0) { - return (max + wanted) / (SUMOReal) 2.0; - } - - if ((state & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0) { - } - if (myVehicle.getLane()->getEdge().getLanes().size() == 1) { - // remove chaning information if on a road with a single lane - changed(); - } - return wanted; -} - - -void* -MSLCM_LC2013::inform(void* info, MSVehicle* /* sender */) { - Info* pinfo = (Info*) info; - myVSafes.push_back(pinfo->first); - myOwnState |= pinfo->second; - delete pinfo; - return (void*) true; -} - - -SUMOReal -MSLCM_LC2013::informLeader(MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, - int dir, - const std::pair& neighLead, - SUMOReal remainingSeconds) { - SUMOReal plannedSpeed = MIN2(myVehicle.getSpeed(), - myVehicle.getCarFollowModel().stopSpeed(&myVehicle, myVehicle.getSpeed(), myLeftSpace - myLeadingBlockerLength)); - for (std::vector::const_iterator i = myVSafes.begin(); i != myVSafes.end(); ++i) { - SUMOReal v = (*i); - if (v >= myVehicle.getSpeed() - ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel())) { - plannedSpeed = MIN2(plannedSpeed, v); - } - } - if ((blocked & LCA_BLOCKED_BY_LEADER) != 0) { - assert(neighLead.first != 0); - MSVehicle* nv = neighLead.first; - // decide whether we want to overtake the leader or follow it - const SUMOReal dv = plannedSpeed - nv->getSpeed(); - const SUMOReal overtakeDist = (neighLead.second // drive to back of follower - + nv->getVehicleType().getLengthWithGap() // drive to front of follower - + myVehicle.getVehicleType().getLength() // ego back reaches follower front - + nv->getCarFollowModel().getSecureGap( // save gap to follower - nv->getSpeed(), myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel())); - - if (dv < 0 - // overtaking on the right on an uncongested highway is forbidden (noOvertakeLCLeft) - || (dir == LCA_MLEFT && !myVehicle.congested()) - // not enough space to overtake? - || myLeftSpace < overtakeDist - // not enough time to overtake? - || dv * remainingSeconds < overtakeDist) { - // cannot overtake - msgPass.informNeighLeader(new Info(-1, dir | LCA_AMBLOCKINGLEADER), &myVehicle); - // slow down smoothly to follow leader - const SUMOReal targetSpeed = myCarFollowModel.followSpeed( - &myVehicle, myVehicle.getSpeed(), neighLead.second, nv->getSpeed(), nv->getCarFollowModel().getMaxDecel()); - if (targetSpeed < myVehicle.getSpeed()) { - // slow down smoothly to follow leader - const SUMOReal decel = ACCEL2SPEED(MIN2(myVehicle.getCarFollowModel().getMaxDecel(), - MAX2(MIN_FALLBEHIND, (myVehicle.getSpeed() - targetSpeed) / remainingSeconds))); - const SUMOReal nextSpeed = MIN2(plannedSpeed, myVehicle.getSpeed() - decel); - myVSafes.push_back(nextSpeed); - return nextSpeed; - } else { - // leader is fast enough anyway - myVSafes.push_back(targetSpeed); - return plannedSpeed; - } - } else { - // overtaking, leader should not accelerate - msgPass.informNeighLeader(new Info(nv->getSpeed(), dir | LCA_AMBLOCKINGLEADER), &myVehicle); - return -1; - } - } else if (neighLead.first != 0) { // (remainUnblocked) - // we are not blocked now. make sure we stay far enough from the leader - MSVehicle* nv = neighLead.first; - const SUMOReal nextNVSpeed = nv->getSpeed() - HELP_OVERTAKE; // conservative - const SUMOReal dv = SPEED2DIST(myVehicle.getSpeed() - nextNVSpeed); - const SUMOReal targetSpeed = myCarFollowModel.followSpeed( - &myVehicle, myVehicle.getSpeed(), neighLead.second - dv, nextNVSpeed, nv->getCarFollowModel().getMaxDecel()); - myVSafes.push_back(targetSpeed); - return MIN2(targetSpeed, plannedSpeed); - } else { - // not overtaking - return plannedSpeed; - } -} - - -void -MSLCM_LC2013::informFollower(MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, - int dir, - const std::pair& neighFollow, - SUMOReal remainingSeconds, - SUMOReal plannedSpeed) { - if ((blocked & LCA_BLOCKED_BY_FOLLOWER) != 0) { - assert(neighFollow.first != 0); - MSVehicle* nv = neighFollow.first; - - // are we fast enough to cut in without any help? - if (plannedSpeed - nv->getSpeed() >= HELP_OVERTAKE) { - const SUMOReal neededGap = nv->getCarFollowModel().getSecureGap(nv->getSpeed(), plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel()); - if ((neededGap - neighFollow.second) / remainingSeconds < (plannedSpeed - nv->getSpeed())) { - // follower might even accelerate but not to much - msgPass.informNeighFollower(new Info(plannedSpeed - HELP_OVERTAKE, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); - return; - } - } - // decide whether we will request help to cut in before the follower or allow to be overtaken - - // PARAMETERS - // assume other vehicle will assume the equivalent of 1 second of - // maximum deceleration to help us (will probably be spread over - // multiple seconds) - // ----------- - const SUMOReal helpDecel = nv->getCarFollowModel().getMaxDecel() * HELP_DECEL_FACTOR ; - - // change in the gap between ego and blocker over 1 second (not STEP!) - const SUMOReal neighNewSpeed = MAX2((SUMOReal)0, nv->getSpeed() - ACCEL2SPEED(helpDecel)); - const SUMOReal neighNewSpeed1s = MAX2((SUMOReal)0, nv->getSpeed() - helpDecel); - const SUMOReal dv = plannedSpeed - neighNewSpeed1s; - // new gap between follower and self in case the follower does brake for 1s - const SUMOReal decelGap = neighFollow.second + dv; - const SUMOReal secureGap = nv->getCarFollowModel().getSecureGap(neighNewSpeed1s, plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel()); - if (decelGap > 0 && decelGap >= secureGap) { - // if the blocking neighbor brakes it could actually help - // how hard does it actually need to be? - const SUMOReal vsafe = MAX2(neighNewSpeed, nv->getCarFollowModel().followSpeed( - nv, nv->getSpeed(), neighFollow.second, plannedSpeed, myVehicle.getCarFollowModel().getMaxDecel())); - msgPass.informNeighFollower(new Info(vsafe, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); - } else if (dv > 0 && dv * remainingSeconds > (secureGap - decelGap + POSITION_EPS)) { - // decelerating once is sufficient to open up a large enough gap in time - msgPass.informNeighFollower(new Info(neighNewSpeed, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); - } else { - SUMOReal vhelp = MAX2(nv->getSpeed(), myVehicle.getSpeed() + HELP_OVERTAKE); - //if (dir == LCA_MRIGHT && myVehicle.getWaitingSeconds() > LCA_RIGHT_IMPATIENCE && - // nv->getSpeed() > myVehicle.getSpeed()) { - if (nv->getSpeed() > myVehicle.getSpeed() && - ((dir == LCA_MRIGHT && myVehicle.getWaitingSeconds() > LCA_RIGHT_IMPATIENCE) - || (dir == LCA_MLEFT && plannedSpeed > CUT_IN_LEFT_SPEED_THRESHOLD) // VARIANT_22 (slowDownLeft) - )) { - // let the follower slow down to increase the likelyhood that later vehicles will be slow enough to help - // follower should still be fast enough to open a gap - vhelp = MAX2(neighNewSpeed, myVehicle.getSpeed() + HELP_OVERTAKE); - if ((nv->getSpeed() - myVehicle.getSpeed()) / helpDecel < remainingSeconds) { - msgPass.informNeighFollower(new Info(vhelp, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); - return; - } - } - msgPass.informNeighFollower(new Info(vhelp, dir | LCA_AMBLOCKINGFOLLOWER), &myVehicle); - // this follower is supposed to overtake us. slow down smoothly to allow this - const SUMOReal overtakeDist = (neighFollow.second // follower reaches ego back - + myVehicle.getVehicleType().getLengthWithGap() // follower reaches ego front - + nv->getVehicleType().getLength() // follower back at ego front - + myVehicle.getCarFollowModel().getSecureGap( // follower has safe dist to ego - plannedSpeed, vhelp, nv->getCarFollowModel().getMaxDecel())); - // speed difference to create a sufficiently large gap - const SUMOReal needDV = overtakeDist / remainingSeconds; - // make sure the deceleration is not to strong - myVSafes.push_back(MAX2(vhelp - needDV, myVehicle.getSpeed() - ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel()))); - } - } -} - - -void -MSLCM_LC2013::prepareStep() { - myOwnState = 0; - myLeadingBlockerLength = 0; - myLeftSpace = 0; - myVSafes.clear(); - myDontBrake = false; - // truncate to work around numerical instability between different builds - mySpeedGainProbability = ceil(mySpeedGainProbability * 100000.0) * 0.00001; - myKeepRightProbability = ceil(myKeepRightProbability * 100000.0) * 0.00001; -} - - -void -MSLCM_LC2013::changed() { - myOwnState = 0; - myLastLaneChangeOffset = 0; - mySpeedGainProbability = 0; - myKeepRightProbability = 0; - if (myVehicle.getBestLaneOffset() == 0) { - // if we are not yet on our best lane there might still be unseen blockers - // (during patchSpeed) - myLeadingBlockerLength = 0; - myLeftSpace = 0; - } - myLookAheadSpeed = LOOK_AHEAD_MIN_SPEED; - myVSafes.clear(); - myDontBrake = false; -} - - -int -MSLCM_LC2013::_wantsChange( - int laneOffset, - MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked) { - assert(laneOffset == 1 || laneOffset == -1); - const SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); - // compute bestLaneOffset - MSVehicle::LaneQ curr, neigh, best; - int bestLaneOffset = 0; - SUMOReal currentDist = 0; - SUMOReal neighDist = 0; - int currIdx = 0; - MSLane* prebLane = myVehicle.getLane(); - if (prebLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { - // internal edges are not kept inside the bestLanes structure - prebLane = prebLane->getLinkCont()[0]->getLane(); - } - for (int p = 0; p < (int) preb.size(); ++p) { - if (preb[p].lane == prebLane && p + laneOffset >= 0) { - assert(p + laneOffset < (int)preb.size()); - curr = preb[p]; - neigh = preb[p + laneOffset]; - currentDist = curr.length; - neighDist = neigh.length; - bestLaneOffset = curr.bestLaneOffset; - if (bestLaneOffset == 0 && preb[p + laneOffset].bestLaneOffset == 0) { - bestLaneOffset = laneOffset; - } - best = preb[p + bestLaneOffset]; - currIdx = p; - break; - } - } - // direction specific constants - const bool right = (laneOffset == -1); - const int lca = (right ? LCA_RIGHT : LCA_LEFT); - const int myLca = (right ? LCA_MRIGHT : LCA_MLEFT); - const int lcaCounter = (right ? LCA_LEFT : LCA_RIGHT); - const bool changeToBest = (right && bestLaneOffset < 0) || (!right && bestLaneOffset > 0); - // keep information about being a leader/follower - int ret = (myOwnState & 0xffff0000); - int req = 0; // the request to change or stay - - ret = slowDownForBlocked(lastBlocked, ret); - if (lastBlocked != firstBlocked) { - ret = slowDownForBlocked(firstBlocked, ret); - } - - - // we try to estimate the distance which is necessary to get on a lane - // we have to get on in order to keep our route - // we assume we need something that depends on our velocity - // and compare this with the free space on our wished lane - // - // if the free space is somehow less than the space we need, we should - // definitely try to get to the desired lane - // - // this rule forces our vehicle to change the lane if a lane changing is necessary soon - // lookAheadDistance: - // we do not want the lookahead distance to change all the time so we discrectize the speed a bit - - if (myVehicle.getSpeed() > myLookAheadSpeed) { - myLookAheadSpeed = myVehicle.getSpeed(); - } else { - myLookAheadSpeed = MAX2(LOOK_AHEAD_MIN_SPEED, - (LOOK_AHEAD_SPEED_MEMORY * myLookAheadSpeed + (1 - LOOK_AHEAD_SPEED_MEMORY) * myVehicle.getSpeed())); - } - SUMOReal laDist = myLookAheadSpeed * (right ? LOOK_FORWARD_RIGHT : LOOK_FORWARD_LEFT); - laDist += myVehicle.getVehicleType().getLengthWithGap() * (SUMOReal) 2.; - // free space that is available for changing - //const SUMOReal neighSpeed = (neighLead.first != 0 ? neighLead.first->getSpeed() : - // neighFollow.first != 0 ? neighFollow.first->getSpeed() : - // best.lane->getSpeedLimit()); - // @note: while this lets vehicles change earlier into the correct direction - // it also makes the vehicles more "selfish" and prevents changes which are necessary to help others - - int roundaboutEdgesAhead = 0; - for (std::vector::iterator it = curr.bestContinuations.begin(); it != curr.bestContinuations.end(); ++it) { - if ((*it) != 0 && (*it)->getEdge().isRoundabout()) { - roundaboutEdgesAhead += 1; - } else if (roundaboutEdgesAhead > 0) { - // only check the next roundabout - break; - } - } - int roundaboutEdgesAheadNeigh = 0; - for (std::vector::iterator it = neigh.bestContinuations.begin(); it != neigh.bestContinuations.end(); ++it) { - if ((*it) != 0 && (*it)->getEdge().isRoundabout()) { - roundaboutEdgesAheadNeigh += 1; - } else if (roundaboutEdgesAheadNeigh > 0) { - // only check the next roundabout - break; - } - } - if (roundaboutEdgesAhead > 1) { - currentDist += roundaboutEdgesAhead * ROUNDABOUT_DIST_BONUS; - neighDist += roundaboutEdgesAheadNeigh * ROUNDABOUT_DIST_BONUS; - } - - const SUMOReal usableDist = (currentDist - myVehicle.getPositionOnLane() - best.occupation * JAM_FACTOR); - const SUMOReal maxJam = MAX2(preb[currIdx + laneOffset].occupation, preb[currIdx].occupation); - const SUMOReal neighLeftPlace = MAX2((SUMOReal) 0, neighDist - myVehicle.getPositionOnLane() - maxJam); - - if (changeToBest && bestLaneOffset == curr.bestLaneOffset - && currentDistDisallows(usableDist, bestLaneOffset, laDist)) { - /// @brief we urgently need to change lanes to follow our route - ret = ret | lca | LCA_STRATEGIC | LCA_URGENT; - } else { - - if (!myAllowOvertakingRight && !right && !myVehicle.congested() && neighLead.first != 0) { - // check for slower leader on the left. we should not overtake but - // rather move left ourselves (unless congested) - MSVehicle* nv = neighLead.first; - if (nv->getSpeed() < myVehicle.getSpeed()) { - myVSafes.push_back(myCarFollowModel.followSpeed( - &myVehicle, myVehicle.getSpeed(), neighLead.second, nv->getSpeed(), nv->getCarFollowModel().getMaxDecel())); - if (nv->getSpeed() + 5 / 3.6 < myVehicle.getSpeed()) { - mySpeedGainProbability += CHANGE_PROB_THRESHOLD_LEFT / 3; - } - } - } - - if (!changeToBest && (currentDistDisallows(neighLeftPlace, abs(bestLaneOffset) + 2, laDist))) { - // the opposite lane-changing direction should be done than the one examined herein - // we'll check whether we assume we could change anyhow and get back in time... - // - // this rule prevents the vehicle from moving in opposite direction of the best lane - // unless the way till the end where the vehicle has to be on the best lane - // is long enough - ret = ret | LCA_STAY | LCA_STRATEGIC; - } else if (bestLaneOffset == 0 && (neighLeftPlace * 2. < laDist)) { - // the current lane is the best and a lane-changing would cause a situation - // of which we assume we will not be able to return to the lane we have to be on. - // this rule prevents the vehicle from leaving the current, best lane when it is - // close to this lane's end - ret = ret | LCA_STAY | LCA_STRATEGIC; - } - } - // check for overriding TraCI requests - ret = myVehicle.influenceChangeDecision(ret); - if ((ret & lcaCounter) != 0) { - // we are not interested in traci requests for the opposite direction here - ret &= ~(LCA_TRACI | lcaCounter | LCA_URGENT); - } - - if ((ret & LCA_STAY) != 0) { - return ret; - } - if ((ret & LCA_URGENT) != 0) { - // prepare urgent lane change maneuver - // save the left space - myLeftSpace = currentDist - myVehicle.getPositionOnLane(); - if (changeToBest && abs(bestLaneOffset) > 1) { - // there might be a vehicle which needs to counter-lane-change one lane further and we cannot see it yet - myLeadingBlockerLength = MAX2((SUMOReal)(right ? 20.0 : 40.0), myLeadingBlockerLength); - } - - // letting vehicles merge in at the end of the lane in case of counter-lane change, step#1 - // if there is a leader and he wants to change to the opposite direction - saveBlockerLength(neighLead.first, lcaCounter); - if (*firstBlocked != neighLead.first) { - saveBlockerLength(*firstBlocked, lcaCounter); - } - - const SUMOReal remainingSeconds = ((ret & LCA_TRACI) == 0 ? - MAX2((SUMOReal)STEPS2TIME(TS), myLeftSpace / MAX2(myLookAheadSpeed, NUMERICAL_EPS) / abs(bestLaneOffset) / URGENCY) : - myVehicle.getInfluencer().changeRequestRemainingSeconds(currentTime)); - const SUMOReal plannedSpeed = informLeader(msgPass, blocked, myLca, neighLead, remainingSeconds); - if (plannedSpeed >= 0) { - // maybe we need to deal with a blocking follower - informFollower(msgPass, blocked, myLca, neighFollow, remainingSeconds, plannedSpeed); - } - - return ret; - } - - if (roundaboutEdgesAhead > 1) { - // try to use the inner lanes of a roundabout to increase throughput - // unless we are approaching the exit - if (lca == LCA_LEFT) { - req = ret | lca | LCA_COOPERATIVE; - } else { - req = ret | LCA_STAY | LCA_COOPERATIVE; - } - if (!cancelRequest(req)) { - return ret | req; - } - } - - // let's also regard the case where the vehicle is driving on a highway... - // in this case, we do not want to get to the dead-end of an on-ramp - if (right) { - if (bestLaneOffset == 0 && myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle) > 80. / 3.6 && myLookAheadSpeed > SUMO_const_haltingSpeed) { - req = ret | LCA_STAY | LCA_STRATEGIC; - if (!cancelRequest(req)) { - return ret | req; - } - } - } - // -------- - - // -------- make place on current lane if blocking follower - //if (amBlockingFollowerPlusNB()) { - // std::cout << myVehicle.getID() << ", " << currentDistAllows(neighDist, bestLaneOffset, laDist) - // << " neighDist=" << neighDist - // << " currentDist=" << currentDist - // << "\n"; - //} - if (amBlockingFollowerPlusNB() - && (changeToBest || currentDistAllows(neighDist, abs(bestLaneOffset) + 1, laDist))) { - - req = ret | lca | LCA_COOPERATIVE | LCA_URGENT ;//| LCA_CHANGE_TO_HELP; - if (!cancelRequest(req)) { - return ret | req; - } - } - - // -------- - - - //// -------- security checks for krauss - //// (vsafe fails when gap<0) - //if ((blocked & LCA_BLOCKED) != 0) { - // return ret; - //} - //// -------- - - // -------- higher speed - //if ((congested(neighLead.first) && neighLead.second < 20) || predInteraction(leader.first)) { //!!! - // return ret; - //} - 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 { - // @todo: what if leader is below safe gap?!!! - neighLaneVSafe = MIN2(neighLaneVSafe, myCarFollowModel.followSpeed( - &myVehicle, myVehicle.getSpeed(), neighLead.second, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel())); - } - if (leader.first == 0) { - thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), currentDist, 0, 0)); - } else { - // @todo: what if leader is below safe gap?!!! - thisLaneVSafe = MIN2(thisLaneVSafe, myCarFollowModel.followSpeed(&myVehicle, myVehicle.getSpeed(), leader.second, leader.first->getSpeed(), leader.first->getCarFollowModel().getMaxDecel())); - } - - const SUMOReal vMax = MIN2(myVehicle.getVehicleType().getMaxSpeed(), myVehicle.getLane()->getVehicleMaxSpeed(&myVehicle)); - thisLaneVSafe = MIN2(thisLaneVSafe, vMax); - neighLaneVSafe = MIN2(neighLaneVSafe, vMax); - const SUMOReal relativeGain = (neighLaneVSafe - thisLaneVSafe) / MAX2(neighLaneVSafe, - RELGAIN_NORMALIZATION_MIN_SPEED); - - if (right) { - // ONLY FOR CHANGING TO THE RIGHT - if (thisLaneVSafe - 5 / 3.6 > neighLaneVSafe) { - // ok, the current lane is faster than the right one... - if (mySpeedGainProbability < 0) { - mySpeedGainProbability /= 2.0; - //myKeepRightProbability /= 2.0; - } - } else { - // ok, the current lane is not faster than the right one - mySpeedGainProbability -= relativeGain; - - // honor the obligation to keep right (Rechtsfahrgebot) - // XXX consider fast approaching followers on the current lane - //const SUMOReal vMax = myLookAheadSpeed; - const SUMOReal acceptanceTime = KEEP_RIGHT_ACCEPTANCE * vMax * MAX2((SUMOReal)1, myVehicle.getSpeed()) / myVehicle.getLane()->getSpeedLimit(); - SUMOReal fullSpeedGap = MAX2((SUMOReal)0, neighDist - myVehicle.getCarFollowModel().brakeGap(vMax)); - SUMOReal fullSpeedDrivingSeconds = MIN2(acceptanceTime, fullSpeedGap / vMax); - if (neighLead.first != 0 && neighLead.first->getSpeed() < vMax) { - fullSpeedGap = MAX2((SUMOReal)0, MIN2(fullSpeedGap, - neighLead.second - myVehicle.getCarFollowModel().getSecureGap( - vMax, neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel()))); - fullSpeedDrivingSeconds = MIN2(fullSpeedDrivingSeconds, fullSpeedGap / (vMax - neighLead.first->getSpeed())); - } - const SUMOReal deltaProb = (CHANGE_PROB_THRESHOLD_RIGHT - * STEPS2TIME(DELTA_T) - * (fullSpeedDrivingSeconds / acceptanceTime) / KEEP_RIGHT_TIME); - myKeepRightProbability -= deltaProb; - - if (gDebugFlag2) { - std::cout << STEPS2TIME(currentTime) - << " veh=" << myVehicle.getID() - << " vMax=" << vMax - << " neighDist=" << neighDist - << " brakeGap=" << myVehicle.getCarFollowModel().brakeGap(myVehicle.getSpeed()) - << " leaderSpeed=" << (neighLead.first == 0 ? -1 : neighLead.first->getSpeed()) - << " secGap=" << (neighLead.first == 0 ? -1 : myVehicle.getCarFollowModel().getSecureGap( - myVehicle.getSpeed(), neighLead.first->getSpeed(), neighLead.first->getCarFollowModel().getMaxDecel())) - << " acceptanceTime=" << acceptanceTime - << " fullSpeedGap=" << fullSpeedGap - << " fullSpeedDrivingSeconds=" << fullSpeedDrivingSeconds - << " dProb=" << deltaProb - << "\n"; - } - if (myKeepRightProbability < -CHANGE_PROB_THRESHOLD_RIGHT) { - req = ret | lca | LCA_KEEPRIGHT; - if (!cancelRequest(req)) { - return ret | req; - } - } - } - - if (mySpeedGainProbability < -CHANGE_PROB_THRESHOLD_RIGHT - && neighDist / MAX2((SUMOReal) .1, myVehicle.getSpeed()) > 20.) { //./MAX2((SUMOReal) .1, myVehicle.getSpeed())) { // -.1 - req = ret | lca | LCA_SPEEDGAIN; - if (!cancelRequest(req)) { - return ret | req; - } - } - } else { - // ONLY FOR CHANGING TO THE LEFT - if (thisLaneVSafe > neighLaneVSafe) { - // this lane is better - if (mySpeedGainProbability > 0) { - mySpeedGainProbability /= 2.0; - } - } else { - // left lane is better - mySpeedGainProbability += relativeGain; - } - if (mySpeedGainProbability > CHANGE_PROB_THRESHOLD_LEFT && neighDist / MAX2((SUMOReal) .1, myVehicle.getSpeed()) > 20.) { // .1 - req = ret | lca | LCA_SPEEDGAIN; - if (!cancelRequest(req)) { - return ret | req; - } - } - } - // -------- - if (changeToBest && bestLaneOffset == curr.bestLaneOffset - && (right ? mySpeedGainProbability < 0 : mySpeedGainProbability > 0)) { - // change towards the correct lane, speedwise it does not hurt - req = ret | lca | LCA_STRATEGIC; - if (!cancelRequest(req)) { - return ret | req; - } - } - - return ret; -} - - -int -MSLCM_LC2013::slowDownForBlocked(MSVehicle** blocked, int state) { - // if this vehicle is blocking someone in front, we maybe decelerate to let him in - if ((*blocked) != 0) { - SUMOReal gap = (*blocked)->getPositionOnLane() - (*blocked)->getVehicleType().getLength() - myVehicle.getPositionOnLane() - myVehicle.getVehicleType().getMinGap(); - if (gap > POSITION_EPS) { - if (myVehicle.getSpeed() < ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxDecel())) { - if ((*blocked)->getSpeed() < SUMO_const_haltingSpeed) { - state |= LCA_AMBACKBLOCKER_STANDING; - } else { - state |= LCA_AMBACKBLOCKER; - } - myVSafes.push_back(myCarFollowModel.followSpeed( - &myVehicle, myVehicle.getSpeed(), - (SUMOReal)(gap - POSITION_EPS), (*blocked)->getSpeed(), - (*blocked)->getCarFollowModel().getMaxDecel())); - } - } - } - return state; -} - - -void -MSLCM_LC2013::saveBlockerLength(MSVehicle* blocker, int lcaCounter) { - if (blocker != 0 && (blocker->getLaneChangeModel().getOwnState() & lcaCounter) != 0) { - // is there enough space in front of us for the blocker? - const SUMOReal potential = myLeftSpace - myVehicle.getCarFollowModel().brakeGap( - myVehicle.getSpeed(), myVehicle.getCarFollowModel().getMaxDecel(), 0); - if (blocker->getVehicleType().getLengthWithGap() <= potential) { - // save at least his length in myLeadingBlockerLength - myLeadingBlockerLength = MAX2(blocker->getVehicleType().getLengthWithGap(), myLeadingBlockerLength); - } else { - // we cannot save enough space for the blocker. It needs to save - // space for ego instead - blocker->getLaneChangeModel().saveBlockerLength(myVehicle.getVehicleType().getLengthWithGap()); - } - } -} -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLCM_LC2013.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLCM_LC2013.h --- sumo-0.21.0+dfsg/src/microsim/MSLCM_LC2013.h 2014-03-06 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLCM_LC2013.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,199 +0,0 @@ -/****************************************************************************/ -/// @file MSLCM_LC2013.h -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Friedemann Wesner -/// @author Sascha Krieg -/// @author Michael Behrisch -/// @date Fri, 08.10.2013 -/// @version $Id: MSLCM_LC2013.h 15861 2014-03-06 16:45:02Z namdre $ -/// -// A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013 -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 MSLCM_LC2013_h -#define MSLCM_LC2013_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class MSLCM_LC2013 - * @brief A lane change model developed by D. Krajzewicz, J. Erdmann - * et al. between 2004 and 2013 - */ -class MSLCM_LC2013 : public MSAbstractLaneChangeModel { -public: - - enum MyLCAEnum { - LCA_AMBLOCKINGLEADER = 1 << 16, - LCA_AMBLOCKINGFOLLOWER = 1 << 17, - LCA_MRIGHT = 1 << 18, - LCA_MLEFT = 1 << 19, - // !!! never set LCA_UNBLOCK = 1 << 20, - LCA_AMBLOCKINGFOLLOWER_DONTBRAKE = 1 << 21, - // !!! never used LCA_AMBLOCKINGSECONDFOLLOWER = 1 << 22, - LCA_CHANGE_TO_HELP = 1 << 23, - // !!! never read LCA_KEEP1 = 1 << 24, - // !!! never used LCA_KEEP2 = 1 << 25, - LCA_AMBACKBLOCKER = 1 << 26, - LCA_AMBACKBLOCKER_STANDING = 1 << 27 - }; - - - MSLCM_LC2013(MSVehicle& v); - - virtual ~MSLCM_LC2013(); - - /** @brief Called to examine whether the vehicle wants to change - * using the given laneOffset. - * This method gets the information about the surrounding vehicles - * and whether another lane may be more preferable */ - int wantsChange( - int laneOffset, - MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked); - - void* inform(void* info, MSVehicle* sender); - - /** @brief Called to adapt the speed in order to allow a lane change. - * - * @param min The minimum resulting speed - * @param wanted The aspired speed of the car following model - * @param max The maximum resulting speed - * @param cfModel The model used - * @return the new speed of the vehicle as proposed by the lane changer - */ - SUMOReal patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, - const MSCFModel& cfModel); - /** helper function which contains the actual logic */ - SUMOReal _patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, - const MSCFModel& cfModel); - - void changed(); - - void prepareStep(); - - -protected: - - /// @brief helper function for doing the actual work - int _wantsChange( - int laneOffset, - MSAbstractLaneChangeModel::MSLCMessager& msgPass, int blocked, - const std::pair& leader, - const std::pair& neighLead, - const std::pair& neighFollow, - const MSLane& neighLane, - const std::vector& preb, - MSVehicle** lastBlocked, - MSVehicle** firstBlocked); - - - /* @brief decide whether we will overtake or follow a blocking leader - * and inform it accordingly - * If we decide to follow, myVSafes will be extended - * returns the planned speed if following or -1 if overtaking */ - SUMOReal informLeader(MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, int dir, - const std::pair& neighLead, - SUMOReal remainingSeconds); - - /// @brief decide whether we will try cut in before the follower or allow to be overtaken - void informFollower(MSAbstractLaneChangeModel::MSLCMessager& msgPass, - int blocked, int dir, - const std::pair& neighFollow, - SUMOReal remainingSeconds, - SUMOReal plannedSpeed); - - - /// @brief compute useful slowdowns for blocked vehicles - int slowDownForBlocked(MSVehicle** blocked, int state); - - /// @brief save space for vehicles which need to counter-lane-change - void saveBlockerLength(MSVehicle* blocker, int lcaCounter); - - /// @brief reserve space at the end of the lane to avoid dead locks - inline void saveBlockerLength(SUMOReal length) { - myLeadingBlockerLength = MAX2(length, myLeadingBlockerLength); - }; - - inline bool amBlockingLeader() { - return (myOwnState & LCA_AMBLOCKINGLEADER) != 0; - } - inline bool amBlockingFollower() { - return (myOwnState & LCA_AMBLOCKINGFOLLOWER) != 0; - } - inline bool amBlockingFollowerNB() { - return (myOwnState & LCA_AMBLOCKINGFOLLOWER_DONTBRAKE) != 0; - } - inline bool amBlockingFollowerPlusNB() { - return (myOwnState & (LCA_AMBLOCKINGFOLLOWER | LCA_AMBLOCKINGFOLLOWER_DONTBRAKE)) != 0; - } - inline bool currentDistDisallows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) { - return dist / (abs(laneOffset)) < lookForwardDist; - } - inline bool currentDistAllows(SUMOReal dist, int laneOffset, SUMOReal lookForwardDist) { - return dist / abs(laneOffset) > lookForwardDist; - } - - /// @brief information regarding save velocity (unused) and state flags of the ego vehicle - typedef std::pair Info; - - - -protected: - /// @brief a value for tracking the probability that a change to the offset with the same sign is beneficial - SUMOReal mySpeedGainProbability; - /* @brief a value for tracking the probability of following the/"Rechtsfahrgebot" - * A larger negative value indicates higher probability for moving to the - * right (as in mySpeedGainProbability) */ - SUMOReal myKeepRightProbability; - - SUMOReal myLeadingBlockerLength; - SUMOReal myLeftSpace; - - /*@brief the speed to use when computing the look-ahead distance for - * determining urgency of strategic lane changes */ - SUMOReal myLookAheadSpeed; - - std::vector myVSafes; - bool myDontBrake; - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLinkCont.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLinkCont.cpp --- sumo-0.21.0+dfsg/src/microsim/MSLinkCont.cpp 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLinkCont.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date 15 Feb 2004 -/// @version $Id: MSLinkCont.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSLinkCont.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Helpers for link vector /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLinkCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLinkCont.h --- sumo-0.21.0+dfsg/src/microsim/MSLinkCont.h 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLinkCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: MSLinkCont.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSLinkCont.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A vector of links /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLink.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLink.cpp --- sumo-0.21.0+dfsg/src/microsim/MSLink.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLink.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: MSLink.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSLink.cpp 18148 2015-03-25 13:39:50Z namdre $ /// // A connnection between lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -37,11 +37,11 @@ #include "MSNet.h" #include "MSLink.h" #include "MSLane.h" -#include "MSPerson.h" +#include #include "MSEdge.h" #include "MSGlobals.h" #include "MSVehicle.h" -#include "MSPModel.h" +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -63,20 +63,25 @@ myLane(succLane), myIndex(-1), myState(state), + myLastStateChange(-1), myDirection(dir), myLength(length), myHasFoes(false), - myAmCont(false) + myAmCont(false), + myJunction(0) #else MSLink::MSLink(MSLane* succLane, MSLane* via, LinkDirection dir, LinkState state, SUMOReal length) : myLane(succLane), myIndex(-1), myState(state), + myLastStateChange(-1), myDirection(dir), myLength(length), myHasFoes(false), myAmCont(false), - myJunctionInlane(via) + myJunctionInlane(via), + myInternalLaneBefore(0), + myJunction(0) #endif {} @@ -93,11 +98,13 @@ myHasFoes = hasFoes; myAmCont = isCont; myFoeLinks = foeLinks; - myFoeLanes = foeLanes; -#ifdef MSLink_DEBUG_CROSSING_POINTS - std::cout << " link " << myIndex << " to " << getViaLaneOrLane()->getID() << " has foes: " << toString(foeLanes) << "\n"; -#endif + for (std::vector::const_iterator it_lane = foeLanes.begin(); it_lane != foeLanes.end(); ++it_lane) { + // cannot assign vector due to const-ness + myFoeLanes.push_back(*it_lane); + } + myJunction = myLane->getEdge().getFromJunction(); // junctionGraph is initialized after the whole network is loaded #ifdef HAVE_INTERNAL_LANES + myInternalLaneBefore = internalLaneBefore; MSLane* lane = 0; if (internalLaneBefore != 0) { // this is an exit link. compute crossing points with all foeLanes @@ -107,9 +114,16 @@ // // @note not currently used by pedestrians // lane = myLane; } +#ifdef MSLink_DEBUG_CROSSING_POINTS + std::cout << " link " << myIndex << " to " << getViaLaneOrLane()->getID() << " internalLane=" << (lane == 0 ? "NULL" : lane->getID()) << " has foes: " << toString(foeLanes) << "\n"; +#endif if (lane != 0) { - for (std::vector::const_iterator it_lane = myFoeLanes.begin(); it_lane != myFoeLanes.end(); ++it_lane) { - if (myLane == (*it_lane)->getLinkCont()[0]->getLane() && !lane->getLinkCont()[0]->getViaLaneOrLane()->getEdge().isInternal()) { + const bool beforeInternalJunction = lane->getLinkCont()[0]->getViaLaneOrLane()->getEdge().isInternal(); + assert(lane->getIncomingLanes().size() == 1); + // compute crossing points + for (std::vector::const_iterator it_lane = myFoeLanes.begin(); it_lane != myFoeLanes.end(); ++it_lane) { + const bool sameTarget = myLane == (*it_lane)->getLinkCont()[0]->getLane(); + if (sameTarget && !beforeInternalJunction) { //if (myLane == (*it_lane)->getLinkCont()[0]->getLane()) { // this foeLane has the same target and merges at the end (lane exits the junction) myLengthsBehindCrossing.push_back(std::make_pair(0, 0)); // dummy value, never used @@ -124,22 +138,44 @@ #endif } else { std::vector intersections1 = lane->getShape().intersectsAtLengths2D((*it_lane)->getShape()); - //std::cout << " number of intersections1=" << intersections1.size() << "\n"; +#ifdef MSLink_DEBUG_CROSSING_POINTS + //std::cout << " intersections1=" << toString(intersections1) << "\n"; +#endif + bool haveIntersection = true; if (intersections1.size() == 0) { - intersections1.push_back(10000.0); // disregard this foe (using maxdouble leads to nasty problems down the line) + intersections1.push_back(-10000.0); // disregard this foe (using maxdouble leads to nasty problems down the line) + haveIntersection = false; } else if (intersections1.size() > 1) { std::sort(intersections1.begin(), intersections1.end()); } std::vector intersections2 = (*it_lane)->getShape().intersectsAtLengths2D(lane->getShape()); - //std::cout << " number of intersections2=" << intersections2.size() << "\n"; +#ifdef MSLink_DEBUG_CROSSING_POINTS + //std::cout << " intersections2=" << toString(intersections2) << "\n"; +#endif if (intersections2.size() == 0) { intersections2.push_back(0); } else if (intersections2.size() > 1) { std::sort(intersections2.begin(), intersections2.end()); } + if (haveIntersection) { + // lane width affects the crossing point + intersections1.back() -= (*it_lane)->getWidth() / 2; + intersections2.back() -= lane->getWidth() / 2; + // also length/geometry factor + intersections1.back() = lane->interpolateGeometryPosToLanePos(intersections1.back()); + intersections2.back() = (*it_lane)->interpolateGeometryPosToLanePos(intersections2.back()); + + if (internalLaneBefore->getLogicalPredecessorLane()->getEdge().isInternal() && !(*it_lane)->getEdge().isCrossing()) { + // wait at the internal junction + // (except for foes that are crossings since there is no internal junction) + intersections1.back() = 0; + } + } + myLengthsBehindCrossing.push_back(std::make_pair( lane->getLength() - intersections1.back(), (*it_lane)->getLength() - intersections2.back())); + #ifdef MSLink_DEBUG_CROSSING_POINTS std::cout << " intersection of " << lane->getID() @@ -152,6 +188,36 @@ #endif } } + // check for overlap with internal lanes from the same source lane + const MSLane* pred = lane->getLogicalPredecessorLane(); + // to avoid overlap with vehicles that came from pred (especially when pred has endOffset > 0) + // we add all other internal lanes from pred as foeLanes + const MSLinkCont& predLinks = pred->getLinkCont(); + for (MSLinkCont::const_iterator it = predLinks.begin(); it != predLinks.end(); ++it) { + const MSLane* sibling = (*it)->getViaLane(); + if (sibling != lane && sibling != 0) { + std::vector intersections1 = lane->getShape().intersectsAtLengths2D(sibling->getShape()); +#ifdef MSLink_DEBUG_CROSSING_POINTS + //std::cout << " intersections1=" << toString(intersections1) << "\n"; +#endif + if (intersections1.size() > 0) { + std::sort(intersections1.begin(), intersections1.end()); + if (intersections1.back() > NUMERICAL_EPS) { + // siblings share a common shape up to the last crossing point so intersections are identical and only need to be computed once + myLengthsBehindCrossing.push_back(std::make_pair( + lane->getLength() - intersections1.back(), + sibling->getLength() - intersections1.back())); + myFoeLanes.push_back(sibling); +#ifdef MSLink_DEBUG_CROSSING_POINTS + std::cout << " adding same-origin foe" << sibling->getID() + << " dist1=" << myLengthsBehindCrossing.back().first + << " dist2=" << myLengthsBehindCrossing.back().second + << "\n"; +#endif + } + } + } + } } #else UNUSED_PARAMETER(internalLaneBefore); @@ -159,6 +225,9 @@ } +std::pair +getLastIntersections(const MSLane* lane, const MSLane* foe); + void MSLink::setApproaching(const SUMOVehicle* approaching, const SUMOTime arrivalTime, const SUMOReal arrivalSpeed, const SUMOReal leaveSpeed, const bool setRequest, const SUMOTime arrivalTimeBraking, const SUMOReal arrivalSpeedBraking, const SUMOTime waitingTime) { @@ -215,7 +284,7 @@ MSLink::opened(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength, SUMOReal impatience, SUMOReal decel, SUMOTime waitingTime, std::vector* collectFoes) const { - if (myState == LINKSTATE_TL_RED) { + if (haveRed()) { return false; } if (myAmCont && MSGlobals::gUsingInternalLanes) { @@ -228,7 +297,7 @@ for (std::vector::const_iterator i = myFoeLinks.begin(); i != myFoeLinks.end(); ++i) { #ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { - if ((*i)->getState() == LINKSTATE_TL_RED) { + if ((*i)->haveRed()) { continue; } } @@ -323,7 +392,7 @@ return true; } } - for (std::vector::const_iterator i = myFoeLanes.begin(); i != myFoeLanes.end(); ++i) { + for (std::vector::const_iterator i = myFoeLanes.begin(); i != myFoeLanes.end(); ++i) { if ((*i)->getVehicleNumber() > 0 || (*i)->getPartialOccupator() != 0) { return true; } @@ -339,7 +408,10 @@ void -MSLink::setTLState(LinkState state, SUMOTime /*t*/) { +MSLink::setTLState(LinkState state, SUMOTime t) { + if (myState != state) { + myLastStateChange = t; + } myState = state; } @@ -349,6 +421,33 @@ return myLane; } +MSLane* +MSLink::getApproachingLane() const { + MSLane* approachedLane; //the lane approached by this link; this lane may be an internal lane +#ifdef HAVE_INTERNAL_LANES + if (myJunctionInlane != 0) { // if there is an internal lane + approachedLane = myJunctionInlane; //consider the internal lane as the approached lane + } else { //if ther is no internal lane + approachedLane = myLane; + } +#else + approachedLane = myLane; +#endif + const std::vector possibleLanes = approachedLane->getIncomingLanes(); + std::vector::const_iterator i; + for (i = possibleLanes.begin(); i != possibleLanes.end(); i++) { + MSLane* lane = (*i).lane; + MSLinkCont outgoingLinks = lane->getLinkCont(); //the links outgoing from lane + for (MSLinkCont::const_iterator j = outgoingLinks.begin(); j != outgoingLinks.end(); j++) { + if ((*j) == this) { + return lane; + } + } + } + WRITE_WARNING("No approaching lane found for the link with the index " + toString(this->getIndex()) + "."); + return 0; +} + bool MSLink::lastWasContMajor() const { @@ -419,18 +518,23 @@ MSLink::LinkLeaders MSLink::getLeaderInfo(SUMOReal dist, SUMOReal minGap, std::vector* collectBlockers) const { LinkLeaders result; + //gDebugFlag1 = true; // this link needs to start at an internal lane (either an exit link or between two internal lanes) if (MSGlobals::gUsingInternalLanes && ( - (myJunctionInlane == 0 && getLane()->getEdge().getPurpose() != MSEdge::EDGEFUNCTION_INTERNAL) + (myJunctionInlane == 0 && getLane()->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_NORMAL) || (myJunctionInlane != 0 && myJunctionInlane->getLogicalPredecessorLane()->getEdge().isInternal()))) { - //std::cout << " getLeaderInfo link=" << getViaLaneOrLane()->getID() << "\n"; + //if (gDebugFlag1) std::cout << SIMTIME << " getLeaderInfo link=" << getViaLaneOrLane()->getID() << "\n"; // this is an exit link for (size_t i = 0; i < myFoeLanes.size(); ++i) { - MSLane* foeLane = myFoeLanes[i]; + const MSLane* foeLane = myFoeLanes[i]; // distance from the querying vehicle to the crossing point with foeLane const SUMOReal distToCrossing = dist - myLengthsBehindCrossing[i].first; - //std::cout << " distToCrossing=" << distToCrossing << " foeLane=" << foeLane->getID() << "\n"; - if (distToCrossing < 0) { + const bool sameTarget = (myLane == foeLane->getLinkCont()[0]->getLane()); + const bool sameSource = (myInternalLaneBefore != 0 && myInternalLaneBefore->getLogicalPredecessorLane() == foeLane->getLogicalPredecessorLane()); + const SUMOReal crossingWidth = (sameTarget || sameSource) ? 0 : foeLane->getWidth(); + const SUMOReal foeCrossingWidth = (sameTarget || sameSource) ? 0 : myInternalLaneBefore->getWidth(); + //if (gDebugFlag1) std::cout << " distToCrossing=" << distToCrossing << " foeLane=" << foeLane->getID() << "\n"; + if (distToCrossing + crossingWidth < 0) { continue; // vehicle is behind the crossing point, continue with next foe lane } const SUMOReal foeDistToCrossing = foeLane->getLength() - myLengthsBehindCrossing[i].second; @@ -440,24 +544,26 @@ // special care must be taken for continuation lanes. (next lane is also internal) // vehicles on these lanes should always block (gap = -1) const bool contLane = (foeLane->getLinkCont()[0]->getViaLaneOrLane()->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL); - const bool sameTarget = (myLane == foeLane->getLinkCont()[0]->getLane()); // vehicles on cont. lanes or on internal lanes with the same target as this link can never be ignored - const bool cannotIgnore = contLane || sameTarget; + const bool cannotIgnore = contLane || sameTarget || sameSource; const MSLane::VehCont& vehicles = foeLane->getVehiclesSecure(); foeLane->releaseVehicles(); for (MSLane::VehCont::const_iterator it_veh = vehicles.begin(); it_veh != vehicles.end(); ++it_veh) { MSVehicle* leader = *it_veh; + if (!cannotIgnore && !foeLane->getLinkCont()[0]->getApproaching(leader).willPass) { + continue; + } if (cannotIgnore || leader->getWaitingTime() < MSGlobals::gIgnoreJunctionBlocker) { // compute distance between vehicles on the the superimposition of both lanes // where the crossing point is the common point SUMOReal gap; - if (contLane) { + if (contLane && !sameSource) { gap = -1; // always break for vehicles which are on a continuation lane } else { const SUMOReal leaderBack = leader->getPositionOnLane() - leader->getVehicleType().getLength(); const SUMOReal leaderBackDist = foeDistToCrossing - leaderBack; - //std::cout << " distToCrossing=" << distToCrossing << " leader backDist=" << leaderBackDist << "\n"; - if (leaderBackDist < 0) { + //if (gDebugFlag1) std::cout << " distToCrossing=" << distToCrossing << " leader back=" << leaderBack << " backDist=" << leaderBackDist << "\n"; + if (leaderBackDist + foeCrossingWidth < 0) { // leader is completely past the crossing point // or there is no crossing point continue; // next vehicle @@ -474,12 +580,12 @@ // compute distance between vehicles on the the superimposition of both lanes // where the crossing point is the common point SUMOReal gap; - if (contLane) { + if (contLane && !sameSource) { gap = -1; // always break for vehicles which are on a continuation lane } else { const SUMOReal leaderBackDist = foeDistToCrossing - foeLane->getPartialOccupatorEnd(); - //std::cout << " distToCrossing=" << distToCrossing << " leader (partialOccupator) backDist=" << leaderBackDist << "\n"; - if (leaderBackDist < 0) { + //if (gDebugFlag1) std::cout << " distToCrossing=" << distToCrossing << " leader (partialOccupator) backDist=" << leaderBackDist << "\n"; + if (leaderBackDist + foeCrossingWidth < 0) { // leader is completely past the crossing point // or there is no crossing point continue; // next lane @@ -490,7 +596,7 @@ } } // check for crossing pedestrians (keep driving if already on top of the crossing - const SUMOReal distToPeds = distToCrossing - MSPModel::SAFETY_GAP - foeLane->getWidth() * 0.5; + const SUMOReal distToPeds = distToCrossing - MSPModel::SAFETY_GAP; if (distToPeds >= -MSPModel::SAFETY_GAP && MSPModel::getModel()->blockedAtDist(foeLane, foeDistToCrossing, collectBlockers)) { result.push_back(LinkLeader((MSVehicle*)0, -1, distToPeds)); } diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLink.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLink.h --- sumo-0.21.0+dfsg/src/microsim/MSLink.h 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLink.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSLink.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSLink.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A connnection between lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -43,6 +43,7 @@ // class declarations // =========================================================================== class MSLane; +class MSJunction; class SUMOVehicle; class MSVehicle; class MSPerson; @@ -249,6 +250,12 @@ } + //@brief Returns the time of the last state change + inline SUMOTime getLastStateChange() const { + return myLastStateChange; + } + + /** @brief Returns the direction the vehicle passing this link take * * @return The direction of this link @@ -259,6 +266,7 @@ /** @brief Sets the current tl-state * * @param[in] state The current state of the link + * @param[in] t The time of the state change */ void setTLState(LinkState state, SUMOTime t); @@ -270,6 +278,13 @@ MSLane* getLane() const; + /** @brief Returns the lane leading to this link + * + * @return The lane leading to this link + */ + MSLane* getApproachingLane() const; + + /** @brief Returns the respond index (for visualization) * * @return The respond index for this link @@ -282,10 +297,17 @@ /** @brief Returns whether this link is a major link * @return Whether the link has a large priority */ - bool havePriority() const { + inline bool havePriority() const { return myState >= 'A' && myState <= 'Z'; } + /** @brief Returns whether this link is blocked by a red (or redyellow) traffic light + * @return Whether the link has a red light + */ + inline bool haveRed() const { + return myState == LINKSTATE_TL_RED || myState == LINKSTATE_TL_REDYELLOW; + } + /** @brief Returns the length of this link * @@ -341,6 +363,10 @@ /// @brief write information about all approaching vehicles to the given output device void writeApproaching(OutputDevice& od, const std::string fromLaneID) const; + /// @brief return the junction to which this link belongs + const MSJunction* getJunction() const { + return myJunction; + } private: /// @brief return whether the given vehicles may NOT merge safely @@ -353,7 +379,7 @@ static bool maybeOccupied(MSLane* lane); private: - /// @brief The lane approached by this link + /// @brief The lane (but the internal one) approached by this link MSLane* myLane; std::map myApproachingVehicles; @@ -365,6 +391,9 @@ /// @brief The state of the link LinkState myState; + /// @brief The time of the last state change + SUMOTime myLastStateChange; + /// @brief An abstract (hopefully human readable) definition of the link's direction LinkDirection myDirection; @@ -380,6 +409,9 @@ /// @brief The following junction-internal lane if used MSLane* const myJunctionInlane; + /// @brief The preceding junction-internal lane if used + const MSLane* myInternalLaneBefore; + /* @brief lengths after the crossing point with foeLane * (lengthOnThis, lengthOnFoe) * (index corresponds to myFoeLanes) @@ -388,8 +420,11 @@ std::vector > myLengthsBehindCrossing; #endif + /// @brief the junction to which this link belongs + const MSJunction* myJunction; + std::vector myFoeLinks; - std::vector myFoeLanes; + std::vector myFoeLanes; static SUMOTime myLookaheadTime; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLogicJunction.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLogicJunction.cpp --- sumo-0.21.0+dfsg/src/microsim/MSLogicJunction.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLogicJunction.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Wed, 12 Dez 2001 -/// @version $Id: MSLogicJunction.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSLogicJunction.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // with one ore more logics. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -46,6 +46,7 @@ * methods from MSLogicJunction * ----------------------------------------------------------------------- */ MSLogicJunction::MSLogicJunction(const std::string& id, + SumoXMLNodeType type, const Position& position, const PositionVector& shape, std::vector incoming @@ -53,7 +54,7 @@ , std::vector internal #endif ): - MSJunction(id, position, shape), + MSJunction(id, type, position, shape), myIncomingLanes(incoming) #ifdef HAVE_INTERNAL_LANES , myInternalLanes(internal) diff -Nru sumo-0.21.0+dfsg/src/microsim/MSLogicJunction.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLogicJunction.h --- sumo-0.21.0+dfsg/src/microsim/MSLogicJunction.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSLogicJunction.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Wed, 12 Dez 2001 -/// @version $Id: MSLogicJunction.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSLogicJunction.h 18095 2015-03-17 09:39:00Z behrisch $ /// // with one ore more logics. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -75,12 +75,15 @@ protected: /** @brief Constructor * @param[in] id The id of the junction + * @param[in] id The type of the junction * @param[in] position The position of the junction * @param[in] shape The shape of the junction * @param[in] incoming The incoming lanes * @param[in] internal The internal lanes */ - MSLogicJunction(const std::string& id, const Position& position, + MSLogicJunction(const std::string& id, + SumoXMLNodeType type, + const Position& position, const PositionVector& shape, std::vector incoming #ifdef HAVE_INTERNAL_LANES diff -Nru sumo-0.21.0+dfsg/src/microsim/MSMoveReminder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSMoveReminder.cpp --- sumo-0.21.0+dfsg/src/microsim/MSMoveReminder.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSMoveReminder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2008-10-27 -/// @version $Id: MSMoveReminder.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSMoveReminder.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Something on a lane to be noticed about vehicle movement /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -50,7 +50,8 @@ #ifdef HAVE_INTERNAL void MSMoveReminder::updateDetector(SUMOVehicle& veh, SUMOReal entryPos, SUMOReal leavePos, - SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime) { + SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime, + bool cleanUp) { // 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 @@ -67,7 +68,6 @@ entryTime = previousEntryTime; entryPos = j->second.second; } - myLastVehicleUpdateValues.erase(j); } assert(entryTime <= currentTime); if ((entryTime < leaveTime) && (entryPos < leavePos)) { @@ -84,7 +84,16 @@ // However, in the presence of calibrators, vehicles may jump a bit myLastVehicleUpdateValues[&veh] = std::pair(leaveTime, leavePos); } + if (cleanUp) { + // clean up after the vehicle has left the area of this reminder + removeFromVehicleUpdateValues(veh); + } +} + +void +MSMoveReminder::removeFromVehicleUpdateValues(SUMOVehicle& veh) { + myLastVehicleUpdateValues.erase(&veh); } #endif /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/MSMoveReminder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSMoveReminder.h --- sumo-0.21.0+dfsg/src/microsim/MSMoveReminder.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSMoveReminder.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2003-05-21 -/// @version $Id: MSMoveReminder.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSMoveReminder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Something on a lane to be noticed about vehicle movement /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -183,7 +183,8 @@ #ifdef HAVE_INTERNAL void updateDetector(SUMOVehicle& veh, SUMOReal entryPos, SUMOReal leavePos, - SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime); + SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime, + bool cleanUp); #endif /// @} @@ -215,14 +216,20 @@ return myDescription; } +#ifdef HAVE_INTERNAL +protected: + void removeFromVehicleUpdateValues(SUMOVehicle& veh); +#endif protected: + /// @brief Lane on which the reminder works MSLane* const myLane; /// @brief a description of this moveReminder std::string myDescription; #ifdef HAVE_INTERNAL +private: std::map > myLastVehicleUpdateValues; #endif diff -Nru sumo-0.21.0+dfsg/src/microsim/MSNet.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSNet.cpp --- sumo-0.21.0+dfsg/src/microsim/MSNet.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSNet.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -10,12 +10,12 @@ /// @author Mario Krumnow /// @author Christoph Sommer /// @date Tue, 06 Mar 2001 -/// @version $Id: MSNet.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSNet.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // The simulated network and simulation perfomer /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,10 +36,6 @@ #include #endif -#ifdef HAVE_VERSION_H -#include -#endif - #include #include #include @@ -51,6 +47,7 @@ #include #include "MSNet.h" #include "MSPersonControl.h" +#include "MSContainerControl.h" #include "MSEdgeControl.h" #include "MSJunctionControl.h" #include "MSInsertionControl.h" @@ -72,6 +69,7 @@ #include #include #include +#include #include "traffic_lights/MSTrafficLightLogic.h" #include #include @@ -88,11 +86,13 @@ #include #include #include -#include +#include #include "MSGlobals.h" -#include "MSPModel.h" +#include +#include #include -#include "MSPerson.h" +#include +#include "MSContainer.h" #include "MSEdgeWeightsStorage.h" #include "MSStateHandler.h" @@ -168,6 +168,8 @@ MSEventControl* endOfTimestepEvents, MSEventControl* insertionEvents, ShapeContainer* shapeCont): myVehiclesMoved(0), + myHaveRestrictions(false), + myHasInternalLinks(false), myRouterTTInitialized(false), myRouterTTDijkstra(0), myRouterTTAStar(0), @@ -189,6 +191,7 @@ myRouteLoaders = 0; myLogics = 0; myPersonControl = 0; + myContainerControl = 0; myEdgeWeights = 0; myShapeContainer = shapeCont == 0 ? new ShapeContainer() : shapeCont; @@ -213,7 +216,8 @@ SUMORouteLoaderControl* routeLoaders, MSTLLogicControl* tlc, std::vector stateDumpTimes, - std::vector stateDumpFiles) { + std::vector stateDumpFiles, + bool hasInternalLinks) { myEdges = edges; myJunctions = junctions; myRouteLoaders = routeLoaders; @@ -229,14 +233,18 @@ if (myLogExecutionTime) { mySimBeginMillis = SysUtils::getCurrentMillis(); } + myHasInternalLinks = hasInternalLinks; } MSNet::~MSNet() { // delete events first maybe they do some cleanup delete myBeginOfTimestepEvents; + myBeginOfTimestepEvents = 0; delete myEndOfTimestepEvents; + myEndOfTimestepEvents = 0; delete myInsertionEvents; + myInsertionEvents = 0; // delete controls delete myJunctions; delete myDetectorControl; @@ -249,6 +257,9 @@ if (myPersonControl != 0) { delete myPersonControl; } + if (myContainerControl != 0) { + delete myContainerControl; + } delete myShapeContainer; delete myEdgeWeights; delete myRouterTTDijkstra; @@ -322,7 +333,7 @@ long duration = SysUtils::getCurrentMillis() - mySimBeginMillis; std::ostringstream msg; // print performance notice - msg << "Performance: " << "\n" << " Duration: " << duration << " ms" << "\n"; + msg << "Performance: " << "\n" << " Duration: " << duration << "ms" << "\n"; if (duration != 0) { msg << " Real time factor: " << (STEPS2TIME(myStep - start) * 1000. / (SUMOReal)duration) << "\n"; msg.setf(std::ios::fixed , std::ios::floatfield); // use decimal format @@ -363,6 +374,9 @@ if (OptionsCont::getOptions().getBool("vehroute-output.write-unfinished")) { MSDevice_Vehroutes::generateOutputForUnfinished(); } + if (OptionsCont::getOptions().getBool("tripinfo-output.write-unfinished")) { + MSDevice_Tripinfo::generateOutputForUnfinished(); + } #ifndef NO_TRACI TraCIServer::close(); #endif @@ -389,6 +403,9 @@ MSStateHandler::saveState(myStateDumpFiles[dist], myStep); } myBeginOfTimestepEvents->execute(myStep); +#ifdef HAVE_FOX + MSDevice_Routing::waitForAll(); +#endif if (MSGlobals::gCheck4Accidents) { myEdges->detectCollisions(myStep, STAGE_EVENTS); } @@ -414,7 +431,7 @@ myEdges->detectCollisions(myStep, STAGE_MOVEMENTS); } - // Vehicles change Lanes (maybe) + // vehicles may change lanes myEdges->changeLanes(myStep); if (MSGlobals::gCheck4Accidents) { @@ -426,11 +443,18 @@ loadRoutes(); // persons - if (myPersonControl != 0) { + if (myPersonControl != 0 && myPersonControl->hasPersons()) { myPersonControl->checkWaitingPersons(this, myStep); } - // insert Vehicles + // insert vehicles + myInserter->determineCandidates(myStep); // containers + if (myContainerControl != 0) { + myContainerControl->checkWaitingContainers(this, myStep); + } myInsertionEvents->execute(myStep); +#ifdef HAVE_FOX + MSDevice_Routing::waitForAll(); +#endif myInserter->emitVehicles(myStep); if (MSGlobals::gCheck4Accidents) { myEdges->detectCollisions(myStep, STAGE_INSERTIONS); @@ -473,10 +497,14 @@ if (myInsertionEvents->isEmpty() && (myVehicleControl->getActiveVehicleCount() == 0) && (myInserter->getPendingFlowCount() == 0) - && (myPersonControl == 0 || !myPersonControl->hasNonWaiting())) { + && (myPersonControl == 0 || !myPersonControl->hasNonWaiting()) + && (myContainerControl == 0 || !myContainerControl->hasNonWaiting())) { if (myPersonControl) { myPersonControl->abortWaiting(); } + if (myContainerControl) { + myContainerControl->abortWaiting(); + } myVehicleControl->abortWaiting(); return SIMSTATE_NO_FURTHER_VEHICLES; } @@ -520,6 +548,7 @@ MSTrigger::cleanup(); MSCalibrator::cleanup(); MSPModel::cleanup(); + MSCModel_NonInteracting::cleanup(); PedestrianEdge::cleanup(); } @@ -528,10 +557,12 @@ MSNet::writeOutput() { // update detector values myDetectorControl->updateDetectors(myStep); + const OptionsCont& oc = OptionsCont::getOptions(); // check state dumps - if (OptionsCont::getOptions().isSet("netstate-dump")) { - MSXMLRawOut::write(OutputDevice::getDeviceByOption("netstate-dump"), *myEdges, myStep); + if (oc.isSet("netstate-dump")) { + MSXMLRawOut::write(OutputDevice::getDeviceByOption("netstate-dump"), *myEdges, myStep, + oc.getInt("netstate-dump.precision")); } // check fcd dumps @@ -602,8 +633,8 @@ OutputDevice& od = OutputDevice::getDeviceByOption("link-output"); od.openTag("timestep"); od.writeAttr(SUMO_ATTR_ID, STEPS2TIME(myStep)); - const std::vector& edges = myEdges->getEdges(); - for (std::vector::const_iterator i = edges.begin(); i != edges.end(); ++i) { + const MSEdgeVector& edges = myEdges->getEdges(); + for (MSEdgeVector::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) { const std::vector& links = (*j)->getLinkCont(); @@ -631,6 +662,14 @@ return *myPersonControl; } +MSContainerControl& +MSNet::getContainerControl() { + if (myContainerControl == 0) { + myContainerControl = new MSContainerControl(); + } + return *myContainerControl; +} + MSEdgeWeightsStorage& MSNet::getWeightsStorage() { @@ -723,20 +762,43 @@ return ""; } +// ------ Insertion and retrieval of container stops ------ +bool +MSNet::addContainerStop(MSContainerStop* containerStop) { + return myContainerStopDict.add(containerStop->getID(), containerStop); +} + +MSContainerStop* +MSNet::getContainerStop(const std::string& id) const { + return myContainerStopDict.get(id); +} + +std::string +MSNet::getContainerStopID(const MSLane* lane, const SUMOReal pos) const { + const std::map& vals = myContainerStopDict.getMyMap(); + for (std::map::const_iterator it = vals.begin(); it != vals.end(); ++it) { + MSContainerStop* stop = it->second; + if (&stop->getLane() == lane && fabs(stop->getEndLanePosition() - pos) < POSITION_EPS) { + return stop->getID(); + } + } + return ""; +} + SUMOAbstractRouter& -MSNet::getRouterTT(const std::vector& prohibited) const { +MSNet::getRouterTT(const MSEdgeVector& prohibited) const { if (!myRouterTTInitialized) { myRouterTTInitialized = true; const std::string routingAlgorithm = OptionsCont::getOptions().getString("routing-algorithm"); if (routingAlgorithm == "dijkstra") { - myRouterTTDijkstra = new DijkstraRouterTT_ByProxi >( + myRouterTTDijkstra = new DijkstraRouterTT >( 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 >( + myRouterTTAStar = new AStarRouter >( MSEdge::numericalDictSize(), true, &MSNet::getTravelTime); } } @@ -752,9 +814,9 @@ SUMOAbstractRouter& -MSNet::getRouterEffort(const std::vector& prohibited) const { +MSNet::getRouterEffort(const MSEdgeVector& prohibited) const { if (myRouterEffort == 0) { - myRouterEffort = new DijkstraRouterEffort_ByProxi >( + myRouterEffort = new DijkstraRouterEffort >( MSEdge::numericalDictSize(), true, &MSNet::getEffort, &MSNet::getTravelTime); } myRouterEffort->prohibit(prohibited); @@ -763,7 +825,7 @@ MSNet::MSPedestrianRouterDijkstra& -MSNet::getPedestrianRouter(const std::vector& prohibited) const { +MSNet::getPedestrianRouter(const MSEdgeVector& prohibited) const { if (myPedestrianRouter == 0) { myPedestrianRouter = new MSPedestrianRouterDijkstra(); } diff -Nru sumo-0.21.0+dfsg/src/microsim/MSNet.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSNet.h --- sumo-0.21.0+dfsg/src/microsim/MSNet.h 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSNet.h 2015-04-17 05:44:20.000000000 +0000 @@ -8,12 +8,12 @@ /// @author Clemens Honomichl /// @author Michael Behrisch /// @date Mon, 12 Mar 2001 -/// @version $Id: MSNet.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSNet.h 18096 2015-03-17 09:50:59Z behrisch $ /// // The simulated network and simulation perfomer /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -50,14 +50,15 @@ #include #include #include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include +#include // =========================================================================== @@ -70,6 +71,7 @@ class MSInsertionControl; class SUMORouteLoaderControl; class MSPersonControl; +class MSContainerControl; class MSVehicle; class MSRoute; class MSLane; @@ -80,6 +82,7 @@ class MSEdgeWeightsStorage; class SUMOVehicle; +typedef std::vector MSEdgeVector; // =========================================================================== // class definitions @@ -153,11 +156,27 @@ * @param[in] tlc The control of traffic lights which belong to this network * @param[in] stateDumpTimes List of time steps at which state shall be written * @param[in] stateDumpFiles Filenames for states + * @param[in] hasInternalLinks Whether the network actually contains internal links * @todo Try to move all this to the constructor? */ void closeBuilding(MSEdgeControl* edges, MSJunctionControl* junctions, SUMORouteLoaderControl* routeLoaders, MSTLLogicControl* tlc, - std::vector stateDumpTimes, std::vector stateDumpFiles); + std::vector stateDumpTimes, std::vector stateDumpFiles, + bool hasInternalLinks); + + + /** @brief Returns whether the network has vehicle class restrictions + * @return whether restrictions are present + */ + bool hasRestrictions() const { + return myHaveRestrictions; + } + + + /// @brief Labels the network to contain vehicle class restrictions + void setRestrictionFound() { + myHaveRestrictions = true; + } /** @brief Clears all dictionaries @@ -281,6 +300,16 @@ */ virtual MSPersonControl& getPersonControl(); + /** @brief Returns the container control + * + * If the container control does not exist, yet, it is created. + * + * @return The container control + * @see MSContainerControl + * @see myContainerControl + */ + virtual MSContainerControl& getContainerControl(); + /** @brief Returns the edge control * @return The edge control @@ -333,32 +362,32 @@ /** @brief Returns the event control for events executed at the begin of a time step - * @return The control reponsible for events that are executed at the begin of a time step + * @return The control responsible for events that are executed at the begin of a time step * @see MSEventControl * @see myBeginOfTimestepEvents */ - MSEventControl& getBeginOfTimestepEvents() { - return *myBeginOfTimestepEvents; + MSEventControl* getBeginOfTimestepEvents() { + return myBeginOfTimestepEvents; } /** @brief Returns the event control for events executed at the end of a time step - * @return The control reponsible for events that are executed at the end of a time step + * @return The control responsible for events that are executed at the end of a time step * @see MSEventControl * @see myEndOfTimestepEvents */ - MSEventControl& getEndOfTimestepEvents() { - return *myEndOfTimestepEvents; + MSEventControl* getEndOfTimestepEvents() { + return myEndOfTimestepEvents; } /** @brief Returns the event control for insertion events - * @return The control reponsible for insertion events + * @return The control responsible for insertion events * @see MSEventControl * @see myInsertionEvents */ - MSEventControl& getInsertionEvents() { - return *myInsertionEvents; + MSEventControl* getInsertionEvents() { + return myInsertionEvents; } @@ -415,6 +444,37 @@ /// @} + /// @name Insertion and retrieval of container stops + /// @{ + + /** @brief Adds a container stop + * + * If another container stop with the same id exists, false is returned. + * Otherwise, the container stop is added to the internal container stop + * container "myContainerStopDict". + * + * This control gets responsible for deletion of the added container stop. + * + * @param[in] containerStop The container stop to add + * @return Whether the container stop could be added + */ + bool addContainerStop(MSContainerStop* containerStop); + + /** @brief Returns the named container stop + * @param[in] id The id of the container stop to return. + * @return The named container stop, or 0 if no such stop exists + */ + MSContainerStop* getContainerStop(const std::string& id) const; + + /** @brief Returns the container stop close to the given position + * @param[in] lane the lane of the container stop to return. + * @param[in] pos the position of the container stop to return. + * @return The container stop id on the location, or "" if no such stop exists + */ + std::string getContainerStopID(const MSLane* lane, const SUMOReal pos) const; + /// @} + + /// @name Notification about vehicle state changes /// @{ @@ -510,10 +570,10 @@ * @param[in] prohibited The vector of forbidden edges (optional) */ SUMOAbstractRouter& getRouterTT( - const std::vector& prohibited = std::vector()) const; + const MSEdgeVector& prohibited = MSEdgeVector()) const; SUMOAbstractRouter& getRouterEffort( - const std::vector& prohibited = std::vector()) const; - MSPedestrianRouterDijkstra& getPedestrianRouter(const std::vector& prohibited = std::vector()) const; + const MSEdgeVector& prohibited = MSEdgeVector()) const; + MSPedestrianRouterDijkstra& getPedestrianRouter(const MSEdgeVector& prohibited = MSEdgeVector()) const; /** @brief Returns an RTree that contains lane IDs @@ -521,6 +581,10 @@ */ const NamedRTree& getLanesRTree() const; + /// @brief return whether the network contains internal links + bool hasInternalLinks() const { + return myHasInternalLinks; + } protected: /// @brief Unique instance of MSNet @@ -541,6 +605,8 @@ MSVehicleControl* myVehicleControl; /// @brief Controls person building and deletion; @see MSPersonControl MSPersonControl* myPersonControl; + /// @brief Controls container building and deletion; @see MSContainerControl + MSContainerControl* myContainerControl; /// @brief Controls edges, performs vehicle movement; @see MSEdgeControl MSEdgeControl* myEdges; /// @brief Controls junctions, realizes right-of-way rules; @see MSJunctionControl @@ -597,12 +663,21 @@ + /// @brief Whether the network contains edges which not all vehicles may pass + bool myHaveRestrictions; + + /// @brief Whether the network contains internal links/lanes/edges + bool myHasInternalLinks; + /// @brief Storage for maximum vehicle number int myTooManyVehicles; /// @brief Dictionary of bus stops NamedObjectCont myBusStopDict; + /// @brief Dictionary of container stops + NamedObjectCont myContainerStopDict; + /// @brief Container for vehicle state listener std::vector myVehicleStateListeners; @@ -612,9 +687,9 @@ * @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; + mutable DijkstraRouterTT >* myRouterTTDijkstra; + mutable AStarRouter >* myRouterTTAStar; + mutable DijkstraRouterEffort >* myRouterEffort; mutable MSPedestrianRouterDijkstra* myPedestrianRouter; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSNoLogicJunction.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSNoLogicJunction.cpp --- sumo-0.21.0+dfsg/src/microsim/MSNoLogicJunction.cpp 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSNoLogicJunction.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Thu, 06 Jun 2002 -/// @version $Id: MSNoLogicJunction.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSNoLogicJunction.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -49,6 +49,7 @@ // method definitions // =========================================================================== MSNoLogicJunction::MSNoLogicJunction(const std::string& id, + SumoXMLNodeType type, const Position& position, const PositionVector& shape, std::vector incoming @@ -56,7 +57,7 @@ , std::vector internal #endif ): - MSJunction(id, position, shape), + MSJunction(id, type, position, shape), myIncomingLanes(incoming) #ifdef HAVE_INTERNAL_LANES , myInternalLanes(internal) diff -Nru sumo-0.21.0+dfsg/src/microsim/MSNoLogicJunction.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSNoLogicJunction.h --- sumo-0.21.0+dfsg/src/microsim/MSNoLogicJunction.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSNoLogicJunction.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Wed, 12 Dez 2001 -/// @version $Id: MSNoLogicJunction.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSNoLogicJunction.h 18095 2015-03-17 09:39:00Z behrisch $ /// // logic, e.g. for exits. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -65,7 +65,7 @@ * @param[in] incoming The incoming lanes * @param[in] internal The internal lanes */ - MSNoLogicJunction(const std::string& id, const Position& position, + MSNoLogicJunction(const std::string& id, SumoXMLNodeType type, const Position& position, const PositionVector& shape, std::vector incoming #ifdef HAVE_INTERNAL_LANES diff -Nru sumo-0.21.0+dfsg/src/microsim/MSPersonControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPersonControl.cpp --- sumo-0.21.0+dfsg/src/microsim/MSPersonControl.cpp 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPersonControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: MSPersonControl.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSPersonControl.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Stores all persons in the net and handles their waiting for cars. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,7 +35,7 @@ #include #include "MSNet.h" #include "MSEdge.h" -#include "MSPerson.h" +#include #include "MSVehicle.h" #include "MSPersonControl.h" #include @@ -71,6 +71,16 @@ } +MSPerson* +MSPersonControl::get(const std::string& id) const { + std::map::const_iterator i = myPersons.find(id); + if (i == myPersons.end()) { + return 0; + } + return (*i).second; +} + + void MSPersonControl::erase(MSPerson* person) { const std::string& id = person->getID(); @@ -156,15 +166,25 @@ bool -MSPersonControl::boardAnyWaiting(MSEdge* edge, MSVehicle* vehicle) { +MSPersonControl::boardAnyWaiting(MSEdge* edge, MSVehicle* vehicle, MSVehicle::Stop* stop) { bool ret = false; if (myWaiting4Vehicle.find(edge) != myWaiting4Vehicle.end()) { PersonVector& waitPersons = myWaiting4Vehicle[edge]; + const std::string& line = vehicle->getParameter().line == "" ? vehicle->getParameter().id : vehicle->getParameter().line; + SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); 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)) { + if ((*i)->isWaitingFor(line) && vehicle->getVehicleType().getPersonCapacity() > vehicle->getPersonNumber() && stop->timeToBoardNextPerson <= currentTime && stop->startPos <= (*i)->getEdgePos() && (*i)->getEdgePos() <= stop->endPos) { edge->removePerson(*i); vehicle->addPerson(*i); + //if the time a person needs to enter the vehicle extends the duration of the stop of the vehicle extend + //the duration by setting it to the boarding duration of the person + const SUMOTime boardingDuration = vehicle->getVehicleType().getBoardingDuration(); + if (boardingDuration >= stop->duration) { + stop->duration = boardingDuration; + } + //update the time point at which the next person can board the vehicle + stop->timeToBoardNextPerson = currentTime + boardingDuration; + static_cast((*i)->getCurrentStage())->setVehicle(vehicle); i = waitPersons.erase(i); ret = true; @@ -179,7 +199,6 @@ return ret; } - bool MSPersonControl::hasPersons() const { return !myPersons.empty(); diff -Nru sumo-0.21.0+dfsg/src/microsim/MSPersonControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPersonControl.h --- sumo-0.21.0+dfsg/src/microsim/MSPersonControl.h 2014-02-22 23:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPersonControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: MSPersonControl.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSPersonControl.h 18096 2015-03-17 09:50:59Z behrisch $ /// // Stores all persons in the net and handles their waiting for cars. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,7 +35,8 @@ #include #include -#include "MSPerson.h" +#include +#include "MSVehicle.h" // =========================================================================== @@ -57,18 +58,37 @@ */ class MSPersonControl { public: - + /// @brief Definition of a list of persons typedef std::vector PersonVector; - /// constructor + /// @brief Definition of the internal persons map iterator + typedef std::map::const_iterator constVehIt; + + +public: + /// @brief Constructor MSPersonControl(); - /// destructor + + /// @brief Destructor virtual ~MSPersonControl(); - /// adds a single person, returns false if an id clash occured + + /** @brief Adds a single person, returns false if an id clash occured + * @param[in] id The id of the person + * @param[in] person The person to add + * @return Whether the person could be added (none with the same id existed before) + */ bool add(const std::string& id, MSPerson* person); + + /** @brief Returns the named person, if existing + * @param[in] id The id of the person + * @return The named person, if existing, otherwise 0 + */ + MSPerson* get(const std::string& id) const; + + /// removes a single person virtual void erase(MSPerson* person); @@ -88,9 +108,10 @@ * Boards any people who wait on that edge for the given vehicle and removes them from myWaiting * @param[in] the edge on which the boarding should take place * @param[in] the vehicle which is taking on passengers + * @param[in] the stop at which the vehicle is stopping * @return Whether any persons have been boarded */ - bool boardAnyWaiting(MSEdge* edge, MSVehicle* vehicle); + bool boardAnyWaiting(MSEdge* edge, MSVehicle* vehicle, MSVehicle::Stop* stop); /// checks whether any person waits to finish her plan bool hasPersons() const; @@ -115,11 +136,32 @@ /// @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; - const std::map& getPersons() const { - return myPersons; + + /** @brief Returns the begin of the internal persons map + * @return The begin of the internal persons map + */ + constVehIt loadedPersonsBegin() const { + return myPersons.begin(); + } + + + /** @brief Returns the end of the internal persons map + * @return The end of the internal persons map + */ + constVehIt loadedPersonsEnd() const { + return myPersons.end(); } -private: + + /** @brief Returns the number of known persons + * @return The number of stored persons + */ + unsigned int size() const { + return (unsigned int) myPersons.size(); + } + + +protected: /// all persons by id std::map myPersons; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSPerson.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPerson.cpp --- sumo-0.21.0+dfsg/src/microsim/MSPerson.cpp 2014-06-10 22:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPerson.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,641 +0,0 @@ -/****************************************************************************/ -/// @file MSPerson.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @author Laura Bieker -/// @date Mon, 9 Jul 2001 -/// @version $Id: MSPerson.cpp 16566 2014-06-10 09:22:55Z behrisch $ -/// -// The class for modelling person-movements -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 "MSNet.h" -#include "MSEdge.h" -#include "MSLane.h" -#include "MSPerson.h" -#include "MSPersonControl.h" -#include "MSInsertionControl.h" -#include "MSVehicle.h" -#include "MSPModel.h" - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - -/* ------------------------------------------------------------------------- - * static member definitions - * ----------------------------------------------------------------------- */ - -// =========================================================================== -// method definitions -// =========================================================================== -/* ------------------------------------------------------------------------- - * MSPerson::MSPersonStage - methods - * ----------------------------------------------------------------------- */ -MSPerson::MSPersonStage::MSPersonStage(const MSEdge& destination, StageType type) - : myDestination(destination), myDeparted(-1), myArrived(-1), myType(type) {} - - -MSPerson::MSPersonStage::~MSPersonStage() {} - - -const MSEdge& -MSPerson::MSPersonStage::getDestination() const { - return myDestination; -} - - -void -MSPerson::MSPersonStage::setDeparted(SUMOTime now) { - if (myDeparted < 0) { - myDeparted = now; - } -} - - -void -MSPerson::MSPersonStage::setArrived(SUMOTime now) { - myArrived = now; -} - - -bool -MSPerson::MSPersonStage::isWaitingFor(const std::string& /*line*/) const { - return false; -} - - -Position -MSPerson::MSPersonStage::getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const { - return getLanePosition(e->getLanes()[0], at, offset); -} - - -Position -MSPerson::MSPersonStage::getLanePosition(const MSLane* lane, SUMOReal at, SUMOReal offset) const { - return lane->getShape().positionAtOffset(lane->interpolateLanePosToGeometryPos(at), offset); -} - - -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.rotationDegreeAtOffset(at); -} - - - -/* ------------------------------------------------------------------------- - * MSPerson::MSPersonStage_Walking - methods - * ----------------------------------------------------------------------- */ -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), - myCurrentInternalEdge(0), - myDepartPos(departPos), myArrivalPos(arrivalPos), myDestinationBusStop(toBS), - mySpeed(speed), - myPedestrianState(0) { - 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) { - mySpeed = computeAverageSpeed(); - } -} - - -MSPerson::MSPersonStage_Walking::~MSPersonStage_Walking() { -} - - -const MSEdge* -MSPerson::MSPersonStage_Walking::getEdge() const { - if (myCurrentInternalEdge != 0) { - return myCurrentInternalEdge; - } else { - return *myRouteStep; - } -} - - -const MSEdge* -MSPerson::MSPersonStage_Walking::getFromEdge() const { - return myRoute.front(); -} - - -SUMOReal -MSPerson::MSPersonStage_Walking::getEdgePos(SUMOTime now) const { - return myPedestrianState->getEdgePos(*this, now); -} - - -Position -MSPerson::MSPersonStage_Walking::getPosition(SUMOTime now) const { - return myPedestrianState->getPosition(*this, now); -} - - -SUMOReal -MSPerson::MSPersonStage_Walking::getAngle(SUMOTime now) const { - return myPedestrianState->getAngle(*this, now); -} - - -SUMOTime -MSPerson::MSPersonStage_Walking::getWaitingTime(SUMOTime now) const { - return myPedestrianState->getWaitingTime(*this, now); -} - - -SUMOReal -MSPerson::MSPersonStage_Walking::getSpeed() const { - return myPedestrianState->getSpeed(*this); -} - - -void -MSPerson::MSPersonStage_Walking::proceed(MSNet* net, MSPerson* person, SUMOTime now, - MSEdge* previousEdge, const SUMOReal at) { - previousEdge->removePerson(person); - myRouteStep = myRoute.begin(); - if (myWalkingTime == 0) { - if (!person->proceed(net, now)) { - MSNet::getInstance()->getPersonControl().erase(person); - }; - return; - } - MSNet::getInstance()->getPersonControl().setWalking(person); - if (at >= 0) { - myDepartPos = at; - if (myWalkingTime > 0) { - mySpeed = computeAverageSpeed(); - } - } - myPedestrianState = MSPModel::getModel()->add(person, this, now); - ((MSEdge*) *myRouteStep)->addPerson(person); -} - - -SUMOReal -MSPerson::MSPersonStage_Walking::computeAverageSpeed() const { - SUMOReal length = 0; - for (std::vector::const_iterator i = myRoute.begin(); i != myRoute.end(); ++i) { - length += (*i)->getLength(); - } - length -= myDepartPos; - length -= myRoute.back()->getLength() - myArrivalPos; - return length / STEPS2TIME(myWalkingTime + 1); // avoid systematic rounding errors -} - - -void -MSPerson::MSPersonStage_Walking::tripInfoOutput(OutputDevice& os) const { - os.openTag("walk").writeAttr("arrival", time2string(myArrived)).closeTag(); -} - - -void -MSPerson::MSPersonStage_Walking::routeOutput(OutputDevice& os) const { - os.openTag("walk").writeAttr(SUMO_ATTR_EDGES, myRoute); - if (myWalkingTime > 0) { - os.writeAttr(SUMO_ATTR_DURATION, time2string(myWalkingTime)); - } else if (mySpeed > 0) { - os.writeAttr(SUMO_ATTR_SPEED, mySpeed); - } - os.closeTag(); -} - - -void -MSPerson::MSPersonStage_Walking::beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { - os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "departure") - .writeAttr("agent", p.getID()).writeAttr("link", myRoute.front()->getID()).closeTag(); -} - - -void -MSPerson::MSPersonStage_Walking::endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { - os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival") - .writeAttr("agent", p.getID()).writeAttr("link", myRoute.back()->getID()).closeTag(); -} - - -bool -MSPerson::MSPersonStage_Walking::moveToNextEdge(MSPerson* person, SUMOTime currentTime, MSEdge* nextInternal) { - ((MSEdge*)getEdge())->removePerson(person); - //std::cout << SIMTIME << " moveToNextEdge person=" << person->getID() << "\n"; - 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); - } - //std::cout << " end walk. myRouteStep=" << (*myRouteStep)->getID() << "\n"; - return true; - } else { - if (nextInternal == 0) { - ++myRouteStep; - myCurrentInternalEdge = 0; - } else { - myCurrentInternalEdge = nextInternal; - } - ((MSEdge*) getEdge())->addPerson(person); - return false; - } -} - - - -/* ------------------------------------------------------------------------- - * MSPerson::MSPersonStage_Driving - methods - * ----------------------------------------------------------------------- */ -MSPerson::MSPersonStage_Driving::MSPersonStage_Driving(const MSEdge& destination, - 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() 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()->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().positionAtOffset(myVehicle->getPositionOnLane()); - } - return getEdgePosition(myWaitingEdge, myWaitingPos, MSPModel::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, - MSEdge* previousEdge, const SUMOReal at) { - myWaitingEdge = previousEdge; - myWaitingPos = at; - myWaitingSince = now; - 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); - previousEdge->addPerson(person); - } -} - - -bool -MSPerson::MSPersonStage_Driving::isWaitingFor(const std::string& line) const { - return myLines.count(line) > 0; -} - - -bool -MSPerson::MSPersonStage_Driving::isWaiting4Vehicle() const { - return myVehicle == 0; -} - - -SUMOTime -MSPerson::MSPersonStage_Driving::getWaitingTime(SUMOTime now) const { - return isWaiting4Vehicle() ? now - myWaitingSince : 0; -} - - -SUMOReal -MSPerson::MSPersonStage_Driving::getSpeed() const { - return myVehicle == 0 ? 0 : myVehicle->getSpeed(); -} - - -std::string -MSPerson::MSPersonStage_Driving::getStageDescription() const { - return isWaiting4Vehicle() ? "waiting for " + joinToString(myLines, ",") : "driving"; -} - - -void -MSPerson::MSPersonStage_Driving::tripInfoOutput(OutputDevice& os) const { - os.openTag("ride").writeAttr("depart", time2string(myDeparted)).writeAttr("arrival", time2string(myArrived)).closeTag(); -} - - -void -MSPerson::MSPersonStage_Driving::routeOutput(OutputDevice& os) const { - os.openTag("ride").writeAttr(SUMO_ATTR_FROM, getFromEdge()->getID()).writeAttr(SUMO_ATTR_TO, getDestination().getID()); - os.writeAttr(SUMO_ATTR_LINES, myLines).closeTag(); -} - - -void -MSPerson::MSPersonStage_Driving::beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { - os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag(); -} - - -void -MSPerson::MSPersonStage_Driving::endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { - os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag(); -} - - - -/* ------------------------------------------------------------------------- - * MSPerson::MSPersonStage_Waiting - methods - * ----------------------------------------------------------------------- */ -MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting(const MSEdge& destination, - 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() const { - return &myDestination; -} - - -const MSEdge* -MSPerson::MSPersonStage_Waiting::getFromEdge() const { - return &myDestination; -} - - -SUMOReal -MSPerson::MSPersonStage_Waiting::getEdgePos(SUMOTime /* now */) const { - return myStartPos; -} - - -SUMOTime -MSPerson::MSPersonStage_Waiting::getUntil() const { - return myWaitingUntil; -} - - -Position -MSPerson::MSPersonStage_Waiting::getPosition(SUMOTime /* now */) const { - return getEdgePosition(&myDestination, myStartPos, MSPModel::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, - MSEdge* previousEdge, const SUMOReal /* at */) { - previousEdge->addPerson(person); - myWaitingStart = now; - const SUMOTime until = MAX3(now, now + myWaitingDuration, myWaitingUntil); - net->getPersonControl().setWaitEnd(until, person); -} - - -void -MSPerson::MSPersonStage_Waiting::tripInfoOutput(OutputDevice& os) const { - os.openTag("stop").writeAttr("arrival", time2string(myArrived)).closeTag(); -} - - -void -MSPerson::MSPersonStage_Waiting::routeOutput(OutputDevice& os) const { - os.openTag("stop").writeAttr(SUMO_ATTR_LANE, getDestination().getID()); - if (myWaitingDuration >= 0) { - os.writeAttr(SUMO_ATTR_DURATION, time2string(myWaitingDuration)); - } - if (myWaitingUntil >= 0) { - os.writeAttr(SUMO_ATTR_UNTIL, time2string(myWaitingUntil)); - } - os.closeTag(); -} - - -void -MSPerson::MSPersonStage_Waiting::beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { - os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actstart " + myActType) - .writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag(); -} - - -void -MSPerson::MSPersonStage_Waiting::endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { - os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actend " + myActType).writeAttr("agent", p.getID()) - .writeAttr("link", getEdge()->getID()).closeTag(); -} - - -SUMOTime -MSPerson::MSPersonStage_Waiting::getWaitingTime(SUMOTime now) const { - return now - myWaitingStart; -} - - -SUMOReal -MSPerson::MSPersonStage_Waiting::getSpeed() const { - return 0; -} - - - - -/* ------------------------------------------------------------------------- - * MSPerson - methods - * ----------------------------------------------------------------------- */ -MSPerson::MSPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPersonPlan* plan) - : myParameter(pars), myVType(vtype), myPlan(plan) { - myStep = myPlan->begin(); -} - - -MSPerson::~MSPerson() { - for (MSPersonPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) { - delete *i; - } - delete myPlan; - delete myParameter; -} - - -const std::string& -MSPerson::getID() const { - return myParameter->id; -} - - -bool -MSPerson::proceed(MSNet* net, SUMOTime time) { - MSEdge* arrivedAt = (MSEdge*)(*myStep)->getEdge(); - SUMOReal atPos = (*myStep)->getEdgePos(time); - //MSPersonPlan::iterator prior = myStep; - (*myStep)->setArrived(time); - /* - if(myWriteEvents) { - (*myStep)->endEventOutput(*this, time, OutputDevice::getDeviceByOption("person-event-output")); - } - */ - myStep++; - if (myStep != myPlan->end()) { - (*myStep)->proceed(net, this, time, arrivedAt, atPos); - /* - if(myWriteEvents) { - (*myStep)->beginEventOutput(*this, time, OutputDevice::getDeviceByOption("person-event-output")); - } - */ - return true; - } else { - arrivedAt->removePerson(this); - return false; - } -} - - -SUMOTime -MSPerson::getDesiredDepart() const { - return myParameter->depart; -} - - -void -MSPerson::setDeparted(SUMOTime now) { - (*myStep)->setDeparted(now); -} - - -void -MSPerson::tripInfoOutput(OutputDevice& os) const { - for (MSPersonPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) { - (*i)->tripInfoOutput(os); - } -} - - -void -MSPerson::routeOutput(OutputDevice& os) const { - MSPersonPlan::const_iterator i = myPlan->begin(); - if ((*i)->getStageType() == WAITING && getDesiredDepart() == static_cast(*i)->getUntil()) { - ++i; - } - for (; i != myPlan->end(); ++i) { - (*i)->routeOutput(os); - } -} - -SUMOReal -MSPerson::getEdgePos() const { - return (*myStep)->getEdgePos(MSNet::getInstance()->getCurrentTimeStep()); -} - -Position -MSPerson::getPosition() const { - return (*myStep)->getPosition(MSNet::getInstance()->getCurrentTimeStep()); -} - - -SUMOReal -MSPerson::getAngle() const { - return (*myStep)->getAngle(MSNet::getInstance()->getCurrentTimeStep()); -} - -SUMOReal -MSPerson::getWaitingSeconds() const { - return STEPS2TIME((*myStep)->getWaitingTime(MSNet::getInstance()->getCurrentTimeStep())); -} - -SUMOReal -MSPerson::getSpeed() const { - return (*myStep)->getSpeed(); -} - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/microsim/MSPerson.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPerson.h --- sumo-0.21.0+dfsg/src/microsim/MSPerson.h 2014-06-10 22:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPerson.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,643 +0,0 @@ -/****************************************************************************/ -/// @file MSPerson.h -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Sascha Krieg -/// @author Michael Behrisch -/// @date Mon, 9 Jul 2001 -/// @version $Id: MSPerson.h 16566 2014-06-10 09:22:55Z behrisch $ -/// -// The class for modelling person-movements -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 MSPerson_h -#define MSPerson_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class MSNet; -class MSEdge; -class MSLane; -class OutputDevice; -class SUMOVehicleParameter; -class MSBusStop; -class SUMOVehicle; -class MSVehicleType; -class MSPModel; -class PedestrianState; - -typedef std::vector MSEdgeVector; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class MSPerson - * - * The class holds a simulated person together with her movement stages - */ -class MSPerson { -public: - enum StageType { - WALKING = 0, - DRIVING = 1, - WAITING = 2 - }; - - - /** - * The "abstract" class for a single stage of a persons movement - * Contains the destination of the current movement step - */ - class MSPersonStage { - public: - /// constructor - MSPersonStage(const MSEdge& destination, StageType type); - - /// destructor - virtual ~MSPersonStage(); - - /// returns the destination edge - const MSEdge& getDestination() const; - - /// Returns the current edge - virtual const MSEdge* getEdge() 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 getStageDescription() const = 0; - - /// proceeds to the next step - virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at) = 0; - - /// logs end of the step - void setDeparted(SUMOTime now); - - /// logs end of the step - void setArrived(SUMOTime now); - - /// 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 the time this person spent waiting - virtual SUMOTime getWaitingTime(SUMOTime now) const = 0; - - /// @brief the time this person spent waiting - virtual SUMOReal getSpeed() const = 0; - - /// @brief get position on edge e at length at with orthogonal offset - Position getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const; - - /// @brief get position on lane at length at with orthogonal offset - Position getLanePosition(const MSLane* lane, 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 on writing vehroute output - * @param[in] os The stream to write the information into - * @exception IOError not yet implemented - */ - virtual void routeOutput(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) - const MSEdge& myDestination; - - /// the time at which this stage started - SUMOTime myDeparted; - - /// the time at which this stage ended - SUMOTime myArrived; - - /// The type of this stage - StageType myType; - - private: - /// @brief Invalidated copy constructor. - MSPersonStage(const MSPersonStage&); - - /// @brief Invalidated assignment operator. - MSPersonStage& operator=(const MSPersonStage&); - - }; - - /** - * A "real" stage performing the walking to an edge - * The walking does not need any route as it is not simulated. - * Only the duration is needed - */ - class MSPersonStage_Walking : public MSPersonStage { - friend class MSPModel; - friend class GUIPerson; // debugging - - public: - /// constructor - 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, MSEdge* previousEdge, const SUMOReal at); - - /// Returns the current edge - const MSEdge* getEdge() const; - const MSEdge* getFromEdge() const; - SUMOReal getEdgePos(SUMOTime now) const; - - /// - Position getPosition(SUMOTime now) const; - - SUMOReal getAngle(SUMOTime now) const; - - SUMOTime getWaitingTime(SUMOTime now) const; - - SUMOReal getSpeed() const; - - std::string getStageDescription() 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 on writing vehroute output - * @param[in] os The stream to write the information into - * @exception IOError not yet implemented - */ - virtual void routeOutput(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; - - /// @brief move forward and return whether the person arrived - bool moveToNextEdge(MSPerson* person, SUMOTime currentTime, MSEdge* nextInternal = 0); - - - /// @brief accessors to be used by MSPModel - //@{ - inline SUMOReal getMaxSpeed() const { - return mySpeed; - } - inline SUMOReal getDepartPos() const { - return myDepartPos; - } - inline SUMOReal getArrivalPos() const { - return myArrivalPos; - } - - inline const MSEdge* getRouteEdge() const { - return *myRouteStep; - } - inline const MSEdge* getNextRouteEdge() const { - return myRouteStep == myRoute.end() - 1 ? 0 : *(myRouteStep + 1); - } - inline const std::vector& getRoute() const { - return myRoute; - } - - PedestrianState* getPedestrianState() const { - return myPedestrianState; - } - //@} - - - private: - - /* @brief compute average speed if the total walking duration is given - * @note Must be callled when the previous stage changes myDepartPos from the default*/ - SUMOReal computeAverageSpeed() const; - - - private: - /// the time the person is walking - SUMOTime myWalkingTime; - - /// @brief The route of the person - std::vector myRoute; - - - std::vector::iterator myRouteStep; - - /// @brief The current internal edge this person is on or 0 - MSEdge* myCurrentInternalEdge; - - /// @brief A vector of computed times an edge is reached - //std::vector myArrivalTimes; - - SUMOReal myDepartPos; - SUMOReal myArrivalPos; - MSBusStop* myDestinationBusStop; - SUMOReal mySpeed; - - /// @brief state that is to be manipulated by MSPModel - PedestrianState* myPedestrianState; - - 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&); - - /// @brief Invalidated assignment operator. - MSPersonStage_Walking& operator=(const MSPersonStage_Walking&); - - }; - - /** - * A "real" stage performing the travelling by a transport system - * The given route will be chosen. The travel time is computed by the simulation - */ - class MSPersonStage_Driving : public MSPersonStage { - public: - /// constructor - 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, MSEdge* previousEdge, const SUMOReal at); - - /// Returns the current edge - const MSEdge* getEdge() const; - const MSEdge* getFromEdge() const; - SUMOReal getEdgePos(SUMOTime now) const; - - /// - Position getPosition(SUMOTime now) const; - - SUMOReal getAngle(SUMOTime now) const; - - std::string getStageDescription() const; - - /// Whether the person waits for a vehicle of the line specified. - bool isWaitingFor(const std::string& line) const; - - /// @brief Whether the person waits for a vehicle - bool isWaiting4Vehicle() const; - - /// @brief time spent waiting for a ride - SUMOTime getWaitingTime(SUMOTime now) const; - - SUMOReal getSpeed() const; - - void setVehicle(SUMOVehicle* v) { - myVehicle = v; - } - - /** @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 on writing vehroute output - * - * @param[in] os The stream to write the information into - * @exception IOError not yet implemented - */ - virtual void routeOutput(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; - SUMOReal myWaitingPos; - /// @brief The time since which this person is waiting for a ride - SUMOTime myWaitingSince; - const MSEdge* myWaitingEdge; - - private: - /// @brief Invalidated copy constructor. - MSPersonStage_Driving(const MSPersonStage_Driving&); - - /// @brief Invalidated assignment operator. - MSPersonStage_Driving& operator=(const MSPersonStage_Driving&); - - }; - - /** - * A "real" stage performing a waiting over the specified time - */ - class MSPersonStage_Waiting : public MSPersonStage { - public: - /// constructor - 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() const; - const MSEdge* getFromEdge() const; - SUMOReal getEdgePos(SUMOTime now) const; - SUMOTime getUntil() const; - - /// - Position getPosition(SUMOTime now) const; - - SUMOReal getAngle(SUMOTime now) const; - - SUMOTime getWaitingTime(SUMOTime now) const; - - SUMOReal getSpeed() const; - - std::string getStageDescription() const { - return "waiting (" + myActType + ")"; - } - - /// proceeds to the next step - virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at); - - /** @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 on writing vehroute output - * - * @param[in] os The stream to write the information into - * @exception IOError not yet implemented - */ - virtual void routeOutput(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; - - /// the time until the person is waiting - SUMOTime myWaitingUntil; - - /// the time the person is waiting - SUMOTime myWaitingStart; - - /// @brief The type of activity - std::string myActType; - - SUMOReal myStartPos; - - - private: - /// @brief Invalidated copy constructor. - MSPersonStage_Waiting(const MSPersonStage_Waiting&); - - /// @brief Invalidated assignment operator. - MSPersonStage_Waiting& operator=(const MSPersonStage_Waiting&); - - }; - -public: - /// the structure holding the plan of a person - typedef std::vector MSPersonPlan; - -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, const MSVehicleType* vtype, MSPersonPlan* plan); - - /// destructor - virtual ~MSPerson(); - - /// returns the person id - const std::string& getID() const; - - /* @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; - - /// logs end of the step - void setDeparted(SUMOTime now); - - /// Returns the current destination. - const MSEdge& getDestination() const { - return (*myStep)->getDestination(); - } - - /// @brief Returns the current edge - const MSEdge* getEdge() const { - return (*myStep)->getEdge(); - } - - /// @brief Returns the departure edge - const MSEdge* getFromEdge() const { - return (*myStep)->getFromEdge(); - } - - /// @brief return the offset from the start of the current edge - virtual SUMOReal getEdgePos() const; - - /// @brief return the Network coordinate of the person - virtual Position getPosition() const; - - /// @brief return the current angle of the person - virtual SUMOReal getAngle() const; - - /// @brief the time this person spent waiting in seconds - virtual SUMOReal getWaitingSeconds() const; - - /// @brief the current speed of the person - virtual SUMOReal getSpeed() const; - - /// - StageType getCurrentStageType() const { - return (*myStep)->getStageType(); - } - - - std::string getCurrentStageDescription() const { - return (*myStep)->getStageDescription(); - } - - MSPersonStage* getCurrentStage() const { - return *myStep; - } - - /** @brief Called on writing tripinfo output - * - * @param[in] os The stream to write the information into - * @exception IOError not yet implemented - */ - void tripInfoOutput(OutputDevice& os) const; - - /** @brief Called on writing vehroute output - * - * @param[in] os The stream to write the information into - * @exception IOError not yet implemented - */ - void routeOutput(OutputDevice& os) const; - - /// Whether the person waits for a vehicle of the line specified. - bool isWaitingFor(const std::string& line) const { - return (*myStep)->isWaitingFor(line); - } - - /// Whether the person waits for a vehicle - bool isWaiting4Vehicle() const { - return (*myStep)->isWaiting4Vehicle(); - } - - - const SUMOVehicleParameter& getParameter() const { - return *myParameter; - } - - - inline const MSVehicleType& getVehicleType() const { - return *myVType; - } - -private: - /// @brief Invalidated copy constructor. - MSPerson(const MSPerson&); - - /// @brief Invalidated assignment operator. - MSPerson& operator=(const MSPerson&); - -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/MSPModel.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPModel.cpp --- sumo-0.21.0+dfsg/src/microsim/MSPModel.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPModel.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ -/****************************************************************************/ -/// @file MSPModel.h -/// @author Jakob Erdmann -/// @date Mon, 13 Jan 2014 -/// @version $Id: MSPModel.cpp 16560 2014-06-09 20:54:15Z behrisch $ -/// -// The pedestrian following model (prototype) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 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 "MSNet.h" -#include "MSEdge.h" -#include "MSJunction.h" -#include "MSLane.h" -#include "MSPModel_Striping.h" -#include "MSPModel_NonInteracting.h" -#include "MSPModel.h" - - - - -// =========================================================================== -// static members -// =========================================================================== -MSPModel* MSPModel::myModel(0); - -// named constants -const int MSPModel::FORWARD(1); -const int MSPModel::BACKWARD(-1); -const int MSPModel::UNDEFINED_DIRECTION(0); - -// parameters shared by all models -const SUMOReal MSPModel::SAFETY_GAP(1.0); - -const SUMOReal MSPModel::SIDEWALK_OFFSET(3); - -// =========================================================================== -// MSPModel method definitions -// =========================================================================== - - -MSPModel* -MSPModel::getModel() { - if (myModel == 0) { - const OptionsCont& oc = OptionsCont::getOptions(); - MSNet* net = MSNet::getInstance(); - const std::string model = oc.getString("pedestrian.model"); - if (model == "striping") { - myModel = new MSPModel_Striping(oc, net); - } else if (model == "nonInteracting") { - myModel = new MSPModel_NonInteracting(oc, net); - } else { - throw ProcessError("Unknown pedestrian model '" + model + "'"); - } - } - return myModel; -} - - -void -MSPModel::cleanup() { - if (myModel != 0) { - myModel->cleanupHelper(); - delete myModel; - myModel = 0; - } -} - - -MSLane* -MSPModel::getSidewalk(const MSEdge* edge) { - if (edge == 0) { - return 0; - } - assert(edge->getLanes().size() > 0); - const std::vector& lanes = edge->getLanes(); - for (std::vector::const_iterator it = lanes.begin(); it != lanes.end(); ++it) { - if ((*it)->allowsVehicleClass(SVC_PEDESTRIAN)) { - return *it; - } - } - return lanes.front(); -} - - -bool -MSPModel::canTraverse(int dir, const std::vector& route) { - const MSJunction* junction = 0; - for (std::vector::const_iterator it = route.begin(); it != route.end(); ++it) { - const MSEdge* edge = *it; - if (junction != 0) { - //std::cout << " junction=" << junction->getID() << " edge=" << edge->getID() << "\n"; - if (junction == edge->getFromJunction()) { - dir = FORWARD; - } else if (junction == edge->getToJunction()) { - dir = BACKWARD; - } else { - return false; - } - } - junction = dir == FORWARD ? edge->getToJunction() : edge->getFromJunction(); - } - return true; -} - -/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/MSPModel.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPModel.h --- sumo-0.21.0+dfsg/src/microsim/MSPModel.h 2014-05-06 22:02:08.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPModel.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,119 +0,0 @@ -/****************************************************************************/ -/// @file MSPModel.h -/// @author Jakob Erdmann -/// @date Mon, 13 Jan 2014 -/// @version $Id: MSPModel.h 16297 2014-05-06 06:39:16Z namdre $ -/// -// The pedestrian following model (prototype) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 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 MSPModel_h -#define MSPModel_h - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include - -// =========================================================================== -// class declarations -// =========================================================================== -class MSNet; -class MSLane; -class MSJunction; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class MSPModel - * @brief The pedestrian following model - * - */ -class MSPModel { -public: - - static MSPModel* getModel(); - - /// @brief remove state at simulation end - static void cleanup(); - - /// @brief return the appropriate lane to walk on - static MSLane* getSidewalk(const MSEdge* edge); - - virtual ~MSPModel() {}; - - /// @brief register the given person as a pedestrian - virtual PedestrianState* add(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, SUMOTime now) = 0; - - /// @brief whether a pedestrian is blocking the crossing of lane at offset distToCrossing - virtual bool blockedAtDist(const MSLane* lane, SUMOReal distToCrossing, std::vector* collectBlockers) = 0; - - virtual void cleanupHelper() {}; - - // @brief walking directions - static const int FORWARD; - static const int BACKWARD; - static const int UNDEFINED_DIRECTION; - - // @brief the safety gap to keep between the car and the pedestrian in all directions - static const SUMOReal SAFETY_GAP; - - /// @brief the offset for computing person positions when walking on edges without a sidewalk - static const SUMOReal SIDEWALK_OFFSET; - - /// @brief return whether the route may traversed with the given starting direction - static bool canTraverse(int dir, const std::vector& route); - -private: - static MSPModel* myModel; - -}; - - -/// @brief abstract base class for managing callbacks to retrieve various state information from the model -class PedestrianState { -public: - virtual ~PedestrianState() {}; - - /// @brief return the offset from the start of the current edge measured in its natural direction - virtual SUMOReal getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const = 0; - - /// @brief return the network coordinate of the person - virtual Position getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const = 0; - - /// @brief return the direction in which the person faces in degrees - virtual SUMOReal getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const = 0; - - /// @brief return the time the person spent standing - virtual SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const = 0; - - /// @brief return the current speed of the person - virtual SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking& stage) const = 0; -}; - - - -#endif /* MSPModel_h */ - diff -Nru sumo-0.21.0+dfsg/src/microsim/MSPModel_NonInteracting.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPModel_NonInteracting.cpp --- sumo-0.21.0+dfsg/src/microsim/MSPModel_NonInteracting.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPModel_NonInteracting.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ -/****************************************************************************/ -/// @file MSPModel_NonInteracting.h -/// @author Jakob Erdmann -/// @date Mon, 13 Jan 2014 -/// @version $Id: MSPModel_NonInteracting.cpp 16560 2014-06-09 20:54:15Z behrisch $ -/// -// The pedestrian following model (prototype) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 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 "MSPModel_NonInteracting.h" - - -// =========================================================================== -// DEBUGGING HELPERS -// =========================================================================== -// -#define DEBUG1 "disabled" -#define DEBUG2 "disabled" -#define DEBUGCOND(PEDID) (PEDID == DEBUG1 || PEDID == DEBUG2) - -// =========================================================================== -// named (internal) constants -// =========================================================================== - - -// =========================================================================== -// static members -// =========================================================================== - - -// =========================================================================== -// MSPModel_NonInteracting method definitions -// =========================================================================== - -MSPModel_NonInteracting::MSPModel_NonInteracting(const OptionsCont& oc, MSNet* net) : - myNet(net) { - assert(myNet != 0); - UNUSED_PARAMETER(oc); -} - - -MSPModel_NonInteracting::~MSPModel_NonInteracting() { -} - - -PedestrianState* -MSPModel_NonInteracting::add(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, SUMOTime now) { - PState* state = new PState(); - const SUMOTime firstEdgeDuration = state->computeWalkingTime(0, *stage, now); - myNet->getBeginOfTimestepEvents().addEvent(new MoveToNextEdge(person, *stage), - now + firstEdgeDuration, MSEventControl::ADAPT_AFTER_EXECUTION); - - //if DEBUGCOND(person->getID()) std::cout << SIMTIME << " " << person->getID() << " inserted on " << stage->getEdge()->getID() << "\n"; - return state; -} - - -bool -MSPModel_NonInteracting::blockedAtDist(const MSLane*, SUMOReal, std::vector*) { - return false; -} - - -SUMOTime -MSPModel_NonInteracting::MoveToNextEdge::execute(SUMOTime currentTime) { - PState* state = dynamic_cast(myParent.getPedestrianState()); - const MSEdge* old = myParent.getEdge(); - const bool arrived = myParent.moveToNextEdge(myPerson, currentTime); - if (arrived) { - // walk finished. clean up state - delete state; - //if DEBUGCOND(myPerson->getID()) std::cout << SIMTIME << " " << myPerson->getID() << " arrived on " << old->getID() << "\n"; - return 0; - } else { - //if DEBUGCOND(myPerson->getID()) std::cout << SIMTIME << " " << myPerson->getID() << " moves to " << myParent.getEdge()->getID() << "\n"; - return state->computeWalkingTime(old, myParent, currentTime); - } -} - - -SUMOTime -MSPModel_NonInteracting::PState::computeWalkingTime(const MSEdge* prev, const MSPerson::MSPersonStage_Walking& stage, SUMOTime currentTime) { - myLastEntryTime = currentTime; - const MSEdge* edge = stage.getEdge(); - const MSEdge* next = stage.getNextRouteEdge(); - int dir = UNDEFINED_DIRECTION; - if (prev == 0) { - myCurrentBeginPos = stage.getDepartPos(); - } else { - // default to FORWARD if not connected - dir = (edge->getToJunction() == prev->getToJunction() || edge->getToJunction() == prev->getFromJunction()) ? BACKWARD : FORWARD; - myCurrentBeginPos = dir == FORWARD ? 0 : edge->getLength(); - } - if (next == 0) { - myCurrentEndPos = stage.getArrivalPos(); - } else { - if (dir == UNDEFINED_DIRECTION) { - // default to FORWARD if not connected - dir = (edge->getFromJunction() == next->getFromJunction() || edge->getFromJunction() == next->getToJunction()) ? BACKWARD : FORWARD; - } - myCurrentEndPos = dir == FORWARD ? edge->getLength() : 0; - } - // ensure that a result > 0 is returned even if the walk ends immediately - myCurrentDuration = MAX2((SUMOTime)1, TIME2STEPS(fabs(myCurrentEndPos - myCurrentBeginPos) / stage.getMaxSpeed())); - //std::cout << SIMTIME << " dir=" << dir << " curBeg=" << myCurrentBeginPos << " curEnd=" << myCurrentEndPos << " speed=" << stage.getMaxSpeed() << " dur=" << myCurrentDuration << "\n"; - return myCurrentDuration; -} - - -SUMOReal -MSPModel_NonInteracting::PState::getEdgePos(const MSPerson::MSPersonStage_Walking&, SUMOTime now) const { - //std::cout << SIMTIME << " pos=" << (myCurrentBeginPos + (myCurrentEndPos - myCurrentBeginPos) / myCurrentDuration * (now - myLastEntryTime)) << "\n"; - return myCurrentBeginPos + (myCurrentEndPos - myCurrentBeginPos) / myCurrentDuration * (now - myLastEntryTime); -} - - -Position -MSPModel_NonInteracting::PState::getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const { - const MSLane* lane = getSidewalk(stage.getEdge()); - const SUMOReal lateral_offset = lane->allowsVehicleClass(SVC_PEDESTRIAN) ? 0 : SIDEWALK_OFFSET; - return stage.getLanePosition(lane, getEdgePos(stage, now), lateral_offset); -} - - -SUMOReal -MSPModel_NonInteracting::PState::getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const { - //std::cout << SIMTIME << " rawAngle=" << stage.getEdgeAngle(stage.getEdge(), getEdgePos(stage, now)) << " angle=" << stage.getEdgeAngle(stage.getEdge(), getEdgePos(stage, now)) + (myCurrentEndPos < myCurrentBeginPos ? 180 : 0) << "\n"; - SUMOReal angle = -stage.getEdgeAngle(stage.getEdge(), getEdgePos(stage, now)) + (myCurrentEndPos < myCurrentBeginPos ? 180 : 0); - if (angle > 180) { - angle -= 360; - } - return angle; -} - - -SUMOTime -MSPModel_NonInteracting::PState::getWaitingTime(const MSPerson::MSPersonStage_Walking&, SUMOTime) const { - return 0; -} - - -SUMOReal -MSPModel_NonInteracting::PState::getSpeed(const MSPerson::MSPersonStage_Walking& stage) const { - return stage.getMaxSpeed(); -} - -/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/MSPModel_NonInteracting.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPModel_NonInteracting.h --- sumo-0.21.0+dfsg/src/microsim/MSPModel_NonInteracting.h 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPModel_NonInteracting.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,119 +0,0 @@ -/****************************************************************************/ -/// @file MSPModel_NonInteracting.h -/// @author Jakob Erdmann -/// @date Mon, 13 Jan 2014 -/// @version $Id: MSPModel_NonInteracting.h 16290 2014-05-05 12:38:38Z namdre $ -/// -// The pedestrian following model (prototype) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 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 MSPModel_NonInteracting_h -#define MSPModel_NonInteracting_h - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include - -// =========================================================================== -// class declarations -// =========================================================================== -class MSNet; -class MSLink; -class MSLane; -class MSJunction; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class MSPModel_NonInteracting - * @brief The pedestrian following model - * - */ -class MSPModel_NonInteracting : public MSPModel { -public: - - /// @brief Constructor (it should not be necessary to construct more than one instance) - MSPModel_NonInteracting(const OptionsCont& oc, MSNet* net); - - ~MSPModel_NonInteracting(); - - /// @brief register the given person as a pedestrian - PedestrianState* add(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, SUMOTime now); - - /// @brief whether a pedestrian is blocking the crossing of lane at offset distToCrossing - bool blockedAtDist(const MSLane* lane, SUMOReal distToCrossing, std::vector* collectBlockers); - -private: - class MoveToNextEdge : public Command { - public: - MoveToNextEdge(MSPerson* person, MSPerson::MSPersonStage_Walking& walk) : myParent(walk), myPerson(person) {} - ~MoveToNextEdge() {} - SUMOTime execute(SUMOTime currentTime); - - private: - MSPerson::MSPersonStage_Walking& myParent; - MSPerson* myPerson; - private: - /// @brief Invalidated assignment operator. - MoveToNextEdge& operator=(const MoveToNextEdge&); - }; - - /// @brief abstract base class for managing callbacks to retrieve various state information from the model - class PState : public PedestrianState { - public: - PState() {}; - - /// @brief abstract methods inherited from PedestrianState - /// @{ - SUMOReal getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; - Position getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; - SUMOReal getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; - SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; - SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking& stage) const; - /// @} - - /// @brief compute walking time on edge and update state members - SUMOTime computeWalkingTime(const MSEdge* prev, const MSPerson::MSPersonStage_Walking& stage, SUMOTime currentTime); - - - private: - SUMOTime myLastEntryTime; - SUMOTime myCurrentDuration; - SUMOReal myCurrentBeginPos; - SUMOReal myCurrentEndPos; - - }; - -private: - /// @brief the net to which to issue moveToNextEdge commands - MSNet* myNet; - -}; - - -#endif /* MSPModel_NonInteracting_h */ - diff -Nru sumo-0.21.0+dfsg/src/microsim/MSPModel_Striping.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPModel_Striping.cpp --- sumo-0.21.0+dfsg/src/microsim/MSPModel_Striping.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPModel_Striping.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1040 +0,0 @@ -/****************************************************************************/ -/// @file MSPModel_Striping.h -/// @author Jakob Erdmann -/// @date Mon, 13 Jan 2014 -/// @version $Id: MSPModel_Striping.cpp 16560 2014-06-09 20:54:15Z behrisch $ -/// -// The pedestrian following model (prototype) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 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 "MSPModel_Striping.h" - - -// =========================================================================== -// DEBUGGING HELPERS -// =========================================================================== -// -#define DEBUG1 "disabled" -#define DEBUG2 "disabled" -#define DEBUGCOND(PEDID) (PEDID == DEBUG1 || PEDID == DEBUG2) -#define LOG_ALL false - -void MSPModel_Striping::DEBUG_PRINT(const Obstacles& obs) { - for (int i = 0; i < (int)obs.size(); ++i) { - std::cout - << "(" << obs[i].description - << " x=" << obs[i].x - << " s=" << obs[i].speed - << ") "; - } - std::cout << "\n"; -} - -// =========================================================================== -// named (internal) constants -// =========================================================================== - - -// need to be able to subtract without underflow -#define BLOCKED_STRIPE -10000 -#define FAR_AWAY 10000 -#define ONCOMING_CONFLICT -1000 - -// =========================================================================== -// static members -// =========================================================================== - -MSPModel_Striping::WalkingAreaPaths MSPModel_Striping::myWalkingAreaPaths; -MSPModel_Striping::Pedestrians MSPModel_Striping::noPedestrians; - - -// model parameters (static to simplify access from class PState -SUMOReal MSPModel_Striping::stripeWidth; -SUMOReal MSPModel_Striping::dawdling; -const SUMOReal MSPModel_Striping::LOOKAHEAD_SAMEDIR(4.0); // seconds -const SUMOReal MSPModel_Striping::LOOKAHEAD_ONCOMING(10.0); // seconds -const SUMOReal MSPModel_Striping::LATERAL_PENALTY(-1); -const SUMOReal MSPModel_Striping::SQUEEZE(0.7); -const SUMOReal MSPModel_Striping::BLOCKER_LOOKAHEAD(10.0); -const SUMOReal MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR(0.0); -const SUMOReal MSPModel_Striping::MAX_WAIT_TOLERANCE(120.); // seconds -const SUMOReal MSPModel_Striping::LATERAL_SPEED_FACTOR(0.4); - - -// =========================================================================== -// MSPModel_Striping method definitions -// =========================================================================== - -MSPModel_Striping::MSPModel_Striping(const OptionsCont& oc, MSNet* net) : - myNumActivePedestrians(0) { - myCommand = new MovePedestrians(this); - net->getBeginOfTimestepEvents().addEvent(myCommand, net->getCurrentTimeStep() + DELTA_T, MSEventControl::ADAPT_AFTER_EXECUTION); - initWalkingAreaPaths(net); - // configurable parameters - stripeWidth = oc.getFloat("pedestrian.striping.stripe-width"); - dawdling = oc.getFloat("pedestrian.striping.dawdling"); -} - - -MSPModel_Striping::~MSPModel_Striping() { -} - - -PedestrianState* -MSPModel_Striping::add(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, SUMOTime) { - assert(person->getCurrentStageType() == MSPerson::WALKING); - const MSLane* lane = getSidewalk(person->getEdge()); - PState* ped = new PState(person, stage, lane); - myActiveLanes[lane].push_back(ped); - myNumActivePedestrians++; - return ped; -} - - -bool -MSPModel_Striping::blockedAtDist(const MSLane* lane, SUMOReal distToCrossing, std::vector* collectBlockers) { - const Pedestrians& pedestrians = getPedestrians(lane); - for (Pedestrians::const_iterator it_ped = pedestrians.begin(); it_ped != pedestrians.end(); ++it_ped) { - const PState& ped = **it_ped; - const SUMOReal halfVehicleWidth = 1.0; // @note could get the actual value from the vehicle - const SUMOReal leaderBackDist = (ped.myDir == FORWARD - ? distToCrossing - (ped.myRelX - ped.getLength() - MSPModel::SAFETY_GAP - halfVehicleWidth) - : (ped.myRelX + ped.getLength() + MSPModel::SAFETY_GAP + halfVehicleWidth) - distToCrossing); - //std::cout << SIMTIME << " foe=" << foeLane->getID() << " dir=" << p.myDir << " pX=" << ped.myRelX << " pL=" << ped.getLength() << " fDTC=" << distToCrossing << " lBD=" << leaderBackDist << "\n"; - if (leaderBackDist >= 0 && leaderBackDist <= BLOCKER_LOOKAHEAD) { - // found one pedestrian that is not completely past the crossing point - //std::cout << SIMTIME << " blocking pedestrian foeLane=" << lane->getID() << " ped=" << ped.myPerson->getID() << " dir=" << ped.myDir << " pX=" << ped.myRelX << " pL=" << ped.getLength() << " fDTC=" << distToCrossing << " lBD=" << leaderBackDist << "\n"; - if (collectBlockers == 0) { - return true; - } else { - collectBlockers->push_back(ped.myPerson); - } - } - } - if (collectBlockers == 0) { - return false; - } else { - return collectBlockers->size() > 0; - } -} - - -MSPModel_Striping::Pedestrians& -MSPModel_Striping::getPedestrians(const MSLane* lane) { - ActiveLanes::iterator it = myActiveLanes.find(lane); - if (it != myActiveLanes.end()) { - //std::cout << " found lane=" << lane->getID() << " n=" << it->second.size() << "\n"; - return (it->second); - } else { - return noPedestrians; - } -} - - -void -MSPModel_Striping::cleanupHelper() { - myActiveLanes.clear(); - myNumActivePedestrians = 0; - myWalkingAreaPaths.clear(); // need to recompute when lane pointers change -} - - -int -MSPModel_Striping::numStripes(const MSLane* lane) { - return (int)floor(lane->getWidth() / stripeWidth); -} - -int -MSPModel_Striping::connectedDirection(const MSLane* from, const MSLane* to) { - if (from == 0 || to == 0) { - return UNDEFINED_DIRECTION; - } else if (MSLinkContHelper::getConnectingLink(*from, *to)) { - return FORWARD; - } else if (MSLinkContHelper::getConnectingLink(*to, *from)) { - return BACKWARD; - } else { - return UNDEFINED_DIRECTION; - } -} - - -void -MSPModel_Striping::initWalkingAreaPaths(const MSNet*) { - if (myWalkingAreaPaths.size() > 0) { - return; - } - for (size_t i = 0; i < MSEdge::dictSize(); ++i) { - const MSEdge* edge = MSEdge::dictionary(i); - if (edge->isWalkingArea()) { - const MSLane* walkingArea = getSidewalk(edge); - // build all possible paths across this walkingArea - // gather all incident lanes - std::vector lanes; - const std::vector& incoming = edge->getIncomingEdges(); - for (int j = 0; j < (int)incoming.size(); ++j) { - lanes.push_back(getSidewalk(incoming[j])); - } - for (int j = 0; j < (int)edge->getNoFollowing(); ++j) { - lanes.push_back(getSidewalk(edge->getFollower(j))); - } - // build all combinations - for (int j = 0; j < (int)lanes.size(); ++j) { - for (int k = 0; k < (int)lanes.size(); ++k) { - if (j != k) { - // build the walkingArea - const MSLane* from = lanes[j]; - const MSLane* to = lanes[k]; - const int fromDir = MSLinkContHelper::getConnectingLink(*from, *walkingArea) != 0 ? FORWARD : BACKWARD; - const int toDir = MSLinkContHelper::getConnectingLink(*walkingArea, *to) != 0 ? FORWARD : BACKWARD; - PositionVector shape; - Position fromPos = from->getShape()[fromDir == FORWARD ? -1 : 0]; - Position toPos = to->getShape()[toDir == FORWARD ? 0 : -1]; - const SUMOReal maxExtent = fromPos.distanceTo2D(toPos) / 4; // prevent sharp corners - const SUMOReal extrapolateBy = MIN2(maxExtent, walkingArea->getWidth() / 2); - // assemble shape - shape.push_back(fromPos); - if (extrapolateBy > POSITION_EPS) { - PositionVector fromShp = from->getShape(); - fromShp.extrapolate(extrapolateBy); - shape.push_back(fromDir == FORWARD ? fromShp.back() : fromShp.front()); - PositionVector nextShp = to->getShape(); - nextShp.extrapolate(extrapolateBy); - shape.push_back(toDir == FORWARD ? nextShp.front() : nextShp.back()); - } - shape.push_back(toPos); - if (fromDir == BACKWARD) { - // will be walking backward on walkingArea - shape = shape.reverse(); - } - myWalkingAreaPaths[std::make_pair(from, to)] = WalkingAreaPath(from, walkingArea, to, shape); - } - } - } - } - } -} - - -MSPModel_Striping::NextLaneInfo -MSPModel_Striping::getNextLane(const PState& ped, const MSLane* currentLane, const MSLane* prevLane) { - const MSEdge* currentEdge = ¤tLane->getEdge(); - const MSJunction* junction = ped.myDir == FORWARD ? currentEdge->getToJunction() : currentEdge->getFromJunction(); - const MSEdge* nextRouteEdge = ped.myStage->getNextRouteEdge(); - const MSLane* nextRouteLane = getSidewalk(nextRouteEdge); - // result values - const MSLane* nextLane = nextRouteLane; - MSLink* link = 0; - int nextDir = UNDEFINED_DIRECTION; - - if (nextRouteLane != 0) { - if (currentEdge->isInternal()) { - assert(junction == currentEdge->getFromJunction()); - nextDir = junction == nextRouteEdge->getFromJunction() ? FORWARD : BACKWARD; - if DEBUGCOND(ped.myPerson->getID()) { - std::cout << " internal\n"; - } - } else if (currentEdge->isCrossing()) { - nextDir = ped.myDir; - if (ped.myDir == FORWARD) { - nextLane = currentLane->getLinkCont()[0]->getLane(); - } else { - nextLane = currentLane->getLogicalPredecessorLane(); - } - if DEBUGCOND(ped.myPerson->getID()) { - std::cout << " crossing\n"; - } - } else if (currentEdge->isWalkingArea()) { - std::vector crossingRoute; - // departPos can be 0 because the direction of the walkingArea does not matter - // for the arrivalPos, we need to make sure that the route does not deviate across other junctions - const int nextRouteEdgeDir = nextRouteEdge->getFromJunction() == junction ? FORWARD : BACKWARD; - const SUMOReal arrivalPos = (nextRouteEdge == ped.myStage->getRoute().back() - ? ped.myStage->getArrivalPos() - : (nextRouteEdgeDir == FORWARD ? 0 : nextRouteEdge->getLength())); - std::vector prohibited; - prohibited.push_back(&prevLane->getEdge()); - MSNet::getInstance()->getPedestrianRouter(prohibited).compute(currentEdge, nextRouteEdge, 0, arrivalPos, ped.myStage->getMaxSpeed(), 0, junction, crossingRoute, true); - if DEBUGCOND(ped.myPerson->getID()) { - std::cout - << " nreDir=" << nextRouteEdgeDir - << " aPos=" << arrivalPos - << " crossingRoute=" << toString(crossingRoute) - << "\n"; - } - if (crossingRoute.size() > 1) { - const MSEdge* nextEdge = crossingRoute[1]; - nextLane = getSidewalk(crossingRoute[1]); - assert((nextEdge->getFromJunction() == junction || nextEdge->getToJunction() == junction)); - assert(nextLane != prevLane); - nextDir = connectedDirection(currentLane, nextLane); - if DEBUGCOND(ped.myPerson->getID()) { - std::cout << " nextDir=" << nextDir << "\n"; - } - assert(nextDir != UNDEFINED_DIRECTION); - if (nextDir == FORWARD) { - link = MSLinkContHelper::getConnectingLink(*currentLane, *nextLane); - } else if (nextEdge->isCrossing()) { - const MSLane* oppositeWalkingArea = nextLane->getLogicalPredecessorLane(); - link = MSLinkContHelper::getConnectingLink(*oppositeWalkingArea, *nextLane); - } else { - link = MSLinkContHelper::getConnectingLink(*nextLane, *currentLane); - } - assert(link != 0); - } else { - if DEBUGCOND(ped.myPerson->getID()) { - std::cout << SIMTIME - << " no route from '" << (currentEdge == 0 ? "NULL" : currentEdge->getID()) - << "' to '" << (nextRouteEdge == 0 ? "NULL" : nextRouteEdge->getID()) - << "\n"; - } - nextDir = FORWARD; // fallback - } - } else { - // normal edge. by default use next / previous walking area - nextDir = ped.myDir; - nextLane = getNextWalkingArea(currentLane, ped.myDir, link); - if (nextLane != 0) { - // walking area found - if DEBUGCOND(ped.myPerson->getID()) { - std::cout << " next walkingArea " << (nextDir == FORWARD ? "forward" : "backward") << "\n"; - } - } else { - // try to use a direct link as fallback - // direct links only exist if built explicitly. They are used to model tl-controlled links if there are no crossings - if (ped.myDir == FORWARD) { - link = MSLinkContHelper::getConnectingLink(*currentLane, *nextRouteLane); -#ifdef HAVE_INTERNAL_LANES - if (link != 0) { - if DEBUGCOND(ped.myPerson->getID()) { - std::cout << " direct forward\n"; - } - nextLane = MSLinkContHelper::getInternalFollowingLane(currentLane, nextRouteLane); - } -#endif - } else { - link = MSLinkContHelper::getConnectingLink(*nextRouteLane, *currentLane); -#ifdef HAVE_INTERNAL_LANES - if (link != 0) { - if DEBUGCOND(ped.myPerson->getID()) { - std::cout << " direct backward\n"; - } - nextLane = MSLinkContHelper::getInternalFollowingLane(nextRouteLane, currentLane); - } -#endif - } - } - if (nextLane == 0) { - // no internal lane found - nextLane = nextRouteLane; - if DEBUGCOND(ped.myPerson->getID()) { - std::cout << SIMTIME << " no next lane found for " << currentLane->getID() << " dir=" << ped.myDir << "\n"; - } - } else if (nextLane->getLength() <= POSITION_EPS) { - // internal lane too short - nextLane = nextRouteLane; - } - } - } - if DEBUGCOND(ped.myPerson->getID()) { - std::cout << SIMTIME - << " p=" << ped.myPerson->getID() - << " l=" << currentLane->getID() - << " nl=" << (nextLane == 0 ? "NULL" : nextLane->getID()) - << " nrl=" << (nextRouteLane == 0 ? "NULL" : nextRouteLane->getID()) - << " d=" << nextDir - << " link=" << (link == 0 ? "NULL" : link->getViaLaneOrLane()->getID()) - << " pedDir=" << ped.myDir - << "\n"; - } - return NextLaneInfo(nextLane, link, nextDir); -} - - -const MSLane* -MSPModel_Striping::getNextWalkingArea(const MSLane* currentLane, const int dir, MSLink*& link) { - if (dir == FORWARD) { - const MSLinkCont& links = currentLane->getLinkCont(); - for (MSLinkCont::const_iterator it = links.begin(); it != links.end(); ++it) { - if ((*it)->getLane()->getEdge().isWalkingArea()) { - link = *it; - return (*it)->getLane(); - } - } - } else { - const std::vector& laneInfos = currentLane->getIncomingLanes(); - for (std::vector::const_iterator it = laneInfos.begin(); it != laneInfos.end(); ++it) { - if ((*it).lane->getEdge().isWalkingArea()) { - link = (*it).viaLink; - return (*it).lane; - } - } - } - return 0; -} - - -MSPModel_Striping::Obstacles -MSPModel_Striping::mergeObstacles(const Obstacles& obs1, const Obstacles& obs2, int dir) { - Obstacles result(obs1.begin(), obs1.end()); - for (int i = 0; i < (int)obs1.size(); ++i) { - if ((obs2[i].x - obs1[i].x) * dir < 0) { - result[i] = obs2[i]; - } - } - return result; -} - - -MSPModel_Striping::Obstacles -MSPModel_Striping::getNeighboringObstacles(const Pedestrians& pedestrians, int egoIndex, int stripes) { - const PState& ego = *pedestrians[egoIndex]; - const SUMOReal egoBack = ego.myRelX - ego.myDir * ego.getLength(); - int index = egoIndex + 1; - Obstacles obs(stripes, Obstacle(ego.myDir)); - while (index < (int)pedestrians.size() && ego.myDir * (pedestrians[index]->myRelX - egoBack) > 0) { - const PState& p = *pedestrians[index]; - if (!p.myWaitingToEnter) { - Obstacle o(p, ego.myDir); - obs[p.stripe()] = o; - obs[p.otherStripe()] = o; - } - index++; - } - if DEBUGCOND(ego.myPerson->getID()) { - std::cout << SIMTIME << " ped=" << ego.myPerson->getID() << " neighObs="; - DEBUG_PRINT(obs); - } - return obs; -} - - -const MSPModel_Striping::Obstacles& -MSPModel_Striping::getNextLaneObstacles(NextLanesObstacles& nextLanesObs, const MSLane* nextLane, int stripes, SUMOReal nextLength, int nextDir, - SUMOReal currentLength, int currentDir) { - if (nextLanesObs.count(nextLane) == 0) { - //std::cout << SIMTIME << " getNextLaneObstacles" - // << " nextLane=" << nextLane->getID() - // << " nextLength=" << nextLength - // << " nextDir=" << nextDir - // << " currentLength=" << currentLength - // << " currentDir=" << currentDir - // << "\n"; - - // figure out the which pedestrians are ahead on the next lane - const int offset = (stripes - numStripes(nextLane)) / 2; - Obstacles obs(stripes, Obstacle(nextDir)); - Pedestrians& pedestrians = getPedestrians(nextLane); - // XXX consider waitingToEnter on nextLane - sort(pedestrians.begin(), pedestrians.end(), by_xpos_sorter(nextDir)); - for (int ii = 0; ii < (int)pedestrians.size(); ++ii) { - const PState& p = *pedestrians[ii]; - if (p.myWaitingToEnter) { - continue; - } - Obstacle o(p, nextDir); - int mappedStripe = p.stripe() + offset; - if (mappedStripe >= 0 && mappedStripe < stripes) { - obs[mappedStripe] = o; - } - mappedStripe = p.otherStripe() + offset; - if (mappedStripe >= 0 && mappedStripe < stripes) { - obs[mappedStripe] = o; - } - } - for (int ii = 0; ii < stripes; ++ii) { - Obstacle& o = obs[ii]; - if (nextDir == BACKWARD) { - o.x = nextLength - o.x; - } - if (currentDir == FORWARD) { - o.x += currentLength; - } else { - o.x *= -1; - } - } - nextLanesObs[nextLane] = obs; - } - return nextLanesObs[nextLane]; -} - - -void -MSPModel_Striping::moveInDirection(SUMOTime currentTime, std::set& changedLane, int dir) { - for (ActiveLanes::iterator it_lane = myActiveLanes.begin(); it_lane != myActiveLanes.end(); ++it_lane) { - const MSLane* lane = it_lane->first; - const int stripes = numStripes(lane); - Pedestrians& pedestrians = it_lane->second; - //std::cout << SIMTIME << ">>> lane=" << lane->getID() << " numPeds=" << pedestrians.size() << "\n"; - - // move forward - Obstacles obs(stripes, Obstacle(dir)); // continously updated - NextLanesObstacles nextLanesObs; // continously updated - sort(pedestrians.begin(), pedestrians.end(), by_xpos_sorter(dir)); - for (int ii = 0; ii < (int)pedestrians.size(); ++ii) { - PState& p = *pedestrians[ii]; - //std::cout << SIMTIME << "CHECKING" << p.myPerson->getID() << "\n"; - Obstacles currentObs = obs; - if (p.myDir != dir || changedLane.count(p.myPerson) != 0) { - if (!p.myWaitingToEnter) { - Obstacle o(p, dir); - obs[p.stripe()] = o; - obs[p.otherStripe()] = o; - } - continue; - } - if DEBUGCOND(p.myPerson->getID()) { - std::cout << SIMTIME << " ped=" << p.myPerson->getID() << " currentObs="; - DEBUG_PRINT(currentObs); - } - const MSLane* nextLane = p.myNLI.lane; - const MSLink* link = p.myNLI.link; - const SUMOReal dist = p.distToLaneEnd(); - const SUMOReal speed = p.myStage->getMaxSpeed(); - if (nextLane != 0) { - const SUMOReal currentLength = (p.myWalkingAreaPath == 0 ? lane->getLength() : p.myWalkingAreaPath->length); - const SUMOReal nextLength = nextLane->getLength(); // XXX what to do if nextLane is a walkingArea? - const Obstacles& nextObs = getNextLaneObstacles( - nextLanesObs, nextLane, stripes, - nextLength, p.myNLI.dir, - currentLength, dir); - - if DEBUGCOND(p.myPerson->getID()) { - std::cout << SIMTIME << " ped=" << p.myPerson->getID() << " nextObs="; - DEBUG_PRINT(nextObs); - } - currentObs = mergeObstacles(currentObs, nextObs, dir); - } - if DEBUGCOND(p.myPerson->getID()) { - std::cout << SIMTIME << " ped=" << p.myPerson->getID() << " obsWithNext="; - DEBUG_PRINT(currentObs); - } - currentObs = mergeObstacles(currentObs, getNeighboringObstacles(pedestrians, ii, stripes), dir); - if DEBUGCOND(p.myPerson->getID()) { - std::cout << SIMTIME << " ped=" << p.myPerson->getID() << " obsWithNeigh="; - DEBUG_PRINT(currentObs); - } - // check link state - if (link != 0 - && dist < speed // only check close before junction - && (!link->opened(currentTime, speed, speed, p.getLength(), p.getImpatience(currentTime), speed, 0) - // XXX check for presence of vehicles blocking the path - )) { - // prevent movement passed a closed link - Obstacles closedLink(stripes, Obstacle(p.myRelX + dir * dist - POSITION_EPS, 0, "closedLink")); - currentObs = mergeObstacles(currentObs, closedLink, dir); - if DEBUGCOND(p.myPerson->getID()) { - std::cout << SIMTIME << " ped=" << p.myPerson->getID() << " obsWitTLS="; - DEBUG_PRINT(currentObs); - } - // consider rerouting over another crossing - if (p.myWalkingAreaPath != 0) { - // XXX actually another path would be needed starting at the current position - p.myNLI = getNextLane(p, p.myLane, p.myWalkingAreaPath->from); - } - } - p.walk(currentObs, currentTime); - if (!p.myWaitingToEnter) { - Obstacle o(p, dir); - obs[p.stripe()] = o; - obs[p.otherStripe()] = o; - } - //std::cout << SIMTIME << p.myPerson->getID() << " lane=" << lane->getID() << " x=" << p.myRelX << "\n"; - } - - // advance to the next lane - sort(pedestrians.begin(), pedestrians.end(), by_xpos_sorter(dir)); - bool checkAdvance = true; - while (checkAdvance) { - checkAdvance = false;; - if (pedestrians.size() > 0) { - PState* p = pedestrians.front(); - if (p->myDir != dir) { - continue; - } - if (p->moveToNextLane(currentTime)) { - pedestrians.erase(pedestrians.begin()); - checkAdvance = true; - if (p->myLane != 0) { - changedLane.insert(p->myPerson); - myActiveLanes[p->myLane].push_back(p); - } else { - delete p; - myNumActivePedestrians--; - } - } - } - } - } -} - -// =========================================================================== -// MSPModel_Striping::Obstacle method definitions -// =========================================================================== -MSPModel_Striping::Obstacle::Obstacle(int dir) : - x(dir* FAR_AWAY), // far away when seen in dir - speed(0), - description("") -{} - - -MSPModel_Striping::Obstacle::Obstacle(const PState& ped, int dir) : - description(ped.myPerson->getID()) { - assert(!ped.myWaitingToEnter); - if (dir == ped.myDir) { - speed = ped.mySpeed; - x = ped.myRelX - dir * ped.getLength(); - } else { - speed = -ped.mySpeed; - x = ped.myRelX; - } -} - - -// =========================================================================== -// MSPModel_Striping::PState method definitions -// =========================================================================== - - -MSPModel_Striping::PState::PState(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, const MSLane* lane): - myPerson(person), - myStage(stage), - myLane(lane), - myRelX(stage->getDepartPos()), - myRelY(0), - myDir(FORWARD), - mySpeed(0), - myBlockedByOncoming(false), - myWaitingToEnter(true), - myWaitingTime(0), - myWalkingAreaPath(0) { - const MSEdge* currentEdge = &lane->getEdge(); - assert(!currentEdge->isWalkingArea()); - const std::vector& route = myStage->getRoute(); - if (route.size() == 1) { - // only a single edge, move towards end pos - myDir = (myRelX <= myStage->getArrivalPos()) ? FORWARD : BACKWARD; - } else { - const bool mayStartForward = canTraverse(FORWARD, route); - const bool mayStartBackward = canTraverse(BACKWARD, route); - if DEBUGCOND(myPerson->getID()) { - std::cout << " initialize dir for " << myPerson->getID() << " forward=" << mayStartForward << " backward=" << mayStartBackward << "\n"; - } - if (mayStartForward && mayStartBackward) { - // figure out the best direction via routing - std::vector crossingRoute; - MSNet::getInstance()->getPedestrianRouter().compute(currentEdge, route.back(), myRelX, myStage->getArrivalPos(), myStage->getMaxSpeed(), 0, 0, crossingRoute, true); - if (crossingRoute.size() > 1) { - // route found - const MSEdge* nextEdge = crossingRoute[1]; - if (nextEdge->getFromJunction() == currentEdge->getFromJunction() || nextEdge->getToJunction() == currentEdge->getFromJunction()) { - myDir = BACKWARD; - } - } - if DEBUGCOND(myPerson->getID()) { - std::cout << " crossingRoute=" << toString(crossingRoute) << "\n"; - } - } else { - myDir = !mayStartBackward ? FORWARD : BACKWARD; - } - } - if (myDir == FORWARD) { - // start at the right side of the sidewalk - myRelY = stripeWidth * (numStripes(lane) - 1); - } - if DEBUGCOND(myPerson->getID()) { - std::cout << " added new pedestrian " << myPerson->getID() << " on " << lane->getID() << " myRelX=" << myRelX << " myRelY=" << myRelY << " dir=" << myDir << " route=" << toString(myStage->getRoute()) << "\n"; - } - - myNLI = getNextLane(*this, lane, 0); -} - - -SUMOReal -MSPModel_Striping::PState::getLength() const { - return myPerson->getVehicleType().getLength(); -} - - -int -MSPModel_Striping::PState::stripe() const { - const int max = numStripes(myLane) - 1; - return MIN2(MAX2(0, (int)floor((myRelY + 0.5 * stripeWidth) / stripeWidth)), max); -} - - -int -MSPModel_Striping::PState::otherStripe() const { - const int max = numStripes(myLane) - 1; - const int s = stripe(); - const SUMOReal offset = myRelY - s * stripeWidth; - const SUMOReal threshold = MAX2(NUMERICAL_EPS, stripeWidth - SQUEEZE * myPerson->getVehicleType().getWidth()); - int result; - if (offset > threshold) { - result = s + 1; - } else if (offset < -threshold) { - result = s - 1; - } else { - result = s; - } - std::cout.setf(std::ios::fixed , std::ios::floatfield); - std::cout << std::setprecision(5); - //if DEBUGCOND(myPerson->getID()) std::cout << " otherStripe " << myPerson->getID() << " offset=" << offset << " threshold=" << threshold << " rawResult=" << result << "\n"; - return MIN2(MAX2(0, result), max); -} - - -SUMOReal -MSPModel_Striping::PState::distToLaneEnd() const { - if (myStage->getNextRouteEdge() == 0) { - return myDir * (myStage->getArrivalPos() - myRelX); - } else { - const SUMOReal length = myWalkingAreaPath == 0 ? myLane->getLength() : myWalkingAreaPath->length; - return myDir == FORWARD ? length - myRelX : myRelX; - } -} - - -bool -MSPModel_Striping::PState::moveToNextLane(SUMOTime currentTime) { - const SUMOReal dist = distToLaneEnd(); - //if (myPerson->getID() == DEBUG1) { - // std::cout << SIMTIME << " myRelX=" << myRelX << " dist=" << dist << "\n"; - //} - if (dist <= 0) { - //if (ped.myPerson->getID() == DEBUG1) { - // std::cout << SIMTIME << " addToLane x=" << ped.myRelX << " newDir=" << newDir << " newLane=" << newLane->getID() << " walkingAreaShape=" << walkingAreaShape << "\n"; - //} - //std::cout << " changing to " << newLane->getID() << " myRelY=" << ped.myRelY << " oldStripes=" << oldStripes << " newStripes=" << numStripes(newLane); - //std::cout << " newY=" << ped.myRelY << " myDir=" << ped.myDir << " newDir=" << newDir; - const int oldStripes = numStripes(myLane); - const int oldDir = myDir; - const MSLane* oldLane = myLane; - myLane = myNLI.lane; - myDir = myNLI.dir; - const bool normalLane = (myLane == 0 || myLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_NORMAL); - if DEBUGCOND(myPerson->getID()) { - std::cout << SIMTIME - << " ped=" << myPerson->getID() - << " moveToNextLane old=" << oldLane->getID() - << " new=" << (myLane == 0 ? "NULL" : myLane->getID()) - << "\n"; - } - myStage->moveToNextEdge(myPerson, currentTime, normalLane ? 0 : &myLane->getEdge()); - if (myLane != 0) { - assert(myDir != UNDEFINED_DIRECTION); - myNLI = getNextLane(*this, myLane, oldLane); - if DEBUGCOND(myPerson->getID()) { - std::cout << " nextLane=" << (myNLI.lane == 0 ? "NULL" : myNLI.lane->getID()) << "\n"; - } - if (myLane->getEdge().isWalkingArea()) { - myWalkingAreaPath = &myWalkingAreaPaths[std::make_pair(oldLane, myNLI.lane)]; - assert(myWalkingAreaPath->from != 0); - assert(myWalkingAreaPath->to != 0); - assert(myWalkingAreaPath->shape.size() >= 2); - if DEBUGCOND(myPerson->getID()) { - std::cout << " mWAPath shape=" << myWalkingAreaPath->shape << " length=" << myWalkingAreaPath->length << "\n"; - } - } else { - myWalkingAreaPath = 0; - } - // adapt x to fit onto the new lane - if (myDir == BACKWARD) { - const SUMOReal newLength = (myWalkingAreaPath == 0 ? myLane->getLength() : myWalkingAreaPath->length); - myRelX = newLength + dist; - } else { - myRelX = -dist; - } - // adjust to change in direction - if (myDir != oldDir) { - myRelY = (numStripes(oldLane) - 1) * stripeWidth - myRelY; - } - // adjust to differences in sidewalk width - myRelY += 0.5 * stripeWidth * (numStripes(myLane) - oldStripes); - } - return true; - } else { - return false; - } -} - - -void -MSPModel_Striping::PState::walk(const Obstacles& obs, SUMOTime currentTime) { - const int stripes = (int)obs.size(); - const int sMax = stripes - 1; - assert(stripes == numStripes(myLane)); - const SUMOReal vMax = myStage->getMaxSpeed(); - // ultimate goal is to chose the prefered stripe (chosen) - const int current = stripe(); - const int other = otherStripe(); - int chosen = current; - // compute utility for all stripes - std::vector utility(stripes, 0); - - // penalize lateral movement (may increase jamming) - for (int i = 0; i < stripes; ++i) { - utility[i] += abs(i - current) * LATERAL_PENALTY; - } - // compute distances - std::vector distance(stripes); - for (int i = 0; i < stripes; ++i) { - distance[i] += myDir * (obs[i].x - myRelX); - } - // forbid stripes which are blocked and also all stripes behind them - for (int i = 0; i < stripes; ++i) { - if (distance[i] <= 0) { - if (i < current) { - for (int j = 0; j <= i; ++j) { - utility[j] = 2 * BLOCKED_STRIPE; - } - } else { - for (int j = i; j < stripes; ++j) { - utility[j] = 2 * BLOCKED_STRIPE; - } - } - } - } - // forbid a portion of the leftmost stripes (in walking direction). - // lanes with stripes less than 1 / RESERVE_FOR_ONCOMING_FACTOR - // may still deadlock in heavy pedestrian traffic - const int reserved = (int)floor(stripes * RESERVE_FOR_ONCOMING_FACTOR); - if (myDir == FORWARD) { - for (int i = 0; i < reserved; ++i) { - utility[i] = BLOCKED_STRIPE; - } - } else { - for (int i = sMax; i > sMax - reserved; --i) { - utility[i] = BLOCKED_STRIPE; - } - } - // adapt utility based on obstacles - for (int i = 0; i < stripes; ++i) { - if (obs[i].speed < 0) { - // penalize evasion to the left - if (myDir == FORWARD && i > 0) { - utility[i - 1] -= 0.5; - } else if (myDir == BACKWARD && i < sMax) { - utility[i + 1] -= 0.5; - } - } - // compute expected distance achievable by staying on this stripe for a time horizon - const SUMOReal lookAhead = obs[i].speed >= 0 ? LOOKAHEAD_SAMEDIR : LOOKAHEAD_ONCOMING; - const SUMOReal expectedDist = MIN2(vMax * LOOKAHEAD_SAMEDIR, distance[i] + obs[i].speed * lookAhead); - if (DEBUGCOND(myPerson->getID())) { - std::cout << " util=" << utility[i] << " exp=" << expectedDist << "\n"; - } - if (expectedDist >= 0) { - utility[i] += expectedDist; - } else { - // let only the distance count - utility[i] += ONCOMING_CONFLICT + distance[i]; - } - } - // bonus to remain on the rightmost lane (in walking direction) if there - // are oncoming - if (((myDir == FORWARD && current == sMax) - || (myDir == BACKWARD && current == 0)) - && obs[current].speed < 0) { - utility[current] -= ONCOMING_CONFLICT; - } - // bonus to leave the leftmost lane (in walking direction) if there - // are oncoming - if (((myDir == BACKWARD && current == sMax) - || (myDir == FORWARD && current == 0)) - && obs[current].speed < 0) { - utility[current] += ONCOMING_CONFLICT; - } - - // select best stripe - for (int i = 0; i < stripes; ++i) { - if (utility[chosen] < utility[i]) { - chosen = i; - } - } - // compute speed components along both axes - const int next = (chosen == current ? current : (chosen < current ? current - 1 : current + 1)); - const SUMOReal xDist = MIN3(distance[current], distance[other], distance[next]); - // XXX preferred gap differs between approaching a standing obstacle or a moving obstacle - const SUMOReal preferredGap = myPerson->getVehicleType().getMinGap() + xDist * 0.5; - SUMOReal xSpeed = MIN2(vMax, MAX2((SUMOReal)0, xDist - preferredGap)); - // avoid tiny steps - // XXX pressure from behind? - if (DEBUGCOND(myPerson->getID())) { - std::cout << " xSpeedPotential=" << xSpeed << "\n"; - } - if (mySpeed == 0 && xSpeed < 0.5 * vMax) { - xSpeed = 0; - } - // dawdling - const SUMOReal dawdle = MIN2(xSpeed, RandHelper::rand() * vMax * dawdling); - xSpeed -= dawdle; - - // XXX ensure that diagonal speed <= vMax - // avoid deadlocks on narrow sidewalks - //if (oncoming && xSpeed == 0 && myStage->getWaitingTime(currentTime) > TIME2STEPS(ONCOMIN_PATIENCE)) { - // if DEBUGCOND(myPerson->getID()) std::cout << " stepping asside to resolve oncoming deadlock\n"; - // xSpeed = POSITION_EPS; // reset myWaitingTime - // if (myDir == FORWARD && chosen < sMax) { - // chosen += 1; - // } else if (myDir == BACKWARD && chosen > 0) { - // chosen -= 1; - // } - //} - const SUMOReal maxYSpeed = MAX2(vMax * LATERAL_SPEED_FACTOR, vMax - xSpeed); - SUMOReal ySpeed = 0; - const SUMOReal yDist = (chosen * stripeWidth) - myRelY; - if (fabs(yDist) > NUMERICAL_EPS) { - ySpeed = (yDist > 0 ? - MIN2(maxYSpeed, yDist) : - MAX2(-maxYSpeed, yDist)); - } - // DEBUG - if (true && DEBUGCOND(myPerson->getID())) { - std::cout << SIMTIME - << " ped=" << myPerson->getID() - << " edge=" << myStage->getEdge()->getID() - << " x=" << myRelX - << " y=" << myRelY - << " d=" << myDir - << " pvx=" << mySpeed - << " cur=" << current - << " cho=" << chosen - << " oth=" << other - << " nxt=" << next - << " vx=" << xSpeed - << " dawdle=" << dawdle - << " vy=" << ySpeed - << " xd=" << xDist - << " yd=" << yDist - << " vMax=" << myStage->getMaxSpeed() - << " wTime=" << myStage->getWaitingTime(currentTime) - << "\n distance=" << toString(distance) - << " utility=" << toString(utility) - << "\n"; - DEBUG_PRINT(obs); - } - myRelX += SPEED2DIST(xSpeed * myDir); - myRelY += SPEED2DIST(ySpeed); - mySpeed = xSpeed; - if (xSpeed > 0) { - myWaitingToEnter = false; - myWaitingTime = 0; - } else { - myWaitingTime += DELTA_T; - } -} - - -SUMOReal -MSPModel_Striping::PState::getImpatience(SUMOTime now) const { - return MAX2((SUMOReal)0, MIN2(SUMOReal(1), - myPerson->getVehicleType().getImpatience() - + STEPS2TIME(myStage->getWaitingTime(now)) / MAX_WAIT_TOLERANCE)); -} - - -SUMOReal -MSPModel_Striping::PState::getEdgePos(const MSPerson::MSPersonStage_Walking&, SUMOTime) const { - return myRelX; -} - - -Position -MSPModel_Striping::PState::getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime) const { - if (myLane == 0) { - // pedestrian has already finished - return Position::INVALID; - } - const SUMOReal lateral_offset = myRelY + (stripeWidth - myLane->getWidth()) * 0.5; - if (myWalkingAreaPath == 0) { - return stage.getLanePosition(myLane, myRelX, lateral_offset); - } else { - return myWalkingAreaPath->shape.positionAtOffset(myRelX, lateral_offset); - } -} - - -SUMOReal -MSPModel_Striping::PState::getAngle(const MSPerson::MSPersonStage_Walking&, SUMOTime) const { - if (myLane == 0) { - // pedestrian has already finished - return 0; - } - const PositionVector& shp = myWalkingAreaPath == 0 ? myLane->getShape() : myWalkingAreaPath->shape; - SUMOReal angle = -shp.rotationDegreeAtOffset(myRelX) + (myDir == MSPModel::BACKWARD ? 180 : 0); - if (angle > 180) { - angle -= 360; - } - return angle; -} - - -SUMOTime -MSPModel_Striping::PState::getWaitingTime(const MSPerson::MSPersonStage_Walking&, SUMOTime) const { - return myWaitingTime; -} - - -SUMOReal -MSPModel_Striping::PState::getSpeed(const MSPerson::MSPersonStage_Walking&) const { - return mySpeed; -} - -// =========================================================================== -// MSPModel_Striping::MovePedestrians method definitions -// =========================================================================== -// - -SUMOTime -MSPModel_Striping::MovePedestrians::execute(SUMOTime currentTime) { - std::set changedLane; - myModel->moveInDirection(currentTime, changedLane, FORWARD); - myModel->moveInDirection(currentTime, changedLane, BACKWARD); - // DEBUG - if (LOG_ALL) { - for (ActiveLanes::const_iterator it_lane = myModel->getActiveLanes().begin(); it_lane != myModel->getActiveLanes().end(); ++it_lane) { - const MSLane* lane = it_lane->first; - Pedestrians pedestrians = it_lane->second; - if (pedestrians.size() == 0) { - continue; - } - sort(pedestrians.begin(), pedestrians.end(), by_xpos_sorter(FORWARD)); - std::cout << SIMTIME << " lane=" << lane->getID(); - for (int ii = 0; ii < (int)pedestrians.size(); ++ii) { - const PState& p = *pedestrians[ii]; - std::cout << " (" << p.myPerson->getID() << " " << p.myRelX << "," << p.myRelY << " " << p.myDir << ")"; - } - std::cout << "\n"; - } - } - return DELTA_T; -} - diff -Nru sumo-0.21.0+dfsg/src/microsim/MSPModel_Striping.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPModel_Striping.h --- sumo-0.21.0+dfsg/src/microsim/MSPModel_Striping.h 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSPModel_Striping.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,338 +0,0 @@ -/****************************************************************************/ -/// @file MSPModel_Striping.h -/// @author Jakob Erdmann -/// @date Mon, 13 Jan 2014 -/// @version $Id: MSPModel_Striping.h 16560 2014-06-09 20:54:15Z behrisch $ -/// -// The pedestrian following model (prototype) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 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 MSPModel_Striping_h -#define MSPModel_Striping_h - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -// =========================================================================== -// class declarations -// =========================================================================== -class MSNet; -class MSLink; -class MSLane; -class MSJunction; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class MSPModel_Striping - * @brief The pedestrian following model - * - */ -class MSPModel_Striping : public MSPModel { - - friend class GUIPerson; // for debugging - -public: - - /// @brief Constructor (it should not be necessary to construct more than one instance) - MSPModel_Striping(const OptionsCont& oc, MSNet* net); - - ~MSPModel_Striping(); - - /// @brief register the given person as a pedestrian - PedestrianState* add(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, SUMOTime now); - - /// @brief whether a pedestrian is blocking the crossing of lane at offset distToCrossing - bool blockedAtDist(const MSLane* lane, SUMOReal distToCrossing, std::vector* collectBlockers); - - /// @brief remove state at simulation end - void cleanupHelper(); - - /// @brief model parameters - ///@{ - - // @brief the width of a pedstrian stripe - static SUMOReal stripeWidth; - - // @brief the factor for random slow-down - static SUMOReal dawdling; - - // @brief the distance to look ahead for changing stripes - static const SUMOReal LOOKAHEAD_SAMEDIR; - // @brief the distance to look ahead for changing stripes (regarding oncoming pedestrians) - static const SUMOReal LOOKAHEAD_ONCOMING; - - // @brief the speed penalty for moving sideways - static const SUMOReal LATERAL_PENALTY; - - // @brief the factor by which pedestrian width is reduced when sqeezing past each other - static const SUMOReal SQUEEZE; - - // @brief the maximum distance at which oncoming pedestrians block right turning traffic - static const SUMOReal BLOCKER_LOOKAHEAD; - - // @brief fraction of the leftmost lanes to reserve for oncoming traffic - static const SUMOReal RESERVE_FOR_ONCOMING_FACTOR; - - // @brief the time pedestrians take to reach maximum impatience - static const SUMOReal MAX_WAIT_TOLERANCE; - - // @brief the fraction of forward speed to be used for lateral movemenk - static const SUMOReal LATERAL_SPEED_FACTOR; - - ///@} - - -protected: - struct Obstacle; - struct WalkingAreaPath; - class PState; - typedef std::vector Pedestrians; - typedef std::map ActiveLanes; - typedef std::vector Obstacles; - typedef std::map NextLanesObstacles; - typedef std::map, WalkingAreaPath> WalkingAreaPaths; - - struct NextLaneInfo { - NextLaneInfo(const MSLane* _lane, const MSLink* _link, int _dir) : - lane(_lane), - link(_link), - dir(_dir) - { } - - NextLaneInfo() : - lane(0), - link(0), - dir(UNDEFINED_DIRECTION) - { } - - // @brief the next lane to be used - const MSLane* lane; - // @brief the link from the current lane to the next lane - const MSLink* link; - // @brief the direction on the next lane - int dir; - }; - - /// @brief information regarding surround Pedestrians (and potentially other things) - struct Obstacle { - /// @brief create No-Obstacle - Obstacle(int dir); - /// @brief create an obstacle from ped for ego moving in dir - Obstacle(const PState& ped, int dir); - /// @brief create an obstacle from explict values - Obstacle(SUMOReal _x, SUMOReal _speed, const std::string& _description) : x(_x), speed(_speed), description(_description) {}; - - /// @brief position on the current lane - SUMOReal x; - /// @brief speed relative to ego direction (positive means in the same direction) - SUMOReal speed; - /// @brief the id / description of the obstacle - std::string description; - }; - - struct WalkingAreaPath { - WalkingAreaPath(const MSLane* _from, const MSLane* _walkingArea, const MSLane* _to, const PositionVector& _shape) : - from(_from), - to(_to), - lane(_walkingArea), - shape(_shape), - length(_shape.length()) - {} - - WalkingAreaPath(): from(0), to(0), lane(0) {}; - - const MSLane* from; - const MSLane* to; - const MSLane* lane; // the walkingArea; - // actually const but needs to be copyable by some stl code - PositionVector shape; - SUMOReal length; - - }; - - /** - * @class PState - * @brief Container for pedestrian state and individual position update function - */ - class PState : public PedestrianState { - public: - - /// @brief abstract methods inherited from PedestrianState - /// @{ - SUMOReal getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; - Position getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; - SUMOReal getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; - SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; - SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking& stage) const; - /// @} - - PState(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, const MSLane* lane); - ~PState() {}; - MSPerson* myPerson; - MSPerson::MSPersonStage_Walking* myStage; - /// @brief the current lane of this pedestrian - const MSLane* myLane; - /// @brief the advancement along the current lane - SUMOReal myRelX; - /// @brief the orthogonal shift on the current lane - SUMOReal myRelY; - /// @brief the walking direction on the current lane (1 forward, -1 backward) - int myDir; - /// @brief the current walking speed - SUMOReal mySpeed; - /// @brief whether the pedestrian is blocked by an oncoming pedestrian - int myBlockedByOncoming; - /// @brief whether the pedestrian is waiting to start its walk - bool myWaitingToEnter; - /// @brief the consecutive time spent at speed 0 - SUMOTime myWaitingTime; - /// @brief information about the upcoming lane - NextLaneInfo myNLI; - /// @brief the current walkingAreaPath or 0 - WalkingAreaPath* myWalkingAreaPath; - - /// @brief return the length of the pedestrian - SUMOReal getLength() const; - - /// @brief the absolute distance to the end of the lane in walking direction (or to the arrivalPos) - SUMOReal distToLaneEnd() const; - - /// @brief return whether this pedestrian has passed the end of the current lane and update myRelX if so - bool moveToNextLane(SUMOTime currentTime); - - /// @brief perform position update - void walk(const Obstacles& obs, SUMOTime currentTime); - - /// @brief returns the impatience - SUMOReal getImpatience(SUMOTime now) const; // XXX - - /// @brief return the speed-dependent minGap of the pedestrian - SUMOReal getMingap() const; - - int stripe() const; - int otherStripe() const; - - }; - - class MovePedestrians : public Command { - public: - MovePedestrians(MSPModel_Striping* model) : myModel(model) {}; - ~MovePedestrians() {}; - SUMOTime execute(SUMOTime currentTime); - private: - MSPModel_Striping* const myModel; - private: - /// @brief Invalidated assignment operator. - MovePedestrians& operator=(const MovePedestrians&); - }; - - class by_xpos_sorter { - public: - /// constructor - by_xpos_sorter(int dir): myDir(dir) {} - - public: - /// comparing operation - bool operator()(const PState* p1, const PState* p2) const { - if (p1->myRelX != p2->myRelX) { - return myDir * p1->myRelX > myDir * p2->myRelX; - } - return p1->myPerson->getID() < p2->myPerson->getID(); - } - - private: - const int myDir; - - private: - /// @brief Invalidated assignment operator. - by_xpos_sorter& operator=(const by_xpos_sorter&); - }; - - - /// @brief move all pedestrians forward and advance to the next lane if applicable - void moveInDirection(SUMOTime currentTime, std::set& changedLane, int dir); - - const ActiveLanes& getActiveLanes() { - return myActiveLanes; - } - -private: - static void DEBUG_PRINT(const Obstacles& obs); - - /// @brief returns the direction in which these lanes are connectioned or 0 if they are not - static int connectedDirection(const MSLane* from, const MSLane* to); - - /** @brief computes the successor lane for the given pedestrian and sets the - * link as well as the direction to use on the succesor lane - * @param[in] currentLane The lane the pedestrian is currently on - * @param[in] ped The pedestrian for which to compute the next lane - */ - static NextLaneInfo getNextLane(const PState& ped, const MSLane* currentLane, const MSLane* prevLane); - - /// @brief return the next walkingArea in the given direction - static const MSLane* getNextWalkingArea(const MSLane* currentLane, const int dir, MSLink*& link); - - static void initWalkingAreaPaths(const MSNet* net); - - /// @brief return the maximum number of pedestrians walking side by side - static int numStripes(const MSLane* lane); - - static Obstacles mergeObstacles(const Obstacles& obs1, const Obstacles& obs2, int dir); - - static Obstacles getNeighboringObstacles(const Pedestrians& pedestrians, int egoIndex, int stripes); - - const Obstacles& getNextLaneObstacles(NextLanesObstacles& nextLanesObs, const MSLane* nextLane, int stripes, - SUMOReal nextLength, int nextDir, SUMOReal currentLength, int currentDir); - - /// @brief retrieves the pedestian vector for the given lane (may be empty) - Pedestrians& getPedestrians(const MSLane* lane); - - -private: - /// @brief the MovePedestrians command that is registered - MovePedestrians* myCommand; - - /// @brief the total number of active pedestrians - int myNumActivePedestrians; - - /// @brief store of all lanes which have pedestrians on them - ActiveLanes myActiveLanes; - - /// @brief store for walkinArea elements - static WalkingAreaPaths myWalkingAreaPaths; - - /// @brief empty pedestrian vector - static Pedestrians noPedestrians; - -}; - - -#endif /* MSPModel_Striping_h */ - diff -Nru sumo-0.21.0+dfsg/src/microsim/MSRightOfWayJunction.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSRightOfWayJunction.cpp --- sumo-0.21.0+dfsg/src/microsim/MSRightOfWayJunction.cpp 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSRightOfWayJunction.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Wed, 12 Dez 2001 -/// @version $Id: MSRightOfWayJunction.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSRightOfWayJunction.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // junction. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -50,6 +50,7 @@ // method definitions // =========================================================================== MSRightOfWayJunction::MSRightOfWayJunction(const std::string& id, + SumoXMLNodeType type, const Position& position, const PositionVector& shape, std::vector incoming, @@ -57,7 +58,7 @@ std::vector internal, #endif MSJunctionLogic* logic) - : MSLogicJunction(id, position, shape, incoming + : MSLogicJunction(id, type, position, shape, incoming #ifdef HAVE_INTERNAL_LANES , internal), #else diff -Nru sumo-0.21.0+dfsg/src/microsim/MSRightOfWayJunction.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSRightOfWayJunction.h --- sumo-0.21.0+dfsg/src/microsim/MSRightOfWayJunction.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSRightOfWayJunction.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 12 Dez 2001 -/// @version $Id: MSRightOfWayJunction.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSRightOfWayJunction.h 18152 2015-03-26 07:54:46Z namdre $ /// // A junction with right-of-way - rules /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -66,7 +66,7 @@ * @param[in] internal The internal lanes * @param[in] logic The logic of this junction */ - MSRightOfWayJunction(const std::string& id, const Position& position, + MSRightOfWayJunction(const std::string& id, SumoXMLNodeType type, const Position& position, const PositionVector& shape, std::vector incoming, #ifdef HAVE_INTERNAL_LANES @@ -87,6 +87,10 @@ return myLinkFoeInternalLanes.find(srcLink)->second; } + // @brief return the underlying right-of-way and conflict matrix + const MSJunctionLogic* getLogic() const { + return myLogic; + } protected: /** the type of the junction (its logic) */ diff -Nru sumo-0.21.0+dfsg/src/microsim/MSRoute.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSRoute.cpp --- sumo-0.21.0+dfsg/src/microsim/MSRoute.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSRoute.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: MSRoute.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSRoute.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A vehicle route /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -58,7 +58,7 @@ // member method definitions // =========================================================================== MSRoute::MSRoute(const std::string& id, - const MSEdgeVector& edges, + const ConstMSEdgeVector& edges, const bool isPermanent, const RGBColor* const c, const std::vector& stops) : Named(id), myEdges(edges), myAmPermanent(isPermanent), @@ -133,14 +133,14 @@ const MSRoute* -MSRoute::dictionary(const std::string& id) { +MSRoute::dictionary(const std::string& id, MTRand* rng) { RouteDict::iterator it = myDict.find(id); if (it == myDict.end()) { RouteDistDict::iterator it2 = myDistDict.find(id); if (it2 == myDistDict.end() || it2->second.first->getOverallProb() == 0) { return 0; } - return it2->second.first->get(); + return it2->second.first->get(rng); } return it->second; } @@ -198,7 +198,7 @@ int MSRoute::writeEdgeIDs(OutputDevice& os, const MSEdge* const from, const MSEdge* const upTo) const { int numWritten = 0; - MSEdgeVector::const_iterator i = myEdges.begin(); + ConstMSEdgeVector::const_iterator i = myEdges.begin(); if (from != 0) { i = std::find(myEdges.begin(), myEdges.end(), from); } @@ -217,8 +217,8 @@ bool -MSRoute::containsAnyOf(const std::vector& edgelist) const { - std::vector::const_iterator i = edgelist.begin(); +MSRoute::containsAnyOf(const MSEdgeVector& edgelist) const { + MSEdgeVector::const_iterator i = edgelist.begin(); for (; i != edgelist.end(); ++i) { if (contains(*i)) { return true; @@ -252,55 +252,70 @@ SUMOReal -MSRoute::getLength() const { - SUMOReal ret = 0; - for (MSEdgeVector::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) { - ret += (*i)->getLength(); +MSRoute::getDistanceBetween(SUMOReal fromPos, SUMOReal toPos, + const MSEdge* fromEdge, const MSEdge* toEdge, bool includeInternal) const { + ConstMSEdgeVector::const_iterator it = std::find(myEdges.begin(), myEdges.end(), fromEdge); + if (it == myEdges.end() || std::find(it, myEdges.end(), toEdge) == myEdges.end()) { + // start or destination not contained in route + return std::numeric_limits::max(); + } + ConstMSEdgeVector::const_iterator it2 = std::find(it + 1, myEdges.end(), toEdge); + + if (fromEdge == toEdge) { + if (fromPos < toPos) { + return toPos - fromPos; + } else if (it2 == myEdges.end()) { + // we don't visit the edge again + return std::numeric_limits::max(); + } } - return ret; + return getDistanceBetween(fromPos, toPos, it, it2, includeInternal); } SUMOReal -MSRoute::getDistanceBetween(SUMOReal fromPos, SUMOReal toPos, const MSEdge* fromEdge, const MSEdge* toEdge) const { +MSRoute::getDistanceBetween(SUMOReal fromPos, SUMOReal toPos, + const MSRouteIterator& fromEdge, const MSRouteIterator& toEdge, bool includeInternal) const { bool isFirstIteration = true; SUMOReal distance = -fromPos; - MSEdgeVector::const_iterator it = std::find(myEdges.begin(), myEdges.end(), fromEdge); - - if (it == myEdges.end() || std::find(it, myEdges.end(), toEdge) == myEdges.end()) { - // start or destination not contained in route - return std::numeric_limits::max(); - } + MSRouteIterator it = fromEdge; if (fromEdge == toEdge) { // destination position is on start edge if (fromPos <= toPos) { return toPos - fromPos; - } else if (std::find(it + 1, myEdges.end(), toEdge) == myEdges.end()) { - // we don't visit the edge again + } else { + // we cannot go backwards. Something is wrong here return std::numeric_limits::max(); } + } else if (fromEdge > toEdge) { + // we don't visit the edge again + return std::numeric_limits::max(); } for (; it != end(); ++it) { - if ((*it) == toEdge && !isFirstIteration) { + if (it == toEdge && !isFirstIteration) { distance += toPos; break; } else { const std::vector& lanes = (*it)->getLanes(); distance += lanes[0]->getLength(); #ifdef HAVE_INTERNAL_LANES - // add length of internal lanes to the result - for (std::vector::const_iterator laneIt = lanes.begin(); laneIt != lanes.end(); ++laneIt) { - const MSLinkCont& links = (*laneIt)->getLinkCont(); - for (MSLinkCont::const_iterator linkIt = links.begin(); linkIt != links.end(); ++linkIt) { - if ((*linkIt) == 0 || (*linkIt)->getLane() == 0) { - continue; - } - std::string succLaneId = (*(it + 1))->getLanes()[0]->getID(); - if ((*linkIt)->getLane()->getID().compare(succLaneId) == 0) { - distance += (*linkIt)->getLength(); + if (includeInternal) { + // add length of internal lanes to the result + for (std::vector::const_iterator laneIt = lanes.begin(); laneIt != lanes.end(); ++laneIt) { + const MSLinkCont& links = (*laneIt)->getLinkCont(); + for (MSLinkCont::const_iterator linkIt = links.begin(); linkIt != links.end(); ++linkIt) { + if ((*linkIt) == 0 || (*linkIt)->getLane() == 0) { + continue; + } + std::string succLaneId = (*(it + 1))->getLanes()[0]->getID(); + if ((*linkIt)->getLane()->getID().compare(succLaneId) == 0) { + distance += (*linkIt)->getLength(); + } } } } +#else + UNUSED_PARAMETER(includeInternal); #endif } isFirstIteration = false; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSRoute.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSRoute.h --- sumo-0.21.0+dfsg/src/microsim/MSRoute.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSRoute.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: MSRoute.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSRoute.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A vehicle route /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include @@ -56,8 +56,9 @@ // =========================================================================== // types definitions // =========================================================================== -typedef std::vector MSEdgeVector; -typedef MSEdgeVector::const_iterator MSRouteIterator; +typedef std::vector ConstMSEdgeVector; +typedef std::vector MSEdgeVector; +typedef ConstMSEdgeVector::const_iterator MSRouteIterator; // =========================================================================== @@ -69,7 +70,7 @@ class MSRoute : public Named, public Parameterised { public: /// Constructor - MSRoute(const std::string& id, const MSEdgeVector& edges, + MSRoute(const std::string& id, const ConstMSEdgeVector& edges, const bool isPermanent, const RGBColor* const c, const std::vector& stops); @@ -106,7 +107,7 @@ return std::find(myEdges.begin(), myEdges.end(), edge) != myEdges.end(); } - bool containsAnyOf(const std::vector& edgelist) const; + bool containsAnyOf(const MSEdgeVector& edgelist) const; const MSEdge* operator[](unsigned index) const; @@ -120,25 +121,56 @@ static void dict_saveState(OutputDevice& out); /// @} - const MSEdgeVector& getEdges() const { + const ConstMSEdgeVector& getEdges() const { return myEdges; } - SUMOReal getLength() const; + /** @brief Compute the distance between 2 given edges on this route, including the length of internal lanes. + * Note, that for edges which contain loops: + * - the first occurance of fromEdge will be used + * - the first occurance of toEdge after the first occurance of fromEdge will be used + * + * @param[in] fromPos position on the first edge, at wich the computed distance begins + * @param[in] toPos position on the last edge, at which the coumputed distance endsance + * @param[in] fromEdge edge at wich computation begins + * @param[in] toEdge edge at which distance computation shall stop + * @param[in] includeInternal Whether the lengths of internal edges shall be counted + * @return distance between the position fromPos on fromEdge and toPos on toEdge + */ + SUMOReal getDistanceBetween(SUMOReal fromPos, SUMOReal toPos, const MSEdge* fromEdge, const MSEdge* toEdge, bool includeInternal = true) const; /** @brief Compute the distance between 2 given edges on this route, including the length of internal lanes. + * This has the same semantics as above but uses iterators instead of edge + * points so looping routes are not an issue. * * @param[in] fromPos position on the first edge, at wich the computed distance begins - * @param[in] toPos position on the last edge, at which the coumputed distance endsance + * @param[in] toPos position on the last edge, at which the coumputed distance endsance * @param[in] fromEdge edge at wich computation begins * @param[in] toEdge edge at which distance computation shall stop + * @param[in] includeInternal Whether the lengths of internal edges shall be counted * @return distance between the position fromPos on fromEdge and toPos on toEdge */ - SUMOReal getDistanceBetween(SUMOReal fromPos, SUMOReal toPos, const MSEdge* fromEdge, const MSEdge* toEdge) const; + SUMOReal getDistanceBetween(SUMOReal fromPos, SUMOReal toPos, const MSRouteIterator& fromEdge, const MSRouteIterator& toEdge, bool includeInternal = true) const; /// Returns the color const RGBColor& getColor() const; + /** @brief Returns the costs of the route + * + * @return The route's costs (normally the time needed to pass it) + */ + SUMOReal getCosts() const { + return myCosts; + } + + /** @brief Sets the costs of the route + * + * @param[in] costs The new route costs + */ + void setCosts(SUMOReal costs) { + myCosts = costs; + } + /// Returns the stops const std::vector& getStops() const; @@ -174,7 +206,7 @@ * @param[in] id the id of the route or the distribution * @return the route (sample) */ - static const MSRoute* dictionary(const std::string& id); + static const MSRoute* dictionary(const std::string& id, MTRand* rng = 0); /** @brief Returns the named route distribution. * @@ -195,7 +227,7 @@ private: /// The list of edges to pass - MSEdgeVector myEdges; + ConstMSEdgeVector myEdges; /// whether the route may be deleted after the last vehicle abandoned it const bool myAmPermanent; @@ -206,6 +238,9 @@ /// The color const RGBColor* const myColor; + /// @brief The assigned or calculated costs + SUMOReal myCosts; + /// @brief List of the stops on the parsed route std::vector myStops; diff -Nru sumo-0.21.0+dfsg/src/microsim/MSRouteHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSRouteHandler.cpp --- sumo-0.21.0+dfsg/src/microsim/MSRouteHandler.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSRouteHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: MSRouteHandler.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSRouteHandler.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Parser and container for routes during their loading /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -44,6 +44,7 @@ #include #include "MSRouteHandler.h" #include "MSPersonControl.h" +#include "MSContainerControl.h" #include #include #include @@ -54,6 +55,7 @@ #include "MSNet.h" #include +//#include #include #include @@ -63,12 +65,19 @@ // =========================================================================== +// static members +// =========================================================================== +MTRand MSRouteHandler::myParsingRNG; + + +// =========================================================================== // method definitions // =========================================================================== MSRouteHandler::MSRouteHandler(const std::string& file, bool addVehiclesDirectly) : SUMORouteHandler(file), myActivePlan(0), + myActiveContainerPlan(0), myAddVehiclesDirectly(addVehiclesDirectly), myCurrentVTypeDistribution(0), myCurrentRouteDistribution(0) { @@ -81,6 +90,54 @@ void +MSRouteHandler::parseFromViaTo(std::string element, + const SUMOSAXAttributes& attrs) { + myActiveRoute.clear(); + bool useTaz = OptionsCont::getOptions().getBool("with-taz"); + if (useTaz && !myVehicleParameter->wasSet(VEHPARS_FROM_TAZ_SET) && !myVehicleParameter->wasSet(VEHPARS_TO_TAZ_SET)) { + WRITE_WARNING("Taz usage was requested but no taz present in " + element + " '" + myVehicleParameter->id + "'!"); + useTaz = false; + } + bool ok = true; + if ((useTaz || !attrs.hasAttribute(SUMO_ATTR_FROM)) && myVehicleParameter->wasSet(VEHPARS_FROM_TAZ_SET)) { + const MSEdge* fromTaz = MSEdge::dictionary(myVehicleParameter->fromTaz + "-source"); + if (fromTaz == 0) { + throw ProcessError("Source taz '" + myVehicleParameter->fromTaz + "' not known for " + element + " '" + myVehicleParameter->id + "'!"); + } else if (fromTaz->getNumSuccessors() == 0) { + throw ProcessError("Source taz '" + myVehicleParameter->fromTaz + "' has no outgoing edges for " + element + " '" + myVehicleParameter->id + "'!"); + } else { + myActiveRoute.push_back(fromTaz); + } + } else { + MSEdge::parseEdgesList(attrs.getOpt(SUMO_ATTR_FROM, myVehicleParameter->id.c_str(), ok, "", true), + myActiveRoute, "for " + element + " '" + myVehicleParameter->id + "'"); + } + if (!attrs.hasAttribute(SUMO_ATTR_VIA) && !attrs.hasAttribute(SUMO_ATTR_ROUTE)) { + myInsertStopEdgesAt = (int)myActiveRoute.size(); + } + MSEdge::parseEdgesList(attrs.getOpt(SUMO_ATTR_VIA, myVehicleParameter->id.c_str(), ok, "", true), + myActiveRoute, "for " + element + " '" + myVehicleParameter->id + "'"); + if ((useTaz || !attrs.hasAttribute(SUMO_ATTR_TO)) && myVehicleParameter->wasSet(VEHPARS_TO_TAZ_SET)) { + const MSEdge* toTaz = MSEdge::dictionary(myVehicleParameter->toTaz + "-sink"); + if (toTaz == 0) { + throw ProcessError("Sink taz '" + myVehicleParameter->toTaz + "' not known for " + element + " '" + myVehicleParameter->id + "'!"); + } else if (toTaz->getNumPredecessors() == 0) { + throw ProcessError("Sink taz '" + myVehicleParameter->toTaz + "' has no incoming edges for " + element + " '" + myVehicleParameter->id + "'!"); + } else { + myActiveRoute.push_back(toTaz); + } + } else { + MSEdge::parseEdgesList(attrs.getOpt(SUMO_ATTR_TO, myVehicleParameter->id.c_str(), ok, "", true), + myActiveRoute, "for " + element + " '" + myVehicleParameter->id + "'"); + } + myActiveRouteID = "!" + myVehicleParameter->id; + if (myVehicleParameter->routeid == "") { + myVehicleParameter->routeid = myActiveRouteID; + } +} + + +void MSRouteHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { SUMORouteHandler::myStartElement(element, attrs); @@ -88,6 +145,9 @@ case SUMO_TAG_PERSON: myActivePlan = new MSPerson::MSPersonPlan(); break; + case SUMO_TAG_CONTAINER: + myActiveContainerPlan = new MSContainer::MSContainerPlan(); + break; case SUMO_TAG_RIDE: { const std::string pid = myVehicleParameter->id; bool ok = true; @@ -136,7 +196,7 @@ throw ProcessError("Non-positive walking duration for '" + myVehicleParameter->id + "'."); } SUMOReal speed = DEFAULT_PEDESTRIAN_SPEED; - const MSVehicleType* vtype = MSNet::getInstance()->getVehicleControl().getVType(myVehicleParameter->vtypeid); + const MSVehicleType* vtype = MSNet::getInstance()->getVehicleControl().getVType(myVehicleParameter->vtypeid, &myParsingRNG); // need to check for explicitly set speed since we might have // DEFAULT_VEHTYPE if (vtype != 0 && vtype->wasSet(VTYPEPARS_MAXSPEED_SET)) { speed = vtype->getMaxSpeed(); @@ -176,8 +236,7 @@ const std::string error = "No connection found between '" + from->getID() + "' and '" + to->getID() + "' for person '" + myVehicleParameter->id + "'."; if (OptionsCont::getOptions().getBool("ignore-route-errors")) { myActiveRoute.push_back(from); - // XXX - //myActiveRoute.push_back(to); + myActiveRoute.push_back(to); // pedestrian will teleport //WRITE_WARNING(error); } else { WRITE_ERROR(error); @@ -200,38 +259,115 @@ myActiveRoute.clear(); break; } - case SUMO_TAG_FLOW: - if (attrs.hasAttribute(SUMO_ATTR_FROM) && attrs.hasAttribute(SUMO_ATTR_TO)) { - myActiveRouteID = "!" + myVehicleParameter->id; - bool ok = true; - MSEdge::parseEdgesList(attrs.get(SUMO_ATTR_FROM, myVehicleParameter->id.c_str(), ok), - myActiveRoute, "for vehicle '" + myVehicleParameter->id + "'"); - MSEdge::parseEdgesList(attrs.get(SUMO_ATTR_TO, myVehicleParameter->id.c_str(), ok), - myActiveRoute, "for vehicle '" + myVehicleParameter->id + "'"); - closeRoute(true); + case SUMO_TAG_TRANSPORT: { + const std::string containerId = myVehicleParameter->id; + bool ok = true; + MSEdge* from = 0; + const std::string desc = attrs.get(SUMO_ATTR_LINES, containerId.c_str(), ok); + StringTokenizer st(desc); + std::string csID = attrs.getOpt(SUMO_ATTR_CONTAINER_STOP, 0, ok, ""); + MSContainerStop* cs = 0; + if (csID != "") { + cs = MSNet::getInstance()->getContainerStop(csID); + if (cs == 0) { + throw ProcessError("Unknown container stop '" + csID + "' for container '" + myVehicleParameter->id + "'."); + } + } + if (attrs.hasAttribute(SUMO_ATTR_FROM)) { + const std::string fromID = attrs.get(SUMO_ATTR_FROM, containerId.c_str(), ok); + from = MSEdge::dictionary(fromID); + if (from == 0) { + throw ProcessError("The from edge '" + fromID + "' within a transport of container '" + containerId + "' is not known."); + } + if (!myActiveContainerPlan->empty() && &myActiveContainerPlan->back()->getDestination() != from) { + throw ProcessError("Disconnected plan for container '" + myVehicleParameter->id + "' (" + fromID + "!=" + myActiveContainerPlan->back()->getDestination().getID() + ")."); + } + if (myActiveContainerPlan->empty()) { + myActiveContainerPlan->push_back(new MSContainer::MSContainerStage_Waiting( + *from, -1, myVehicleParameter->depart, myVehicleParameter->departPos, "start")); + } + } else if (myActiveContainerPlan->empty()) { + throw ProcessError("The start edge within a transport of container '" + containerId + "' is not known."); } + const std::string toID = attrs.get(SUMO_ATTR_TO, containerId.c_str(), ok); + MSEdge* to = MSEdge::dictionary(toID); + if (to == 0) { + throw ProcessError("The to edge '" + toID + "' within a transport of container '" + containerId + "' is not known."); + } + myActiveContainerPlan->push_back(new MSContainer::MSContainerStage_Driving(*to, cs, st.getVector())); break; - case SUMO_TAG_TRIP: { + } + case SUMO_TAG_TRANSHIP: { + myActiveRoute.clear(); bool ok = true; - if (attrs.hasAttribute(SUMO_ATTR_FROM) || !myVehicleParameter->wasSet(VEHPARS_TAZ_SET)) { - MSEdge::parseEdgesList(attrs.get(SUMO_ATTR_FROM, myVehicleParameter->id.c_str(), ok), - myActiveRoute, "for vehicle '" + myVehicleParameter->id + "'"); - MSEdge::parseEdgesList(attrs.get(SUMO_ATTR_TO, myVehicleParameter->id.c_str(), ok), - myActiveRoute, "for vehicle '" + myVehicleParameter->id + "'"); + SUMOReal departPos = attrs.getOpt(SUMO_ATTR_DEPARTPOS, myVehicleParameter->id.c_str(), ok, 0); + SUMOReal arrivalPos = attrs.getOpt(SUMO_ATTR_ARRIVALPOS, myVehicleParameter->id.c_str(), ok, -NUMERICAL_EPS); + SUMOReal speed = DEFAULT_CONTAINER_TRANSHIP_SPEED; + const MSVehicleType* vtype = MSNet::getInstance()->getVehicleControl().getVType(myVehicleParameter->vtypeid); + // need to check for explicitly set speed since we might have // DEFAULT_VEHTYPE + if (vtype != 0 && vtype->wasSet(VTYPEPARS_MAXSPEED_SET)) { + speed = vtype->getMaxSpeed(); + } + speed = attrs.getOpt(SUMO_ATTR_SPEED, 0, ok, speed); + if (speed <= 0) { + throw ProcessError("Non-positive tranship speed for container '" + myVehicleParameter->id + "'."); + } + std::string csID = attrs.getOpt(SUMO_ATTR_CONTAINER_STOP, 0, ok, ""); + MSContainerStop* cs = 0; + if (csID != "") { + cs = MSNet::getInstance()->getContainerStop(csID); + if (cs == 0) { + throw ProcessError("Unknown container stop '" + csID + "' for container '" + myVehicleParameter->id + "'."); + } + arrivalPos = cs->getEndLanePosition(); + } + if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { + MSEdge::parseEdgesList(attrs.get(SUMO_ATTR_EDGES, myVehicleParameter->id.c_str(), ok), myActiveRoute, myActiveRouteID); } else { - const MSEdge* fromTaz = MSEdge::dictionary(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)); + if (attrs.hasAttribute(SUMO_ATTR_FROM) && attrs.hasAttribute(SUMO_ATTR_TO)) { + const std::string fromID = attrs.get(SUMO_ATTR_FROM, myVehicleParameter->id.c_str(), ok); + MSEdge* from = MSEdge::dictionary(fromID); + if (from == 0) { + throw ProcessError("The from edge '" + fromID + "' within a tranship of container '" + myVehicleParameter->id + "' is not known."); + } + const std::string toID = attrs.get(SUMO_ATTR_TO, myVehicleParameter->id.c_str(), ok); + MSEdge* to = MSEdge::dictionary(toID); + if (to == 0) { + throw ProcessError("The to edge '" + toID + "' within a tranship of container '" + myVehicleParameter->id + "' is not known."); + } + //the route of the container's tranship stage consists only of the 'from' and the 'to' edge + myActiveRoute.push_back(from); + myActiveRoute.push_back(to); + if (myActiveRoute.empty()) { + const std::string error = "No connection found between '" + from->getID() + "' and '" + to->getID() + "' for container '" + myVehicleParameter->id + "'."; + if (OptionsCont::getOptions().getBool("ignore-route-errors")) { + myActiveRoute.push_back(from); + } else { + WRITE_ERROR(error); + } + } } } - closeRoute(true); - closeVehicle(); + if (myActiveRoute.empty()) { + throw ProcessError("No edges to tranship container '" + myVehicleParameter->id + "'."); + } + if (!myActiveContainerPlan->empty() && &myActiveContainerPlan->back()->getDestination() != myActiveRoute.front()) { + throw ProcessError("Disconnected plan for container '" + myVehicleParameter->id + "' (" + myActiveRoute.front()->getID() + "!=" + myActiveContainerPlan->back()->getDestination().getID() + ")."); + } + if (myActiveContainerPlan->empty()) { + myActiveContainerPlan->push_back(new MSContainer::MSContainerStage_Waiting( + *myActiveRoute.front(), -1, myVehicleParameter->depart, departPos, "start")); + } + myActiveContainerPlan->push_back(new MSContainer::MSContainerStage_Tranship(myActiveRoute, cs, speed, departPos, arrivalPos)); + myActiveRoute.clear(); + break; } - break; + case SUMO_TAG_FLOW: + parseFromViaTo("flow", attrs); + break; + case SUMO_TAG_TRIP: + parseFromViaTo("trip", attrs); + break; default: break; } @@ -254,7 +390,7 @@ StringTokenizer st(vTypes); while (st.hasNext()) { std::string vtypeID = st.next(); - MSVehicleType* type = MSNet::getInstance()->getVehicleControl().getVType(vtypeID); + MSVehicleType* type = MSNet::getInstance()->getVehicleControl().getVType(vtypeID, &myParsingRNG); if (type == 0) { throw ProcessError("Unknown vtype '" + vtypeID + "' in distribution '" + myCurrentVTypeDistributionID + "'."); } @@ -287,6 +423,8 @@ void MSRouteHandler::openRoute(const SUMOSAXAttributes& attrs) { + myActiveRoute.clear(); + myInsertStopEdgesAt = -1; // check whether the id is really necessary std::string rid; if (myCurrentRouteDistribution != 0) { @@ -315,11 +453,15 @@ MSEdge::parseEdgesList(attrs.get(SUMO_ATTR_EDGES, myActiveRouteID.c_str(), ok), myActiveRoute, rid); } myActiveRouteRefID = attrs.getOpt(SUMO_ATTR_REFID, myActiveRouteID.c_str(), ok, ""); - if (myActiveRouteRefID != "" && MSRoute::dictionary(myActiveRouteRefID) == 0) { + if (myActiveRouteRefID != "" && MSRoute::dictionary(myActiveRouteRefID, &myParsingRNG) == 0) { WRITE_ERROR("Invalid reference to route '" + myActiveRouteRefID + "' in route " + rid + "."); } myActiveRouteProbability = attrs.getOpt(SUMO_ATTR_PROB, myActiveRouteID.c_str(), ok, DEFAULT_VEH_PROB); myActiveRouteColor = attrs.hasAttribute(SUMO_ATTR_COLOR) ? new RGBColor(attrs.get(SUMO_ATTR_COLOR, myActiveRouteID.c_str(), ok)) : 0; + myCurrentCosts = attrs.getOpt(SUMO_ATTR_COST, myActiveRouteID.c_str(), ok, -1); + if (ok && myCurrentCosts != -1 && myCurrentCosts < 0) { + WRITE_ERROR("Invalid cost for route '" + myActiveRouteID + "'."); + } } @@ -344,6 +486,14 @@ } } break; + case SUMO_TAG_TRIP: + myVehicleParameter->setParameter |= VEHPARS_FORCE_REROUTE; + closeRoute(true); + closeVehicle(); + delete myVehicleParameter; + myVehicleParameter = 0; + myInsertStopEdgesAt = -1; + break; default: break; } @@ -351,12 +501,20 @@ void -MSRouteHandler::closeRoute(const bool /* mayBeDisconnected */) { +MSRouteHandler::closeRoute(const bool mayBeDisconnected) { + std::string type = "vehicle"; + if (mayBeDisconnected) { + if (myVehicleParameter->repetitionNumber >= 0) { + type = "flow"; + } else { + type = "trip"; + } + } if (myActiveRoute.size() == 0) { delete myActiveRouteColor; myActiveRouteColor = 0; if (myActiveRouteRefID != "" && myCurrentRouteDistribution != 0) { - const MSRoute* route = MSRoute::dictionary(myActiveRouteRefID); + const MSRoute* route = MSRoute::dictionary(myActiveRouteRefID, &myParsingRNG); if (route != 0) { if (myCurrentRouteDistribution->add(myActiveRouteProbability, route)) { route->addReference(); @@ -367,21 +525,25 @@ return; } if (myVehicleParameter != 0) { - throw ProcessError("Vehicle's '" + myVehicleParameter->id + "' route has no edges."); + throw ProcessError("The route for " + type + " '" + myVehicleParameter->id + "' has no edges."); } else { throw ProcessError("Route '" + myActiveRouteID + "' has no edges."); } } + if (myActiveRoute.size() == 1 && myActiveRoute.front()->getPurpose() == MSEdge::EDGEFUNCTION_DISTRICT) { + throw ProcessError("The routing information for " + type + " '" + myVehicleParameter->id + "' is insufficient."); + } MSRoute* route = new MSRoute(myActiveRouteID, myActiveRoute, myVehicleParameter == 0 || myVehicleParameter->repetitionNumber >= 1, myActiveRouteColor, myActiveRouteStops); + route->setCosts(myCurrentCosts); myActiveRoute.clear(); if (!MSRoute::dictionary(myActiveRouteID, route)) { delete route; if (!MSGlobals::gStateLoaded) { if (myVehicleParameter != 0) { if (MSNet::getInstance()->getVehicleControl().getVehicle(myVehicleParameter->id) == 0) { - throw ProcessError("Another route for vehicle '" + myVehicleParameter->id + "' exists."); + throw ProcessError("Another route for " + type + " '" + myVehicleParameter->id + "' exists."); } else { throw ProcessError("A vehicle with id '" + myVehicleParameter->id + "' already exists."); } @@ -431,7 +593,7 @@ size_t probIndex = 0; while (st.hasNext()) { std::string routeID = st.next(); - const MSRoute* route = MSRoute::dictionary(routeID); + const MSRoute* route = MSRoute::dictionary(routeID, &myParsingRNG); if (route == 0) { throw ProcessError("Unknown route '" + routeID + "' in distribution '" + myCurrentRouteDistributionID + "'."); } @@ -452,7 +614,7 @@ void MSRouteHandler::closeRouteDistribution() { if (myCurrentRouteDistribution != 0) { - const bool haveSameID = MSRoute::dictionary(myCurrentRouteDistributionID) != 0; + const bool haveSameID = MSRoute::dictionary(myCurrentRouteDistributionID, &myParsingRNG) != 0; if (MSGlobals::gStateLoaded && haveSameID) { delete myCurrentRouteDistribution; return; @@ -474,7 +636,7 @@ void MSRouteHandler::closeVehicle() { // get nested route - const MSRoute* route = MSRoute::dictionary("!" + myVehicleParameter->id); + const MSRoute* route = MSRoute::dictionary("!" + myVehicleParameter->id, &myParsingRNG); MSVehicleControl& vehControl = MSNet::getInstance()->getVehicleControl(); if (myVehicleParameter->departProcedure == DEPART_GIVEN) { // let's check whether this vehicle had to depart before the simulation starts @@ -489,17 +651,17 @@ // get the vehicle's type MSVehicleType* vtype = 0; if (myVehicleParameter->vtypeid != "") { - vtype = vehControl.getVType(myVehicleParameter->vtypeid); + vtype = vehControl.getVType(myVehicleParameter->vtypeid, &myParsingRNG); if (vtype == 0) { throw ProcessError("The vehicle type '" + myVehicleParameter->vtypeid + "' for vehicle '" + myVehicleParameter->id + "' is not known."); } } else { // there should be one (at least the default one) - vtype = vehControl.getVType(); + vtype = vehControl.getVType(DEFAULT_VTYPE_ID, &myParsingRNG); } if (route == 0) { // if there is no nested route, try via the (hopefully) given route-id - route = MSRoute::dictionary(myVehicleParameter->routeid); + route = MSRoute::dictionary(myVehicleParameter->routeid, &myParsingRNG); } if (route == 0) { // nothing found? -> error @@ -514,21 +676,41 @@ // try to build the vehicle SUMOVehicle* vehicle = 0; if (vehControl.getVehicle(myVehicleParameter->id) == 0) { - vehicle = vehControl.buildVehicle(myVehicleParameter, route, vtype); + const bool ignoreRouteErrors = OptionsCont::getOptions().getBool("ignore-route-errors"); + try { + vehicle = vehControl.buildVehicle(myVehicleParameter, route, vtype, ignoreRouteErrors); + } catch (const ProcessError& e) { + if (ignoreRouteErrors) { + WRITE_WARNING(e.what()); + vehControl.deleteVehicle(0, true); + myVehicleParameter = 0; + vehicle = 0; + return; + } else { + throw e; + } + } // maybe we do not want this vehicle to be inserted due to scaling unsigned int quota = vehControl.getQuota(); if (quota > 0) { vehControl.addVehicle(myVehicleParameter->id, vehicle); if (myVehicleParameter->departProcedure == DEPART_TRIGGERED) { + const MSEdge* const firstEdge = vehicle->getRoute().getEdges()[0]; + static_cast(vehicle)->setTentativeLaneAndPosition(firstEdge->getLanes()[0], myVehicleParameter->departPos); vehControl.addWaiting(*route->begin(), vehicle); vehControl.registerOneWaitingForPerson(); + } else if (myVehicleParameter->departProcedure == DEPART_CONTAINER_TRIGGERED) { + const MSEdge* const firstEdge = vehicle->getRoute().getEdges()[0]; + static_cast(vehicle)->setTentativeLaneAndPosition(firstEdge->getLanes()[0], myVehicleParameter->departPos); + vehControl.addWaiting(*route->begin(), vehicle); + vehControl.registerOneWaitingForContainer(); } else { // !!! no scaling for triggered vehicles yet for (unsigned int i = 1; i < quota; i++) { MSNet::getInstance()->getInsertionControl().add(vehicle); SUMOVehicleParameter* newPars = new SUMOVehicleParameter(*myVehicleParameter); newPars->id = myVehicleParameter->id + "." + toString(i); - vehicle = vehControl.buildVehicle(newPars, route, vtype); + vehicle = vehControl.buildVehicle(newPars, route, vtype, OptionsCont::getOptions().getBool("ignore-route-errors")); vehControl.addVehicle(newPars->id, vehicle); } } @@ -565,7 +747,7 @@ if (myActivePlan->size() == 0) { throw ProcessError("Person '" + myVehicleParameter->id + "' has no plan."); } - MSVehicleType* type = MSNet::getInstance()->getVehicleControl().getVType(myVehicleParameter->vtypeid); + MSVehicleType* type = MSNet::getInstance()->getVehicleControl().getVType(myVehicleParameter->vtypeid, &myParsingRNG); if (type == 0) { throw ProcessError("The type '" + myVehicleParameter->vtypeid + "' for person '" + myVehicleParameter->id + "' is not known."); } @@ -576,8 +758,9 @@ MSNet::getInstance()->getPersonControl().setDeparture(myVehicleParameter->depart, person); registerLastDepart(); } else { + ProcessError error("Another person with the id '" + myVehicleParameter->id + "' exists."); delete person; - throw ProcessError("Another person with the id '" + myVehicleParameter->id + "' exists."); + throw error; } } else { // warning already given @@ -587,6 +770,33 @@ myActivePlan = 0; } +void +MSRouteHandler::closeContainer() { + if (myActiveContainerPlan->size() == 0) { + throw ProcessError("Container '" + myVehicleParameter->id + "' has no plan."); + } + MSVehicleType* type = MSNet::getInstance()->getVehicleControl().getVType(myVehicleParameter->vtypeid); + if (type == 0) { + throw ProcessError("The type '" + myVehicleParameter->vtypeid + "' for container '" + myVehicleParameter->id + "' is not known."); + } + MSContainer* container = MSNet::getInstance()->getContainerControl().buildContainer(myVehicleParameter, type, myActiveContainerPlan); + // @todo: consider myScale? + if (myAddVehiclesDirectly || checkLastDepart()) { + if (MSNet::getInstance()->getContainerControl().add(myVehicleParameter->id, container)) { + MSNet::getInstance()->getContainerControl().setDeparture(myVehicleParameter->depart, container); + registerLastDepart(); + } else { + ProcessError error("Another container with the id '" + myVehicleParameter->id + "' exists."); + delete container; + throw error; + } + } else { + // warning already given + delete container; + } + myVehicleParameter = 0; + myActiveContainerPlan = 0; +} void MSRouteHandler::closeFlow() { @@ -595,68 +805,85 @@ } // let's check whether vehicles had to depart before the simulation starts myVehicleParameter->repetitionsDone = 0; - const SUMOTime offsetToBegin = string2time(OptionsCont::getOptions().getString("begin")) - myVehicleParameter->depart; - while (myVehicleParameter->repetitionsDone * myVehicleParameter->repetitionOffset < offsetToBegin) { - myVehicleParameter->repetitionsDone++; - if (myVehicleParameter->repetitionsDone == myVehicleParameter->repetitionNumber) { - return; + if (myVehicleParameter->repetitionProbability < 0) { + const 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 (MSNet::getInstance()->getVehicleControl().getVType(myVehicleParameter->vtypeid, &myParsingRNG) == 0) { + throw ProcessError("The vehicle type '" + myVehicleParameter->vtypeid + "' for flow '" + 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; + if (myVehicleParameter->routeid[0] == '!' && MSRoute::dictionary(myVehicleParameter->routeid, &myParsingRNG) == 0) { + myVehicleParameter->setParameter |= VEHPARS_FORCE_REROUTE; + closeRoute(true); + } + if (MSRoute::dictionary(myVehicleParameter->routeid, &myParsingRNG) == 0) { + throw ProcessError("The route '" + myVehicleParameter->routeid + "' for flow '" + myVehicleParameter->id + "' is not known."); } 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(); + if (MSNet::getInstance()->getInsertionControl().add(myVehicleParameter)) { + registerLastDepart(); + } else { + throw ProcessError("Another flow with the id '" + myVehicleParameter->id + "' exists."); + } } myVehicleParameter = 0; + myInsertStopEdgesAt = -1; } void MSRouteHandler::addStop(const SUMOSAXAttributes& attrs) { std::string errorSuffix; - if (myActiveRouteID != "") { - errorSuffix = " in route '" + myActiveRouteID + "'."; - } else if (myActivePlan) { + if (myActivePlan != 0) { errorSuffix = " in person '" + myVehicleParameter->id + "'."; - } else { + } else if (myVehicleParameter != 0) { errorSuffix = " in vehicle '" + myVehicleParameter->id + "'."; + } else if (myActiveContainerPlan != 0) { + errorSuffix = " in container '" + myVehicleParameter->id + "'."; + } else { + errorSuffix = " in route '" + myActiveRouteID + "'."; } SUMOVehicleParameter::Stop stop; bool ok = parseStop(stop, attrs, errorSuffix, MsgHandler::getErrorInstance()); if (!ok) { return; } + MSEdge* edge = 0; // try to parse the assigned bus stop 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 { + if (bs == 0) { WRITE_ERROR("The bus stop '" + stop.busstop + "' is not known" + errorSuffix); return; } + const MSLane& l = bs->getLane(); + stop.lane = l.getID(); + stop.endPos = bs->getEndLanePosition(); + stop.startPos = bs->getBeginLanePosition(); + edge = &l.getEdge(); + } //try to parse the assigned container stop + else if (stop.containerstop != "") { + // ok, we have obviously a container stop + MSContainerStop* cs = MSNet::getInstance()->getContainerStop(stop.containerstop); + if (cs == 0) { + WRITE_ERROR("The container stop '" + stop.containerstop + "' is not known" + errorSuffix); + return; + } + const MSLane& l = cs->getLane(); + stop.lane = l.getID(); + stop.endPos = cs->getEndLanePosition(); + stop.startPos = cs->getBeginLanePosition(); + edge = &l.getEdge(); } else { // no, the lane and the position should be given // get the lane @@ -667,17 +894,27 @@ return; } } else { - WRITE_ERROR("A stop must be placed on a bus stop or a lane" + errorSuffix); + WRITE_ERROR("A stop must be placed on a bus stop, a container stop or a lane" + errorSuffix); return; } + edge = &MSLane::dictionary(stop.lane)->getEdge(); 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() + ")."); + &myActivePlan->back()->getDestination() != edge) { + throw ProcessError("Disconnected plan for person '" + myVehicleParameter->id + "' (" + edge->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")); + *edge, -1, myVehicleParameter->depart, myVehicleParameter->departPos, "start")); + } + if (myActiveContainerPlan && + !myActiveContainerPlan->empty() && + &myActiveContainerPlan->back()->getDestination() != &MSLane::dictionary(stop.lane)->getEdge()) { + throw ProcessError("Disconnected plan for container '" + myVehicleParameter->id + "' (" + MSLane::dictionary(stop.lane)->getEdge().getID() + "!=" + myActiveContainerPlan->back()->getDestination().getID() + ")."); + } + if (myActiveContainerPlan && myActiveContainerPlan->empty()) { + myActiveContainerPlan->push_back(new MSContainer::MSContainerStage_Waiting( + MSLane::dictionary(stop.lane)->getEdge(), -1, myVehicleParameter->depart, myVehicleParameter->departPos, "start")); } stop.endPos = attrs.getOpt(SUMO_ATTR_ENDPOS, 0, ok, MSLane::dictionary(stop.lane)->getLength()); if (attrs.hasAttribute(SUMO_ATTR_POSITION)) { @@ -691,14 +928,22 @@ return; } } - if (myActiveRouteID != "") { - myActiveRouteStops.push_back(stop); - } else if (myActivePlan) { + if (myActivePlan != 0) { std::string actType = attrs.getOpt(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 { + } else if (myActiveContainerPlan != 0) { + std::string actType = attrs.getOpt(SUMO_ATTR_ACTTYPE, 0, ok, "waiting"); + myActiveContainerPlan->push_back(new MSContainer::MSContainerStage_Waiting( + MSLane::dictionary(stop.lane)->getEdge(), stop.duration, stop.until, stop.startPos, actType)); + } else if (myVehicleParameter != 0) { myVehicleParameter->stops.push_back(stop); + } else { + myActiveRouteStops.push_back(stop); + } + if (myInsertStopEdgesAt >= 0) { + myActiveRoute.insert(myActiveRoute.begin() + myInsertStopEdgesAt, edge); + myInsertStopEdgesAt++; } } diff -Nru sumo-0.21.0+dfsg/src/microsim/MSRouteHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSRouteHandler.h --- sumo-0.21.0+dfsg/src/microsim/MSRouteHandler.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSRouteHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: MSRouteHandler.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSRouteHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Parser and container for routes during their loading /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -33,7 +33,8 @@ #endif #include -#include "MSPerson.h" +#include +#include "MSContainer.h" #include "MSVehicle.h" #include #include @@ -66,6 +67,10 @@ /// standard destructor virtual ~MSRouteHandler(); + static MTRand* getParsingRNG() { + return &myParsingRNG; + } + protected: /// @name inherited from GenericSAXHandler //@{ @@ -91,6 +96,16 @@ //@} + /** @brief Called for parsing from and to and the corresponding taz attributes + * + * @param[in] element description of the currently opened element + * @param[in] attrs Attributes within the currently opened element + * @exception ProcessError If something fails + */ + void parseFromViaTo(std::string element, + const SUMOSAXAttributes& attrs); + + /** opens a type distribution for reading */ void openVehicleTypeDistribution(const SUMOSAXAttributes& attrs); @@ -119,6 +134,9 @@ /// Ends the processing of a person void closePerson(); + /// Ends the processing of a container + void closeContainer(); + /// Ends the processing of a flow void closeFlow(); @@ -127,11 +145,14 @@ protected: /// @brief The current route - MSEdgeVector myActiveRoute; + ConstMSEdgeVector myActiveRoute; /// @brief The plan of the current person MSPerson::MSPersonPlan* myActivePlan; + /// @brief The plan of the current container + MSContainer::MSContainerPlan* myActiveContainerPlan; + /// @brief Information whether vehicles shall be directly added to the network or kept within the buffer bool myAddVehiclesDirectly; @@ -147,6 +168,9 @@ /// @brief The id of the currently parsed route distribution std::string myCurrentRouteDistributionID; + /// @brief A random number generator used to choose from vtype/route distributions and computing the speed factors + static MTRand myParsingRNG; + private: /// @brief Invalidated copy constructor MSRouteHandler(const MSRouteHandler& s); diff -Nru sumo-0.21.0+dfsg/src/microsim/MSStateHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSStateHandler.cpp --- sumo-0.21.0+dfsg/src/microsim/MSStateHandler.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSStateHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,11 +4,11 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Thu, 13 Dec 2012 -/// @version $Id: MSStateHandler.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSStateHandler.cpp 17899 2015-02-18 09:21:14Z namdre $ /// // Parser and output filter for routes and vehicles state saving and loading /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ // Copyright (C) 200122014 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // @@ -30,6 +30,10 @@ #include #endif +#ifdef HAVE_VERSION_H +#include +#endif + #include #include #include @@ -47,7 +51,6 @@ #include #endif - #ifdef CHECK_MEMORY_LEAKS #include #endif // CHECK_MEMORY_LEAKS @@ -116,7 +119,7 @@ case SUMO_TAG_ROUTE: { const std::string id = attrs.getString(SUMO_ATTR_ID); if (MSRoute::dictionary(id) == 0) { - MSEdgeVector edges; + ConstMSEdgeVector edges; MSEdge::parseEdgesList(attrs.getString(SUMO_ATTR_EDGES), edges, id); MSRoute* r = new MSRoute(id, edges, attrs.getBool(SUMO_ATTR_STATE), 0, std::vector()); @@ -177,7 +180,7 @@ assert(type != 0); assert(vc.getVehicle(p->id) == 0); - SUMOVehicle* v = vc.buildVehicle(p, route, type); + SUMOVehicle* v = vc.buildVehicle(p, route, type, true); v->loadState(attrs, myOffset); if (!vc.addVehicle(p->id, v)) { throw ProcessError("Error: Could not build vehicle " + p->id + "!"); diff -Nru sumo-0.21.0+dfsg/src/microsim/MSStateHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSStateHandler.h --- sumo-0.21.0+dfsg/src/microsim/MSStateHandler.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSStateHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Thu, 13 Dec 2012 -/// @version $Id: MSStateHandler.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSStateHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Parser and output filter for routes and vehicles state saving and loading /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSVehicleContainer.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleContainer.cpp --- sumo-0.21.0+dfsg/src/microsim/MSVehicleContainer.cpp 2014-06-03 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleContainer.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 12 Mar 2001 -/// @version $Id: MSVehicleContainer.cpp 16504 2014-06-03 21:48:00Z behrisch $ +/// @version $Id: MSVehicleContainer.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // vehicles sorted by their departures /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -123,7 +123,7 @@ if (isFull()) { std::vector array2((array.size() - 1) * 2 + 1, VehicleDepartureVector()); for (int i = (int)array.size(); i-- > 0;) { - assert(array2.size() > i); + assert(i < (int)array2.size()); array2[i] = array[i]; } array = array2; @@ -141,10 +141,8 @@ bool -MSVehicleContainer::anyWaitingFor(SUMOTime time) const { - VehicleHeap::const_iterator j = - find_if(array.begin() + 1, array.begin() + currentSize + 1, DepartFinder(time)); - return j != array.begin() + currentSize + 1; +MSVehicleContainer::anyWaitingBefore(SUMOTime time) const { + return !isEmpty() && topTime() < time; } diff -Nru sumo-0.21.0+dfsg/src/microsim/MSVehicleContainer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleContainer.h --- sumo-0.21.0+dfsg/src/microsim/MSVehicleContainer.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleContainer.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 12 Mar 2001 -/// @version $Id: MSVehicleContainer.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSVehicleContainer.h 18095 2015-03-17 09:39:00Z behrisch $ /// // vehicles sorted by their departures /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -74,8 +74,8 @@ /// Adds a container with vehicles departing at the given time void add(SUMOTime time, const VehicleVector& cont); - /// Returns the information whether any vehicles want to depart at the given time - bool anyWaitingFor(SUMOTime time) const; + /// Returns the information whether any vehicles want to depart before the given time + bool anyWaitingBefore(SUMOTime time) const; /// Returns the uppermost vehicle vector const VehicleVector& top(); diff -Nru sumo-0.21.0+dfsg/src/microsim/MSVehicleControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleControl.cpp --- sumo-0.21.0+dfsg/src/microsim/MSVehicleControl.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 10. Dec 2003 -/// @version $Id: MSVehicleControl.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSVehicleControl.cpp 18131 2015-03-24 13:26:29Z behrisch $ /// // The class responsible for building and deletion of vehicles /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -33,11 +33,13 @@ #include "MSVehicleControl.h" #include "MSVehicle.h" #include "MSLane.h" +#include "MSEdge.h" #include "MSNet.h" +#include "MSRouteHandler.h" #include #include #include -#include +#include #include #include #include @@ -48,12 +50,6 @@ // =========================================================================== -// static members -// =========================================================================== -MTRand MSVehicleControl::myVehicleParamsRNG; - - -// =========================================================================== // member method definitions // =========================================================================== MSVehicleControl::MSVehicleControl() : @@ -70,9 +66,15 @@ myTotalTravelTime(0), myDefaultVTypeMayBeDeleted(true), myWaitingForPerson(0), - myScale(-1) { + myWaitingForContainer(0), + myScale(-1), + myMaxSpeedFactor(1), + myMinDeceleration(SUMOVTypeParameter::getDefaultDecel(SVC_IGNORING)) { SUMOVTypeParameter defType(DEFAULT_VTYPE_ID, SVC_IGNORING); myVTypeDict[DEFAULT_VTYPE_ID] = MSVehicleType::build(defType); + SUMOVTypeParameter defPedType(DEFAULT_PEDTYPE_ID, SVC_PEDESTRIAN); + defPedType.setParameter |= VTYPEPARS_VEHICLECLASS_SET; + myVTypeDict[DEFAULT_PEDTYPE_ID] = MSVehicleType::build(defPedType); OptionsCont& oc = OptionsCont::getOptions(); if (oc.isSet("scale")) { myScale = oc.getFloat("scale"); @@ -99,17 +101,27 @@ myVTypeDict.clear(); } +SUMOTime +MSVehicleControl::computeRandomDepartOffset() const { + if (myMaxRandomDepartOffset > 0) { + // round to the closest usable simulation step + return DELTA_T * int((MSRouteHandler::getParsingRNG()->rand((int)myMaxRandomDepartOffset) + 0.5 * DELTA_T) / DELTA_T); + } else { + return 0; + } +} SUMOVehicle* MSVehicleControl::buildVehicle(SUMOVehicleParameter* defs, const MSRoute* route, - const MSVehicleType* type) { + const MSVehicleType* type, + const bool ignoreStopErrors, const bool fromRouteFile) { myLoadedVehNo++; - if (myMaxRandomDepartOffset > 0) { - // round to the closest usable simulation step - defs->depart += DELTA_T * int((myVehicleParamsRNG.rand((int)myMaxRandomDepartOffset) + 0.5 * DELTA_T) / DELTA_T); + if (fromRouteFile) { + defs->depart += computeRandomDepartOffset(); } - MSVehicle* built = new MSVehicle(defs, route, type, type->computeChosenSpeedDeviation(myVehicleParamsRNG)); + MSVehicle* built = new MSVehicle(defs, route, type, type->computeChosenSpeedDeviation(fromRouteFile ? MSRouteHandler::getParsingRNG() : 0)); + built->addStops(ignoreStopErrors); MSNet::getInstance()->informVehicleStateListener(built, MSNet::VEHICLE_STATE_BUILT); return built; } @@ -125,6 +137,7 @@ (*i)->generateOutput(); } if (OptionsCont::getOptions().isSet("tripinfo-output")) { + // close tag after tripinfo (possibly including emissions from another device) have been written OutputDevice::getDeviceByOption("tripinfo-output").closeTag(); } deleteVehicle(veh); @@ -136,6 +149,8 @@ ++myRunningVehNo; myTotalDepartureDelay += STEPS2TIME(v.getDeparture() - STEPFLOOR(v.getParameter().depart)); MSNet::getInstance()->informVehicleStateListener(&v, MSNet::VEHICLE_STATE_DEPARTED); + myMaxSpeedFactor = MAX2(myMaxSpeedFactor, v.getChosenSpeedFactor()); + myMinDeceleration = MIN2(myMinDeceleration, v.getVehicleType().getCarFollowModel().getMaxDecel()); } @@ -196,23 +211,13 @@ if (discard) { myDiscarded++; } - myVehicleDict.erase(veh->getID()); + if (veh != 0) { + myVehicleDict.erase(veh->getID()); + } delete veh; } -MSVehicleControl::constVehIt -MSVehicleControl::loadedVehBegin() const { - return myVehicleDict.begin(); -} - - -MSVehicleControl::constVehIt -MSVehicleControl::loadedVehEnd() const { - return myVehicleDict.end(); -} - - bool MSVehicleControl::checkVType(const std::string& id) { if (id == DEFAULT_VTYPE_ID) { @@ -223,6 +228,14 @@ } else { return false; } + } else if (id == DEFAULT_PEDTYPE_ID) { + if (myDefaultPedTypeMayBeDeleted) { + delete myVTypeDict[id]; + myVTypeDict.erase(myVTypeDict.find(id)); + myDefaultPedTypeMayBeDeleted = false; + } else { + return false; + } } else { if (myVTypeDict.find(id) != myVTypeDict.end() || myVTypeDistDict.find(id) != myVTypeDistDict.end()) { return false; @@ -258,17 +271,19 @@ MSVehicleType* -MSVehicleControl::getVType(const std::string& id) { +MSVehicleControl::getVType(const std::string& id, MTRand* rng) { VTypeDictType::iterator it = myVTypeDict.find(id); if (it == myVTypeDict.end()) { VTypeDistDictType::iterator it2 = myVTypeDistDict.find(id); if (it2 == myVTypeDistDict.end()) { return 0; } - return it2->second->get(&myVehicleParamsRNG); + return it2->second->get(rng); } if (id == DEFAULT_VTYPE_ID) { myDefaultVTypeMayBeDeleted = false; + } else if (id == DEFAULT_PEDTYPE_ID) { + myDefaultPedTypeMayBeDeleted = false; } return it->second; } @@ -307,14 +322,33 @@ SUMOVehicle* -MSVehicleControl::getWaitingVehicle(const MSEdge* const edge, const std::set& lines) { +MSVehicleControl::getWaitingVehicle(const MSEdge* const edge, const std::set& lines, const SUMOReal position, const std::string ridingID) { if (myWaiting.find(edge) != myWaiting.end()) { + // for every vehicle waiting vehicle at this edge + std::vector waitingTooFarAway; 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; + SUMOReal vehiclePosition = (*it)->getPositionOnLane(); + // if the line of the vehicle is contained in the set of given lines and the vehicle is stopped and is positioned + // in the interval [position - t, position + t] for a tolerance t=10 if (lines.count(line)) { - return (*it); + if ((position - 10 <= vehiclePosition) && (vehiclePosition <= position + 10)) { + return (*it); + } else if ((*it)->isStoppedTriggered() || + (*it)->getParameter().departProcedure == DEPART_TRIGGERED) { + // maybe we are within the range of the stop + MSVehicle* veh = static_cast(*it); + if (veh->isStoppedInRange(position)) { + return (*it); + } else { + waitingTooFarAway.push_back(*it); + } + } } } + for (std::vector::iterator it = waitingTooFarAway.begin(); it != waitingTooFarAway.end(); ++it) { + WRITE_WARNING(ridingID + " at edge '" + edge->getID() + "' position " + toString(position) + " cannot use waiting vehicle '" + (*it)->getID() + "' at position " + toString((*it)->getPositionOnLane()) + " because it is too far away."); + } } return 0; } @@ -323,7 +357,7 @@ void MSVehicleControl::abortWaiting() { for (VehicleDictType::iterator i = myVehicleDict.begin(); i != myVehicleDict.end(); ++i) { - WRITE_WARNING("Vehicle " + i->first + " aborted waiting for a person that will never come."); + WRITE_WARNING("Vehicle " + i->first + " aborted waiting for a person or a container that will never come."); } } diff -Nru sumo-0.21.0+dfsg/src/microsim/MSVehicleControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleControl.h --- sumo-0.21.0+dfsg/src/microsim/MSVehicleControl.h 2014-05-26 22:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 10. Dec 2003 -/// @version $Id: MSVehicleControl.h 16427 2014-05-26 11:11:19Z behrisch $ +/// @version $Id: MSVehicleControl.h 18096 2015-03-17 09:50:59Z behrisch $ /// // The class responsible for building and deletion of vehicles /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,21 +36,20 @@ #include #include #include -#include "MSGlobals.h" -#include -#include #include -#include +#include +#include // =========================================================================== // class declarations // =========================================================================== class SUMOVehicle; +class SUMOVehicleParameter; class MSVehicle; class MSRoute; class MSVehicleType; -class BinaryInputDevice; +class OutputDevice; class MSEdge; @@ -97,10 +96,13 @@ * @param[in] defs The parameter defining the vehicle * @param[in] route The route of this vehicle * @param[in] type The type of this vehicle + * @param[in] ignoreStopErrors whether invalid stops trigger a warning only + * @param[in] fromRouteFile whether we are just reading the route file or creating via trigger, traci, ... * @return The built vehicle (MSVehicle instance) */ virtual SUMOVehicle* buildVehicle(SUMOVehicleParameter* defs, const MSRoute* route, - const MSVehicleType* type); + const MSVehicleType* type, + const bool ignoreStopErrors, const bool fromRouteFile = true); /// @} @@ -158,17 +160,19 @@ /** @brief Returns the begin of the internal vehicle map - * * @return The begin of the internal vehicle map */ - constVehIt loadedVehBegin() const; + constVehIt loadedVehBegin() const { + return myVehicleDict.begin(); + } /** @brief Returns the end of the internal vehicle map - * * @return The end of the internal vehicle map */ - constVehIt loadedVehEnd() const; + constVehIt loadedVehEnd() const { + return myVehicleDict.end(); + } /// @} @@ -232,12 +236,12 @@ unsigned int getQuota(SUMOReal frac = -1) const; - /** @brief Returns the number of build vehicles that have not been removed - * or need to wait for a passenger + /** @brief Returns the number of build vehicles that have not been removed or + * need to wait for a passenger or a container * @return Number of active vehicles */ int getActiveVehicleCount() const { - return myLoadedVehNo - (myWaitingForPerson + myEndedVehNo); + return myLoadedVehNo - (myWaitingForPerson + myWaitingForContainer + myEndedVehNo); } @@ -338,7 +342,7 @@ * @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, MTRand* rng = 0); /** @brief Inserts ids of all known vehicle types and vehicle type distributions to the given vector @@ -347,11 +351,19 @@ void insertVTypeIDs(std::vector& into) const; /// @} + /// @brief Adds a vehicle to the list of waiting vehiclse to a given edge void addWaiting(const MSEdge* const edge, SUMOVehicle* vehicle); + /// @brief Removes a vehicle from the list of waiting vehicles to a given edge void removeWaiting(const MSEdge* const edge, SUMOVehicle* vehicle); - SUMOVehicle* getWaitingVehicle(const MSEdge* const edge, const std::set& lines); + /* @brief returns a vehicle of the given lines that is waiting for a for a person or a container at this edge at the given positions + * @param[in] edge The edge at which the vehicle is positioned. + * @param[in] lines The set of lines from which at least one must correspond to the line of the vehicle + * @param[in] position The vehicle shall be positioned in the interval [position - t, position + t], where t is some tolerance + * @param[in] ridingID The id of the person or container that wants to ride + */ + SUMOVehicle* getWaitingVehicle(const MSEdge* const edge, const std::set& lines, const SUMOReal position, const std::string ridingID); /** @brief increases the count of vehicles waiting for a person to allow recogniztion of person related deadlocks */ @@ -365,6 +377,18 @@ myWaitingForPerson--; } + /** @brief increases the count of vehicles waiting for a container to allow recogniztion of container related deadlocks + */ + void registerOneWaitingForContainer() { + myWaitingForContainer++; + } + + /** @brief decreases the count of vehicles waiting for a container to allow recogniztion of container related deadlocks + */ + void unregisterOneWaitingForContainer() { + myWaitingForContainer--; + } + /// @brief registers one collision-related teleport void registerCollision() { myCollisions++; @@ -403,15 +427,22 @@ /// @} - /** @brief removes any vehicles that are still waiting + /** @brief informes about all waiting vehicles (deletion in destructor) */ void abortWaiting(); + /// @brief compute (optional) random offset to the departure time + SUMOTime computeRandomDepartOffset() const; -public: - /// @brief A random number generator used to choose from vtype/route distributions and computing the speed factors - static MTRand myVehicleParamsRNG; + /// @brief return the maximum speed factor for all vehicles that ever entered the network + SUMOReal getMaxSpeedFactor() const { + return myMaxSpeedFactor; + } + /// @brief return the minimum deceleration capability for all vehicles that ever entered the network + SUMOReal getMinDeceleration() const { + return myMinDeceleration; + } private: /** @brief Checks whether the vehicle type (distribution) may be added @@ -493,18 +524,29 @@ /// @brief Whether no vehicle type was loaded bool myDefaultVTypeMayBeDeleted; - /// the lists of waiting vehicles + /// @brief Whether no pedestrian type was loaded + bool myDefaultPedTypeMayBeDeleted; + + /// the lists of waiting vehicles to a given edge std::map > myWaiting; - /// the number of vehicles contained in myWaiting which can only continue by being triggered + /// the number of vehicles wainting for persons contained in myWaiting which can only continue by being triggered unsigned int myWaitingForPerson; + /// the number of vehicles wainting for containers contained in myWaiting which can only continue by being triggered + unsigned int myWaitingForContainer; + /// @brief The scaling factor (especially for inc-dua) SUMOReal myScale; /// @brief The maximum random offset to be added to vehicles departure times (non-negative) SUMOTime myMaxRandomDepartOffset; + /// @brief The maximum speed factor for all vehicles in the network + SUMOReal myMaxSpeedFactor; + + /// @brief The minimum deceleration capability for all vehicles in the network + SUMOReal myMinDeceleration; private: /// @brief invalidated copy constructor diff -Nru sumo-0.21.0+dfsg/src/microsim/MSVehicle.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicle.cpp --- sumo-0.21.0+dfsg/src/microsim/MSVehicle.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicle.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -12,12 +12,12 @@ /// @author Axel Wegener /// @author Christoph Sommer /// @date Mon, 05 Mar 2001 -/// @version $Id: MSVehicle.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSVehicle.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Representation of a vehicle in the micro simulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -43,10 +43,9 @@ #include #include #include -#include #include #include -#include +#include #include #include #include @@ -62,11 +61,14 @@ #include #include "trigger/MSBusStop.h" #include "devices/MSDevice_Person.h" +#include "devices/MSDevice_Container.h" #include "MSEdgeWeightsStorage.h" -#include "MSAbstractLaneChangeModel.h" +#include #include "MSMoveReminder.h" -#include "MSPerson.h" +#include #include "MSPersonControl.h" +#include "MSContainer.h" +#include "MSContainerControl.h" #include "MSLane.h" #include "MSVehicle.h" #include "MSEdge.h" @@ -155,6 +157,7 @@ myRespectJunctionPriority(true), myEmergencyBrakeRedLight(true), myAmVTDControlled(false), + myLastVTDAccess(-TIME2STEPS(20)), myStrategicLC(LC_NOCONFLICT), myCooperativeLC(LC_NOCONFLICT), mySpeedGainLC(LC_NOCONFLICT), @@ -387,10 +390,8 @@ } -MSVehicle::MSVehicle(SUMOVehicleParameter* pars, - const MSRoute* route, - const MSVehicleType* type, - SUMOReal speedFactor) : +MSVehicle::MSVehicle(SUMOVehicleParameter* pars, const MSRoute* route, + const MSVehicleType* type, const SUMOReal speedFactor) : MSBaseVehicle(pars, route, type, speedFactor), myWaitingTime(0), myState(0, 0), // @@ -398,10 +399,12 @@ myLastBestLanesEdge(0), myLastBestLanesInternalLane(0), myPersonDevice(0), + myContainerDevice(0), myAcceleration(0), mySignals(0), myAmOnNet(false), myAmRegisteredAsWaitingForPerson(false), + myAmRegisteredAsWaitingForContainer(false), myHaveToWaitOnNextLink(false), myCachedPosition(Position::INVALID), myEdgeWeights(0) @@ -409,36 +412,21 @@ , myInfluencer(0) #endif { - for (std::vector::iterator i = pars->stops.begin(); i != pars->stops.end(); ++i) { - if (!addStop(*i)) { - throw ProcessError("Stop for vehicle '" + pars->id + - "' on lane '" + i->lane + "' is too close or not downstream the current route."); - } - } - for (std::vector::const_iterator i = route->getStops().begin(); i != route->getStops().end(); ++i) { - if (!addStop(*i)) { - throw ProcessError("Stop for vehicle '" + pars->id + - "' on lane '" + i->lane + "' is too close or not downstream the current route."); - } - } - updateBestLanes(true, (*myCurrEdge)->getLanes()[0]); // must be called before getBestLanes in getDepartLane - const MSLane* const depLane = (*myCurrEdge)->getDepartLane(*this); - if (depLane == 0) { - throw ProcessError("Invalid departlane definition for vehicle '" + pars->id + "'."); - } - if (pars->departSpeedProcedure == DEPART_SPEED_GIVEN && pars->departSpeed > depLane->getVehicleMaxSpeed(this)) { - if (type->getSpeedDeviation() > 0 && pars->departSpeed <= type->getSpeedFactor() * depLane->getSpeedLimit() * (2 * type->getSpeedDeviation() + 1.)) { - WRITE_WARNING("Choosing new speed factor for vehicle '" + pars->id + "' to match departure speed."); - myChosenSpeedFactor = type->computeChosenSpeedDeviation(MSVehicleControl::myVehicleParamsRNG, pars->departSpeed / (type->getSpeedFactor() * depLane->getSpeedLimit())); + if ((*myCurrEdge)->getPurpose() != MSEdge::EDGEFUNCTION_DISTRICT) { + if (pars->departLaneProcedure == DEPART_LANE_GIVEN) { + if ((*myCurrEdge)->getDepartLane(*this) == 0) { + throw ProcessError("Invalid departlane definition for vehicle '" + pars->id + "'."); + } } else { + if ((*myCurrEdge)->allowedLanes(type->getVehicleClass()) == 0) { + throw ProcessError("Vehicle '" + pars->id + "' is not allowed to depart on any lane of its first edge."); + } + } + if (pars->departSpeedProcedure == DEPART_SPEED_GIVEN && pars->departSpeed > type->getMaxSpeed()) { throw ProcessError("Departure speed for vehicle '" + pars->id + - "' is too high for the departure lane '" + depLane->getID() + "'."); + "' is too high for the vehicle type '" + type->getID() + "'."); } } - if (pars->departSpeedProcedure == DEPART_SPEED_GIVEN && pars->departSpeed > type->getMaxSpeed()) { - throw ProcessError("Departure speed for vehicle '" + pars->id + - "' is too high for the vehicle type '" + type->getID() + "'."); - } myLaneChangeModel = MSAbstractLaneChangeModel::build(type->getLaneChangeModel(), *this); myCFVariables = type->getCarFollowModel().createVehicleVariables(); } @@ -467,7 +455,7 @@ bool MSVehicle::replaceRoute(const MSRoute* newRoute, bool onInit, int offset) { - const MSEdgeVector& edges = newRoute->getEdges(); + const ConstMSEdgeVector& edges = newRoute->getEdges(); // assert the vehicle may continue (must not be "teleported" or whatever to another position) if (!onInit && !newRoute->contains(*myCurrEdge)) { return false; @@ -486,9 +474,7 @@ myRoute = newRoute; myLastBestLanesEdge = 0; myLastBestLanesInternalLane = 0; - if (!onInit) { - updateBestLanes(true); - } + updateBestLanes(true, onInit ? (*myCurrEdge)->getLanes().front() : 0); // update arrival definition calculateArrivalPos(); // save information that the vehicle was rerouted @@ -505,9 +491,10 @@ } // add new stops for (std::vector::const_iterator i = newRoute->getStops().begin(); i != newRoute->getStops().end(); ++i) { - if (!addStop(*i)) { - WRITE_WARNING("Stop for vehicle '" + getID() + - "' on lane '" + i->lane + "' is too close or not downstream the new route."); + std::string error; + addStop(*i, error); + if (error != "") { + WRITE_WARNING(error); } } return true; @@ -639,23 +626,42 @@ } +const MSEdge* +MSVehicle::getRerouteOrigin() const { + // too close to the next junction, so avoid an emergency brake here + if (myLane != 0 && (myCurrEdge + 1) != myRoute->end() && + myState.myPos > myLane->getLength() - getCarFollowModel().brakeGap(myState.mySpeed, getCarFollowModel().getMaxDecel(), 0.)) { + return *(myCurrEdge + 1); + } +#ifdef HAVE_INTERNAL_LANES + if (myLane != 0) { + return myLane->getInternalFollower(); + } +#endif + return *myCurrEdge; +} + + SUMOReal MSVehicle::getAngle() const { Position p1; Position p2; + if (isParking()) { + return -myLane->getShape().rotationDegreeAtOffset(myLane->interpolateLanePosToGeometryPos(getPositionOnLane())); + } if (getLaneChangeModel().isChangingLanes()) { // cannot use getPosition() because it already includes the offset to the side and thus messes up the angle p1 = myLane->geometryPositionAtOffset(myState.myPos); } else { p1 = getPosition(); } - if (getPositionOnLane() * myLane->getLengthGeometryFactor() > myType->getLength()) { - // vehicle is fully on the new lane (visually) - p2 = myLane->getShape().positionAtOffset(getPositionOnLane() * myLane->getLengthGeometryFactor() - myType->getLength()); + if (myState.myPos >= myType->getLength()) { + // vehicle is fully on the new lane + p2 = myLane->geometryPositionAtOffset(myState.myPos - myType->getLength()); } else { p2 = myFurtherLanes.size() > 0 ? myFurtherLanes.back()->geometryPositionAtOffset(myFurtherLanes.back()->getPartialOccupatorEnd()) - : myLane->geometryPositionAtOffset(myState.myPos - myType->getLength()); + : myLane->getShape().front(); } SUMOReal result = (p1 != p2 ? atan2(p1.x() - p2.x(), p2.y() - p1.y()) * 180. / M_PI : @@ -670,24 +676,45 @@ // ------------ bool -MSVehicle::addStop(const SUMOVehicleParameter::Stop& stopPar, SUMOTime untilOffset) { +MSVehicle::addStop(const SUMOVehicleParameter::Stop& stopPar, std::string& errorMsg, SUMOTime untilOffset) { Stop stop; stop.lane = MSLane::dictionary(stopPar.lane); + if (!stop.lane->allowsVehicleClass(myType->getVehicleClass())) { + errorMsg = "Vehicle '" + myParameter->id + "' is not allowed to stop on lane '" + stopPar.lane + "'."; + return false; + } stop.busstop = MSNet::getInstance()->getBusStop(stopPar.busstop); + stop.containerstop = MSNet::getInstance()->getContainerStop(stopPar.containerstop); stop.startPos = stopPar.startPos; stop.endPos = stopPar.endPos; stop.duration = stopPar.duration; stop.until = stopPar.until; + stop.timeToBoardNextPerson = 0; + stop.timeToLoadNextContainer = 0; stop.awaitedPersons = stopPar.awaitedPersons; + stop.awaitedContainers = stopPar.awaitedContainers; if (stop.until != -1) { stop.until += untilOffset; } stop.triggered = stopPar.triggered; + stop.containerTriggered = stopPar.containerTriggered; stop.parking = stopPar.parking; stop.reached = false; if (stop.startPos < 0 || stop.endPos > stop.lane->getLength()) { + if (stop.busstop != 0) { + errorMsg = "Bus stop '" + stop.busstop->getID() + "'"; + } else { + errorMsg = "Stop"; + } + errorMsg += " for vehicle '" + myParameter->id + "' on lane '" + stopPar.lane + "' has an invalid position."; return false; } + if (stop.busstop != 0 && myType->getLength() / 2. > stop.endPos - stop.startPos) { + errorMsg = "Bus stop '" + stop.busstop->getID() + "' on lane '" + stopPar.lane + "' is too short for vehicle '" + myParameter->id + "'."; + } + if (stop.containerstop != 0 && myType->getLength() / 2. > stop.endPos - stop.startPos) { + errorMsg = "Container stop '" + stop.containerstop->getID() + "' on lane '" + stopPar.lane + "' is too short for vehicle '" + myParameter->id + "'."; + } stop.edge = find(myCurrEdge, myRoute->end(), &stop.lane->getEdge()); MSRouteIterator prevStopEdge = myCurrEdge; SUMOReal prevStopPos = myState.myPos; @@ -724,11 +751,18 @@ } if (stop.edge == myRoute->end() || prevStopEdge > stop.edge || (prevStopEdge == stop.edge && prevStopPos > stop.endPos)) { + if (stop.busstop != 0) { + errorMsg = "Bus stop '" + stop.busstop->getID() + "'"; + } else { + errorMsg = "Stop"; + } + errorMsg += " for vehicle '" + myParameter->id + "' on lane '" + stopPar.lane + "' is not downstream the current route."; return false; } // David.C: //if (!stop.parking && (myCurrEdge == stop.edge && myState.myPos > stop.endPos - getCarFollowModel().brakeGap(myState.mySpeed))) { if (myCurrEdge == stop.edge && myState.myPos > stop.endPos - getCarFollowModel().brakeGap(myState.mySpeed)) { + errorMsg = "Stop for vehicle '" + myParameter->id + "' on lane '" + stopPar.lane + "' is too close to break."; return false; } if (!hasDeparted() && myCurrEdge == stop.edge) { @@ -743,9 +777,27 @@ pos = MIN2(static_cast(getVehicleType().getLength() + POSITION_EPS), (*myCurrEdge)->getLength()); } if (pos > stop.endPos) { + if (stop.busstop != 0) { + errorMsg = "Bus stop '" + stop.busstop->getID() + "'"; + } else { + errorMsg = "Stop"; + } + errorMsg += " for vehicle '" + myParameter->id + "' on lane '" + stopPar.lane + "' is behind departPos."; return false; } } + if (iter != myStops.begin()) { + std::list::iterator iter2 = iter; + iter2--; + if (stop.until >= 0 && iter2->until > stop.until) { + if (stop.busstop != 0) { + errorMsg = "Bus stop '" + stop.busstop->getID() + "'"; + } else { + errorMsg = "Stop"; + } + errorMsg += " for vehicle '" + myParameter->id + "' on lane '" + stopPar.lane + "' ends earlier than previous stop."; + } + } myStops.insert(iter, stop); return true; } @@ -765,7 +817,13 @@ bool MSVehicle::isStoppedTriggered() const { - return isStopped() && myStops.begin()->triggered; + return isStopped() && (myStops.begin()->triggered || myStops.begin()->containerTriggered); +} + + +bool +MSVehicle::isStoppedInRange(SUMOReal pos) const { + return isStopped() && myStops.begin()->startPos <= pos && myStops.begin()->endPos >= pos; } @@ -779,8 +837,11 @@ if (stop.reached) { // ok, we have already reached the next stop // any waiting persons may board now - bool boarded = MSNet::getInstance()->getPersonControl().boardAnyWaiting(&myLane->getEdge(), this); + bool boarded = MSNet::getInstance()->getPersonControl().boardAnyWaiting(&myLane->getEdge(), this, &stop); boarded &= stop.awaitedPersons.size() == 0; + // load containers + bool loaded = MSNet::getInstance()->getContainerControl().loadAnyWaiting(&myLane->getEdge(), this, &stop); + loaded &= stop.awaitedContainers.size() == 0; if (boarded) { if (stop.busstop != 0) { const std::vector& persons = myPersonDevice->getPersons(); @@ -795,7 +856,21 @@ myAmRegisteredAsWaitingForPerson = false; } } - if (stop.duration <= 0 && !stop.triggered) { + if (loaded) { + if (stop.containerstop != 0) { + const std::vector& containers = myContainerDevice->getContainers(); + for (std::vector::const_iterator i = containers.begin(); i != containers.end(); ++i) { + stop.containerstop->removeContainer(*i); + } + } + // the triggering condition has been fulfilled + stop.containerTriggered = false; + if (myAmRegisteredAsWaitingForContainer) { + MSNet::getInstance()->getVehicleControl().unregisterOneWaitingForContainer(); + myAmRegisteredAsWaitingForContainer = false; + } + } + if (stop.duration <= 0 && !stop.triggered && !stop.containerTriggered) { resumeFromStopping(); } else { // we have to wait some more time @@ -804,6 +879,11 @@ MSNet::getInstance()->getVehicleControl().registerOneWaitingForPerson(); myAmRegisteredAsWaitingForPerson = true; } + if (stop.containerTriggered && !myAmRegisteredAsWaitingForContainer) { + // we can only register after waiting for one step. otherwise we might falsely signal a deadlock + MSNet::getInstance()->getVehicleControl().registerOneWaitingForContainer(); + myAmRegisteredAsWaitingForContainer = true; + } stop.duration -= DELTA_T; return 0; } @@ -816,12 +896,23 @@ if (stop.busstop != 0) { // on bus stops, we have to wait for free place if they are in use... endPos = stop.busstop->getLastFreePos(*this); - if (endPos - 5. < stop.busstop->getBeginLanePosition()) { // !!! explicit offset + // at least half the bus has to fit on non-empty bus stops + if (endPos != stop.busstop->getEndLanePosition() && endPos - myType->getLength() / 2. < stop.busstop->getBeginLanePosition()) { busStopsMustHaveSpace = false; } } + bool containerStopsMustHaveSpace = true; + // if the stop is a container stop we check if the vehicle fits into the last free position of the stop + if (stop.containerstop != 0) { + // on container stops, we have to wait for free place if they are in use... + endPos = stop.containerstop->getLastFreePos(*this); + if (endPos != stop.containerstop->getEndLanePosition() && endPos - myType->getLength() / 2. < stop.containerstop->getBeginLanePosition()) { + containerStopsMustHaveSpace = false; + } + } + // we use the same offset for container stops as for bus stops. we might have to change it at some point! if (myState.pos() + getVehicleType().getMinGap() >= endPos - BUS_STOP_OFFSET && busStopsMustHaveSpace - && myLane == stop.lane) { + && containerStopsMustHaveSpace && myLane == stop.lane) { // ok, we may stop (have reached the stop) stop.reached = true; MSNet::getInstance()->getVehicleControl().addWaiting(&myLane->getEdge(), this); @@ -838,6 +929,10 @@ // let the bus stop know the vehicle stop.busstop->enter(this, myState.pos() + getVehicleType().getMinGap(), myState.pos() - myType->getLength()); } + if (stop.containerstop != 0) { + // let the container stop know the vehicle + stop.containerstop->enter(this, myState.pos() + getVehicleType().getMinGap(), myState.pos() - myType->getLength()); + } } // decelerate return getCarFollowModel().stopSpeed(this, getSpeed(), endPos - myState.pos()); @@ -847,6 +942,16 @@ } +const ConstMSEdgeVector +MSVehicle::getStopEdges() const { + ConstMSEdgeVector result; + for (std::list::const_iterator iter = myStops.begin(); iter != myStops.end(); ++iter) { + result.push_back(*iter->edge); + } + return result; +} + + void MSVehicle::planMove(const SUMOTime t, const MSVehicle* pred, const SUMOReal lengthsInFront) { planMoveInternal(t, pred, myLFLinkLanes); @@ -869,9 +974,6 @@ } } lfLinks.clear(); -#ifdef HAVE_INTERNAL_LANES - myLinkLeaders.clear(); -#endif // const MSCFModel& cfModel = getCarFollowModel(); const SUMOReal vehicleLength = getVehicleType().getLength(); @@ -927,7 +1029,7 @@ const SUMOReal stopDist = seen + endPos - lane->getLength(); const SUMOReal stopSpeed = cfModel.stopSpeed(this, getSpeed(), stopDist); if (lastLink != 0) { - lastLink->adaptLeaveSpeed(stopSpeed); + lastLink->adaptLeaveSpeed(cfModel.stopSpeed(this, vLinkPass, endPos)); } v = MIN2(v, stopSpeed); lfLinks.push_back(DriveProcessItem(v, stopDist)); @@ -962,6 +1064,7 @@ break; } const bool yellowOrRed = (*link)->getState() == LINKSTATE_TL_RED || + (*link)->getState() == LINKSTATE_TL_REDYELLOW || (*link)->getState() == LINKSTATE_TL_YELLOW_MAJOR || (*link)->getState() == LINKSTATE_TL_YELLOW_MINOR; // We distinguish 3 cases when determining the point at which a vehicle stops: @@ -989,11 +1092,12 @@ } } - const bool setRequest = v > 0; // even if red, if we cannot break we should issue a request + bool setRequest = v > 0; // even if red, if we cannot break we should issue a request SUMOReal vLinkWait = MIN2(v, cfModel.stopSpeed(this, getSpeed(), stopDist)); - if (yellowOrRed && seen >= cfModel.brakeGap(myState.mySpeed) - myState.mySpeed * cfModel.getHeadwayTime()) { + const SUMOReal brakeDist = cfModel.brakeGap(myState.mySpeed) - myState.mySpeed * cfModel.getHeadwayTime(); + if (yellowOrRed && seen >= brakeDist) { // the vehicle is able to brake in front of a yellow/red traffic light - lfLinks.push_back(DriveProcessItem(*link, vLinkWait, vLinkWait, false, t + TIME2STEPS(seen / MAX2(vLinkWait, NUMERICAL_EPS)), vLinkWait, 0, SUMOTime_MAX, stopDist)); + lfLinks.push_back(DriveProcessItem(*link, vLinkWait, vLinkWait, false, t + TIME2STEPS(seen / MAX2(vLinkWait, NUMERICAL_EPS)), vLinkWait, 0, SUMOTime_MAX, seen)); //lfLinks.push_back(DriveProcessItem(0, vLinkWait, vLinkWait, false, 0, 0, stopDist)); break; } @@ -1008,15 +1112,19 @@ // leader is a pedestrian. Passing 'this' as a dummy. //std::cout << SIMTIME << " veh=" << getID() << " is blocked on link to " << (*link)->getViaLaneOrLane()->getID() << " by pedestrian. dist=" << it->distToCrossing << "\n"; adaptToLeader(std::make_pair(this, -1), seen, lastLink, lane, v, vLinkPass, it->distToCrossing); - } else if (leader->myLinkLeaders.count(getID()) == 0) { + } else if (leader->myLinkLeaders[(*link)->getJunction()].count(getID()) == 0) { // leader isn't already following us, now we follow it - myLinkLeaders.insert(leader->getID()); + myLinkLeaders[(*link)->getJunction()].insert(leader->getID()); adaptToLeader(it->vehAndGap, seen, lastLink, lane, v, vLinkPass, it->distToCrossing); if (lastLink != 0) { // we are not yet on the junction with this linkLeader. // at least we can drive up to the previous link and stop there v = MAX2(v, lastLink->myVLinkWait); } + // if blocked by a leader from the same lane we must yield our request + if (v < SUMO_const_haltingSpeed && leader->getLane()->getLogicalPredecessorLane() == myLane->getLogicalPredecessorLane()) { + setRequest = false; + } } } // if this is the link between two internal lanes we may have to slow down for pedestrians @@ -1027,21 +1135,25 @@ lastLink->adaptLeaveSpeed(laneMaxV); } SUMOReal arrivalSpeed = vLinkPass; - SUMOTime arrivalTime; // vehicles should decelerate when approaching a minor link - if (!(*link)->havePriority() && stopDist > cfModel.getMaxDecel()) { + // - unless they are close enough to have clear visibility and may start to accelerate again + // - and unless they are so close that stopping is impossible (i.e. when a green light turns to yellow when close to the junction) + if (!(*link)->havePriority() && stopDist > cfModel.getMaxDecel() && brakeDist < seen) { // vehicle decelerates just enough to be able to stop if necessary and then accelerates arrivalSpeed = cfModel.getMaxDecel() + cfModel.getMaxAccel(); - const SUMOReal v1 = MAX2(vLinkWait, arrivalSpeed); - // now + time spent decelerating + time spent at full speed - arrivalTime = t + TIME2STEPS((v1 - arrivalSpeed) / cfModel.getMaxDecel() - + (seen - (v1 * v1 - arrivalSpeed * arrivalSpeed) * 0.5 / cfModel.getMaxDecel()) / MAX2(vLinkWait, NUMERICAL_EPS)); - } else { - const SUMOReal accel = (vLinkPass >= v) ? cfModel.getMaxAccel() : -cfModel.getMaxDecel(); - const SUMOReal accelTime = (vLinkPass - v) / accel; - const SUMOReal accelWay = accelTime * (vLinkPass + v) * 0.5; - arrivalTime = t + TIME2STEPS(accelTime + MAX2(SUMOReal(0), seen - accelWay) / MAX2(vLinkPass, NUMERICAL_EPS)); } + // @note intuitively it would make sense to compare arrivalSpeed with getSpeed() instead of v + // however, due to the current position update rule (ticket #860) the vehicle moves with v in this step + const SUMOReal accel = (arrivalSpeed >= v) ? cfModel.getMaxAccel() : -cfModel.getMaxDecel(); + const SUMOReal accelTime = (arrivalSpeed - v) / accel; + const SUMOReal accelWay = accelTime * (arrivalSpeed + v) * 0.5; + const SUMOReal nonAccelWay = MAX2(SUMOReal(0), seen - accelWay); + // will either drive as fast as possible and decelerate as late as possible + // or accelerate as fast as possible and then hold that speed + const SUMOReal nonAccelSpeed = MAX3(v, arrivalSpeed, SUMO_const_haltingSpeed); + // subtract DELTA_T because t is the time at the end of this step and the movement is not carried out yet + const SUMOTime arrivalTime = t - DELTA_T + TIME2STEPS(accelTime + nonAccelWay / nonAccelSpeed); + // compute speed, time if vehicle starts braking now // if stopping is possible, arrivalTime can be arbitrarily large. A small value keeps fractional times (impatience) meaningful SUMOReal arrivalSpeedBraking = 0; @@ -1064,7 +1176,7 @@ lfLinks.push_back(DriveProcessItem(*link, v, vLinkWait, setRequest, arrivalTime, arrivalSpeed, arrivalTimeBraking, arrivalSpeedBraking, - stopDist, + seen, estimateLeaveSpeed(*link, vLinkPass))); #ifdef HAVE_INTERNAL_LANES if ((*link)->getViaLane() == 0) { @@ -1103,19 +1215,7 @@ const MSLane* const lane, SUMOReal& v, SUMOReal& vLinkPass, SUMOReal distToCrossing) const { if (leaderInfo.first != 0) { - const MSCFModel& cfModel = getCarFollowModel(); - 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, getSpeed(), seen - lane->getLength() - POSITION_EPS); - } - if (distToCrossing >= 0) { - // drive up to the crossing point with the current link leader - vsafeLeader = MAX2(vsafeLeader, cfModel.stopSpeed(this, getSpeed(), distToCrossing)); - } + const SUMOReal vsafeLeader = getSafeFollowSpeed(leaderInfo, seen, lane, distToCrossing); if (lastLink != 0) { lastLink->adaptLeaveSpeed(vsafeLeader); } @@ -1125,6 +1225,27 @@ } +SUMOReal +MSVehicle::getSafeFollowSpeed(const std::pair leaderInfo, + const SUMOReal seen, const MSLane* const lane, SUMOReal distToCrossing) const { + assert(leaderInfo.first != 0); + const MSCFModel& cfModel = getCarFollowModel(); + 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, getSpeed(), seen - lane->getLength() - POSITION_EPS); + } + if (distToCrossing >= 0) { + // drive up to the crossing point with the current link leader + vsafeLeader = MAX2(vsafeLeader, cfModel.stopSpeed(this, getSpeed(), distToCrossing)); + } + return vsafeLeader; +} + + bool MSVehicle::executeMove() { #ifdef DEBUG_VEHICLE_GUI_SELECTION @@ -1174,7 +1295,7 @@ getVehicleType().getLength(), getImpatience(), getCarFollowModel().getMaxDecel(), getWaitingTime()); // vehicles should decelerate when approaching a minor link - if (opened && !influencerPrio && !link->havePriority() && !link->lastWasContMajor()) { + if (opened && !influencerPrio && !link->havePriority() && !link->lastWasContMajor() && !link->isCont()) { if ((*i).myDistance > getCarFollowModel().getMaxDecel()) { vSafe = (*i).myVLinkWait; myHaveToWaitOnNextLink = true; @@ -1229,12 +1350,18 @@ // XXX braking due to lane-changing is not registered bool braking = vSafe < getSpeed(); - // apply speed reduction due to dawdling / lane changing but ensure minimum save speed + // apply speed reduction due to dawdling / lane changing but ensure minimum safe speed SUMOReal vNext = MAX2(getCarFollowModel().moveHelper(this, vSafe), vSafeMin); - //if (vNext > vSafe) { + // vNext may be higher than vSafe without implying a bug: + // - when approaching a green light that suddenly switches to yellow + // - when using unregulated junctions + // - when using tau < step-size + // - when using unsafe car following models + // - when using TraCI and some speedMode / laneChangeMode settings + //if (vNext > vSafe + NUMERICAL_EPS) { // WRITE_WARNING("vehicle '" + getID() + "' cannot brake hard enough to reach safe speed " - // + toString(vSafe) + ", moving at " + toString(vNext) + " instead. time=" + // + toString(vSafe, 4) + ", moving at " + toString(vNext, 4) + " instead. time=" // + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); //} vNext = MAX2(vNext, (SUMOReal) 0.); @@ -1324,6 +1451,12 @@ getLaneChangeModel().endLaneChangeManeuver(); } } +#ifdef HAVE_INTERNAL_LANES + // erase leaders when past the junction + if (link->getViaLane() == 0) { + myLinkLeaders[link->getJunction()].clear(); + } +#endif moved = true; if (approachedLane->getEdge().isVaporizing()) { leaveLane(MSMoveReminder::NOTIFICATION_VAPORIZED); @@ -1342,7 +1475,6 @@ if (myInfluencer != 0 && myInfluencer->isVTDControlled()) { myWaitingTime = 0; -// myInfluencer->setVTDControlled(false); return false; } @@ -1482,7 +1614,8 @@ // check which links allow continuation and add pass available to the previous item for (int i = (int)(lfLinks.size() - 1); i > 0; --i) { DriveProcessItem& item = lfLinks[i - 1]; - const bool opened = item.myLink != 0 && (item.myLink->havePriority() || + const bool canLeaveJunction = item.myLink->getViaLane() == 0 || lfLinks[i].mySetRequest; + const bool opened = item.myLink != 0 && canLeaveJunction && (item.myLink->havePriority() || #ifndef NO_TRACI (myInfluencer != 0 && !myInfluencer->getRespectJunctionPriority()) || #endif @@ -1626,6 +1759,7 @@ MSVehicle::enterLaneAtLaneChange(MSLane* enteredLane) { myAmOnNet = true; myLane = enteredLane; + myCachedPosition = Position::INVALID; // need to update myCurrentLaneInBestLanes updateBestLanes(); // switch to and activate the new lane's reminders @@ -1772,7 +1906,6 @@ myLastBestLanesEdge = 0; } #endif - if (startLane == 0) { startLane = myLane; } @@ -1861,7 +1994,7 @@ if (nextStopEdge != 0) { // make sure that the "wrong" lanes get a penalty. (penalty needs to be // large enough to overcome a magic threshold in MSLCM_DK2004.cpp:383) - nextStopPos = MIN2((SUMOReal)nextStopPos, (SUMOReal)(nextStopEdge->getLength() - 2 * POSITION_EPS)); + nextStopPos = MAX2(POSITION_EPS, MIN2((SUMOReal)nextStopPos, (SUMOReal)(nextStopEdge->getLength() - 2 * POSITION_EPS))); } // go forward along the next lanes; @@ -1883,7 +2016,7 @@ q.lane = cl; q.bestContinuations.push_back(cl); q.bestLaneOffset = 0; - q.length = cl->getLength(); + q.length = cl->allowsVehicleClass(myType->getVehicleClass()) ? cl->getLength() : 0; q.allowsContinuation = allowed == 0 || find(allowed->begin(), allowed->end(), cl) != allowed->end(); currentLanes.push_back(q); } @@ -1907,7 +2040,7 @@ progress &= ce != myRoute->end(); /* if(progress) { - progress &= (currentLanes.size()!=1||(*ce)->getLanes().size()!=1); + progress &= (currentLanes.size()!=1||(*ce)->getLanes().size()!=1); } */ } @@ -2072,7 +2205,7 @@ void MSVehicle::adaptBestLanesOccupation(int laneIndex, SUMOReal density) { std::vector& preb = myBestLanes.front(); - assert(laneIndex < preb.size()); + assert(laneIndex < (int)preb.size()); preb[laneIndex].occupation = density + preb[laneIndex].nextOccupation; } @@ -2207,6 +2340,25 @@ } } +void +MSVehicle::addContainer(MSContainer* container) { + if (myContainerDevice == 0) { + myContainerDevice = MSDevice_Container::buildVehicleDevices(*this, myDevices); + myMoveReminders.push_back(std::make_pair(myContainerDevice, 0.)); + } + myContainerDevice->addContainer(container); + if (myStops.size() > 0 && myStops.front().reached && myStops.front().containerTriggered) { + unsigned int numExpected = (unsigned int) myStops.front().awaitedContainers.size(); + if (numExpected != 0) { + myStops.front().awaitedContainers.erase(container->getID()); + numExpected = (unsigned int) myStops.front().awaitedContainers.size(); + } + if (numExpected == 0) { + myStops.front().duration = 0; + } + } +} + unsigned int MSVehicle::getPersonNumber() const { @@ -2214,6 +2366,12 @@ return boarded + myParameter->personNumber; } +unsigned int +MSVehicle::getContainerNumber() const { + unsigned int loaded = myContainerDevice == 0 ? 0 : myContainerDevice->size(); + return loaded + myParameter->containerNumber; +} + void MSVehicle::setBlinkerInformation() { @@ -2261,9 +2419,18 @@ } +void +MSVehicle::setTentativeLaneAndPosition(MSLane* lane, const SUMOReal pos) { + assert(lane != 0); + myLane = lane; + myState.myPos = pos; +} + + #ifndef NO_TRACI bool -MSVehicle::addTraciStop(MSLane* lane, SUMOReal pos, SUMOReal /*radius*/, SUMOTime duration, bool parking, bool triggered) { +MSVehicle::addTraciStop(MSLane* lane, SUMOReal pos, SUMOReal /*radius*/, SUMOTime duration, + bool parking, bool triggered, bool containerTriggered, std::string& errorMsg) { //if the stop exists update the duration for (std::list::iterator iter = myStops.begin(); iter != myStops.end(); iter++) { if (iter->lane == lane && fabs(iter->endPos - pos) < POSITION_EPS) { @@ -2279,14 +2446,20 @@ SUMOVehicleParameter::Stop newStop; newStop.lane = lane->getID(); newStop.busstop = MSNet::getInstance()->getBusStopID(lane, pos); + newStop.containerstop = MSNet::getInstance()->getContainerStopID(lane, pos); newStop.startPos = pos - POSITION_EPS; newStop.endPos = pos; newStop.duration = duration; newStop.until = -1; newStop.triggered = triggered; + newStop.containerTriggered = containerTriggered; newStop.parking = parking; newStop.index = STOP_INDEX_FIT; - return addStop(newStop); + const bool result = addStop(newStop, errorMsg); + if (myLane != 0) { + updateBestLanes(true); + } + return result; } @@ -2297,11 +2470,20 @@ MSNet::getInstance()->getVehicleControl().unregisterOneWaitingForPerson(); myAmRegisteredAsWaitingForPerson = false; } + if (myAmRegisteredAsWaitingForContainer) { + MSNet::getInstance()->getVehicleControl().unregisterOneWaitingForContainer(); + myAmRegisteredAsWaitingForContainer = false; + } // we have waited long enough and fulfilled any passenger-requirements if (myStops.front().busstop != 0) { // inform bus stop about leaving it myStops.front().busstop->leaveFrom(this); } + // we have waited long enough and fulfilled any container-requirements + if (myStops.front().containerstop != 0) { + // inform container stop about leaving it + myStops.front().containerstop->leaveFrom(this); + } // the current stop is no longer valid MSNet::getInstance()->getVehicleControl().removeWaiting(&myLane->getEdge(), this); myStops.pop_front(); diff -Nru sumo-0.21.0+dfsg/src/microsim/MSVehicle.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicle.h --- sumo-0.21.0+dfsg/src/microsim/MSVehicle.h 2014-06-05 22:02:18.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicle.h 2015-04-17 05:44:20.000000000 +0000 @@ -10,12 +10,12 @@ /// @author Michael Behrisch /// @author Axel Wegener /// @date Mon, 12 Mar 2001 -/// @version $Id: MSVehicle.h 16527 2014-06-05 07:33:51Z namdre $ +/// @version $Id: MSVehicle.h 18096 2015-03-17 09:50:59Z behrisch $ /// // Representation of a vehicle in the micro simulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -59,13 +59,16 @@ class MSVehicleTransfer; class MSAbstractLaneChangeModel; class MSBusStop; +class MSContainerStop; class MSPerson; class MSDevice; class MSEdgeWeightsStorage; class OutputDevice; class Position; class MSDevice_Person; - +class MSDevice_Container; +class MSContainer; +class MSJunction; // =========================================================================== // class definitions @@ -141,7 +144,7 @@ * @exception ProcessError If a value is wrong */ MSVehicle(SUMOVehicleParameter* pars, const MSRoute* route, - const MSVehicleType* type, SUMOReal speedFactor); + const MSVehicleType* type, const SUMOReal speedFactor); /// @brief Destructor. virtual ~MSVehicle(); @@ -340,17 +343,11 @@ /** @brief Returns the starting point for reroutes (usually the current edge) * - * This differs from *myCurrEdge only if the vehicle is on an internal edge + * This differs from *myCurrEdge only if the vehicle is on an internal edge or + * very close to the junction * @return The rerouting start point */ - const MSEdge* getRerouteOrigin() const { -#ifdef HAVE_INTERNAL_LANES - if (myLane != 0) { - return myLane->getInternalFollower(); - } -#endif - return *myCurrEdge; - } + const MSEdge* getRerouteOrigin() const; /** @brief Returns the SUMOTime waited (speed was lesser than 0.1m/s) @@ -430,6 +427,11 @@ void enterLaneAtInsertion(MSLane* enteredLane, SUMOReal pos, SUMOReal speed, MSMoveReminder::Notification notification); + /** @brief set tentative lane and position during insertion to ensure that + * all cfmodels work (some of them require veh->getLane() to return a valid lane) + * Once the vehicle is sucessfully inserted the lane is set again (see enterLaneAtInsertion) + */ + void setTentativeLaneAndPosition(MSLane* lane, const SUMOReal pos); /** @brief Update when the vehicle enters a new lane in the laneChange step. * @@ -562,6 +564,8 @@ const MSLane* lane; /// @brief (Optional) bus stop if one is assigned to the stop MSBusStop* busstop; + /// @brief (Optional) container stop if one is assigned to the stop + MSContainerStop* containerstop; /// @brief The stopping position start SUMOReal startPos; /// @brief The stopping position end @@ -572,12 +576,21 @@ SUMOTime until; /// @brief whether an arriving person lets the vehicle continue bool triggered; + /// @brief whether an arriving container lets the vehicle continue + bool containerTriggered; /// @brief whether the vehicle is removed from the net while stopping bool parking; /// @brief Information whether the stop has been reached bool reached; /// @brief IDs of persons the vehicle has to wait for until departing std::set awaitedPersons; + /// @brief IDs of containers the vehicle has to wait for until departing + std::set awaitedContainers; + /// @brief The time at which the vehicle is able to board another person + SUMOTime timeToBoardNextPerson; + /// @brief The time at which the vehicle is able to load another container + SUMOTime timeToLoadNextContainer; + }; @@ -587,7 +600,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, std::string& errorMsg, SUMOTime untilOffset = 0); /** @brief Returns whether the vehicle has to stop somewhere @@ -612,6 +625,10 @@ * @return whether the vehicle is on a triggered stop */ bool isStoppedTriggered() const; + + /** @brief return whether the given position is within range of the current stop + */ + bool isStoppedInRange(SUMOReal pos) const; /// @} bool knowsEdgeTest(MSEdge& edge) const; @@ -620,11 +637,11 @@ /** * Compute distance that will be covered, if the vehicle moves to a given position on its route, * starting at its current position. - * @param destPos: position on the destination edge that shall be reached + * @param destPos: position on the destination edge that shall be reached * @param destEdge: destination edge that shall be reached - * @return distance from the vehicles current position to the destination position, - * or a near infinite real value if the destination position is not contained - * within the vehicles route or the vehicle is not active + * @return distance from the vehicles current position to the destination position, + * or a near infinite real value if the destination position is not contained + * within the vehicles route or the vehicle is not active */ SUMOReal getDistanceToPosition(SUMOReal destPos, const MSEdge* destEdge); @@ -634,6 +651,7 @@ * @todo Describe more detailed * @see Stop * @see MSBusStop + * @see MSContainerStop */ SUMOReal processNextStop(SUMOReal currentVelocity); @@ -641,7 +659,7 @@ * * If the distance is not given it is calculated from the brake gap. * The gap returned does not include the minGap. - * @param dist up to which distance to look for a leader + * @param dist up to which distance to look for a leader * @return The leading vehicle together with the gap; (0, -1) if no leader was found. */ std::pair getLeader(SUMOReal dist = 0) const; @@ -710,12 +728,25 @@ */ void addPerson(MSPerson* person); + /// @name Interaction with containers + //@{ + + /** @brief Adds a container + * @param[in] container The container to add + */ + void addContainer(MSContainer* container); + /** @brief Returns the number of persons * @return The number of passengers on-board */ unsigned int getPersonNumber() const; + /** @brief Returns the number of containers + * @return The number of contaiers on-board + */ + unsigned int getContainerNumber() const; + /// @name Access to bool signals /// @{ @@ -823,14 +854,16 @@ /** * schedule a new stop for the vehicle; each time a stop is reached, the vehicle * will wait for the given duration before continuing on its route - * @param lane lane on wich to stop - * @param pos position on the given lane at wich to stop - * @param radius the vehicle will stop if it is within the range [pos-radius, pos+radius] - * @param duration after waiting for the time period duration, the vehicle will - * @param parking a flag indicating whether the traci stop is used for parking or not + * @param lane lane on wich to stop + * @param pos position on the given lane at wich to stop + * @param radius the vehicle will stop if it is within the range [pos-radius, pos+radius] + * @param duration after waiting for the time period duration, the vehicle will + * @param parking a flag indicating whether the traci stop is used for parking or not * @param triggered a flag indicating whether the traci stop is triggered or not + * @param containerTriggered a flag indicating whether the traci stop is triggered by a container or not */ - bool addTraciStop(MSLane* lane, SUMOReal pos, SUMOReal radius, SUMOTime duration, bool parking, bool triggered); + bool addTraciStop(MSLane* lane, SUMOReal pos, SUMOReal radius, SUMOTime duration, + bool parking, bool triggered, bool containerTriggered, std::string& errorMsg); /** * returns the next imminent stop in the stop queue @@ -968,12 +1001,17 @@ return myOriginalSpeed; } - void setVTDControlled(bool c, MSLane* l, SUMOReal pos, int edgeOffset, const MSEdgeVector& route) { + void setVTDControlled(bool c, MSLane* l, SUMOReal pos, int edgeOffset, const ConstMSEdgeVector& route, SUMOTime t) { myAmVTDControlled = c; myVTDLane = l; myVTDPos = pos; myVTDEdgeOffset = edgeOffset; myVTDRoute = route; + myLastVTDAccess = t; + } + + SUMOTime getLastAccessTimeStep() const { + return myLastVTDAccess; } void postProcessVTD(MSVehicle* v); @@ -982,6 +1020,11 @@ return myAmVTDControlled; } + inline bool isVTDAffected(SUMOTime t) const { + return myAmVTDControlled && myLastVTDAccess >= t - TIME2STEPS(10); + } + + private: /// @brief The velocity time line to apply std::vector > mySpeedTimeLine; @@ -1014,7 +1057,8 @@ MSLane* myVTDLane; SUMOReal myVTDPos; int myVTDEdgeOffset; - MSEdgeVector myVTDRoute; + ConstMSEdgeVector myVTDRoute; + SUMOTime myLastVTDAccess; /// @name Flags for managing conflicts between the laneChangeModel and TraCI laneTimeLine //@{ @@ -1047,6 +1091,9 @@ /// @brief allow TraCI to influence a lane change decision int influenceChangeDecision(int state); + /// @brief compute safe speed for following the given leader + SUMOReal getSafeFollowSpeed(const std::pair leaderInfo, + const SUMOReal seen, const MSLane* const lane, SUMOReal distToCrossing) const; #endif @@ -1093,6 +1140,10 @@ /// updates LaneQ::nextOccupation and myCurrentLaneInBestLanes void updateOccupancyAndCurrentBestLane(const MSLane* startLane); + /** @brief Returns the list of still pending stop edges + */ + const ConstMSEdgeVector getStopEdges() const; + /// @brief The time the vehicle waits (is not faster than 0.1m/s) in seconds SUMOTime myWaitingTime; @@ -1118,6 +1169,9 @@ /// @brief The passengers this vehicle may have MSDevice_Person* myPersonDevice; + /// @brief The containers this vehicle may have + MSDevice_Container* myContainerDevice; + /// @brief The current acceleration after dawdling in m/s SUMOReal myAcceleration; @@ -1133,6 +1187,9 @@ /// @brief Whether this vehicle is registered as waiting for a person (for deadlock-recognition) bool myAmRegisteredAsWaitingForPerson; + /// @brief Whether this vehicle is registered as waiting for a container (for deadlock-recognition) + bool myAmRegisteredAsWaitingForContainer; + bool myHaveToWaitOnNextLink; mutable Position myCachedPosition; @@ -1210,6 +1267,7 @@ * @param[in] dist The distance during which accelerating takes place * @param[in] v The initial speed * @param[in] accel The acceleration + * XXX affected by ticket #860 (the formula is invalid for the current position update rule) */ inline SUMOReal estimateSpeedAfterDistance(const SUMOReal dist, const SUMOReal v, const SUMOReal accel) const { // dist=v*t + 0.5*accel*t^2, solve for t and multiply with accel, then add v @@ -1218,7 +1276,9 @@ } - /* @brief estimate speed while accelerating for the given distance + /* @brief adapt safe velocity in accordance to a moving obstacle: + * - a leader vehicle + * - a vehicle or pedestrian that crosses this vehicles path on an upcoming intersection * @param[in] leaderInfo The leading vehicle and the (virtual) distance to it * @param[in] seen the distance to the end of the current lane * @param[in] lastLink the lastLink index @@ -1234,7 +1294,7 @@ #ifdef HAVE_INTERNAL_LANES /// @brief ids of vehicles being followed across a link (for resolving priority) - mutable std::set myLinkLeaders; + mutable std::map > myLinkLeaders; #endif private: diff -Nru sumo-0.21.0+dfsg/src/microsim/MSVehicleTransfer.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleTransfer.cpp --- sumo-0.21.0+dfsg/src/microsim/MSVehicleTransfer.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleTransfer.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sep 2003 -/// @version $Id: MSVehicleTransfer.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSVehicleTransfer.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A mover of vehicles that got stucked due to grid locks /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,7 +36,7 @@ #include "MSLane.h" #include "MSEdge.h" #include "MSVehicle.h" -#include "MSAbstractLaneChangeModel.h" +#include #include "MSVehicleControl.h" #include "MSVehicleTransfer.h" @@ -113,6 +113,7 @@ // first select all the lanes which allow continuation onto nextEdge // then pick the one which is least occupied // @todo maybe parking vehicles should always continue on the rightmost lane? + const MSLane* oldLane = desc.myVeh->getLane(); MSLane* l = (nextEdge != 0 ? e->getFreeLane(e->allowedLanes(*nextEdge, vclass), vclass) : e->getFreeLane(0, vclass)); @@ -120,14 +121,14 @@ // handle parking vehicles if (l->isInsertionSuccess(desc.myVeh, 0, desc.myVeh->getPositionOnLane(), false, MSMoveReminder::NOTIFICATION_PARKING)) { MSNet::getInstance()->informVehicleStateListener(desc.myVeh, MSNet::VEHICLE_STATE_ENDING_PARKING); - myParkingVehicles[desc.myVeh->getLane()].erase(desc.myVeh); + myParkingVehicles[oldLane].erase(desc.myVeh); i = myVehicles.erase(i); } else { i++; } } else { - // handle teleporting vehicles - if (l->freeInsertion(*(desc.myVeh), MIN2(l->getSpeedLimit(), desc.myVeh->getMaxSpeed()), MSMoveReminder::NOTIFICATION_TELEPORT)) { + // handle teleporting vehicles, lane may be 0 because permissions were modified by a closing rerouter or TraCI + if (l != 0 && 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() + "', time " + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); MSNet::getInstance()->informVehicleStateListener(desc.myVeh, MSNet::VEHICLE_STATE_ENDING_TELEPORT); i = myVehicles.erase(i); diff -Nru sumo-0.21.0+dfsg/src/microsim/MSVehicleTransfer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleTransfer.h --- sumo-0.21.0+dfsg/src/microsim/MSVehicleTransfer.h 2014-05-30 22:02:10.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleTransfer.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,13 +4,13 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sep 2003 -/// @version $Id: MSVehicleTransfer.h 16442 2014-05-30 09:27:23Z behrisch $ +/// @version $Id: MSVehicleTransfer.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A mover of vehicles that got stucked due to grid locks // This class also serves as container for parking vehicles /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/MSVehicleType.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleType.cpp --- sumo-0.21.0+dfsg/src/microsim/MSVehicleType.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleType.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Thimor Bohn /// @author Michael Behrisch /// @date Tue, 06 Mar 2001 -/// @version $Id: MSVehicleType.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSVehicleType.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The car-following model and parameter /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,13 +36,14 @@ #include #include #include -#include +#include #include "MSNet.h" #include "cfmodels/MSCFModel_IDM.h" #include "cfmodels/MSCFModel_Kerner.h" #include "cfmodels/MSCFModel_Krauss.h" #include "cfmodels/MSCFModel_KraussOrig1.h" #include "cfmodels/MSCFModel_KraussPS.h" +#include "cfmodels/MSCFModel_KraussAccelBound.h" #include "cfmodels/MSCFModel_SmartSK.h" #include "cfmodels/MSCFModel_Daniel1.h" #include "cfmodels/MSCFModel_PWag2009.h" @@ -76,7 +77,10 @@ SUMOReal -MSVehicleType::computeChosenSpeedDeviation(MTRand& rng, const SUMOReal minDevFactor) const { +MSVehicleType::computeChosenSpeedDeviation(MTRand* rng, const SUMOReal minDevFactor) const { + if (myParameter.speedDev == 0) { + return myParameter.speedFactor; + } // 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 @@ -221,6 +225,9 @@ case SUMO_TAG_CF_KRAUSS_PLUS_SLOPE: vtype->myCarFollowModel = new MSCFModel_KraussPS(vtype, accel, decel, sigma, tau); break; + case SUMO_TAG_CF_KRAUSS_ACCEL_BOUND: + vtype->myCarFollowModel = new MSCFModel_KraussAccelBound(vtype, accel, decel, sigma, tau); + break; case SUMO_TAG_CF_SMART_SK: vtype->myCarFollowModel = new MSCFModel_SmartSK(vtype, accel, decel, sigma, tau, from.get(SUMO_ATTR_TMP1, 1.), diff -Nru sumo-0.21.0+dfsg/src/microsim/MSVehicleType.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleType.h --- sumo-0.21.0+dfsg/src/microsim/MSVehicleType.h 2014-04-13 19:12:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/MSVehicleType.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 12 Mar 2001 -/// @version $Id: MSVehicleType.h 16185 2014-04-13 19:11:57Z behrisch $ +/// @version $Id: MSVehicleType.h 18096 2015-03-17 09:50:59Z behrisch $ /// // The car-following model and parameter /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include @@ -168,7 +168,7 @@ /** @brief Computes and returns the speed deviation * @return A new, random speed deviation */ - SUMOReal computeChosenSpeedDeviation(MTRand& rng, const SUMOReal minDevFactor = 0.2) const; + SUMOReal computeChosenSpeedDeviation(MTRand* rng, const SUMOReal minDevFactor = 0.2) const; /** @brief Get the default probability of this vehicle type @@ -271,6 +271,36 @@ return myParameter.imgFile; } + + /** @brief Get this vehicle type's person capacity + * @return The person capacity of this vehicle type + */ + unsigned int getPersonCapacity() const { + return myParameter.personCapacity; + } + + + /** @brief Get this vehicle type's container capacity + * @return The container capacity of this vehicle type + */ + unsigned int getContainerCapacity() const { + return myParameter.containerCapacity; + } + + /** @brief Get this vehicle type's boarding duration + * @return The time a person needs to board a vehicle of this type + */ + SUMOTime getBoardingDuration() const { + return myParameter.boardingDuration; + } + + /** @brief Get this vehicle type's loading duration + * @return The time a container needs to get laoded on a vehicle of this type + */ + SUMOTime getLoadingDuration() const { + return myParameter.loadingDuration; + } + /// @} diff -Nru sumo-0.21.0+dfsg/src/microsim/output/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/Makefile.in --- sumo-0.21.0+dfsg/src/microsim/output/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -230,6 +230,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -240,7 +242,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSAmitranTrajectories.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSAmitranTrajectories.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSAmitranTrajectories.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSAmitranTrajectories.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MSAmitranTrajectories.cpp /// @author Michael Behrisch /// @date 13.03.2014 -/// @version $Id: MSAmitranTrajectories.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSAmitranTrajectories.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Realises dumping the complete network state /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSAmitranTrajectories.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSAmitranTrajectories.h --- sumo-0.21.0+dfsg/src/microsim/output/MSAmitranTrajectories.h 2014-04-13 19:12:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSAmitranTrajectories.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MSAmitranTrajectories.h /// @author Michael Behrisch /// @date 13.03.2014 -/// @version $Id: MSAmitranTrajectories.h 16185 2014-04-13 19:11:57Z behrisch $ +/// @version $Id: MSAmitranTrajectories.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Realises dumping the complete network state /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSCrossSection.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSCrossSection.h --- sumo-0.21.0+dfsg/src/microsim/output/MSCrossSection.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSCrossSection.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Sascha Krieg /// @date Tue Nov 25 15:23:28 2003 -/// @version $Id: MSCrossSection.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSCrossSection.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A simple description of a position on a lane (crossing of a lane) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSDetectorControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSDetectorControl.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSDetectorControl.cpp 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSDetectorControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 2005-09-15 -/// @version $Id: MSDetectorControl.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSDetectorControl.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Detectors container; responsible for string and output generation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSDetectorControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSDetectorControl.h --- sumo-0.21.0+dfsg/src/microsim/output/MSDetectorControl.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSDetectorControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date 2005-09-15 -/// @version $Id: MSDetectorControl.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSDetectorControl.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Detectors container; responsible for string and output generation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSDetectorFileOutput.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSDetectorFileOutput.h --- sumo-0.21.0+dfsg/src/microsim/output/MSDetectorFileOutput.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSDetectorFileOutput.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date 2004-11-23 -/// @version $Id: MSDetectorFileOutput.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSDetectorFileOutput.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Base of value-generating classes (detectors) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSE2Collector.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSE2Collector.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSE2Collector.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSE2Collector.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -8,11 +8,11 @@ /// @author Robbin Blokpoel /// @author Jakob Erdmann /// @date Mon Feb 03 2014 10:13 CET -/// @version $Id: MSE2Collector.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSE2Collector.cpp 17235 2014-11-03 10:53:02Z behrisch $ /// // An areal (along a single lane) detector /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ // Copyright (C) 2014 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // @@ -82,20 +82,18 @@ bool MSE2Collector::notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal) { - if (newPos < myStartPos) { + if (newPos <= myStartPos) { // detector not yet reached return true; } - if (newPos >= myStartPos && oldPos < myStartPos) { - if (find(myKnownVehicles.begin(), myKnownVehicles.end(), &veh) == myKnownVehicles.end()) { - myKnownVehicles.push_back(&veh); - } + if (newPos > myStartPos && oldPos <= myStartPos) { + assert(find(myKnownVehicles.begin(), myKnownVehicles.end(), &veh) == myKnownVehicles.end()); + myKnownVehicles.push_back(&veh); } if (newPos - veh.getVehicleType().getLength() > myEndPos) { std::list::iterator i = find(myKnownVehicles.begin(), myKnownVehicles.end(), &veh); - if (i != myKnownVehicles.end()) { - myKnownVehicles.erase(i); - } + assert(i != myKnownVehicles.end()); + myKnownVehicles.erase(i); return false; } return true; @@ -104,7 +102,7 @@ bool MSE2Collector::notifyLeave(SUMOVehicle& veh, SUMOReal lastPos, MSMoveReminder::Notification reason) { - if (reason != MSMoveReminder::NOTIFICATION_JUNCTION || (lastPos >= myStartPos && lastPos - veh.getVehicleType().getLength() < myEndPos)) { + if (reason != MSMoveReminder::NOTIFICATION_JUNCTION || (lastPos > myStartPos && lastPos - veh.getVehicleType().getLength() < myEndPos)) { std::list::iterator i = find(myKnownVehicles.begin(), myKnownVehicles.end(), &veh); if (i != myKnownVehicles.end()) { myKnownVehicles.erase(i); @@ -116,21 +114,21 @@ bool -MSE2Collector::notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification) { +MSE2Collector::notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason) { if (!veh.isOnRoad()) { // vehicle is teleporting over the edge return false; } - if (veh.getPositionOnLane() >= myStartPos && veh.getPositionOnLane() - veh.getVehicleType().getLength() < myEndPos) { - // vehicle is on detector - myKnownVehicles.push_back(&veh); - return true; - } - if (veh.getPositionOnLane() - veh.getVehicleType().getLength() > myEndPos) { - // vehicle is beyond detector + if (veh.getPositionOnLane() - veh.getVehicleType().getLength() >= myEndPos) { + // vehicle is beyond the detector return false; } - // vehicle is in front of detector + if (reason != MSMoveReminder::NOTIFICATION_JUNCTION && veh.getPositionOnLane() > myStartPos) { + // the junction case is handled in the notifyMove + // vehicle is on the detector, being already beyond was checked before + myKnownVehicles.push_back(&veh); + } + // vehicle is in front of the detector return true; } @@ -244,7 +242,7 @@ // it may be a new one or already an existing one if (currentJam == 0) { // the vehicle is the first vehicle in a jam - currentJam = new JamInfo; + currentJam = new JamInfo(); currentJam->firstStandingVehicle = i; } else { // ok, we have a jam already. But - maybe it is too far away @@ -301,8 +299,8 @@ } myCurrentJamNo = (unsigned) jams.size(); - unsigned noVehicles = (unsigned) myKnownVehicles.size(); - myVehicleSamples += noVehicles; + const unsigned numVehicles = (unsigned) myKnownVehicles.size(); + myVehicleSamples += numVehicles; myTimeSamples += 1; // compute occupancy values SUMOReal currentOccupancy = lengthSum / (myEndPos - myStartPos) * (SUMOReal) 100.; @@ -318,11 +316,11 @@ myHaltingVehicleDurations = haltingVehicles; myIntervalHaltingVehicleDurations = intervalHaltingVehicles; // compute information about vehicle numbers - myMeanVehicleNumber += (unsigned) myKnownVehicles.size(); - myMaxVehicleNumber = MAX2((unsigned) myKnownVehicles.size(), myMaxVehicleNumber); + myMeanVehicleNumber += numVehicles; + myMaxVehicleNumber = MAX2(numVehicles, myMaxVehicleNumber); // norm current values - myCurrentMeanSpeed = noVehicles != 0 ? myCurrentMeanSpeed / (SUMOReal) noVehicles : -1; - myCurrentMeanLength = noVehicles != 0 ? myCurrentMeanLength / (SUMOReal) noVehicles : -1; + myCurrentMeanSpeed = numVehicles != 0 ? myCurrentMeanSpeed / (SUMOReal) numVehicles : -1; + myCurrentMeanLength = numVehicles != 0 ? myCurrentMeanLength / (SUMOReal) numVehicles : -1; // clean up for (std::vector::iterator i = jams.begin(); i != jams.end(); ++i) { @@ -399,7 +397,7 @@ void MSE2Collector::writeXMLDetectorProlog(OutputDevice& dev) const { - dev.writeXMLHeader("detector", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/det_e2_file.xsd\""); + dev.writeXMLHeader("detector", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/det_e2_file.xsd\""); } @@ -475,7 +473,7 @@ return v1->getPositionOnLane() > v2->getPositionOnLane(); } -SUMOReal +int MSE2Collector::getCurrentHaltingNumber() const { return myCurrentHaltingsNumber; } diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSE2Collector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSE2Collector.h --- sumo-0.21.0+dfsg/src/microsim/output/MSE2Collector.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSE2Collector.h 2015-04-17 05:44:20.000000000 +0000 @@ -7,11 +7,11 @@ /// @author Robbin Blokpoel /// @author Jakob Erdmann /// @date Mon Feb 03 2014 14:13 CET -/// @version $Id: MSE2Collector.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSE2Collector.h 17235 2014-11-03 10:53:02Z behrisch $ /// // An areal (along a single lane) detector /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ // Copyright (C) 2014 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // @@ -41,7 +41,7 @@ #include #include #include -#include +#include // =========================================================================== @@ -266,7 +266,7 @@ * * @return The mean number of haltings within the area */ - SUMOReal getCurrentHaltingNumber() const; + int getCurrentHaltingNumber() const; /** @brief Returns the IDs of the vehicles within the area * @@ -426,7 +426,7 @@ /// @brief The number of started halts in the last step unsigned myCurrentStartedHalts; /// @brief The number of halted vehicles [#] - SUMOReal myCurrentHaltingsNumber; + int myCurrentHaltingsNumber; /// @} diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MS_E2_ZS_CollectorOverLanes.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MS_E2_ZS_CollectorOverLanes.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MS_E2_ZS_CollectorOverLanes.cpp 2014-04-11 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MS_E2_ZS_CollectorOverLanes.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Oct 2003 -/// @version $Id: MS_E2_ZS_CollectorOverLanes.cpp 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: MS_E2_ZS_CollectorOverLanes.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A detector which joins E2Collectors over consecutive lanes (backward) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -170,10 +170,10 @@ MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(MSLane* l) { std::string eid = l->getEdge().getID(); // get predecessing edges - const std::vector& predEdges = l->getEdge().getIncomingEdges(); + const MSEdgeVector& predEdges = l->getEdge().getIncomingEdges(); std::vector ret; // find predecessing lanes - std::vector::const_iterator i = predEdges.begin(); + MSEdgeVector::const_iterator i = predEdges.begin(); for (; i != predEdges.end(); ++i) { MSEdge* e = *i; assert(e != 0); diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MS_E2_ZS_CollectorOverLanes.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MS_E2_ZS_CollectorOverLanes.h --- sumo-0.21.0+dfsg/src/microsim/output/MS_E2_ZS_CollectorOverLanes.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MS_E2_ZS_CollectorOverLanes.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Oct 2003 -/// @version $Id: MS_E2_ZS_CollectorOverLanes.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MS_E2_ZS_CollectorOverLanes.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A detector which joins E2Collectors over consecutive lanes (backward) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSE3Collector.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSE3Collector.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSE3Collector.cpp 2014-06-03 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSE3Collector.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Tue Dec 02 2003 22:17 CET -/// @version $Id: MSE3Collector.cpp 16485 2014-06-03 12:02:07Z behrisch $ +/// @version $Id: MSE3Collector.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A detector of vehicles passing an area between entry/exit points /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -57,18 +57,15 @@ bool MSE3Collector::MSE3EntryReminder::notifyMove(SUMOVehicle& veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed) { - if (myCollector.myEnteredContainer.find(&veh) == myCollector.myEnteredContainer.end() && newPos >= myPosition) { + 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); + const SUMOReal entryTime = STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()); + assert(newSpeed != 0); // how could it move across the detector otherwise + const SUMOReal fractionTimeOnDet = (newPos - myPosition) / newSpeed; + myCollector.enter(veh, entryTime - fractionTimeOnDet, fractionTimeOnDet); } } return true; @@ -107,11 +104,10 @@ return false; } // crossSection left - SUMOReal leaveTime = STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()); - if (myPosition > oldPos) { - leaveTime += (myPosition - oldPos) / newSpeed; - } - myCollector.leave(veh, leaveTime); + const SUMOReal leaveTime = STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()); + assert(newSpeed != 0); // how could it move across the detector otherwise + const SUMOReal fractionTimeOnDet = (myPosition - oldPos) / newSpeed; + myCollector.leave(veh, leaveTime - TS + fractionTimeOnDet, fractionTimeOnDet); return false; } @@ -134,8 +130,7 @@ SUMOTime haltingTimeThreshold) : MSDetectorFileOutput(id), myEntries(entries), myExits(exits), myHaltingTimeThreshold(haltingTimeThreshold), myHaltingSpeedThreshold(haltingSpeedThreshold), - myCurrentMeanSpeed(0), myCurrentHaltingsNumber(0), myCurrentTouchedVehicles(0), - myLastResetTime(-1) { + myCurrentMeanSpeed(0), myCurrentHaltingsNumber(0), myLastResetTime(-1) { // Set MoveReminders to entries and exits for (CrossSectionVectorConstIt crossSec1 = entries.begin(); crossSec1 != entries.end(); ++crossSec1) { myEntryReminders.push_back(new MSE3EntryReminder(*crossSec1, *this)); @@ -165,23 +160,22 @@ void -MSE3Collector::enter(SUMOVehicle& veh, SUMOReal entryTimestep) { +MSE3Collector::enter(const SUMOVehicle& veh, const SUMOReal entryTimestep, const SUMOReal fractionTimeOnDet) { if (myEnteredContainer.find(&veh) != myEnteredContainer.end()) { WRITE_WARNING("Vehicle '" + veh.getID() + "' reentered " + toString(SUMO_TAG_E3DETECTOR) + " '" + getID() + "'."); return; } - const SUMOReal entryTimestepFraction = ((SUMOReal) DELTA_T - fmod(entryTimestep * 1000., 1000.)) / (SUMOReal) DELTA_T; - const SUMOReal speedFraction = veh.getSpeed() * entryTimestepFraction; + const SUMOReal speedFraction = veh.getSpeed() * fractionTimeOnDet; E3Values v; v.entryTime = entryTimestep; v.leaveTime = 0; - v.speedSum = speedFraction * TS; + v.speedSum = speedFraction; v.haltingBegin = veh.getSpeed() < myHaltingSpeedThreshold ? entryTimestep : -1; - v.intervalSpeedSum = speedFraction * TS; + v.intervalSpeedSum = entryTimestep >= STEPS2TIME(myLastResetTime) ? speedFraction : 0; v.haltings = 0; v.intervalHaltings = 0; if (veh.getSpeed() < myHaltingSpeedThreshold) { - if (1. - entryTimestepFraction > myHaltingTimeThreshold) { + if (fractionTimeOnDet > myHaltingTimeThreshold) { v.haltings++; v.intervalHaltings++; } @@ -192,27 +186,15 @@ void -MSE3Collector::leave(SUMOVehicle& veh, SUMOReal leaveTimestep) { +MSE3Collector::leave(const SUMOVehicle& veh, const SUMOReal leaveTimestep, const SUMOReal fractionTimeOnDet) { if (myEnteredContainer.find(&veh) == myEnteredContainer.end()) { WRITE_WARNING("Vehicle '" + veh.getID() + "' left " + toString(SUMO_TAG_E3DETECTOR) + " '" + getID() + "' before entering it."); } else { E3Values values = myEnteredContainer[&veh]; values.leaveTime = leaveTimestep; - SUMOReal leaveTimestepFraction = leaveTimestep - (SUMOReal)((int) leaveTimestep); - leaveTimestepFraction = fmod(leaveTimestep * 1000., 1000.) / (SUMOReal) DELTA_T; - if (values.hadUpdate) { - SUMOReal speedFraction = (veh.getSpeed() * leaveTimestepFraction); - values.speedSum += speedFraction * TS; - values.intervalSpeedSum += speedFraction * TS; - if (veh.getSpeed() < myHaltingSpeedThreshold && values.haltingBegin != -1 && leaveTimestep - values.haltingBegin > myHaltingTimeThreshold) { - values.haltings++; - values.intervalHaltings++; - } - } else { - SUMOReal speedFraction = (veh.getSpeed() * SUMOReal(1. - leaveTimestepFraction)); - values.speedSum -= speedFraction * TS; - values.intervalSpeedSum -= speedFraction * TS; - } + const SUMOReal speedFraction = veh.getSpeed() * (TS - fractionTimeOnDet); + values.speedSum -= speedFraction; + values.intervalSpeedSum -= speedFraction; myEnteredContainer.erase(&veh); myLeftContainer[&veh] = values; } @@ -228,7 +210,7 @@ SUMOReal meanTravelTime = 0.; SUMOReal meanSpeed = 0.; SUMOReal meanHaltsPerVehicle = 0.; - for (std::map::iterator i = myLeftContainer.begin(); i != myLeftContainer.end(); ++i) { + for (std::map::iterator i = myLeftContainer.begin(); i != myLeftContainer.end(); ++i) { meanHaltsPerVehicle += (SUMOReal)(*i).second.haltings; SUMOReal steps = (*i).second.leaveTime - (*i).second.entryTime; meanTravelTime += steps; @@ -248,11 +230,12 @@ SUMOReal meanIntervalSpeedWithin = 0.; SUMOReal meanIntervalHaltsPerVehicleWithin = 0.; SUMOReal meanIntervalDurationWithin = 0.; - for (std::map::iterator i = myEnteredContainer.begin(); i != myEnteredContainer.end(); ++i) { + for (std::map::iterator i = myEnteredContainer.begin(); i != myEnteredContainer.end(); ++i) { meanHaltsPerVehicleWithin += (SUMOReal)(*i).second.haltings; meanIntervalHaltsPerVehicleWithin += (SUMOReal)(*i).second.intervalHaltings; - const SUMOReal time = STEPS2TIME(stopTime) - (*i).second.entryTime; - const SUMOReal timeWithin = MIN2(time, STEPS2TIME(stopTime - startTime)); + const SUMOReal end = (*i).second.leaveTime == 0 ? STEPS2TIME(stopTime) : (*i).second.leaveTime; + const SUMOReal time = end - (*i).second.entryTime; + const SUMOReal timeWithin = MIN2(time, end - STEPS2TIME(startTime)); if (i->second.speedSum > 0.) { meanSpeedWithin += i->second.speedSum / time; } @@ -299,25 +282,13 @@ MSE3Collector::detectorUpdate(const SUMOTime step) { myCurrentMeanSpeed = 0; myCurrentHaltingsNumber = 0; - myCurrentTouchedVehicles = 0; - for (std::map::iterator pair = myEnteredContainer.begin(); pair != myEnteredContainer.end(); ++pair) { - SUMOVehicle* veh = pair->first; + for (std::map::iterator pair = myEnteredContainer.begin(); pair != myEnteredContainer.end(); ++pair) { + const SUMOVehicle* veh = pair->first; E3Values& values = pair->second; + myCurrentMeanSpeed += veh->getSpeed(); values.hadUpdate = true; - if (values.entryTime * 1000. >= step) { - // vehicle entered at this time step - SUMOReal fraction = step + 1. - values.entryTime; - myCurrentMeanSpeed += fraction * veh->getSpeed(); - myCurrentTouchedVehicles += fraction; - if (values.haltingBegin >= 0) { - myCurrentHaltingsNumber++; - } - continue; - } values.speedSum += veh->getSpeed() * TS; values.intervalSpeedSum += veh->getSpeed() * TS; - myCurrentMeanSpeed += veh->getSpeed(); - myCurrentTouchedVehicles += 1; if (veh->getSpeed() < myHaltingSpeedThreshold) { if (values.haltingBegin == -1) { values.haltingBegin = step; @@ -330,40 +301,37 @@ } else { values.haltingBegin = -1; } - myCurrentMeanSpeed /= myCurrentTouchedVehicles; + } + if (myEnteredContainer.size() == 0) { + myCurrentMeanSpeed = -1; + } else { + myCurrentMeanSpeed /= myEnteredContainer.size(); } } SUMOReal MSE3Collector::getCurrentMeanSpeed() const { - SUMOReal ret = 0; - if (myEnteredContainer.size() == 0) { - return -1; - } - for (std::map::const_iterator pair = myEnteredContainer.begin(); pair != myEnteredContainer.end(); ++pair) { - ret += (*pair).first->getSpeed(); - } - return ret / SUMOReal(myEnteredContainer.size()); + return myCurrentMeanSpeed; } -SUMOReal +int MSE3Collector::getCurrentHaltingNumber() const { return myCurrentHaltingsNumber; } -SUMOReal +int MSE3Collector::getVehiclesWithin() const { - return (SUMOReal) myEnteredContainer.size(); + return (int) myEnteredContainer.size(); } std::vector MSE3Collector::getCurrentVehicleIDs() const { std::vector ret; - for (std::map::const_iterator pair = myEnteredContainer.begin(); pair != myEnteredContainer.end(); ++pair) { + for (std::map::const_iterator pair = myEnteredContainer.begin(); pair != myEnteredContainer.end(); ++pair) { ret.push_back((*pair).first->getID()); } std::sort(ret.begin(), ret.end()); diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSE3Collector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSE3Collector.h --- sumo-0.21.0+dfsg/src/microsim/output/MSE3Collector.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSE3Collector.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Tue Dec 02 2003 22:17 CET -/// @version $Id: MSE3Collector.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSE3Collector.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A detector of vehicles passing an area between entry/exit points /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -225,9 +225,10 @@ * Inserts vehicle into internal containers. * * @param[in] veh The vehicle that entered the area - * @param[in] entryTimestep The time step the vehicle entered the area + * @param[in] entryTimestep The time in seconds the vehicle entered the area + * @param[in] fractionTimeOnDet The interpolated time in seconds the vehicle already spent on the detector */ - void enter(SUMOVehicle& veh, SUMOReal entryTimestep); + void enter(const SUMOVehicle& veh, const SUMOReal entryTimestep, const SUMOReal fractionTimeOnDet); /** @brief Called if a vehicle passes a leave-cross-section. @@ -235,9 +236,10 @@ * Removes vehicle from internal containers. * * @param[in] veh The vehicle that left the area - * @param[in] entryTimestep The time step the vehicle left the area + * @param[in] leaveTimestep The time in seconds the vehicle left the area + * @param[in] fractionTimeOnDet The interpolated time in seconds the vehicle still spent on the detector */ - void leave(SUMOVehicle& veh, SUMOReal leaveTimestep); + void leave(const SUMOVehicle& veh, const SUMOReal leaveTimestep, const SUMOReal fractionTimeOnDet); /// @name Methods returning current values @@ -258,13 +260,13 @@ * * @return The mean number of haltings within the area */ - SUMOReal getCurrentHaltingNumber() const; + int getCurrentHaltingNumber() const; /** @brief Returns the number of vehicles within the area * @return The number of vehicles that passed the entry collector */ - SUMOReal getVehiclesWithin() const; + int getVehiclesWithin() const; /** @brief Returns the number of vehicles within the area @@ -361,10 +363,10 @@ }; /// @brief Container for vehicles that have entered the area - std::map myEnteredContainer; + std::map myEnteredContainer; /// @brief Container for vehicles that have left the area - std::map myLeftContainer; + std::map myLeftContainer; /// @name Storages for current values @@ -374,14 +376,7 @@ SUMOReal myCurrentMeanSpeed; /// @brief The current number of haltings (inside) - SUMOReal myCurrentHaltingsNumber; - - /** @brief The current number of vehicles inside; - * - * Please note, that vehicles that enter the area are given as a fraction - * @see execute - */ - SUMOReal myCurrentTouchedVehicles; + int myCurrentHaltingsNumber; /// @} diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSEmissionExport.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSEmissionExport.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSEmissionExport.cpp 2014-04-11 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSEmissionExport.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2012-04-26 -/// @version $Id: MSEmissionExport.cpp 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: MSEmissionExport.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Realises dumping Emission Data /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -33,6 +33,7 @@ #include #include +#include #include #include #include "MSEmissionExport.h" @@ -47,29 +48,28 @@ // =========================================================================== void MSEmissionExport::write(OutputDevice& of, SUMOTime timestep) { - of.openTag("timestep").writeAttr("time", time2string(timestep)); - 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()) { - continue; + for (MSVehicleControl::constVehIt it = vc.loadedVehBegin(); it != vc.loadedVehEnd(); ++it) { + const SUMOVehicle* veh = it->second; + const MSVehicle* microVeh = dynamic_cast(veh); + if (veh->isOnRoad()) { + std::string fclass = veh->getVehicleType().getID(); + fclass = fclass.substr(0, fclass.find_first_of("@")); + PollutantsInterface::Emissions emiss = PollutantsInterface::computeAll(veh->getVehicleType().getEmissionClass(), veh->getSpeed(), veh->getAcceleration(), veh->getSlope()); + of.openTag("vehicle").writeAttr("id", veh->getID()).writeAttr("eclass", PollutantsInterface::getName(veh->getVehicleType().getEmissionClass())); + of.writeAttr("CO2", emiss.CO2).writeAttr("CO", emiss.CO).writeAttr("HC", emiss.HC).writeAttr("NOx", emiss.NOx); + of.writeAttr("PMx", emiss.PMx).writeAttr("fuel", emiss.fuel); + of.writeAttr("noise", HelpersHarmonoise::computeNoise(veh->getVehicleType().getEmissionClass(), veh->getSpeed(), veh->getAcceleration())); + of.writeAttr("route", veh->getRoute().getID()).writeAttr("type", fclass); + if (microVeh != 0) { + of.writeAttr("waiting", microVeh->getWaitingSeconds()); + of.writeAttr("lane", microVeh->getLane()->getID()); + } + of.writeAttr("pos", veh->getPositionOnLane()).writeAttr("speed", veh->getSpeed()); + of.writeAttr("angle", veh->getAngle()).writeAttr("x", veh->getPosition().x()).writeAttr("y", veh->getPosition().y()); + of.closeTag(); } - - std::string fclass = veh->getVehicleType().getID(); - fclass = fclass.substr(0, fclass.find_first_of("@")); - - Position pos = veh->getLane()->getShape().positionAtOffset(veh->getPositionOnLane()); - of.openTag("vehicle").writeAttr("id", veh->getID()).writeAttr("eclass", PollutantsInterface::getName(veh->getVehicleType().getEmissionClass())).writeAttr("CO2", veh->getCO2Emissions()); - of.writeAttr("CO", veh->getCOEmissions()).writeAttr("HC", veh->getHCEmissions()).writeAttr("NOx", veh->getNOxEmissions()); - of.writeAttr("PMx", veh->getPMxEmissions()).writeAttr("fuel", veh->getFuelConsumption()).writeAttr("noise", veh->getHarmonoise_NoiseEmissions()); - of.writeAttr("route", veh->getRoute().getID()).writeAttr("type", fclass).writeAttr("waiting", veh->getWaitingSeconds()); - of.writeAttr("lane", veh->getLane()->getID()).writeAttr("pos", veh->getPositionOnLane()).writeAttr("speed", veh->getSpeed()); - of.writeAttr("angle", veh->getAngle()).writeAttr("x", pos.x()).writeAttr("y", pos.y()); - of.closeTag(); } of.closeTag(); } diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSEmissionExport.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSEmissionExport.h --- sumo-0.21.0+dfsg/src/microsim/output/MSEmissionExport.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSEmissionExport.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MSEmissionExport.h /// @author Mario Krumnow /// @date 2012-04-26 -/// @version $Id: MSEmissionExport.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSEmissionExport.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Realises dumping Emission Data /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSFCDExport.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSFCDExport.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSFCDExport.cpp 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSFCDExport.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Mario Krumnow /// @author Michael Behrisch /// @date 2012-04-26 -/// @version $Id: MSFCDExport.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSFCDExport.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Realises dumping Floating Car Data (FCD) Data /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,13 +41,10 @@ #include "MSFCDExport.h" #include #include -#include - -#ifdef HAVE_MESOSIM -#include -#include -#endif - +#include +#include +#include +#include #ifdef CHECK_MEMORY_LEAKS #include #endif // CHECK_MEMORY_LEAKS @@ -60,16 +57,13 @@ MSFCDExport::write(OutputDevice& of, SUMOTime timestep) { const bool useGeo = OptionsCont::getOptions().getBool("fcd-output.geo"); const bool signals = OptionsCont::getOptions().getBool("fcd-output.signals"); - MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl(); - MSVehicleControl::constVehIt it = vc.loadedVehBegin(); - MSVehicleControl::constVehIt end = vc.loadedVehEnd(); - of.openTag("timestep").writeAttr(SUMO_ATTR_TIME, time2string(timestep)); - for (; it != end; ++it) { - const MSVehicle* veh = static_cast((*it).second); + MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl(); + for (MSVehicleControl::constVehIt it = vc.loadedVehBegin(); it != vc.loadedVehEnd(); ++it) { + const SUMOVehicle* veh = it->second; + const MSVehicle* microVeh = dynamic_cast(veh); if (veh->isOnRoad()) { Position pos = veh->getPosition(); - MSLane* lane = veh->getLane(); if (useGeo) { of.setPrecision(GEO_OUTPUT_ACCURACY); GeoConvHelper::getFinal().cartesian2geo(pos); @@ -82,36 +76,66 @@ of.writeAttr(SUMO_ATTR_TYPE, veh->getVehicleType().getID()); of.writeAttr(SUMO_ATTR_SPEED, veh->getSpeed()); of.writeAttr(SUMO_ATTR_POSITION, veh->getPositionOnLane()); - of.writeAttr(SUMO_ATTR_LANE, lane->getID()); - of.writeAttr(SUMO_ATTR_SLOPE, lane->getShape().slopeDegreeAtOffset(veh->getPositionOnLane())); - if (signals) { - of.writeAttr("signals", toString(veh->getSignals())); + if (microVeh != 0) { + of.writeAttr(SUMO_ATTR_LANE, microVeh->getLane()->getID()); + } + of.writeAttr(SUMO_ATTR_SLOPE, veh->getSlope()); + if (microVeh != 0 && signals) { + of.writeAttr("signals", toString(microVeh->getSignals())); } of.closeTag(); } } - // write persons - MSEdgeControl& ec = MSNet::getInstance()->getEdgeControl(); - const std::vector& edges = ec.getEdges(); - for (std::vector::const_iterator e = edges.begin(); e != edges.end(); ++e) { - const std::vector& persons = (*e)->getSortedPersons(timestep); - for (std::vector::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) { - MSPerson* p = *it_p; - Position pos = p->getPosition(); - if (useGeo) { - of.setPrecision(GEO_OUTPUT_ACCURACY); - GeoConvHelper::getFinal().cartesian2geo(pos); + if (MSNet::getInstance()->getPersonControl().hasPersons()) { + // write persons + MSEdgeControl& ec = MSNet::getInstance()->getEdgeControl(); + const MSEdgeVector& edges = ec.getEdges(); + for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) { + const std::vector& persons = (*e)->getSortedPersons(timestep); + for (std::vector::const_iterator it_p = persons.begin(); it_p != persons.end(); ++it_p) { + MSPerson* p = *it_p; + Position pos = p->getPosition(); + if (useGeo) { + of.setPrecision(GEO_OUTPUT_ACCURACY); + GeoConvHelper::getFinal().cartesian2geo(pos); + } + of.openTag(SUMO_TAG_PERSON); + of.writeAttr(SUMO_ATTR_ID, p->getID()); + of.writeAttr(SUMO_ATTR_X, pos.x()); + of.writeAttr(SUMO_ATTR_Y, pos.y()); + of.writeAttr(SUMO_ATTR_ANGLE, p->getAngle()); + of.writeAttr(SUMO_ATTR_SPEED, p->getSpeed()); + of.writeAttr(SUMO_ATTR_POSITION, p->getEdgePos()); + of.writeAttr(SUMO_ATTR_EDGE, (*e)->getID()); + of.writeAttr(SUMO_ATTR_SLOPE, (*e)->getLanes()[0]->getShape().slopeDegreeAtOffset(p->getEdgePos())); + of.closeTag(); + } + } + } + if (MSNet::getInstance()->getContainerControl().hasContainers()) { + // write containers + MSEdgeControl& ec = MSNet::getInstance()->getEdgeControl(); + const std::vector& edges = ec.getEdges(); + for (std::vector::const_iterator e = edges.begin(); e != edges.end(); ++e) { + const std::vector& containers = (*e)->getSortedContainers(timestep); + for (std::vector::const_iterator it_c = containers.begin(); it_c != containers.end(); ++it_c) { + MSContainer* c = *it_c; + Position pos = c->getPosition(); + if (useGeo) { + of.setPrecision(GEO_OUTPUT_ACCURACY); + GeoConvHelper::getFinal().cartesian2geo(pos); + } + of.openTag(SUMO_TAG_CONTAINER); + of.writeAttr(SUMO_ATTR_ID, c->getID()); + of.writeAttr(SUMO_ATTR_X, pos.x()); + of.writeAttr(SUMO_ATTR_Y, pos.y()); + of.writeAttr(SUMO_ATTR_ANGLE, c->getAngle()); + of.writeAttr(SUMO_ATTR_SPEED, c->getSpeed()); + of.writeAttr(SUMO_ATTR_POSITION, c->getEdgePos()); + of.writeAttr(SUMO_ATTR_EDGE, (*e)->getID()); + of.writeAttr(SUMO_ATTR_SLOPE, (*e)->getLanes()[0]->getShape().slopeDegreeAtOffset(c->getEdgePos())); + of.closeTag(); } - of.openTag(SUMO_TAG_PERSON); - of.writeAttr(SUMO_ATTR_ID, p->getID()); - of.writeAttr(SUMO_ATTR_X, pos.x()); - of.writeAttr(SUMO_ATTR_Y, pos.y()); - of.writeAttr(SUMO_ATTR_ANGLE, p->getAngle()); - of.writeAttr(SUMO_ATTR_SPEED, p->getSpeed()); - of.writeAttr(SUMO_ATTR_POSITION, p->getEdgePos()); - of.writeAttr(SUMO_ATTR_EDGE, (*e)->getID()); - of.writeAttr(SUMO_ATTR_SLOPE, (*e)->getLanes()[0]->getShape().slopeDegreeAtOffset(p->getEdgePos())); - of.closeTag(); } } of.closeTag(); diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSFCDExport.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSFCDExport.h --- sumo-0.21.0+dfsg/src/microsim/output/MSFCDExport.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSFCDExport.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MSFCDExport.h /// @author Mario Krumnow /// @date 2012-04-26 -/// @version $Id: MSFCDExport.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSFCDExport.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Realises dumping Floating Car Data (FCD) Data /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSFullExport.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSFullExport.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSFullExport.cpp 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSFullExport.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2012-04-26 -/// @version $Id: MSFullExport.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSFullExport.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Dumping a hugh List of Parameters available in the Simulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -65,21 +66,24 @@ MSFullExport::writeVehicles(OutputDevice& of) { of.openTag("vehicles"); 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); + for (MSVehicleControl::constVehIt it = vc.loadedVehBegin(); it != vc.loadedVehEnd(); ++it) { + const SUMOVehicle* veh = it->second; + const MSVehicle* microVeh = dynamic_cast(veh); if (veh->isOnRoad()) { std::string fclass = veh->getVehicleType().getID(); fclass = fclass.substr(0, fclass.find_first_of("@")); - Position pos = veh->getLane()->getShape().positionAtOffset(veh->getPositionOnLane()); + PollutantsInterface::Emissions emiss = PollutantsInterface::computeAll(veh->getVehicleType().getEmissionClass(), veh->getSpeed(), veh->getAcceleration(), veh->getSlope()); of.openTag("vehicle").writeAttr("id", veh->getID()).writeAttr("eclass", PollutantsInterface::getName(veh->getVehicleType().getEmissionClass())); - of.writeAttr("CO2", veh->getCO2Emissions()).writeAttr("CO", veh->getCOEmissions()).writeAttr("HC", veh->getHCEmissions()); - of.writeAttr("NOx", veh->getNOxEmissions()).writeAttr("PMx", veh->getPMxEmissions()).writeAttr("noise", veh->getHarmonoise_NoiseEmissions()); - of.writeAttr("route", veh->getRoute().getID()).writeAttr("type", fclass).writeAttr("waiting", veh->getWaitingSeconds()); - of.writeAttr("lane", veh->getLane()->getID()).writeAttr("pos_lane", veh->getPositionOnLane()).writeAttr("speed", veh->getSpeed()); - of.writeAttr("angle", veh->getAngle()).writeAttr("x", pos.x()).writeAttr("y", pos.y()); - // !!! fuel is missing here + of.writeAttr("CO2", emiss.CO2).writeAttr("CO", emiss.CO).writeAttr("HC", emiss.HC).writeAttr("NOx", emiss.NOx); + of.writeAttr("PMx", emiss.PMx).writeAttr("fuel", emiss.fuel); + of.writeAttr("noise", HelpersHarmonoise::computeNoise(veh->getVehicleType().getEmissionClass(), veh->getSpeed(), veh->getAcceleration())); + of.writeAttr("route", veh->getRoute().getID()).writeAttr("type", fclass); + if (microVeh != 0) { + of.writeAttr("waiting", microVeh->getWaitingSeconds()); + of.writeAttr("lane", microVeh->getLane()->getID()); + } + of.writeAttr("pos", veh->getPositionOnLane()).writeAttr("speed", veh->getSpeed()); + of.writeAttr("angle", veh->getAngle()).writeAttr("x", veh->getPosition().x()).writeAttr("y", veh->getPosition().y()); of.closeTag(); } } @@ -90,8 +94,8 @@ MSFullExport::writeEdge(OutputDevice& of) { of.openTag("edges"); MSEdgeControl& ec = MSNet::getInstance()->getEdgeControl(); - const std::vector& edges = ec.getEdges(); - for (std::vector::const_iterator e = edges.begin(); e != edges.end(); ++e) { + const MSEdgeVector& edges = ec.getEdges(); + for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) { MSEdge& edge = **e; of.openTag("edge").writeAttr("id", edge.getID()).writeAttr("traveltime", edge.getCurrentTravelTime()); const std::vector& lanes = edge.getLanes(); diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSFullExport.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSFullExport.h --- sumo-0.21.0+dfsg/src/microsim/output/MSFullExport.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSFullExport.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MSFullExport.h /// @author Mario Krumnow /// @date 2012-04-26 -/// @version $Id: MSFullExport.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSFullExport.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Dumping a hugh List of Parameters available in the Simulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSInductLoop.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSInductLoop.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSInductLoop.cpp 2014-06-03 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSInductLoop.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 2004-11-23 -/// @version $Id: MSInductLoop.cpp 16492 2014-06-03 13:08:10Z namdre $ +/// @version $Id: MSInductLoop.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An unextended detector measuring at a fixed position on a fixed lane. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -52,6 +52,7 @@ #include #endif // CHECK_MEMORY_LEAKS +#define HAS_NOT_LEFT_DETECTOR -1 // =========================================================================== // method definitions @@ -150,8 +151,10 @@ return -1; } SUMOReal occupancy = 0; + SUMOReal csecond = STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()); for (std::vector< VehicleData >::const_iterator i = d.begin(); i != d.end(); ++i) { - SUMOReal timeOnDetDuringInterval = (*i).leaveTimeM - MAX2(STEPS2TIME(tbeg), (*i).entryTimeM); + const SUMOReal leaveTime = (*i).leaveTimeM == HAS_NOT_LEFT_DETECTOR ? csecond : (*i).leaveTimeM; + SUMOReal timeOnDetDuringInterval = leaveTime - MAX2(STEPS2TIME(tbeg), (*i).entryTimeM); timeOnDetDuringInterval = MIN2(timeOnDetDuringInterval, TS); occupancy += timeOnDetDuringInterval; } @@ -189,7 +192,7 @@ void MSInductLoop::writeXMLDetectorProlog(OutputDevice& dev) const { - dev.writeXMLHeader("detector", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/det_e1_file.xsd\""); + dev.writeXMLHeader("detector", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/det_e1_file.xsd\""); } @@ -313,10 +316,9 @@ ret.push_back(*i); } } - SUMOTime ct = MSNet::getInstance()->getCurrentTimeStep(); for (VehicleMap::const_iterator i = myVehiclesOnDet.begin(); i != myVehiclesOnDet.end(); ++i) { SUMOVehicle* v = (*i).first; - VehicleData d(v->getID(), v->getVehicleType().getLength(), (*i).second, STEPS2TIME(ct), v->getVehicleType().getID()); + VehicleData d(v->getID(), v->getVehicleType().getLength(), (*i).second, HAS_NOT_LEFT_DETECTOR, v->getVehicleType().getID()); d.speedM = v->getSpeed(); ret.push_back(d); } diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSInductLoop.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSInductLoop.h --- sumo-0.21.0+dfsg/src/microsim/output/MSInductLoop.h 2014-06-08 22:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSInductLoop.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2004-11-23 -/// @version $Id: MSInductLoop.h 16558 2014-06-07 22:22:51Z behrisch $ +/// @version $Id: MSInductLoop.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An unextended detector measuring at a fixed position on a fixed lane. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSInstantInductLoop.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSInstantInductLoop.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSInstantInductLoop.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSInstantInductLoop.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2011-09.08 -/// @version $Id: MSInstantInductLoop.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSInstantInductLoop.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An instantaneous induction loop /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSInstantInductLoop.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSInstantInductLoop.h --- sumo-0.21.0+dfsg/src/microsim/output/MSInstantInductLoop.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSInstantInductLoop.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2011-09.08 -/// @version $Id: MSInstantInductLoop.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSInstantInductLoop.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An instantaneous induction loop /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Amitran.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Amitran.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Amitran.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Amitran.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_Amitran.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSMeanData_Amitran.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Network state mean data collector for edges/lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -169,7 +169,7 @@ void MSMeanData_Amitran::writeXMLDetectorProlog(OutputDevice& dev) const { - dev.writeXMLHeader("linkData", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/amitran/linkdata.xsd\""); + dev.writeXMLHeader("linkData", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/amitran/linkdata.xsd\""); } diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Amitran.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Amitran.h --- sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Amitran.h 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Amitran.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_Amitran.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSMeanData_Amitran.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Network state mean data collector for edges/lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSMeanData.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSMeanData.cpp 2014-06-05 22:02:18.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData.cpp 16531 2014-06-05 10:10:48Z behrisch $ +/// @version $Id: MSMeanData.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Data collector for edges/lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -111,6 +111,11 @@ bool MSMeanData::MeanDataValues::notifyLeave(SUMOVehicle& /*veh*/, SUMOReal /*lastPos*/, MSMoveReminder::Notification reason) { +#ifdef HAVE_INTERNAL + if (MSGlobals::gUseMesoSim) { + return false; // reminder is re-added on every segment (@recheck for performance) + } +#endif return reason == MSMoveReminder::NOTIFICATION_JUNCTION; } @@ -269,8 +274,8 @@ void MSMeanData::init() { - const std::vector& edges = MSNet::getInstance()->getEdgeControl().getEdges(); - for (std::vector::const_iterator e = edges.begin(); e != edges.end(); ++e) { + const MSEdgeVector& edges = MSNet::getInstance()->getEdgeControl().getEdges(); + for (MSEdgeVector::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()); @@ -283,6 +288,7 @@ } else { data = createValues(0, lanes[0]->getLength(), false); } + data->setDescription("meandata_" + (*e)->getID()); myMeasures.back().push_back(data); MESegment* s = MSGlobals::gMesoNet->getSegmentForEdge(**e); while (s != 0) { @@ -328,7 +334,7 @@ UNUSED_PARAMETER(stopTime); #ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { - std::vector::iterator edge = myEdges.begin(); + MSEdgeVector::iterator edge = myEdges.begin(); for (std::vector >::const_iterator i = myMeasures.begin(); i != myMeasures.end(); ++i, ++edge) { MESegment* s = MSGlobals::gMesoNet->getSegmentForEdge(**edge); MeanDataValues* data = i->front(); @@ -367,7 +373,7 @@ s->prepareDetectorForWriting(*data); s = s->getNextSegment(); } - if (writePrefix(dev, *data, SUMO_TAG_EDGE, edge->getID())) { + if (writePrefix(dev, *data, SUMO_TAG_EDGE, getEdgeID(edge))) { data->write(dev, stopTime - startTime, (SUMOReal)edge->getLanes().size(), myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); @@ -470,7 +476,7 @@ myPendingIntervals.pop_front(); } openInterval(dev, startTime, stopTime); - std::vector::iterator edge = myEdges.begin(); + MSEdgeVector::iterator edge = myEdges.begin(); for (std::vector >::const_iterator i = myMeasures.begin(); i != myMeasures.end(); ++i, ++edge) { writeEdge(dev, (*i), *edge, startTime, stopTime); } @@ -481,7 +487,7 @@ void MSMeanData::writeXMLDetectorProlog(OutputDevice& dev) const { - dev.writeXMLHeader("meandata", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/meandata_file.xsd\""); + dev.writeXMLHeader("meandata", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/meandata_file.xsd\""); } diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Emissions.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Emissions.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Emissions.cpp 2014-04-25 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Emissions.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_Emissions.cpp 16253 2014-04-25 12:09:01Z behrisch $ +/// @version $Id: MSMeanData_Emissions.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Emission data collector for edges/lanes that /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Emissions.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Emissions.h --- sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Emissions.h 2014-04-25 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Emissions.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_Emissions.h 16253 2014-04-25 12:09:01Z behrisch $ +/// @version $Id: MSMeanData_Emissions.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Emission data collector for edges/lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSMeanData.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData.h --- sumo-0.21.0+dfsg/src/microsim/output/MSMeanData.h 2014-06-04 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 17.11.2009 -/// @version $Id: MSMeanData.h 16505 2014-06-03 22:21:02Z behrisch $ +/// @version $Id: MSMeanData.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Data collector for edges/lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -48,6 +48,7 @@ class MSLane; class SUMOVehicle; +typedef std::vector MSEdgeVector; // =========================================================================== // class definitions @@ -447,7 +448,7 @@ const SUMOTime myDumpBegin, myDumpEnd; /// @brief The corresponding first edges - std::vector myEdges; + MSEdgeVector myEdges; /// @brief Whether empty lanes/edges shall be written const bool myPrintDefaults; diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Harmonoise.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Harmonoise.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Harmonoise.cpp 2014-02-24 23:02:17.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Harmonoise.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_Harmonoise.cpp 15707 2014-02-24 09:12:53Z dkrajzew $ +/// @version $Id: MSMeanData_Harmonoise.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Redirector for mean data output (net->edgecontrol) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Harmonoise.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Harmonoise.h --- sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Harmonoise.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Harmonoise.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_Harmonoise.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSMeanData_Harmonoise.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Noise data collector for edges/lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Net.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Net.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Net.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Net.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_Net.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSMeanData_Net.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Network state mean data collector for edges/lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -122,7 +122,7 @@ if (vehicleApplies(veh) && (getLane() == 0 || getLane() == static_cast(veh).getLane())) { #ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { - myLastVehicleUpdateValues.erase(&veh); + removeFromVehicleUpdateValues(veh); } #endif if (reason == MSMoveReminder::NOTIFICATION_ARRIVED) { diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Net.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Net.h --- sumo-0.21.0+dfsg/src/microsim/output/MSMeanData_Net.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSMeanData_Net.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 10.05.2004 -/// @version $Id: MSMeanData_Net.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSMeanData_Net.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Network state mean data collector for edges/lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSQueueExport.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSQueueExport.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSQueueExport.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSQueueExport.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Mario Krumnow /// @author Michael Behrisch /// @date 2012-04-26 -/// @version $Id: MSQueueExport.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSQueueExport.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Export the queueing length in front of a junction (very experimental!) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -65,8 +65,8 @@ MSQueueExport::writeEdge(OutputDevice& of) { of.openTag("lanes"); MSEdgeControl& ec = MSNet::getInstance()->getEdgeControl(); - const std::vector& edges = ec.getEdges(); - for (std::vector::const_iterator e = edges.begin(); e != edges.end(); ++e) { + const MSEdgeVector& edges = ec.getEdges(); + for (MSEdgeVector::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) { diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSQueueExport.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSQueueExport.h --- sumo-0.21.0+dfsg/src/microsim/output/MSQueueExport.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSQueueExport.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MSQueueExport.h /// @author Mario Krumnow /// @date 2012-04-26 -/// @version $Id: MSQueueExport.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSQueueExport.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Export the queueing length in front of a junction (very experimental!) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSRouteProbe.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSRouteProbe.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSRouteProbe.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSRouteProbe.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Tino Morenz /// @author Jakob Erdmann /// @date Thu, 04.12.2008 -/// @version $Id: MSRouteProbe.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSRouteProbe.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes route distributions at a certain edge /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSRouteProbe.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSRouteProbe.h --- sumo-0.21.0+dfsg/src/microsim/output/MSRouteProbe.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSRouteProbe.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Tino Morenz /// @date Thu, 04.12.2008 -/// @version $Id: MSRouteProbe.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSRouteProbe.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes route distributions at a certain edge /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSVTKExport.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSVTKExport.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSVTKExport.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSVTKExport.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2012-04-26 -/// @version $Id: MSVTKExport.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSVTKExport.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Realises VTK Export /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSVTKExport.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSVTKExport.h --- sumo-0.21.0+dfsg/src/microsim/output/MSVTKExport.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSVTKExport.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MSVTKExport.h /// @author Mario Krumnow /// @date 2012-04-26 -/// @version $Id: MSVTKExport.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSVTKExport.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Produce a VTK output to use with Tools like ParaView /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSVTypeProbe.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSVTypeProbe.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSVTypeProbe.cpp 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSVTypeProbe.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 24.10.2007 -/// @version $Id: MSVTypeProbe.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSVTypeProbe.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes positions of vehicles that have a certain (named) type /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -53,7 +53,7 @@ const std::string& vType, OutputDevice& od, SUMOTime frequency) : Named(id), myVType(vType), myOutputDevice(od), myFrequency(frequency) { - MSNet::getInstance()->getEndOfTimestepEvents().addEvent(this, 0, MSEventControl::ADAPT_AFTER_EXECUTION); + MSNet::getInstance()->getEndOfTimestepEvents()->addEvent(this, 0, MSEventControl::ADAPT_AFTER_EXECUTION); myOutputDevice.writeXMLHeader("vehicle-type-probes"); } @@ -66,30 +66,28 @@ MSVTypeProbe::execute(SUMOTime currentTime) { myOutputDevice.openTag("timestep") << " time=\"" << time2string(currentTime) << "\" id=\"" << getID() << "\" vType=\"" << myVType << "\""; 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); + for (MSVehicleControl::constVehIt it = vc.loadedVehBegin(); it != vc.loadedVehEnd(); ++it) { + const SUMOVehicle* veh = it->second; + const MSVehicle* microVeh = dynamic_cast(veh); if (myVType == "" || myVType == veh->getVehicleType().getID()) { - if (!veh->isOnRoad()) { - continue; + if (veh->isOnRoad()) { + Position pos = veh->getPosition(); + myOutputDevice.openTag("vehicle").writeAttr("id", veh->getID()); + if (microVeh != 0) { + myOutputDevice.writeAttr("lane", microVeh->getLane()->getID()); + } + myOutputDevice.writeAttr("pos", veh->getPositionOnLane()); + myOutputDevice.writeAttr("x", pos.x()).writeAttr("y", pos.y()); + if (GeoConvHelper::getFinal().usingGeoProjection()) { + GeoConvHelper::getFinal().cartesian2geo(pos); + myOutputDevice.setPrecision(GEO_OUTPUT_ACCURACY); + myOutputDevice.writeAttr("lat", pos.y()).writeAttr("lon", pos.x()); + myOutputDevice.setPrecision(); + } + myOutputDevice.writeAttr("speed", veh->getSpeed()); + myOutputDevice.closeTag(); } - Position pos = veh->getLane()->getShape().positionAtOffset(veh->getPositionOnLane()); - myOutputDevice.openTag("vehicle") << " id=\"" << veh->getID() - << "\" lane=\"" << veh->getLane()->getID() - << "\" pos=\"" << veh->getPositionOnLane() - << "\" x=\"" << pos.x() - << "\" y=\"" << pos.y(); - if (GeoConvHelper::getFinal().usingGeoProjection()) { - GeoConvHelper::getFinal().cartesian2geo(pos); - myOutputDevice.setPrecision(GEO_OUTPUT_ACCURACY); - myOutputDevice << "\" lat=\"" << pos.y() << "\" lon=\"" << pos.x(); - myOutputDevice.setPrecision(); - } - myOutputDevice << "\" speed=\"" << veh->getSpeed() << "\""; - myOutputDevice.closeTag(); } - } myOutputDevice.closeTag(); return myFrequency; diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSVTypeProbe.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSVTypeProbe.h --- sumo-0.21.0+dfsg/src/microsim/output/MSVTypeProbe.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSVTypeProbe.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 24.10.2007 -/// @version $Id: MSVTypeProbe.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSVTypeProbe.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Writes positions of vehicles that have a certain (named) type /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSXMLRawOut.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSXMLRawOut.cpp --- sumo-0.21.0+dfsg/src/microsim/output/MSXMLRawOut.cpp 2014-06-10 22:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSXMLRawOut.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Bjoern Hendriks /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSXMLRawOut.cpp 16566 2014-06-10 09:22:55Z behrisch $ +/// @version $Id: MSXMLRawOut.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Realises dumping the complete network state /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -37,8 +37,9 @@ #include #include #include -#include +#include #include +#include #include #include "MSXMLRawOut.h" @@ -57,12 +58,14 @@ // =========================================================================== void MSXMLRawOut::write(OutputDevice& of, const MSEdgeControl& ec, - SUMOTime timestep) { + SUMOTime timestep, int precision) { of.openTag("timestep") << " time=\"" << time2string(timestep) << "\""; - const std::vector& edges = ec.getEdges(); - for (std::vector::const_iterator e = edges.begin(); e != edges.end(); ++e) { + of.setPrecision(precision); + const MSEdgeVector& edges = ec.getEdges(); + for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) { writeEdge(of, **e, timestep); } + of.setPrecision(OUTPUT_ACCURACY); of.closeTag(); } @@ -97,7 +100,8 @@ } //en const std::vector& persons = edge.getSortedPersons(timestep); - if (dump || persons.size() > 0) { + const std::vector& containers = edge.getSortedContainers(timestep); + if (dump || persons.size() > 0 || containers.size() > 0) { of.openTag("edge") << " id=\"" << edge.getID() << "\""; if (dump) { #ifdef HAVE_INTERNAL @@ -126,6 +130,15 @@ of.writeAttr("stage", (*it_p)->getCurrentStageDescription()); of.closeTag(); } + // write containers + for (std::vector::const_iterator it_c = containers.begin(); it_c != containers.end(); ++it_c) { + of.openTag(SUMO_TAG_CONTAINER); + of.writeAttr(SUMO_ATTR_ID, (*it_c)->getID()); + of.writeAttr(SUMO_ATTR_POSITION, (*it_c)->getEdgePos()); + of.writeAttr(SUMO_ATTR_ANGLE, (*it_c)->getAngle()); + of.writeAttr("stage", (*it_c)->getCurrentStageDescription()); + of.closeTag(); + } of.closeTag(); } } @@ -151,8 +164,21 @@ void MSXMLRawOut::writeVehicle(OutputDevice& of, const MSBaseVehicle& veh) { if (veh.isOnRoad()) { - of.openTag("vehicle") << " id=\"" << veh.getID() << "\" pos=\"" - << veh.getPositionOnLane() << "\" speed=\"" << veh.getSpeed() << "\""; + of.openTag("vehicle"); + of.writeAttr(SUMO_ATTR_ID, veh.getID()); + of.writeAttr(SUMO_ATTR_POSITION, veh.getPositionOnLane()); + of.writeAttr(SUMO_ATTR_SPEED, veh.getSpeed()); + if (!MSGlobals::gUseMesoSim) { + // microsim-specific stuff + const unsigned int personNumber = static_cast(veh).getPersonNumber(); + if (personNumber > 0) { + of.writeAttr(SUMO_ATTR_PERSON_NUMBER, personNumber); + } + const unsigned int containerNumber = static_cast(veh).getContainerNumber(); + if (containerNumber > 0) { + of.writeAttr(SUMO_ATTR_CONTAINER_NUMBER, containerNumber); + } + } of.closeTag(); } } diff -Nru sumo-0.21.0+dfsg/src/microsim/output/MSXMLRawOut.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSXMLRawOut.h --- sumo-0.21.0+dfsg/src/microsim/output/MSXMLRawOut.h 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/output/MSXMLRawOut.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Bjoern Hendriks /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: MSXMLRawOut.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSXMLRawOut.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Realises dumping the complete network state /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -69,10 +69,11 @@ * @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 + * @param[in] precision The output precision * @exception IOError If an error on writing occurs (!!! not yet implemented) */ static void write(OutputDevice& of, const MSEdgeControl& ec, - SUMOTime timestep); + SUMOTime timestep, int precision); /** @brief Writes the dump of the given vehicle into the given device diff -Nru sumo-0.21.0+dfsg/src/microsim/pedestrians/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/Makefile.am --- sumo-0.21.0+dfsg/src/microsim/pedestrians/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,6 @@ +noinst_LIBRARIES = libmicrosimpeds.a + +libmicrosimpeds_a_SOURCES = MSPerson.cpp MSPerson.h \ +MSPModel.cpp MSPModel.h \ +MSPModel_Striping.cpp MSPModel_Striping.h \ +MSPModel_NonInteracting.cpp MSPModel_NonInteracting.h diff -Nru sumo-0.21.0+dfsg/src/microsim/pedestrians/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/Makefile.in --- sumo-0.21.0+dfsg/src/microsim/pedestrians/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,622 @@ +# Makefile.in generated by automake 1.13.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +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/microsim/pedestrians +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +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 +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libmicrosimpeds_a_AR = $(AR) $(ARFLAGS) +libmicrosimpeds_a_LIBADD = +am_libmicrosimpeds_a_OBJECTS = MSPerson.$(OBJEXT) MSPModel.$(OBJEXT) \ + MSPModel_Striping.$(OBJEXT) MSPModel_NonInteracting.$(OBJEXT) +libmicrosimpeds_a_OBJECTS = $(am_libmicrosimpeds_a_OBJECTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +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) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libmicrosimpeds_a_SOURCES) +DIST_SOURCES = $(libmicrosimpeds_a_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +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@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +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_CONFIG = @FOX_CONFIG@ +FOX_LDFLAGS = @FOX_LDFLAGS@ +GDAL_CONFIG = @GDAL_CONFIG@ +GDAL_LDFLAGS = @GDAL_LDFLAGS@ +GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ +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_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 = libmicrosimpeds.a +libmicrosimpeds_a_SOURCES = MSPerson.cpp MSPerson.h \ +MSPModel.cpp MSPModel.h \ +MSPModel_Striping.cpp MSPModel_Striping.h \ +MSPModel_NonInteracting.cpp MSPModel_NonInteracting.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/microsim/pedestrians/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/microsim/pedestrians/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) + +libmicrosimpeds.a: $(libmicrosimpeds_a_OBJECTS) $(libmicrosimpeds_a_DEPENDENCIES) $(EXTRA_libmicrosimpeds_a_DEPENDENCIES) + $(AM_V_at)-rm -f libmicrosimpeds.a + $(AM_V_AR)$(libmicrosimpeds_a_AR) libmicrosimpeds.a $(libmicrosimpeds_a_OBJECTS) $(libmicrosimpeds_a_LIBADD) + $(AM_V_at)$(RANLIB) libmicrosimpeds.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPModel.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPModel_NonInteracting.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPModel_Striping.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSPerson.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + 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-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + 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" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +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 TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \ + ctags-am 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 tags-am 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.21.0+dfsg/src/microsim/pedestrians/MSPerson.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPerson.cpp --- sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPerson.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPerson.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,642 @@ +/****************************************************************************/ +/// @file MSPerson.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @author Laura Bieker +/// @date Mon, 9 Jul 2001 +/// @version $Id: MSPerson.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// The class for modelling person-movements +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "MSPerson.h" +#include +#include +#include +#include "MSPModel.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + +/* ------------------------------------------------------------------------- + * static member definitions + * ----------------------------------------------------------------------- */ + +// =========================================================================== +// method definitions +// =========================================================================== +/* ------------------------------------------------------------------------- + * MSPerson::MSPersonStage - methods + * ----------------------------------------------------------------------- */ +MSPerson::MSPersonStage::MSPersonStage(const MSEdge& destination, StageType type) + : myDestination(destination), myDeparted(-1), myArrived(-1), myType(type) {} + + +MSPerson::MSPersonStage::~MSPersonStage() {} + + +const MSEdge& +MSPerson::MSPersonStage::getDestination() const { + return myDestination; +} + + +void +MSPerson::MSPersonStage::setDeparted(SUMOTime now) { + if (myDeparted < 0) { + myDeparted = now; + } +} + + +void +MSPerson::MSPersonStage::setArrived(SUMOTime now) { + myArrived = now; +} + + +bool +MSPerson::MSPersonStage::isWaitingFor(const std::string& /*line*/) const { + return false; +} + + +Position +MSPerson::MSPersonStage::getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const { + return getLanePosition(e->getLanes()[0], at, offset); +} + + +Position +MSPerson::MSPersonStage::getLanePosition(const MSLane* lane, SUMOReal at, SUMOReal offset) const { + return lane->getShape().positionAtOffset(lane->interpolateLanePosToGeometryPos(at), offset); +} + + +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.rotationDegreeAtOffset(at); +} + + + +/* ------------------------------------------------------------------------- + * MSPerson::MSPersonStage_Walking - methods + * ----------------------------------------------------------------------- */ +MSPerson::MSPersonStage_Walking::MSPersonStage_Walking(const ConstMSEdgeVector& route, + MSBusStop* toBS, + SUMOTime walkingTime, SUMOReal speed, + SUMOReal departPos, SUMOReal arrivalPos) : + MSPersonStage(*route.back(), WALKING), myWalkingTime(walkingTime), myRoute(route), + myCurrentInternalEdge(0), + myDepartPos(departPos), myArrivalPos(arrivalPos), myDestinationBusStop(toBS), + mySpeed(speed), + myPedestrianState(0) { + 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) { + mySpeed = computeAverageSpeed(); + } +} + + +MSPerson::MSPersonStage_Walking::~MSPersonStage_Walking() { +} + + +const MSEdge* +MSPerson::MSPersonStage_Walking::getEdge() const { + if (myCurrentInternalEdge != 0) { + return myCurrentInternalEdge; + } else { + return *myRouteStep; + } +} + + +const MSEdge* +MSPerson::MSPersonStage_Walking::getFromEdge() const { + return myRoute.front(); +} + + +SUMOReal +MSPerson::MSPersonStage_Walking::getEdgePos(SUMOTime now) const { + return myPedestrianState->getEdgePos(*this, now); +} + + +Position +MSPerson::MSPersonStage_Walking::getPosition(SUMOTime now) const { + return myPedestrianState->getPosition(*this, now); +} + + +SUMOReal +MSPerson::MSPersonStage_Walking::getAngle(SUMOTime now) const { + return myPedestrianState->getAngle(*this, now); +} + + +SUMOTime +MSPerson::MSPersonStage_Walking::getWaitingTime(SUMOTime now) const { + return myPedestrianState->getWaitingTime(*this, now); +} + + +SUMOReal +MSPerson::MSPersonStage_Walking::getSpeed() const { + return myPedestrianState->getSpeed(*this); +} + + +void +MSPerson::MSPersonStage_Walking::proceed(MSNet* net, MSPerson* person, SUMOTime now, + MSEdge* previousEdge, const SUMOReal at) { + previousEdge->removePerson(person); + myRouteStep = myRoute.begin(); + if (myWalkingTime == 0) { + if (!person->proceed(net, now)) { + MSNet::getInstance()->getPersonControl().erase(person); + }; + return; + } + MSNet::getInstance()->getPersonControl().setWalking(person); + if (at >= 0) { + myDepartPos = at; + if (myWalkingTime > 0) { + mySpeed = computeAverageSpeed(); + } + } + myPedestrianState = MSPModel::getModel()->add(person, this, now); + ((MSEdge*) *myRouteStep)->addPerson(person); +} + + +SUMOReal +MSPerson::MSPersonStage_Walking::computeAverageSpeed() const { + SUMOReal length = 0; + for (ConstMSEdgeVector::const_iterator i = myRoute.begin(); i != myRoute.end(); ++i) { + length += (*i)->getLength(); + } + length -= myDepartPos; + length -= myRoute.back()->getLength() - myArrivalPos; + return length / STEPS2TIME(myWalkingTime + 1); // avoid systematic rounding errors +} + + +void +MSPerson::MSPersonStage_Walking::tripInfoOutput(OutputDevice& os) const { + os.openTag("walk").writeAttr("arrival", time2string(myArrived)).closeTag(); +} + + +void +MSPerson::MSPersonStage_Walking::routeOutput(OutputDevice& os) const { + os.openTag("walk").writeAttr(SUMO_ATTR_EDGES, myRoute); + if (myWalkingTime > 0) { + os.writeAttr(SUMO_ATTR_DURATION, time2string(myWalkingTime)); + } else if (mySpeed > 0) { + os.writeAttr(SUMO_ATTR_SPEED, mySpeed); + } + os.closeTag(); +} + + +void +MSPerson::MSPersonStage_Walking::beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { + os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "departure") + .writeAttr("agent", p.getID()).writeAttr("link", myRoute.front()->getID()).closeTag(); +} + + +void +MSPerson::MSPersonStage_Walking::endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { + os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival") + .writeAttr("agent", p.getID()).writeAttr("link", myRoute.back()->getID()).closeTag(); +} + + +bool +MSPerson::MSPersonStage_Walking::moveToNextEdge(MSPerson* person, SUMOTime currentTime, MSEdge* nextInternal) { + ((MSEdge*)getEdge())->removePerson(person); + //std::cout << SIMTIME << " moveToNextEdge person=" << person->getID() << "\n"; + 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); + } + //std::cout << " end walk. myRouteStep=" << (*myRouteStep)->getID() << "\n"; + return true; + } else { + if (nextInternal == 0) { + ++myRouteStep; + myCurrentInternalEdge = 0; + } else { + myCurrentInternalEdge = nextInternal; + } + ((MSEdge*) getEdge())->addPerson(person); + return false; + } +} + + + +/* ------------------------------------------------------------------------- + * MSPerson::MSPersonStage_Driving - methods + * ----------------------------------------------------------------------- */ +MSPerson::MSPersonStage_Driving::MSPersonStage_Driving(const MSEdge& destination, + 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() 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()->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().positionAtOffset(myVehicle->getPositionOnLane()); + } + return getEdgePosition(myWaitingEdge, myWaitingPos, MSPModel::SIDEWALK_OFFSET); +} + + +SUMOReal +MSPerson::MSPersonStage_Driving::getAngle(SUMOTime /* now */) const { + if (myVehicle != 0) { + MSVehicle* veh = dynamic_cast(myVehicle); + if (veh != 0) { + return veh->getAngle(); + } else { + return 0; + } + } + return getEdgeAngle(myWaitingEdge, myWaitingPos) + 90; +} + + + +void +MSPerson::MSPersonStage_Driving::proceed(MSNet* net, MSPerson* person, SUMOTime now, + MSEdge* previousEdge, const SUMOReal at) { + myWaitingEdge = previousEdge; + myWaitingPos = at; + myWaitingSince = now; + SUMOVehicle* availableVehicle = net->getVehicleControl().getWaitingVehicle(previousEdge, myLines, myWaitingPos, person->getID()); + if (availableVehicle != 0 && availableVehicle->getParameter().departProcedure == DEPART_TRIGGERED) { + myVehicle = availableVehicle; + previousEdge->removePerson(person); + myVehicle->addPerson(person); + net->getInsertionControl().add(myVehicle); + net->getVehicleControl().removeWaiting(previousEdge, myVehicle); + net->getVehicleControl().unregisterOneWaitingForPerson(); + } else { + net->getPersonControl().addWaiting(previousEdge, person); + previousEdge->addPerson(person); + } +} + + +bool +MSPerson::MSPersonStage_Driving::isWaitingFor(const std::string& line) const { + return myLines.count(line) > 0; +} + + +bool +MSPerson::MSPersonStage_Driving::isWaiting4Vehicle() const { + return myVehicle == 0; +} + + +SUMOTime +MSPerson::MSPersonStage_Driving::getWaitingTime(SUMOTime now) const { + return isWaiting4Vehicle() ? now - myWaitingSince : 0; +} + + +SUMOReal +MSPerson::MSPersonStage_Driving::getSpeed() const { + return myVehicle == 0 ? 0 : myVehicle->getSpeed(); +} + + +std::string +MSPerson::MSPersonStage_Driving::getStageDescription() const { + return isWaiting4Vehicle() ? "waiting for " + joinToString(myLines, ",") : "driving"; +} + + +void +MSPerson::MSPersonStage_Driving::tripInfoOutput(OutputDevice& os) const { + os.openTag("ride").writeAttr("depart", time2string(myDeparted)).writeAttr("arrival", time2string(myArrived)).closeTag(); +} + + +void +MSPerson::MSPersonStage_Driving::routeOutput(OutputDevice& os) const { + os.openTag("ride").writeAttr(SUMO_ATTR_FROM, getFromEdge()->getID()).writeAttr(SUMO_ATTR_TO, getDestination().getID()); + os.writeAttr(SUMO_ATTR_LINES, myLines).closeTag(); +} + + +void +MSPerson::MSPersonStage_Driving::beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { + os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag(); +} + + +void +MSPerson::MSPersonStage_Driving::endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { + os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "arrival").writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag(); +} + + + +/* ------------------------------------------------------------------------- + * MSPerson::MSPersonStage_Waiting - methods + * ----------------------------------------------------------------------- */ +MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting(const MSEdge& destination, + 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() const { + return &myDestination; +} + + +const MSEdge* +MSPerson::MSPersonStage_Waiting::getFromEdge() const { + return &myDestination; +} + + +SUMOReal +MSPerson::MSPersonStage_Waiting::getEdgePos(SUMOTime /* now */) const { + return myStartPos; +} + + +SUMOTime +MSPerson::MSPersonStage_Waiting::getUntil() const { + return myWaitingUntil; +} + + +Position +MSPerson::MSPersonStage_Waiting::getPosition(SUMOTime /* now */) const { + return getEdgePosition(&myDestination, myStartPos, MSPModel::SIDEWALK_OFFSET); +} + + +SUMOReal +MSPerson::MSPersonStage_Waiting::getAngle(SUMOTime /* now */) const { + return getEdgeAngle(&myDestination, myStartPos) - 90; +} + + +void +MSPerson::MSPersonStage_Waiting::proceed(MSNet* net, MSPerson* person, SUMOTime now, + MSEdge* previousEdge, const SUMOReal /* at */) { + previousEdge->addPerson(person); + myWaitingStart = now; + const SUMOTime until = MAX3(now, now + myWaitingDuration, myWaitingUntil); + net->getPersonControl().setWaitEnd(until, person); +} + + +void +MSPerson::MSPersonStage_Waiting::tripInfoOutput(OutputDevice& os) const { + os.openTag("stop").writeAttr("arrival", time2string(myArrived)).closeTag(); +} + + +void +MSPerson::MSPersonStage_Waiting::routeOutput(OutputDevice& os) const { + os.openTag("stop").writeAttr(SUMO_ATTR_LANE, getDestination().getID()); + if (myWaitingDuration >= 0) { + os.writeAttr(SUMO_ATTR_DURATION, time2string(myWaitingDuration)); + } + if (myWaitingUntil >= 0) { + os.writeAttr(SUMO_ATTR_UNTIL, time2string(myWaitingUntil)); + } + os.closeTag(); +} + + +void +MSPerson::MSPersonStage_Waiting::beginEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { + os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actstart " + myActType) + .writeAttr("agent", p.getID()).writeAttr("link", getEdge()->getID()).closeTag(); +} + + +void +MSPerson::MSPersonStage_Waiting::endEventOutput(const MSPerson& p, SUMOTime t, OutputDevice& os) const { + os.openTag("event").writeAttr("time", time2string(t)).writeAttr("type", "actend " + myActType).writeAttr("agent", p.getID()) + .writeAttr("link", getEdge()->getID()).closeTag(); +} + + +SUMOTime +MSPerson::MSPersonStage_Waiting::getWaitingTime(SUMOTime now) const { + return now - myWaitingStart; +} + + +SUMOReal +MSPerson::MSPersonStage_Waiting::getSpeed() const { + return 0; +} + + + + +/* ------------------------------------------------------------------------- + * MSPerson - methods + * ----------------------------------------------------------------------- */ +MSPerson::MSPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPersonPlan* plan) + : myParameter(pars), myVType(vtype), myPlan(plan) { + myStep = myPlan->begin(); +} + + +MSPerson::~MSPerson() { + for (MSPersonPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) { + delete *i; + } + delete myPlan; + delete myParameter; +} + + +const std::string& +MSPerson::getID() const { + return myParameter->id; +} + + +bool +MSPerson::proceed(MSNet* net, SUMOTime time) { + MSEdge* arrivedAt = (MSEdge*)(*myStep)->getEdge(); + SUMOReal atPos = (*myStep)->getEdgePos(time); + //MSPersonPlan::iterator prior = myStep; + (*myStep)->setArrived(time); + /* + if(myWriteEvents) { + (*myStep)->endEventOutput(*this, time, OutputDevice::getDeviceByOption("person-event-output")); + } + */ + myStep++; + if (myStep != myPlan->end()) { + (*myStep)->proceed(net, this, time, arrivedAt, atPos); + /* + if(myWriteEvents) { + (*myStep)->beginEventOutput(*this, time, OutputDevice::getDeviceByOption("person-event-output")); + } + */ + return true; + } else { + arrivedAt->removePerson(this); + return false; + } +} + + +SUMOTime +MSPerson::getDesiredDepart() const { + return myParameter->depart; +} + + +void +MSPerson::setDeparted(SUMOTime now) { + (*myStep)->setDeparted(now); +} + + +void +MSPerson::tripInfoOutput(OutputDevice& os) const { + for (MSPersonPlan::const_iterator i = myPlan->begin(); i != myPlan->end(); ++i) { + (*i)->tripInfoOutput(os); + } +} + + +void +MSPerson::routeOutput(OutputDevice& os) const { + MSPersonPlan::const_iterator i = myPlan->begin(); + if ((*i)->getStageType() == WAITING && getDesiredDepart() == static_cast(*i)->getUntil()) { + ++i; + } + for (; i != myPlan->end(); ++i) { + (*i)->routeOutput(os); + } +} + +SUMOReal +MSPerson::getEdgePos() const { + return (*myStep)->getEdgePos(MSNet::getInstance()->getCurrentTimeStep()); +} + +Position +MSPerson::getPosition() const { + return (*myStep)->getPosition(MSNet::getInstance()->getCurrentTimeStep()); +} + + +SUMOReal +MSPerson::getAngle() const { + return (*myStep)->getAngle(MSNet::getInstance()->getCurrentTimeStep()); +} + +SUMOReal +MSPerson::getWaitingSeconds() const { + return STEPS2TIME((*myStep)->getWaitingTime(MSNet::getInstance()->getCurrentTimeStep())); +} + +SUMOReal +MSPerson::getSpeed() const { + return (*myStep)->getSpeed(); +} + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPerson.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPerson.h --- sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPerson.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPerson.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,644 @@ +/****************************************************************************/ +/// @file MSPerson.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Sascha Krieg +/// @author Michael Behrisch +/// @date Mon, 9 Jul 2001 +/// @version $Id: MSPerson.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// The class for modelling person-movements +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 MSPerson_h +#define MSPerson_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSNet; +class MSEdge; +class MSLane; +class OutputDevice; +class SUMOVehicleParameter; +class MSBusStop; +class SUMOVehicle; +class MSVehicleType; +class MSPModel; +class PedestrianState; + +typedef std::vector ConstMSEdgeVector; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSPerson + * + * The class holds a simulated person together with her movement stages + */ +class MSPerson { +public: + enum StageType { + WALKING = 0, + DRIVING = 1, + WAITING = 2 + }; + + + /** + * The "abstract" class for a single stage of a persons movement + * Contains the destination of the current movement step + */ + class MSPersonStage { + public: + /// constructor + MSPersonStage(const MSEdge& destination, StageType type); + + /// destructor + virtual ~MSPersonStage(); + + /// returns the destination edge + const MSEdge& getDestination() const; + + /// Returns the current edge + virtual const MSEdge* getEdge() 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 getStageDescription() const = 0; + + /// proceeds to the next step + virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at) = 0; + + /// logs end of the step + void setDeparted(SUMOTime now); + + /// logs end of the step + void setArrived(SUMOTime now); + + /// 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 the time this person spent waiting + virtual SUMOTime getWaitingTime(SUMOTime now) const = 0; + + /// @brief the time this person spent waiting + virtual SUMOReal getSpeed() const = 0; + + /// @brief get position on edge e at length at with orthogonal offset + Position getEdgePosition(const MSEdge* e, SUMOReal at, SUMOReal offset) const; + + /// @brief get position on lane at length at with orthogonal offset + Position getLanePosition(const MSLane* lane, 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 on writing vehroute output + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void routeOutput(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) + const MSEdge& myDestination; + + /// the time at which this stage started + SUMOTime myDeparted; + + /// the time at which this stage ended + SUMOTime myArrived; + + /// The type of this stage + StageType myType; + + private: + /// @brief Invalidated copy constructor. + MSPersonStage(const MSPersonStage&); + + /// @brief Invalidated assignment operator. + MSPersonStage& operator=(const MSPersonStage&); + + }; + + /** + * A "real" stage performing the walking to an edge + * The walking does not need any route as it is not simulated. + * Only the duration is needed + */ + class MSPersonStage_Walking : public MSPersonStage { + friend class MSPModel; + friend class GUIPerson; // debugging + + public: + /// constructor + MSPersonStage_Walking(const ConstMSEdgeVector& 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, MSEdge* previousEdge, const SUMOReal at); + + /// Returns the current edge + const MSEdge* getEdge() const; + const MSEdge* getFromEdge() const; + SUMOReal getEdgePos(SUMOTime now) const; + + /// + Position getPosition(SUMOTime now) const; + + SUMOReal getAngle(SUMOTime now) const; + + SUMOTime getWaitingTime(SUMOTime now) const; + + SUMOReal getSpeed() const; + + std::string getStageDescription() 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 on writing vehroute output + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void routeOutput(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; + + /// @brief move forward and return whether the person arrived + bool moveToNextEdge(MSPerson* person, SUMOTime currentTime, MSEdge* nextInternal = 0); + + + /// @brief accessors to be used by MSPModel + //@{ + inline SUMOReal getMaxSpeed() const { + return mySpeed; + } + inline SUMOReal getDepartPos() const { + return myDepartPos; + } + inline SUMOReal getArrivalPos() const { + return myArrivalPos; + } + + inline const MSEdge* getRouteEdge() const { + return *myRouteStep; + } + inline const MSEdge* getNextRouteEdge() const { + return myRouteStep == myRoute.end() - 1 ? 0 : *(myRouteStep + 1); + } + inline const ConstMSEdgeVector& getRoute() const { + return myRoute; + } + + PedestrianState* getPedestrianState() const { + return myPedestrianState; + } + //@} + + + private: + + /* @brief compute average speed if the total walking duration is given + * @note Must be callled when the previous stage changes myDepartPos from the default*/ + SUMOReal computeAverageSpeed() const; + + + private: + /// the time the person is walking + SUMOTime myWalkingTime; + + /// @brief The route of the person + ConstMSEdgeVector myRoute; + + + ConstMSEdgeVector::iterator myRouteStep; + + /// @brief The current internal edge this person is on or 0 + MSEdge* myCurrentInternalEdge; + + /// @brief A vector of computed times an edge is reached + //std::vector myArrivalTimes; + + SUMOReal myDepartPos; + SUMOReal myArrivalPos; + MSBusStop* myDestinationBusStop; + SUMOReal mySpeed; + + /// @brief state that is to be manipulated by MSPModel + PedestrianState* myPedestrianState; + + 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&); + + /// @brief Invalidated assignment operator. + MSPersonStage_Walking& operator=(const MSPersonStage_Walking&); + + }; + + /** + * A "real" stage performing the travelling by a transport system + * The given route will be chosen. The travel time is computed by the simulation + */ + class MSPersonStage_Driving : public MSPersonStage { + public: + /// constructor + 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, MSEdge* previousEdge, const SUMOReal at); + + /// Returns the current edge + const MSEdge* getEdge() const; + const MSEdge* getFromEdge() const; + SUMOReal getEdgePos(SUMOTime now) const; + + /// + Position getPosition(SUMOTime now) const; + + SUMOReal getAngle(SUMOTime now) const; + + std::string getStageDescription() const; + + /// Whether the person waits for a vehicle of the line specified. + bool isWaitingFor(const std::string& line) const; + + /// @brief Whether the person waits for a vehicle + bool isWaiting4Vehicle() const; + + /// @brief time spent waiting for a ride + SUMOTime getWaitingTime(SUMOTime now) const; + + SUMOReal getSpeed() const; + + void setVehicle(SUMOVehicle* v) { + myVehicle = v; + } + + /** @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 on writing vehroute output + * + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void routeOutput(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; + SUMOReal myWaitingPos; + /// @brief The time since which this person is waiting for a ride + SUMOTime myWaitingSince; + const MSEdge* myWaitingEdge; + + private: + /// @brief Invalidated copy constructor. + MSPersonStage_Driving(const MSPersonStage_Driving&); + + /// @brief Invalidated assignment operator. + MSPersonStage_Driving& operator=(const MSPersonStage_Driving&); + + }; + + /** + * A "real" stage performing a waiting over the specified time + */ + class MSPersonStage_Waiting : public MSPersonStage { + public: + /// constructor + 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() const; + const MSEdge* getFromEdge() const; + SUMOReal getEdgePos(SUMOTime now) const; + SUMOTime getUntil() const; + + /// + Position getPosition(SUMOTime now) const; + + SUMOReal getAngle(SUMOTime now) const; + + SUMOTime getWaitingTime(SUMOTime now) const; + + SUMOReal getSpeed() const; + + std::string getStageDescription() const { + return "waiting (" + myActType + ")"; + } + + /// proceeds to the next step + virtual void proceed(MSNet* net, MSPerson* person, SUMOTime now, MSEdge* previousEdge, const SUMOReal at); + + /** @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 on writing vehroute output + * + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + virtual void routeOutput(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; + + /// the time until the person is waiting + SUMOTime myWaitingUntil; + + /// the time the person is waiting + SUMOTime myWaitingStart; + + /// @brief The type of activity + std::string myActType; + + SUMOReal myStartPos; + + + private: + /// @brief Invalidated copy constructor. + MSPersonStage_Waiting(const MSPersonStage_Waiting&); + + /// @brief Invalidated assignment operator. + MSPersonStage_Waiting& operator=(const MSPersonStage_Waiting&); + + }; + +public: + /// the structure holding the plan of a person + typedef std::vector MSPersonPlan; + +public: + /// constructor + MSPerson(const SUMOVehicleParameter* pars, const MSVehicleType* vtype, MSPersonPlan* plan); + + /// destructor + virtual ~MSPerson(); + + /// returns the person id + const std::string& getID() const; + + /* @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; + + /// logs end of the step + void setDeparted(SUMOTime now); + + /// Returns the current destination. + const MSEdge& getDestination() const { + return (*myStep)->getDestination(); + } + + /// @brief Returns the current edge + const MSEdge* getEdge() const { + return (*myStep)->getEdge(); + } + + /// @brief Returns the departure edge + const MSEdge* getFromEdge() const { + return (*myStep)->getFromEdge(); + } + + /// @brief return the offset from the start of the current edge + virtual SUMOReal getEdgePos() const; + + /// @brief return the Network coordinate of the person + virtual Position getPosition() const; + + /// @brief return the current angle of the person + virtual SUMOReal getAngle() const; + + /// @brief the time this person spent waiting in seconds + virtual SUMOReal getWaitingSeconds() const; + + /// @brief the current speed of the person + virtual SUMOReal getSpeed() const; + + /// + StageType getCurrentStageType() const { + return (*myStep)->getStageType(); + } + + + std::string getCurrentStageDescription() const { + return (*myStep)->getStageDescription(); + } + + MSPersonStage* getCurrentStage() const { + return *myStep; + } + + /** @brief Called on writing tripinfo output + * + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + void tripInfoOutput(OutputDevice& os) const; + + /** @brief Called on writing vehroute output + * + * @param[in] os The stream to write the information into + * @exception IOError not yet implemented + */ + void routeOutput(OutputDevice& os) const; + + /// Whether the person waits for a vehicle of the line specified. + bool isWaitingFor(const std::string& line) const { + return (*myStep)->isWaitingFor(line); + } + + /// Whether the person waits for a vehicle + bool isWaiting4Vehicle() const { + return (*myStep)->isWaiting4Vehicle(); + } + + + const SUMOVehicleParameter& getParameter() const { + return *myParameter; + } + + + inline const MSVehicleType& getVehicleType() const { + return *myVType; + } + + +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; + + +private: + /// @brief Invalidated copy constructor. + MSPerson(const MSPerson&); + + /// @brief Invalidated assignment operator. + MSPerson& operator=(const MSPerson&); + +}; + + +#endif + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPModel.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPModel.cpp --- sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPModel.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPModel.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,128 @@ +/****************************************************************************/ +/// @file MSPModel.h +/// @author Jakob Erdmann +/// @date Mon, 13 Jan 2014 +/// @version $Id: MSPModel.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// The pedestrian following model (prototype) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 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 "MSPModel_Striping.h" +#include "MSPModel_NonInteracting.h" +#include "MSPModel.h" + + + + +// =========================================================================== +// static members +// =========================================================================== +MSPModel* MSPModel::myModel(0); + +// named constants +const int MSPModel::FORWARD(1); +const int MSPModel::BACKWARD(-1); +const int MSPModel::UNDEFINED_DIRECTION(0); + +// parameters shared by all models +const SUMOReal MSPModel::SAFETY_GAP(1.0); + +const SUMOReal MSPModel::SIDEWALK_OFFSET(3); + +// =========================================================================== +// MSPModel method definitions +// =========================================================================== + + +MSPModel* +MSPModel::getModel() { + if (myModel == 0) { + const OptionsCont& oc = OptionsCont::getOptions(); + MSNet* net = MSNet::getInstance(); + const std::string model = oc.getString("pedestrian.model"); + if (model == "striping") { + myModel = new MSPModel_Striping(oc, net); + } else if (model == "nonInteracting") { + myModel = new MSPModel_NonInteracting(oc, net); + } else { + throw ProcessError("Unknown pedestrian model '" + model + "'"); + } + } + return myModel; +} + + +void +MSPModel::cleanup() { + if (myModel != 0) { + myModel->cleanupHelper(); + delete myModel; + myModel = 0; + } +} + + +MSLane* +MSPModel::getSidewalk(const MSEdge* edge) { + if (edge == 0) { + return 0; + } + assert(edge->getLanes().size() > 0); + const std::vector& lanes = edge->getLanes(); + for (std::vector::const_iterator it = lanes.begin(); it != lanes.end(); ++it) { + if ((*it)->allowsVehicleClass(SVC_PEDESTRIAN)) { + return *it; + } + } + return lanes.front(); +} + + +bool +MSPModel::canTraverse(int dir, const ConstMSEdgeVector& route) { + const MSJunction* junction = 0; + for (ConstMSEdgeVector::const_iterator it = route.begin(); it != route.end(); ++it) { + const MSEdge* edge = *it; + if (junction != 0) { + //std::cout << " junction=" << junction->getID() << " edge=" << edge->getID() << "\n"; + if (junction == edge->getFromJunction()) { + dir = FORWARD; + } else if (junction == edge->getToJunction()) { + dir = BACKWARD; + } else { + return false; + } + } + junction = dir == FORWARD ? edge->getToJunction() : edge->getFromJunction(); + } + return true; +} + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPModel.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPModel.h --- sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPModel.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPModel.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,119 @@ +/****************************************************************************/ +/// @file MSPModel.h +/// @author Jakob Erdmann +/// @date Mon, 13 Jan 2014 +/// @version $Id: MSPModel.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// The pedestrian following model (prototype) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 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 MSPModel_h +#define MSPModel_h + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class MSNet; +class MSLane; +class MSJunction; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSPModel + * @brief The pedestrian following model + * + */ +class MSPModel { +public: + + static MSPModel* getModel(); + + /// @brief remove state at simulation end + static void cleanup(); + + /// @brief return the appropriate lane to walk on + static MSLane* getSidewalk(const MSEdge* edge); + + virtual ~MSPModel() {}; + + /// @brief register the given person as a pedestrian + virtual PedestrianState* add(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, SUMOTime now) = 0; + + /// @brief whether a pedestrian is blocking the crossing of lane at offset distToCrossing + virtual bool blockedAtDist(const MSLane* lane, SUMOReal distToCrossing, std::vector* collectBlockers) = 0; + + virtual void cleanupHelper() {}; + + // @brief walking directions + static const int FORWARD; + static const int BACKWARD; + static const int UNDEFINED_DIRECTION; + + // @brief the safety gap to keep between the car and the pedestrian in all directions + static const SUMOReal SAFETY_GAP; + + /// @brief the offset for computing person positions when walking on edges without a sidewalk + static const SUMOReal SIDEWALK_OFFSET; + + /// @brief return whether the route may traversed with the given starting direction + static bool canTraverse(int dir, const ConstMSEdgeVector& route); + +private: + static MSPModel* myModel; + +}; + + +/// @brief abstract base class for managing callbacks to retrieve various state information from the model +class PedestrianState { +public: + virtual ~PedestrianState() {}; + + /// @brief return the offset from the start of the current edge measured in its natural direction + virtual SUMOReal getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const = 0; + + /// @brief return the network coordinate of the person + virtual Position getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const = 0; + + /// @brief return the direction in which the person faces in degrees + virtual SUMOReal getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const = 0; + + /// @brief return the time the person spent standing + virtual SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const = 0; + + /// @brief return the current speed of the person + virtual SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking& stage) const = 0; +}; + + + +#endif /* MSPModel_h */ + diff -Nru sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPModel_NonInteracting.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPModel_NonInteracting.cpp --- sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPModel_NonInteracting.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPModel_NonInteracting.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,175 @@ +/****************************************************************************/ +/// @file MSPModel_NonInteracting.h +/// @author Jakob Erdmann +/// @date Mon, 13 Jan 2014 +/// @version $Id: MSPModel_NonInteracting.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// The pedestrian following model (prototype) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 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 "MSPModel_NonInteracting.h" + + +// =========================================================================== +// DEBUGGING HELPERS +// =========================================================================== +// +#define DEBUG1 "disabled" +#define DEBUG2 "disabled" +#define DEBUGCOND(PEDID) (PEDID == DEBUG1 || PEDID == DEBUG2) + +// =========================================================================== +// named (internal) constants +// =========================================================================== + + +// =========================================================================== +// static members +// =========================================================================== + + +// =========================================================================== +// MSPModel_NonInteracting method definitions +// =========================================================================== + +MSPModel_NonInteracting::MSPModel_NonInteracting(const OptionsCont& oc, MSNet* net) : + myNet(net) { + assert(myNet != 0); + UNUSED_PARAMETER(oc); +} + + +MSPModel_NonInteracting::~MSPModel_NonInteracting() { +} + + +PedestrianState* +MSPModel_NonInteracting::add(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, SUMOTime now) { + PState* state = new PState(); + const SUMOTime firstEdgeDuration = state->computeWalkingTime(0, *stage, now); + myNet->getBeginOfTimestepEvents()->addEvent(new MoveToNextEdge(person, *stage), + now + firstEdgeDuration, MSEventControl::ADAPT_AFTER_EXECUTION); + + //if DEBUGCOND(person->getID()) std::cout << SIMTIME << " " << person->getID() << " inserted on " << stage->getEdge()->getID() << "\n"; + return state; +} + + +bool +MSPModel_NonInteracting::blockedAtDist(const MSLane*, SUMOReal, std::vector*) { + return false; +} + + +SUMOTime +MSPModel_NonInteracting::MoveToNextEdge::execute(SUMOTime currentTime) { + PState* state = dynamic_cast(myParent.getPedestrianState()); + const MSEdge* old = myParent.getEdge(); + const bool arrived = myParent.moveToNextEdge(myPerson, currentTime); + if (arrived) { + // walk finished. clean up state + delete state; + //if DEBUGCOND(myPerson->getID()) std::cout << SIMTIME << " " << myPerson->getID() << " arrived on " << old->getID() << "\n"; + return 0; + } else { + //if DEBUGCOND(myPerson->getID()) std::cout << SIMTIME << " " << myPerson->getID() << " moves to " << myParent.getEdge()->getID() << "\n"; + return state->computeWalkingTime(old, myParent, currentTime); + } +} + + +SUMOTime +MSPModel_NonInteracting::PState::computeWalkingTime(const MSEdge* prev, const MSPerson::MSPersonStage_Walking& stage, SUMOTime currentTime) { + myLastEntryTime = currentTime; + const MSEdge* edge = stage.getEdge(); + const MSEdge* next = stage.getNextRouteEdge(); + int dir = UNDEFINED_DIRECTION; + if (prev == 0) { + myCurrentBeginPos = stage.getDepartPos(); + } else { + // default to FORWARD if not connected + dir = (edge->getToJunction() == prev->getToJunction() || edge->getToJunction() == prev->getFromJunction()) ? BACKWARD : FORWARD; + myCurrentBeginPos = dir == FORWARD ? 0 : edge->getLength(); + } + if (next == 0) { + myCurrentEndPos = stage.getArrivalPos(); + } else { + if (dir == UNDEFINED_DIRECTION) { + // default to FORWARD if not connected + dir = (edge->getFromJunction() == next->getFromJunction() || edge->getFromJunction() == next->getToJunction()) ? BACKWARD : FORWARD; + } + myCurrentEndPos = dir == FORWARD ? edge->getLength() : 0; + } + // ensure that a result > 0 is returned even if the walk ends immediately + myCurrentDuration = MAX2((SUMOTime)1, TIME2STEPS(fabs(myCurrentEndPos - myCurrentBeginPos) / stage.getMaxSpeed())); + //std::cout << SIMTIME << " dir=" << dir << " curBeg=" << myCurrentBeginPos << " curEnd=" << myCurrentEndPos << " speed=" << stage.getMaxSpeed() << " dur=" << myCurrentDuration << "\n"; + return myCurrentDuration; +} + + +SUMOReal +MSPModel_NonInteracting::PState::getEdgePos(const MSPerson::MSPersonStage_Walking&, SUMOTime now) const { + //std::cout << SIMTIME << " pos=" << (myCurrentBeginPos + (myCurrentEndPos - myCurrentBeginPos) / myCurrentDuration * (now - myLastEntryTime)) << "\n"; + return myCurrentBeginPos + (myCurrentEndPos - myCurrentBeginPos) / myCurrentDuration * (now - myLastEntryTime); +} + + +Position +MSPModel_NonInteracting::PState::getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const { + const MSLane* lane = getSidewalk(stage.getEdge()); + const SUMOReal lateral_offset = lane->allowsVehicleClass(SVC_PEDESTRIAN) ? 0 : SIDEWALK_OFFSET; + return stage.getLanePosition(lane, getEdgePos(stage, now), lateral_offset); +} + + +SUMOReal +MSPModel_NonInteracting::PState::getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const { + //std::cout << SIMTIME << " rawAngle=" << stage.getEdgeAngle(stage.getEdge(), getEdgePos(stage, now)) << " angle=" << stage.getEdgeAngle(stage.getEdge(), getEdgePos(stage, now)) + (myCurrentEndPos < myCurrentBeginPos ? 180 : 0) << "\n"; + SUMOReal angle = stage.getEdgeAngle(stage.getEdge(), getEdgePos(stage, now)) + (myCurrentEndPos < myCurrentBeginPos ? 180 : 0); + if (angle > 180) { + angle -= 360; + } + return angle; +} + + +SUMOTime +MSPModel_NonInteracting::PState::getWaitingTime(const MSPerson::MSPersonStage_Walking&, SUMOTime) const { + return 0; +} + + +SUMOReal +MSPModel_NonInteracting::PState::getSpeed(const MSPerson::MSPersonStage_Walking& stage) const { + return stage.getMaxSpeed(); +} + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPModel_NonInteracting.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPModel_NonInteracting.h --- sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPModel_NonInteracting.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPModel_NonInteracting.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,119 @@ +/****************************************************************************/ +/// @file MSPModel_NonInteracting.h +/// @author Jakob Erdmann +/// @date Mon, 13 Jan 2014 +/// @version $Id: MSPModel_NonInteracting.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// The pedestrian following model (prototype) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 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 MSPModel_NonInteracting_h +#define MSPModel_NonInteracting_h + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include "MSPerson.h" +#include "MSPModel.h" + +// =========================================================================== +// class declarations +// =========================================================================== +class MSNet; +class MSLink; +class MSLane; +class MSJunction; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSPModel_NonInteracting + * @brief The pedestrian following model + * + */ +class MSPModel_NonInteracting : public MSPModel { +public: + + /// @brief Constructor (it should not be necessary to construct more than one instance) + MSPModel_NonInteracting(const OptionsCont& oc, MSNet* net); + + ~MSPModel_NonInteracting(); + + /// @brief register the given person as a pedestrian + PedestrianState* add(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, SUMOTime now); + + /// @brief whether a pedestrian is blocking the crossing of lane at offset distToCrossing + bool blockedAtDist(const MSLane* lane, SUMOReal distToCrossing, std::vector* collectBlockers); + +private: + class MoveToNextEdge : public Command { + public: + MoveToNextEdge(MSPerson* person, MSPerson::MSPersonStage_Walking& walk) : myParent(walk), myPerson(person) {} + ~MoveToNextEdge() {} + SUMOTime execute(SUMOTime currentTime); + + private: + MSPerson::MSPersonStage_Walking& myParent; + MSPerson* myPerson; + private: + /// @brief Invalidated assignment operator. + MoveToNextEdge& operator=(const MoveToNextEdge&); + }; + + /// @brief abstract base class for managing callbacks to retrieve various state information from the model + class PState : public PedestrianState { + public: + PState() {}; + + /// @brief abstract methods inherited from PedestrianState + /// @{ + SUMOReal getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; + Position getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; + SUMOReal getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; + SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; + SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking& stage) const; + /// @} + + /// @brief compute walking time on edge and update state members + SUMOTime computeWalkingTime(const MSEdge* prev, const MSPerson::MSPersonStage_Walking& stage, SUMOTime currentTime); + + + private: + SUMOTime myLastEntryTime; + SUMOTime myCurrentDuration; + SUMOReal myCurrentBeginPos; + SUMOReal myCurrentEndPos; + + }; + +private: + /// @brief the net to which to issue moveToNextEdge commands + MSNet* myNet; + +}; + + +#endif /* MSPModel_NonInteracting_h */ + diff -Nru sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPModel_Striping.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPModel_Striping.cpp --- sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPModel_Striping.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPModel_Striping.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,1200 @@ +/****************************************************************************/ +/// @file MSPModel_Striping.h +/// @author Jakob Erdmann +/// @date Mon, 13 Jan 2014 +/// @version $Id: MSPModel_Striping.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// The pedestrian following model (prototype) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 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 "MSPModel_Striping.h" + + +// =========================================================================== +// DEBUGGING HELPERS +// =========================================================================== +// +#define DEBUG1 "disabled" +#define DEBUG2 "disabled" +#define DEBUGCOND(PEDID) (PEDID == DEBUG1 || PEDID == DEBUG2) +//#define LOG_ALL 1 + +void MSPModel_Striping::DEBUG_PRINT(const Obstacles& obs) { + for (int i = 0; i < (int)obs.size(); ++i) { + std::cout + << "(" << obs[i].description + << " x=" << obs[i].x + << " s=" << obs[i].speed + << ") "; + } + std::cout << "\n"; +} + +// =========================================================================== +// named (internal) constants +// =========================================================================== + + +// need to be able to subtract without underflow +#define BLOCKED_STRIPE -10000 +#define FAR_AWAY 10000 +#define ONCOMING_CONFLICT -1000 + +// =========================================================================== +// static members +// =========================================================================== + +MSPModel_Striping::WalkingAreaPaths MSPModel_Striping::myWalkingAreaPaths; +MSPModel_Striping::Pedestrians MSPModel_Striping::noPedestrians; + + +// model parameters (static to simplify access from class PState +SUMOReal MSPModel_Striping::stripeWidth; +SUMOReal MSPModel_Striping::dawdling; +SUMOTime MSPModel_Striping::jamTime; +const SUMOReal MSPModel_Striping::LOOKAHEAD_SAMEDIR(4.0); // seconds +const SUMOReal MSPModel_Striping::LOOKAHEAD_ONCOMING(10.0); // seconds +const SUMOReal MSPModel_Striping::LATERAL_PENALTY(-1); +const SUMOReal MSPModel_Striping::SQUEEZE(0.7); +const SUMOReal MSPModel_Striping::BLOCKER_LOOKAHEAD(10.0); +const SUMOReal MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR(0.0); +const SUMOReal MSPModel_Striping::MAX_WAIT_TOLERANCE(120.); // seconds +const SUMOReal MSPModel_Striping::LATERAL_SPEED_FACTOR(0.4); +const SUMOReal MSPModel_Striping::MIN_STARTUP_SPEED(0.3); + + +// =========================================================================== +// MSPModel_Striping method definitions +// =========================================================================== + +MSPModel_Striping::MSPModel_Striping(const OptionsCont& oc, MSNet* net) : + myNumActivePedestrians(0) { + myCommand = new MovePedestrians(this); + net->getBeginOfTimestepEvents()->addEvent(myCommand, net->getCurrentTimeStep() + DELTA_T, MSEventControl::ADAPT_AFTER_EXECUTION); + initWalkingAreaPaths(net); + // configurable parameters + stripeWidth = oc.getFloat("pedestrian.striping.stripe-width"); + dawdling = oc.getFloat("pedestrian.striping.dawdling"); + + jamTime = string2time(oc.getString("pedestrian.striping.jamtime")); + if (jamTime <= 0) { + jamTime = SUMOTime_MAX; + } +} + + +MSPModel_Striping::~MSPModel_Striping() { +} + + +PedestrianState* +MSPModel_Striping::add(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, SUMOTime) { + assert(person->getCurrentStageType() == MSPerson::WALKING); + const MSLane* lane = getSidewalk(person->getEdge()); + PState* ped = new PState(person, stage, lane); + myActiveLanes[lane].push_back(ped); + myNumActivePedestrians++; + return ped; +} + + +bool +MSPModel_Striping::blockedAtDist(const MSLane* lane, SUMOReal distToCrossing, std::vector* collectBlockers) { + const Pedestrians& pedestrians = getPedestrians(lane); + for (Pedestrians::const_iterator it_ped = pedestrians.begin(); it_ped != pedestrians.end(); ++it_ped) { + const PState& ped = **it_ped; + const SUMOReal halfVehicleWidth = 1.0; // @note could get the actual value from the vehicle + const SUMOReal leaderBackDist = (ped.myDir == FORWARD + ? distToCrossing - (ped.myRelX - ped.getLength() - MSPModel::SAFETY_GAP - halfVehicleWidth) + : (ped.myRelX + ped.getLength() + MSPModel::SAFETY_GAP + halfVehicleWidth) - distToCrossing); + //std::cout << SIMTIME << " foe=" << foeLane->getID() << " dir=" << p.myDir << " pX=" << ped.myRelX << " pL=" << ped.getLength() << " fDTC=" << distToCrossing << " lBD=" << leaderBackDist << "\n"; + if (leaderBackDist >= 0 && leaderBackDist <= BLOCKER_LOOKAHEAD) { + // found one pedestrian that is not completely past the crossing point + //std::cout << SIMTIME << " blocking pedestrian foeLane=" << lane->getID() << " ped=" << ped.myPerson->getID() << " dir=" << ped.myDir << " pX=" << ped.myRelX << " pL=" << ped.getLength() << " fDTC=" << distToCrossing << " lBD=" << leaderBackDist << "\n"; + if (collectBlockers == 0) { + return true; + } else { + collectBlockers->push_back(ped.myPerson); + } + } + } + if (collectBlockers == 0) { + return false; + } else { + return collectBlockers->size() > 0; + } +} + + +MSPModel_Striping::Pedestrians& +MSPModel_Striping::getPedestrians(const MSLane* lane) { + ActiveLanes::iterator it = myActiveLanes.find(lane); + if (it != myActiveLanes.end()) { + //std::cout << " found lane=" << lane->getID() << " n=" << it->second.size() << "\n"; + return (it->second); + } else { + return noPedestrians; + } +} + + +void +MSPModel_Striping::cleanupHelper() { + myActiveLanes.clear(); + myNumActivePedestrians = 0; + myWalkingAreaPaths.clear(); // need to recompute when lane pointers change +} + + +int +MSPModel_Striping::numStripes(const MSLane* lane) { + return (int)floor(lane->getWidth() / stripeWidth); +} + +int +MSPModel_Striping::connectedDirection(const MSLane* from, const MSLane* to) { + if (from == 0 || to == 0) { + return UNDEFINED_DIRECTION; + } else if (MSLinkContHelper::getConnectingLink(*from, *to)) { + return FORWARD; + } else if (MSLinkContHelper::getConnectingLink(*to, *from)) { + return BACKWARD; + } else { + return UNDEFINED_DIRECTION; + } +} + + +void +MSPModel_Striping::initWalkingAreaPaths(const MSNet*) { + if (myWalkingAreaPaths.size() > 0) { + return; + } + for (size_t i = 0; i < MSEdge::dictSize(); ++i) { + const MSEdge* edge = MSEdge::dictionary(i); + if (edge->isWalkingArea()) { + const MSLane* walkingArea = getSidewalk(edge); + // build all possible paths across this walkingArea + // gather all incident lanes + std::vector lanes; + const MSEdgeVector& incoming = edge->getIncomingEdges(); + for (int j = 0; j < (int)incoming.size(); ++j) { + lanes.push_back(getSidewalk(incoming[j])); + } + const MSEdgeVector& outgoing = edge->getSuccessors(); + for (int j = 0; j < (int)outgoing.size(); ++j) { + lanes.push_back(getSidewalk(outgoing[j])); + } + // build all combinations + for (int j = 0; j < (int)lanes.size(); ++j) { + for (int k = 0; k < (int)lanes.size(); ++k) { + if (j != k) { + // build the walkingArea + const MSLane* from = lanes[j]; + const MSLane* to = lanes[k]; + const int fromDir = MSLinkContHelper::getConnectingLink(*from, *walkingArea) != 0 ? FORWARD : BACKWARD; + const int toDir = MSLinkContHelper::getConnectingLink(*walkingArea, *to) != 0 ? FORWARD : BACKWARD; + PositionVector shape; + Position fromPos = from->getShape()[fromDir == FORWARD ? -1 : 0]; + Position toPos = to->getShape()[toDir == FORWARD ? 0 : -1]; + const SUMOReal maxExtent = fromPos.distanceTo2D(toPos) / 4; // prevent sharp corners + const SUMOReal extrapolateBy = MIN2(maxExtent, walkingArea->getWidth() / 2); + // assemble shape + shape.push_back(fromPos); + if (extrapolateBy > POSITION_EPS) { + PositionVector fromShp = from->getShape(); + fromShp.extrapolate(extrapolateBy); + shape.push_back_noDoublePos(fromDir == FORWARD ? fromShp.back() : fromShp.front()); + PositionVector nextShp = to->getShape(); + nextShp.extrapolate(extrapolateBy); + shape.push_back_noDoublePos(toDir == FORWARD ? nextShp.front() : nextShp.back()); + } + shape.push_back_noDoublePos(toPos); + if (shape.size() < 2) { + PositionVector fromShp = from->getShape(); + fromShp.extrapolate(1.5 * POSITION_EPS); // noDoublePos requires a difference of POSITION_EPS in at least one coordinate + shape.push_back_noDoublePos(fromDir == FORWARD ? fromShp.back() : fromShp.front()); + assert(shape.size() == 2); + } + if (fromDir == BACKWARD) { + // will be walking backward on walkingArea + shape = shape.reverse(); + } + myWalkingAreaPaths[std::make_pair(from, to)] = WalkingAreaPath(from, walkingArea, to, shape); + } + } + } + } + } +} + + +MSPModel_Striping::NextLaneInfo +MSPModel_Striping::getNextLane(const PState& ped, const MSLane* currentLane, const MSLane* prevLane) { + const MSEdge* currentEdge = ¤tLane->getEdge(); + const MSJunction* junction = ped.myDir == FORWARD ? currentEdge->getToJunction() : currentEdge->getFromJunction(); + const MSEdge* nextRouteEdge = ped.myStage->getNextRouteEdge(); + const MSLane* nextRouteLane = getSidewalk(nextRouteEdge); + // result values + const MSLane* nextLane = nextRouteLane; + MSLink* link = 0; + int nextDir = UNDEFINED_DIRECTION; + + if (nextRouteLane != 0) { + if (currentEdge->isInternal()) { + assert(junction == currentEdge->getFromJunction()); + nextDir = junction == nextRouteEdge->getFromJunction() ? FORWARD : BACKWARD; + if DEBUGCOND(ped.myPerson->getID()) { + std::cout << " internal\n"; + } + } else if (currentEdge->isCrossing()) { + nextDir = ped.myDir; + if (ped.myDir == FORWARD) { + nextLane = currentLane->getLinkCont()[0]->getLane(); + } else { + nextLane = currentLane->getLogicalPredecessorLane(); + } + if DEBUGCOND(ped.myPerson->getID()) { + std::cout << " crossing\n"; + } + } else if (currentEdge->isWalkingArea()) { + ConstMSEdgeVector crossingRoute; + // departPos can be 0 because the direction of the walkingArea does not matter + // for the arrivalPos, we need to make sure that the route does not deviate across other junctions + const int nextRouteEdgeDir = nextRouteEdge->getFromJunction() == junction ? FORWARD : BACKWARD; + const SUMOReal arrivalPos = (nextRouteEdge == ped.myStage->getRoute().back() + ? ped.myStage->getArrivalPos() + : (nextRouteEdgeDir == FORWARD ? 0 : nextRouteEdge->getLength())); + MSEdgeVector prohibited; + prohibited.push_back(&prevLane->getEdge()); + MSNet::getInstance()->getPedestrianRouter(prohibited).compute(currentEdge, nextRouteEdge, 0, arrivalPos, ped.myStage->getMaxSpeed(), 0, junction, crossingRoute, true); + if DEBUGCOND(ped.myPerson->getID()) { + std::cout + << " nre=" << nextRouteEdge->getID() + << " nreDir=" << nextRouteEdgeDir + << " aPos=" << arrivalPos + << " crossingRoute=" << toString(crossingRoute) + << "\n"; + } + if (crossingRoute.size() > 1) { + const MSEdge* nextEdge = crossingRoute[1]; + nextLane = getSidewalk(crossingRoute[1]); + assert((nextEdge->getFromJunction() == junction || nextEdge->getToJunction() == junction)); + assert(nextLane != prevLane); + nextDir = connectedDirection(currentLane, nextLane); + if DEBUGCOND(ped.myPerson->getID()) { + std::cout << " nextDir=" << nextDir << "\n"; + } + assert(nextDir != UNDEFINED_DIRECTION); + if (nextDir == FORWARD) { + link = MSLinkContHelper::getConnectingLink(*currentLane, *nextLane); + } else if (nextEdge->isCrossing()) { + const MSLane* oppositeWalkingArea = nextLane->getLogicalPredecessorLane(); + link = MSLinkContHelper::getConnectingLink(*oppositeWalkingArea, *nextLane); + } else { + link = MSLinkContHelper::getConnectingLink(*nextLane, *currentLane); + } + assert(link != 0); + } else { + if DEBUGCOND(ped.myPerson->getID()) { + std::cout << SIMTIME + << " no route from '" << (currentEdge == 0 ? "NULL" : currentEdge->getID()) + << "' to '" << (nextRouteEdge == 0 ? "NULL" : nextRouteEdge->getID()) + << "\n"; + } + // error indicated by nextDir == UNDEFINED_DIRECTION + } + } else if (currentEdge == nextRouteEdge) { + // strange loop in this route. No need to use walkingArea + nextDir = -ped.myDir; + } else { + // normal edge. by default use next / previous walking area + nextDir = ped.myDir; + nextLane = getNextWalkingArea(currentLane, ped.myDir, link); + if (nextLane != 0) { + // walking area found + if DEBUGCOND(ped.myPerson->getID()) { + std::cout << " next walkingArea " << (nextDir == FORWARD ? "forward" : "backward") << "\n"; + } + } else { + nextDir = junction == nextRouteEdge->getFromJunction() ? FORWARD : BACKWARD; + // try to use a direct link as fallback + // direct links only exist if built explicitly. They are used to model tl-controlled links if there are no crossings + if (ped.myDir == FORWARD) { + link = MSLinkContHelper::getConnectingLink(*currentLane, *nextRouteLane); +#ifdef HAVE_INTERNAL_LANES + if (link != 0) { + if DEBUGCOND(ped.myPerson->getID()) { + std::cout << " direct forward\n"; + } + nextLane = MSLinkContHelper::getInternalFollowingLane(currentLane, nextRouteLane); + } +#endif + } else { + link = MSLinkContHelper::getConnectingLink(*nextRouteLane, *currentLane); +#ifdef HAVE_INTERNAL_LANES + if (link != 0) { + if DEBUGCOND(ped.myPerson->getID()) { + std::cout << " direct backward\n"; + } + nextLane = MSLinkContHelper::getInternalFollowingLane(nextRouteLane, currentLane); + } +#endif + } + } + if (nextLane == 0) { + // no internal lane found + nextLane = nextRouteLane; + if DEBUGCOND(ped.myPerson->getID()) { + std::cout << SIMTIME << " no next lane found for " << currentLane->getID() << " dir=" << ped.myDir << "\n"; + } + } else if (nextLane->getLength() <= POSITION_EPS) { + // internal lane too short + nextLane = nextRouteLane; + } + } + } + if DEBUGCOND(ped.myPerson->getID()) { + std::cout << SIMTIME + << " p=" << ped.myPerson->getID() + << " l=" << currentLane->getID() + << " nl=" << (nextLane == 0 ? "NULL" : nextLane->getID()) + << " nrl=" << (nextRouteLane == 0 ? "NULL" : nextRouteLane->getID()) + << " d=" << nextDir + << " link=" << (link == 0 ? "NULL" : link->getViaLaneOrLane()->getID()) + << " pedDir=" << ped.myDir + << "\n"; + } + return NextLaneInfo(nextLane, link, nextDir); +} + + +const MSLane* +MSPModel_Striping::getNextWalkingArea(const MSLane* currentLane, const int dir, MSLink*& link) { + if (dir == FORWARD) { + const MSLinkCont& links = currentLane->getLinkCont(); + for (MSLinkCont::const_iterator it = links.begin(); it != links.end(); ++it) { + if ((*it)->getLane()->getEdge().isWalkingArea()) { + link = *it; + return (*it)->getLane(); + } + } + } else { + const std::vector& laneInfos = currentLane->getIncomingLanes(); + for (std::vector::const_iterator it = laneInfos.begin(); it != laneInfos.end(); ++it) { + if ((*it).lane->getEdge().isWalkingArea()) { + link = (*it).viaLink; + return (*it).lane; + } + } + } + return 0; +} + + +MSPModel_Striping::Obstacles +MSPModel_Striping::mergeObstacles(const Obstacles& obs1, const Obstacles& obs2, int dir) { + Obstacles result(obs1.begin(), obs1.end()); + for (int i = 0; i < (int)obs1.size(); ++i) { + if ((obs2[i].x - obs1[i].x) * dir < 0) { + result[i] = obs2[i]; + } + } + return result; +} + + +MSPModel_Striping::Obstacles +MSPModel_Striping::getNeighboringObstacles(const Pedestrians& pedestrians, int egoIndex, int stripes) { + const PState& ego = *pedestrians[egoIndex]; + const SUMOReal egoBack = ego.myRelX - ego.myDir * ego.getLength(); + int index = egoIndex + 1; + Obstacles obs(stripes, Obstacle(ego.myDir)); + while (index < (int)pedestrians.size() && ego.myDir * (pedestrians[index]->myRelX - egoBack) > 0) { + const PState& p = *pedestrians[index]; + if (!p.myWaitingToEnter) { + Obstacle o(p, ego.myDir); + obs[p.stripe()] = o; + obs[p.otherStripe()] = o; + } + index++; + } + if DEBUGCOND(ego.myPerson->getID()) { + std::cout << SIMTIME << " ped=" << ego.myPerson->getID() << " neighObs="; + DEBUG_PRINT(obs); + } + return obs; +} + + +const MSPModel_Striping::Obstacles& +MSPModel_Striping::getNextLaneObstacles(NextLanesObstacles& nextLanesObs, const + MSLane* lane, const MSLane* nextLane, int stripes, SUMOReal nextLength, int nextDir, + SUMOReal currentLength, int currentDir) { + if (nextLanesObs.count(nextLane) == 0) { + //std::cout << SIMTIME << " getNextLaneObstacles" + // << " nextLane=" << nextLane->getID() + // << " nextLength=" << nextLength + // << " nextDir=" << nextDir + // << " currentLength=" << currentLength + // << " currentDir=" << currentDir + // << "\n"; + + // figure out the which pedestrians are ahead on the next lane + const int nextStripes = numStripes(nextLane); + const int offset = (stripes - nextStripes) / 2; + Obstacles obs(stripes, Obstacle(nextDir)); + if (nextStripes < stripes) { + // some stripes do not continue + for (int ii = 0; ii < stripes; ++ii) { + if (ii < offset || ii >= nextStripes + offset) { + obs[ii] = Obstacle(nextDir == FORWARD ? 0 : nextLength, 0, "stripeEnd"); + } + } + } + Pedestrians& pedestrians = getPedestrians(nextLane); + if (nextLane->getEdge().isWalkingArea()) { + const SUMOReal maxY = stripeWidth * (stripes - 0.5) - NUMERICAL_EPS; + // complex transformation into the coordinate system of the current lane + // (pedestrians on next lane may walk at arbitrary angles relative to the current lane) + const SUMOReal lateral_offset = (lane->getWidth() - stripeWidth) * 0.5; + nextDir = currentDir; + // transform pedestrians into the current coordinate system + for (int ii = 0; ii < (int)pedestrians.size(); ++ii) { + PState& p = *pedestrians[ii]; + Position relPos = lane->getShape().transformToVectorCoordinates(p.getPosition(*p.myStage, -1), true); + const SUMOReal newY = relPos.y() + lateral_offset; + if (newY >= 0 && newY <= maxY) { + addCloserObstacle(obs, relPos.x(), p.stripe(newY), p.myPerson->getID(), stripes, currentDir); + addCloserObstacle(obs, relPos.x(), p.otherStripe(newY), p.myPerson->getID(), stripes, currentDir); + } + } + } else { + // simple transformation into the coordinate system of the current lane + // (only need to worry about currentDir and nextDir) + // XXX consider waitingToEnter on nextLane + sort(pedestrians.begin(), pedestrians.end(), by_xpos_sorter(nextDir)); + for (int ii = 0; ii < (int)pedestrians.size(); ++ii) { + const PState& p = *pedestrians[ii]; + if (p.myWaitingToEnter) { + continue; + } + addMappedObstacle(obs, p, p.stripe(), currentDir, nextDir, offset, stripes, nextStripes); + addMappedObstacle(obs, p, p.otherStripe(), currentDir, nextDir, offset, stripes, nextStripes); + } + for (int ii = 0; ii < stripes; ++ii) { + Obstacle& o = obs[ii]; + if (nextDir == BACKWARD) { + o.x = nextLength - o.x; + } + if (currentDir == FORWARD) { + o.x += currentLength; + } else { + o.x *= -1; + } + } + } + nextLanesObs[nextLane] = obs; + } + return nextLanesObs[nextLane]; +} + + +void +MSPModel_Striping::addMappedObstacle(Obstacles& obs, const PState& p, int stripe, int currentDir, int nextDir, int offset, int stripes, int nextStripes) { + const int mappedStripe = (nextDir == currentDir + ? stripe + offset + : nextStripes - 1 - stripe + offset); + if (mappedStripe >= 0 && mappedStripe < stripes) { + obs[mappedStripe] = Obstacle(p, nextDir); + } +} + + +void +MSPModel_Striping::addCloserObstacle(Obstacles& obs, SUMOReal x, int stripe, const std::string& id, int stripes, int dir) { + if (stripe < stripes && obs[stripe].x * dir > x * dir) { + obs[stripe] = Obstacle(x, 0, id); + } +} + +void +MSPModel_Striping::moveInDirection(SUMOTime currentTime, std::set& changedLane, int dir) { + for (ActiveLanes::iterator it_lane = myActiveLanes.begin(); it_lane != myActiveLanes.end(); ++it_lane) { + const MSLane* lane = it_lane->first; + Pedestrians& pedestrians = it_lane->second; + //std::cout << SIMTIME << ">>> lane=" << lane->getID() << " numPeds=" << pedestrians.size() << "\n"; + if (lane->getEdge().isWalkingArea()) { + const SUMOReal lateral_offset = (lane->getWidth() - stripeWidth) * 0.5; + const WalkingAreaPath* debugPath = 0; + // need to handle each walkingAreaPath seperately and transform + // coordinates beforehand + std::set paths; + for (Pedestrians::iterator it = pedestrians.begin(); it != pedestrians.end(); ++it) { + const PState* p = *it; + assert(p->myWalkingAreaPath != 0); + if (p->myDir == dir) { + paths.insert(p->myWalkingAreaPath); + if DEBUGCOND(p->myPerson->getID()) { + debugPath = p->myWalkingAreaPath; + std::cout << SIMTIME << " debugging WalkingAreaPath from=" << debugPath->from->getID() << " to=" << debugPath->to->getID() << "\n"; + } + } + } + for (std::set::iterator it = paths.begin(); it != paths.end(); ++it) { + const WalkingAreaPath* path = *it; + Pedestrians toDelete; + Pedestrians transformedPeds; + transformedPeds.reserve(pedestrians.size()); + for (Pedestrians::iterator it_p = pedestrians.begin(); it_p != pedestrians.end(); ++it_p) { + PState* p = *it_p; + if (p->myWalkingAreaPath == path + // opposite direction is already in the correct coordinate system + || (p->myWalkingAreaPath->from == path->to && p->myWalkingAreaPath->to == path->from)) { + transformedPeds.push_back(p); + if (path == debugPath) std::cout << " ped=" << p->myPerson->getID() << " relX=" << p->myRelX << " relY=" << p->myRelY << " (untransformed), vecCoord=" + << path->shape.transformToVectorCoordinates(p->getPosition(*p->myStage, -1)) << "\n"; + } else { + const Position relPos = path->shape.transformToVectorCoordinates(p->getPosition(*p->myStage, -1)); + const SUMOReal newY = relPos.y() + lateral_offset; + if (relPos != Position::INVALID && + newY >= 0 && newY <= lane->getWidth()) { + PState* tp = new PState(*p); + tp->myRelX = relPos.x(); + tp->myRelY = newY; + // only an obstacle, speed may be orthogonal to dir + tp->myDir = !dir; + tp->mySpeed = 0; + toDelete.push_back(tp); + transformedPeds.push_back(tp); + if (path == debugPath) { + std::cout << " ped=" << p->myPerson->getID() << " relX=" << relPos.x() << " relY=" << newY << " (transformed), vecCoord=" << relPos << "\n"; + } + } else { + if (path == debugPath) { + std::cout << " ped=" << p->myPerson->getID() << " relX=" << relPos.x() << " relY=" << newY << " (invalid), vecCoord=" << relPos << "\n"; + } + } + } + } + moveInDirectionOnLane(transformedPeds, lane, currentTime, changedLane, dir); + // clean up + for (Pedestrians::iterator it_p = toDelete.begin(); it_p != toDelete.end(); ++it_p) { + delete *it_p; + } + }; + + } else { + moveInDirectionOnLane(pedestrians, lane, currentTime, changedLane, dir); + } + // advance to the next lane / arrive at destination + sort(pedestrians.begin(), pedestrians.end(), by_xpos_sorter(dir)); + for (Pedestrians::iterator it = pedestrians.begin(); it != pedestrians.end();) { + PState* p = *it; + if (p->myDir != dir) { + ++it; + } else if (p->moveToNextLane(currentTime)) { + it = pedestrians.erase(it); + if (p->myLane != 0) { + changedLane.insert(p->myPerson); + myActiveLanes[p->myLane].push_back(p); + } else { + delete p; + myNumActivePedestrians--; + } + } else { + ++it; + } + } + } +} + + +void +MSPModel_Striping::moveInDirectionOnLane(Pedestrians& pedestrians, const MSLane* lane, SUMOTime currentTime, std::set& changedLane, int dir) { + const int stripes = numStripes(lane); + Obstacles obs(stripes, Obstacle(dir)); // continously updated + NextLanesObstacles nextLanesObs; // continously updated + sort(pedestrians.begin(), pedestrians.end(), by_xpos_sorter(dir)); + for (int ii = 0; ii < (int)pedestrians.size(); ++ii) { + PState& p = *pedestrians[ii]; + //std::cout << SIMTIME << "CHECKING" << p.myPerson->getID() << "\n"; + Obstacles currentObs = obs; + if (p.myDir != dir || changedLane.count(p.myPerson) != 0) { + if (!p.myWaitingToEnter) { + Obstacle o(p, dir); + obs[p.stripe()] = o; + obs[p.otherStripe()] = o; + } + continue; + } + if DEBUGCOND(p.myPerson->getID()) { + std::cout << SIMTIME << " ped=" << p.myPerson->getID() << " currentObs="; + DEBUG_PRINT(currentObs); + } + const MSLane* nextLane = p.myNLI.lane; + const MSLink* link = p.myNLI.link; + const SUMOReal dist = p.distToLaneEnd(); + const SUMOReal speed = p.myStage->getMaxSpeed(); + if (nextLane != 0 && dist <= LOOKAHEAD_ONCOMING) { + const SUMOReal currentLength = (p.myWalkingAreaPath == 0 ? lane->getLength() : p.myWalkingAreaPath->length); + const SUMOReal nextLength = nextLane->getLength(); // XXX what to do if nextLane is a walkingArea? + const Obstacles& nextObs = getNextLaneObstacles( + nextLanesObs, lane, nextLane, stripes, + nextLength, p.myNLI.dir, + currentLength, dir); + + if DEBUGCOND(p.myPerson->getID()) { + std::cout << SIMTIME << " ped=" << p.myPerson->getID() << " nextObs="; + DEBUG_PRINT(nextObs); + } + currentObs = mergeObstacles(currentObs, nextObs, dir); + } + if DEBUGCOND(p.myPerson->getID()) { + std::cout << SIMTIME << " ped=" << p.myPerson->getID() << " obsWithNext="; + DEBUG_PRINT(currentObs); + } + currentObs = mergeObstacles(currentObs, getNeighboringObstacles(pedestrians, ii, stripes), dir); + if DEBUGCOND(p.myPerson->getID()) { + std::cout << SIMTIME << " ped=" << p.myPerson->getID() << " obsWithNeigh="; + DEBUG_PRINT(currentObs); + } + // check link state + if (link != 0 + && dist < speed // only check close before junction + && (!link->opened(currentTime, speed, speed, p.getLength(), p.getImpatience(currentTime), speed, 0) + // XXX check for presence of vehicles blocking the path + )) { + // prevent movement passed a closed link + Obstacles closedLink(stripes, Obstacle(p.myRelX + dir * dist - POSITION_EPS, 0, "closedLink")); + currentObs = mergeObstacles(currentObs, closedLink, dir); + if DEBUGCOND(p.myPerson->getID()) { + std::cout << SIMTIME << " ped=" << p.myPerson->getID() << " obsWitTLS="; + DEBUG_PRINT(currentObs); + } + // consider rerouting over another crossing + if (p.myWalkingAreaPath != 0) { + // XXX actually another path would be needed starting at the current position + p.myNLI = getNextLane(p, p.myLane, p.myWalkingAreaPath->from); + } + } + p.walk(currentObs, currentTime); + if (!p.myWaitingToEnter) { + Obstacle o(p, dir); + obs[p.stripe()] = o; + obs[p.otherStripe()] = o; + } + //std::cout << SIMTIME << p.myPerson->getID() << " lane=" << lane->getID() << " x=" << p.myRelX << "\n"; + } +} + + +// =========================================================================== +// MSPModel_Striping::Obstacle method definitions +// =========================================================================== +MSPModel_Striping::Obstacle::Obstacle(int dir) : + x(dir* FAR_AWAY), // far away when seen in dir + speed(0), + description("") +{} + + +MSPModel_Striping::Obstacle::Obstacle(const PState& ped, int dir) : + description(ped.myPerson->getID()) { + assert(!ped.myWaitingToEnter); + if (dir == ped.myDir) { + speed = ped.mySpeed; + x = ped.myRelX - dir * ped.getLength(); + } else { + speed = -ped.mySpeed; + x = ped.myRelX; + } +} + + +// =========================================================================== +// MSPModel_Striping::PState method definitions +// =========================================================================== + + +MSPModel_Striping::PState::PState(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, const MSLane* lane): + myPerson(person), + myStage(stage), + myLane(lane), + myRelX(stage->getDepartPos()), + myRelY(0), + myDir(FORWARD), + mySpeed(0), + myWaitingToEnter(true), + myWaitingTime(0), + myWalkingAreaPath(0), + myAmJammed(false) { + const MSEdge* currentEdge = &lane->getEdge(); + assert(!currentEdge->isWalkingArea()); + const ConstMSEdgeVector& route = myStage->getRoute(); + if (route.size() == 1) { + // only a single edge, move towards end pos + myDir = (myRelX <= myStage->getArrivalPos()) ? FORWARD : BACKWARD; + } else { + const bool mayStartForward = canTraverse(FORWARD, route); + const bool mayStartBackward = canTraverse(BACKWARD, route); + if DEBUGCOND(myPerson->getID()) { + std::cout << " initialize dir for " << myPerson->getID() << " forward=" << mayStartForward << " backward=" << mayStartBackward << "\n"; + } + if (mayStartForward && mayStartBackward) { + // figure out the best direction via routing + ConstMSEdgeVector crossingRoute; + MSNet::getInstance()->getPedestrianRouter().compute(currentEdge, route.back(), myRelX, myStage->getArrivalPos(), myStage->getMaxSpeed(), 0, 0, crossingRoute, true); + if (crossingRoute.size() > 1) { + // route found + const MSEdge* nextEdge = crossingRoute[1]; + if (nextEdge->getFromJunction() == currentEdge->getFromJunction() || nextEdge->getToJunction() == currentEdge->getFromJunction()) { + myDir = BACKWARD; + } + } + if DEBUGCOND(myPerson->getID()) { + std::cout << " crossingRoute=" << toString(crossingRoute) << "\n"; + } + } else { + myDir = !mayStartBackward ? FORWARD : BACKWARD; + } + } + if (myDir == FORWARD) { + // start at the right side of the sidewalk + myRelY = stripeWidth * (numStripes(lane) - 1); + } + if DEBUGCOND(myPerson->getID()) { + std::cout << " added new pedestrian " << myPerson->getID() << " on " << lane->getID() << " myRelX=" << myRelX << " myRelY=" << myRelY << " dir=" << myDir << " route=" << toString(myStage->getRoute()) << "\n"; + } + + myNLI = getNextLane(*this, lane, 0); +} + + +SUMOReal +MSPModel_Striping::PState::getLength() const { + return myPerson->getVehicleType().getLength(); +} + + +int +MSPModel_Striping::PState::stripe(SUMOReal relY) const { + const int max = numStripes(myLane) - 1; + return MIN2(MAX2(0, (int)floor((relY + 0.5 * stripeWidth) / stripeWidth)), max); +} + + +int +MSPModel_Striping::PState::otherStripe(SUMOReal relY) const { + const int max = numStripes(myLane) - 1; + const int s = stripe(); + const SUMOReal offset = relY - s * stripeWidth; + const SUMOReal threshold = MAX2(NUMERICAL_EPS, stripeWidth - SQUEEZE * myPerson->getVehicleType().getWidth()); + int result; + if (offset > threshold) { + result = s + 1; + } else if (offset < -threshold) { + result = s - 1; + } else { + result = s; + } + std::cout.setf(std::ios::fixed , std::ios::floatfield); + std::cout << std::setprecision(5); + //if DEBUGCOND(myPerson->getID()) std::cout << " otherStripe " << myPerson->getID() << " offset=" << offset << " threshold=" << threshold << " rawResult=" << result << "\n"; + return MIN2(MAX2(0, result), max); +} + +int +MSPModel_Striping::PState::stripe() const { + return stripe(myRelY); +} + + +int +MSPModel_Striping::PState::otherStripe() const { + return otherStripe(myRelY); +} + + +SUMOReal +MSPModel_Striping::PState::distToLaneEnd() const { + if (myStage->getNextRouteEdge() == 0) { + return myDir * (myStage->getArrivalPos() - myRelX); + } else { + const SUMOReal length = myWalkingAreaPath == 0 ? myLane->getLength() : myWalkingAreaPath->length; + return myDir == FORWARD ? length - myRelX : myRelX; + } +} + + +bool +MSPModel_Striping::PState::moveToNextLane(SUMOTime currentTime) { + const SUMOReal dist = distToLaneEnd(); + if (myPerson->getID() == DEBUG1) { + std::cout << SIMTIME << " myRelX=" << myRelX << " dist=" << dist << "\n"; + } + if (dist <= 0) { + //if (ped.myPerson->getID() == DEBUG1) { + // std::cout << SIMTIME << " addToLane x=" << ped.myRelX << " newDir=" << newDir << " newLane=" << newLane->getID() << " walkingAreaShape=" << walkingAreaShape << "\n"; + //} + //std::cout << " changing to " << newLane->getID() << " myRelY=" << ped.myRelY << " oldStripes=" << oldStripes << " newStripes=" << numStripes(newLane); + //std::cout << " newY=" << ped.myRelY << " myDir=" << ped.myDir << " newDir=" << newDir; + const int oldStripes = numStripes(myLane); + const int oldDir = myDir; + const MSLane* oldLane = myLane; + myLane = myNLI.lane; + myDir = myNLI.dir; + const bool normalLane = (myLane == 0 || myLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_NORMAL); + if DEBUGCOND(myPerson->getID()) { + std::cout << SIMTIME + << " ped=" << myPerson->getID() + << " moveToNextLane old=" << oldLane->getID() + << " new=" << (myLane == 0 ? "NULL" : myLane->getID()) + << " oldDir=" << oldDir + << " newDir=" << myDir + << "\n"; + } + myStage->moveToNextEdge(myPerson, currentTime, normalLane ? 0 : &myLane->getEdge()); + if (myLane != 0) { + assert(myDir != UNDEFINED_DIRECTION); + myNLI = getNextLane(*this, myLane, oldLane); + assert(myNLI.lane != oldLane); // do not turn around + if DEBUGCOND(myPerson->getID()) { + std::cout << " nextLane=" << (myNLI.lane == 0 ? "NULL" : myNLI.lane->getID()) << "\n"; + } + if (myLane->getEdge().isWalkingArea()) { + if (myNLI.dir != UNDEFINED_DIRECTION) { + myWalkingAreaPath = &myWalkingAreaPaths[std::make_pair(oldLane, myNLI.lane)]; + assert(myWalkingAreaPath->from != 0); + assert(myWalkingAreaPath->to != 0); + assert(myWalkingAreaPath->shape.size() >= 2); + if DEBUGCOND(myPerson->getID()) { + std::cout << " mWAPath shape=" << myWalkingAreaPath->shape << " length=" << myWalkingAreaPath->length << "\n"; + } + } else { + // disconnnected route. move to the next edge (arbitrariliy, maintaining current direction) + if (OptionsCont::getOptions().getBool("ignore-route-errors")) { + myStage->moveToNextEdge(myPerson, currentTime, 0); + myLane = myNLI.lane; + assert(myLane != 0); + assert(myLane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_NORMAL); + myNLI = getNextLane(*this, myLane, oldLane); + myWalkingAreaPath = 0; + } else { + throw ProcessError("Disconnected walk for person '" + myPerson->getID() + "'."); + } + } + } else { + myWalkingAreaPath = 0; + } + // adapt x to fit onto the new lane + if (myDir == BACKWARD) { + const SUMOReal newLength = (myWalkingAreaPath == 0 ? myLane->getLength() : myWalkingAreaPath->length); + myRelX = newLength + dist; + } else { + myRelX = -dist; + } + // adjust to change in direction + if (myDir != oldDir) { + myRelY = (numStripes(oldLane) - 1) * stripeWidth - myRelY; + } + // adjust to differences in sidewalk width + myRelY += 0.5 * stripeWidth * (numStripes(myLane) - oldStripes); + } + return true; + } else { + return false; + } +} + + +void +MSPModel_Striping::PState::walk(const Obstacles& obs, SUMOTime currentTime) { + const int stripes = (int)obs.size(); + const int sMax = stripes - 1; + assert(stripes == numStripes(myLane)); + const SUMOReal vMax = myStage->getMaxSpeed(); + // ultimate goal is to chose the prefered stripe (chosen) + const int current = stripe(); + const int other = otherStripe(); + int chosen = current; + // compute utility for all stripes + std::vector utility(stripes, 0); + + // penalize lateral movement (may increase jamming) + for (int i = 0; i < stripes; ++i) { + utility[i] += abs(i - current) * LATERAL_PENALTY; + } + // compute distances + std::vector distance(stripes); + for (int i = 0; i < stripes; ++i) { + distance[i] += myDir * (obs[i].x - myRelX); + } + // forbid stripes which are blocked and also all stripes behind them + for (int i = 0; i < stripes; ++i) { + if (distance[i] <= 0) { + if (i < current) { + for (int j = 0; j <= i; ++j) { + utility[j] = 2 * BLOCKED_STRIPE; + } + } else { + for (int j = i; j < stripes; ++j) { + utility[j] = 2 * BLOCKED_STRIPE; + } + } + } + } + // forbid a portion of the leftmost stripes (in walking direction). + // lanes with stripes less than 1 / RESERVE_FOR_ONCOMING_FACTOR + // may still deadlock in heavy pedestrian traffic + const int reserved = (int)floor(stripes * RESERVE_FOR_ONCOMING_FACTOR); + if (myDir == FORWARD) { + for (int i = 0; i < reserved; ++i) { + utility[i] = BLOCKED_STRIPE; + } + } else { + for (int i = sMax; i > sMax - reserved; --i) { + utility[i] = BLOCKED_STRIPE; + } + } + // adapt utility based on obstacles + for (int i = 0; i < stripes; ++i) { + if (obs[i].speed < 0) { + // penalize evasion to the left + if (myDir == FORWARD && i > 0) { + utility[i - 1] -= 0.5; + } else if (myDir == BACKWARD && i < sMax) { + utility[i + 1] -= 0.5; + } + } + // compute expected distance achievable by staying on this stripe for a time horizon + const SUMOReal lookAhead = obs[i].speed >= 0 ? LOOKAHEAD_SAMEDIR : LOOKAHEAD_ONCOMING; + const SUMOReal expectedDist = MIN2(vMax * LOOKAHEAD_SAMEDIR, distance[i] + obs[i].speed * lookAhead); + if (DEBUGCOND(myPerson->getID())) { + std::cout << " util=" << utility[i] << " exp=" << expectedDist << "\n"; + } + if (expectedDist >= 0) { + utility[i] += expectedDist; + } else { + // let only the distance count + utility[i] += ONCOMING_CONFLICT + distance[i]; + } + } + // bonus to remain on the rightmost lane (in walking direction) if there + // are oncoming + if (((myDir == FORWARD && current == sMax) + || (myDir == BACKWARD && current == 0)) + && obs[current].speed < 0) { + utility[current] -= ONCOMING_CONFLICT; + } + // bonus to leave the leftmost lane (in walking direction) if there + // are oncoming + if (((myDir == BACKWARD && current == sMax) + || (myDir == FORWARD && current == 0)) + && obs[current].speed < 0) { + utility[current] += ONCOMING_CONFLICT; + } + + // select best stripe + for (int i = 0; i < stripes; ++i) { + if (utility[chosen] < utility[i]) { + chosen = i; + } + } + // compute speed components along both axes + const int next = (chosen == current ? current : (chosen < current ? current - 1 : current + 1)); + const SUMOReal xDist = MIN3(distance[current], distance[other], distance[next]); + // XXX preferred gap differs between approaching a standing obstacle or a moving obstacle + const SUMOReal preferredGap = myPerson->getVehicleType().getMinGap() + xDist * 0.5; + SUMOReal xSpeed = MIN2(vMax, MAX2((SUMOReal)0, xDist - preferredGap)); + if (DEBUGCOND(myPerson->getID())) { + std::cout << " xSpeedPotential=" << xSpeed << "\n"; + } + // avoid tiny steps + // XXX pressure from behind? + if (mySpeed == 0 && xSpeed < MIN_STARTUP_SPEED * vMax) { + xSpeed = 0; + } + if (xSpeed == 0) { + if (myWaitingTime > jamTime || myAmJammed) { + // squeeze slowly through the crowd ignoring others + myAmJammed = true; + xSpeed = vMax / 4; + } else { + myAmJammed = false; + } + } + // dawdling + const SUMOReal dawdle = MIN2(xSpeed, RandHelper::rand() * vMax * dawdling); + xSpeed -= dawdle; + + // XXX ensure that diagonal speed <= vMax + // avoid deadlocks on narrow sidewalks + //if (oncoming && xSpeed == 0 && myStage->getWaitingTime(currentTime) > TIME2STEPS(ONCOMIN_PATIENCE)) { + // if DEBUGCOND(myPerson->getID()) std::cout << " stepping asside to resolve oncoming deadlock\n"; + // xSpeed = POSITION_EPS; // reset myWaitingTime + // if (myDir == FORWARD && chosen < sMax) { + // chosen += 1; + // } else if (myDir == BACKWARD && chosen > 0) { + // chosen -= 1; + // } + //} + const SUMOReal maxYSpeed = MAX2(vMax * LATERAL_SPEED_FACTOR, vMax - xSpeed); + SUMOReal ySpeed = 0; + const SUMOReal yDist = (chosen * stripeWidth) - myRelY; + if (fabs(yDist) > NUMERICAL_EPS) { + ySpeed = (yDist > 0 ? + MIN2(maxYSpeed, yDist) : + MAX2(-maxYSpeed, yDist)); + } + // DEBUG + if DEBUGCOND(myPerson->getID()) { + std::cout << SIMTIME + << " ped=" << myPerson->getID() + << " edge=" << myStage->getEdge()->getID() + << " x=" << myRelX + << " y=" << myRelY + << " d=" << myDir + << " pvx=" << mySpeed + << " cur=" << current + << " cho=" << chosen + << " oth=" << other + << " nxt=" << next + << " vx=" << xSpeed + << " dawdle=" << dawdle + << " vy=" << ySpeed + << " xd=" << xDist + << " yd=" << yDist + << " vMax=" << myStage->getMaxSpeed() + << " wTime=" << myStage->getWaitingTime(currentTime) + << " jammed=" << myAmJammed + << "\n distance=" << toString(distance) + << " utility=" << toString(utility) + << "\n"; + DEBUG_PRINT(obs); + } + myRelX += SPEED2DIST(xSpeed * myDir); + myRelY += SPEED2DIST(ySpeed); + mySpeed = xSpeed; + if (xSpeed > 0) { + myWaitingToEnter = false; + myWaitingTime = 0; + } else { + myWaitingTime += DELTA_T; + } +} + + +SUMOReal +MSPModel_Striping::PState::getImpatience(SUMOTime now) const { + return MAX2((SUMOReal)0, MIN2(SUMOReal(1), + myPerson->getVehicleType().getImpatience() + + STEPS2TIME(myStage->getWaitingTime(now)) / MAX_WAIT_TOLERANCE)); +} + + +SUMOReal +MSPModel_Striping::PState::getEdgePos(const MSPerson::MSPersonStage_Walking&, SUMOTime) const { + return myRelX; +} + + +Position +MSPModel_Striping::PState::getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime) const { + if (myLane == 0) { + // pedestrian has already finished + return Position::INVALID; + } + const SUMOReal lateral_offset = myRelY + (stripeWidth - myLane->getWidth()) * 0.5; + if (myWalkingAreaPath == 0) { + return stage.getLanePosition(myLane, myRelX, lateral_offset); + } else { + return myWalkingAreaPath->shape.positionAtOffset(myRelX, lateral_offset); + } +} + + +SUMOReal +MSPModel_Striping::PState::getAngle(const MSPerson::MSPersonStage_Walking&, SUMOTime) const { + if (myLane == 0) { + // pedestrian has already finished + return 0; + } + const PositionVector& shp = myWalkingAreaPath == 0 ? myLane->getShape() : myWalkingAreaPath->shape; + SUMOReal angle = -shp.rotationDegreeAtOffset(myRelX) + (myDir == MSPModel::BACKWARD ? 180 : 0); + if (angle > 180) { + angle -= 360; + } + return angle; +} + + +SUMOTime +MSPModel_Striping::PState::getWaitingTime(const MSPerson::MSPersonStage_Walking&, SUMOTime) const { + return myWaitingTime; +} + + +SUMOReal +MSPModel_Striping::PState::getSpeed(const MSPerson::MSPersonStage_Walking&) const { + return mySpeed; +} + +// =========================================================================== +// MSPModel_Striping::MovePedestrians method definitions +// =========================================================================== +// + +SUMOTime +MSPModel_Striping::MovePedestrians::execute(SUMOTime currentTime) { + std::set changedLane; + myModel->moveInDirection(currentTime, changedLane, FORWARD); + myModel->moveInDirection(currentTime, changedLane, BACKWARD); + // DEBUG +#ifdef LOG_ALL + for (ActiveLanes::const_iterator it_lane = myModel->getActiveLanes().begin(); it_lane != myModel->getActiveLanes().end(); ++it_lane) { + const MSLane* lane = it_lane->first; + Pedestrians pedestrians = it_lane->second; + if (pedestrians.size() == 0) { + continue; + } + sort(pedestrians.begin(), pedestrians.end(), by_xpos_sorter(FORWARD)); + std::cout << SIMTIME << " lane=" << lane->getID(); + for (int ii = 0; ii < (int)pedestrians.size(); ++ii) { + const PState& p = *pedestrians[ii]; + std::cout << " (" << p.myPerson->getID() << " " << p.myRelX << "," << p.myRelY << " " << p.myDir << ")"; + } + std::cout << "\n"; + } +#endif + return DELTA_T; +} + diff -Nru sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPModel_Striping.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPModel_Striping.h --- sumo-0.21.0+dfsg/src/microsim/pedestrians/MSPModel_Striping.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/pedestrians/MSPModel_Striping.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,374 @@ +/****************************************************************************/ +/// @file MSPModel_Striping.h +/// @author Jakob Erdmann +/// @date Mon, 13 Jan 2014 +/// @version $Id: MSPModel_Striping.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// The pedestrian following model (prototype) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 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 MSPModel_Striping_h +#define MSPModel_Striping_h + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include "MSPerson.h" +#include "MSPModel.h" + +// =========================================================================== +// class declarations +// =========================================================================== +class MSNet; +class MSLink; +class MSJunction; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSPModel_Striping + * @brief The pedestrian following model + * + */ +class MSPModel_Striping : public MSPModel { + + friend class GUIPerson; // for debugging + +public: + + /// @brief Constructor (it should not be necessary to construct more than one instance) + MSPModel_Striping(const OptionsCont& oc, MSNet* net); + + ~MSPModel_Striping(); + + /// @brief register the given person as a pedestrian + PedestrianState* add(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, SUMOTime now); + + /// @brief whether a pedestrian is blocking the crossing of lane at offset distToCrossing + bool blockedAtDist(const MSLane* lane, SUMOReal distToCrossing, std::vector* collectBlockers); + + /// @brief remove state at simulation end + void cleanupHelper(); + + /// @brief model parameters + ///@{ + + // @brief the width of a pedstrian stripe + static SUMOReal stripeWidth; + + // @brief the factor for random slow-down + static SUMOReal dawdling; + + // @brief the time threshold before becoming jammed + static SUMOTime jamTime; + + // @brief the distance to look ahead for changing stripes + static const SUMOReal LOOKAHEAD_SAMEDIR; + // @brief the distance to look ahead for changing stripes (regarding oncoming pedestrians) + static const SUMOReal LOOKAHEAD_ONCOMING; + + // @brief the speed penalty for moving sideways + static const SUMOReal LATERAL_PENALTY; + + // @brief the factor by which pedestrian width is reduced when sqeezing past each other + static const SUMOReal SQUEEZE; + + // @brief the maximum distance at which oncoming pedestrians block right turning traffic + static const SUMOReal BLOCKER_LOOKAHEAD; + + // @brief fraction of the leftmost lanes to reserve for oncoming traffic + static const SUMOReal RESERVE_FOR_ONCOMING_FACTOR; + + // @brief the time pedestrians take to reach maximum impatience + static const SUMOReal MAX_WAIT_TOLERANCE; + + // @brief the fraction of forward speed to be used for lateral movemenk + static const SUMOReal LATERAL_SPEED_FACTOR; + + // @brief the minimum fraction of maxSpeed in order to start walking after stopped + static const SUMOReal MIN_STARTUP_SPEED; + + ///@} + + +protected: + class lane_by_numid_sorter { + public: + /// comparing operation + bool operator()(const MSLane* l1, const MSLane* l2) const { + return l1->getNumericalID() < l2->getNumericalID(); + } + }; + + struct Obstacle; + struct WalkingAreaPath; + class PState; + typedef std::vector Pedestrians; + typedef std::map ActiveLanes; + typedef std::vector Obstacles; + typedef std::map NextLanesObstacles; + typedef std::map, WalkingAreaPath> WalkingAreaPaths; + + struct NextLaneInfo { + NextLaneInfo(const MSLane* _lane, const MSLink* _link, int _dir) : + lane(_lane), + link(_link), + dir(_dir) + { } + + NextLaneInfo() : + lane(0), + link(0), + dir(UNDEFINED_DIRECTION) + { } + + // @brief the next lane to be used + const MSLane* lane; + // @brief the link from the current lane to the next lane + const MSLink* link; + // @brief the direction on the next lane + int dir; + }; + + /// @brief information regarding surround Pedestrians (and potentially other things) + struct Obstacle { + /// @brief create No-Obstacle + Obstacle(int dir); + /// @brief create an obstacle from ped for ego moving in dir + Obstacle(const PState& ped, int dir); + /// @brief create an obstacle from explict values + Obstacle(SUMOReal _x, SUMOReal _speed, const std::string& _description) : x(_x), speed(_speed), description(_description) {}; + + /// @brief position on the current lane + SUMOReal x; + /// @brief speed relative to ego direction (positive means in the same direction) + SUMOReal speed; + /// @brief the id / description of the obstacle + std::string description; + }; + + struct WalkingAreaPath { + WalkingAreaPath(const MSLane* _from, const MSLane* _walkingArea, const MSLane* _to, const PositionVector& _shape) : + from(_from), + to(_to), + lane(_walkingArea), + shape(_shape), + length(_shape.length()) + {} + + WalkingAreaPath(): from(0), to(0), lane(0) {}; + + const MSLane* from; + const MSLane* to; + const MSLane* lane; // the walkingArea; + PositionVector shape; // actually const but needs to be copyable by some stl code + SUMOReal length; + + }; + + class walkingarea_path_sorter { + public: + /// comparing operation + bool operator()(const WalkingAreaPath* p1, const WalkingAreaPath* p2) const { + if (p1->from->getNumericalID() < p2->from->getNumericalID()) { + return true; + } + return p1->to->getNumericalID() < p2->to->getNumericalID(); + } + }; + + + /** + * @class PState + * @brief Container for pedestrian state and individual position update function + */ + class PState : public PedestrianState { + public: + + /// @brief abstract methods inherited from PedestrianState + /// @{ + SUMOReal getEdgePos(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; + Position getPosition(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; + SUMOReal getAngle(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; + SUMOTime getWaitingTime(const MSPerson::MSPersonStage_Walking& stage, SUMOTime now) const; + SUMOReal getSpeed(const MSPerson::MSPersonStage_Walking& stage) const; + /// @} + + PState(MSPerson* person, MSPerson::MSPersonStage_Walking* stage, const MSLane* lane); + + ~PState() {}; + MSPerson* myPerson; + MSPerson::MSPersonStage_Walking* myStage; + /// @brief the current lane of this pedestrian + const MSLane* myLane; + /// @brief the advancement along the current lane + SUMOReal myRelX; + /// @brief the orthogonal shift on the current lane + SUMOReal myRelY; + /// @brief the walking direction on the current lane (1 forward, -1 backward) + int myDir; + /// @brief the current walking speed + SUMOReal mySpeed; + /// @brief whether the pedestrian is waiting to start its walk + bool myWaitingToEnter; + /// @brief the consecutive time spent at speed 0 + SUMOTime myWaitingTime; + /// @brief information about the upcoming lane + NextLaneInfo myNLI; + /// @brief the current walkingAreaPath or 0 + WalkingAreaPath* myWalkingAreaPath; + /// @brief whether the person is jammed + bool myAmJammed; + + /// @brief return the length of the pedestrian + SUMOReal getLength() const; + + /// @brief the absolute distance to the end of the lane in walking direction (or to the arrivalPos) + SUMOReal distToLaneEnd() const; + + /// @brief return whether this pedestrian has passed the end of the current lane and update myRelX if so + bool moveToNextLane(SUMOTime currentTime); + + /// @brief perform position update + void walk(const Obstacles& obs, SUMOTime currentTime); + + /// @brief returns the impatience + SUMOReal getImpatience(SUMOTime now) const; + + /// @brief return the speed-dependent minGap of the pedestrian + SUMOReal getMingap() const; + + int stripe() const; + int otherStripe() const; + + int stripe(SUMOReal relY) const; + int otherStripe(SUMOReal relY) const; + + }; + + class MovePedestrians : public Command { + public: + MovePedestrians(MSPModel_Striping* model) : myModel(model) {}; + ~MovePedestrians() {}; + SUMOTime execute(SUMOTime currentTime); + private: + MSPModel_Striping* const myModel; + private: + /// @brief Invalidated assignment operator. + MovePedestrians& operator=(const MovePedestrians&); + }; + + class by_xpos_sorter { + public: + /// constructor + by_xpos_sorter(int dir): myDir(dir) {} + + public: + /// comparing operation + bool operator()(const PState* p1, const PState* p2) const { + if (p1->myRelX != p2->myRelX) { + return myDir * p1->myRelX > myDir * p2->myRelX; + } + return p1->myPerson->getID() < p2->myPerson->getID(); + } + + private: + const int myDir; + + private: + /// @brief Invalidated assignment operator. + by_xpos_sorter& operator=(const by_xpos_sorter&); + }; + + + /// @brief move all pedestrians forward and advance to the next lane if applicable + void moveInDirection(SUMOTime currentTime, std::set& changedLane, int dir); + + /// @brief move pedestrians forward on one lane + void moveInDirectionOnLane(Pedestrians& pedestrians, const MSLane* lane, SUMOTime currentTime, std::set& changedLane, int dir); + + const ActiveLanes& getActiveLanes() { + return myActiveLanes; + } + +private: + static void DEBUG_PRINT(const Obstacles& obs); + + /// @brief returns the direction in which these lanes are connectioned or 0 if they are not + static int connectedDirection(const MSLane* from, const MSLane* to); + + /** @brief computes the successor lane for the given pedestrian and sets the + * link as well as the direction to use on the succesor lane + * @param[in] currentLane The lane the pedestrian is currently on + * @param[in] ped The pedestrian for which to compute the next lane + */ + static NextLaneInfo getNextLane(const PState& ped, const MSLane* currentLane, const MSLane* prevLane); + + /// @brief return the next walkingArea in the given direction + static const MSLane* getNextWalkingArea(const MSLane* currentLane, const int dir, MSLink*& link); + + static void initWalkingAreaPaths(const MSNet* net); + + /// @brief return the maximum number of pedestrians walking side by side + static int numStripes(const MSLane* lane); + + static Obstacles mergeObstacles(const Obstacles& obs1, const Obstacles& obs2, int dir); + + static Obstacles getNeighboringObstacles(const Pedestrians& pedestrians, int egoIndex, int stripes); + + const Obstacles& getNextLaneObstacles(NextLanesObstacles& nextLanesObs, const MSLane* lane, const MSLane* nextLane, int stripes, + SUMOReal nextLength, int nextDir, SUMOReal currentLength, int currentDir); + + static void addMappedObstacle(Obstacles& obs, const PState& p, int stripe, int currentDir, int nextDir, int offset, int stripes, int nextStripes); + + static void addCloserObstacle(Obstacles& obs, SUMOReal x, int stripe, const std::string& id, int stripes, int dir); + + /// @brief retrieves the pedestian vector for the given lane (may be empty) + Pedestrians& getPedestrians(const MSLane* lane); + + +private: + /// @brief the MovePedestrians command that is registered + MovePedestrians* myCommand; + + /// @brief the total number of active pedestrians + int myNumActivePedestrians; + + /// @brief store of all lanes which have pedestrians on them + ActiveLanes myActiveLanes; + + /// @brief store for walkinArea elements + static WalkingAreaPaths myWalkingAreaPaths; + + /// @brief empty pedestrian vector + static Pedestrians noPedestrians; + +}; + + +#endif /* MSPModel_Striping_h */ + diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/Makefile.am --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/Makefile.am 2013-05-03 20:25:07.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -2,9 +2,10 @@ libmicrosimtls_a_SOURCES = \ MSActuatedTrafficLightLogic.cpp \ -MSActuatedTrafficLightLogic.h MSAgentbasedTrafficLightLogic.cpp \ -MSAgentbasedTrafficLightLogic.h MSPhaseDefinition.h \ +MSActuatedTrafficLightLogic.h \ +MSPhaseDefinition.h \ MSOffTrafficLightLogic.cpp MSOffTrafficLightLogic.h \ +MSRailSignal.cpp MSRailSignal.h \ MSSimpleTrafficLightLogic.cpp MSSimpleTrafficLightLogic.h \ MSTLLogicControl.cpp MSTLLogicControl.h \ MSTrafficLightLogic.cpp MSTrafficLightLogic.h diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/Makefile.in --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -99,8 +99,7 @@ libmicrosimtls_a_AR = $(AR) $(ARFLAGS) libmicrosimtls_a_LIBADD = am_libmicrosimtls_a_OBJECTS = MSActuatedTrafficLightLogic.$(OBJEXT) \ - MSAgentbasedTrafficLightLogic.$(OBJEXT) \ - MSOffTrafficLightLogic.$(OBJEXT) \ + MSOffTrafficLightLogic.$(OBJEXT) MSRailSignal.$(OBJEXT) \ MSSimpleTrafficLightLogic.$(OBJEXT) MSTLLogicControl.$(OBJEXT) \ MSTrafficLightLogic.$(OBJEXT) libmicrosimtls_a_OBJECTS = $(am_libmicrosimtls_a_OBJECTS) @@ -224,6 +223,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -234,7 +235,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -331,9 +331,10 @@ noinst_LIBRARIES = libmicrosimtls.a libmicrosimtls_a_SOURCES = \ MSActuatedTrafficLightLogic.cpp \ -MSActuatedTrafficLightLogic.h MSAgentbasedTrafficLightLogic.cpp \ -MSAgentbasedTrafficLightLogic.h MSPhaseDefinition.h \ +MSActuatedTrafficLightLogic.h \ +MSPhaseDefinition.h \ MSOffTrafficLightLogic.cpp MSOffTrafficLightLogic.h \ +MSRailSignal.cpp MSRailSignal.h \ MSSimpleTrafficLightLogic.cpp MSSimpleTrafficLightLogic.h \ MSTLLogicControl.cpp MSTLLogicControl.h \ MSTrafficLightLogic.cpp MSTrafficLightLogic.h @@ -388,8 +389,8 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSActuatedTrafficLightLogic.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSAgentbasedTrafficLightLogic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSOffTrafficLightLogic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSRailSignal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSSimpleTrafficLightLogic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTLLogicControl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSTrafficLightLogic.Po@am__quote@ diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: MSActuatedTrafficLightLogic.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSActuatedTrafficLightLogic.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An actuated (adaptive) traffic light logic /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include "MSTrafficLightLogic.h" @@ -66,12 +67,12 @@ const Phases& phases, unsigned int step, SUMOTime delay, const std::map& parameter) : - MSSimpleTrafficLightLogic(tlcontrol, id, programID, phases, step, delay, parameter), - myContinue(false) { + MSSimpleTrafficLightLogic(tlcontrol, id, programID, phases, step, delay, parameter) { myMaxGap = TplConvert::_2SUMOReal(getParameter("max-gap", DEFAULT_MAX_GAP).c_str()); myPassingTime = TplConvert::_2SUMOReal(getParameter("passing-time", DEFAULT_PASSING_TIME).c_str()); myDetectorGap = TplConvert::_2SUMOReal(getParameter("detector-gap", DEFAULT_DETECTOR_GAP).c_str()); + myShowDetectors = TplConvert::_2bool(getParameter("show-detectors", "false").c_str()); } @@ -101,6 +102,9 @@ if (myInductLoops.find(lane) == myInductLoops.end()) { myInductLoops[lane] = dynamic_cast(nb.createInductLoop(id, lane, ilpos, false)); assert(myInductLoops[lane] != 0); + if (myShowDetectors) { + MSNet::getInstance()->getDetectorControl().add(SUMO_TAG_INDUCTION_LOOP, myInductLoops[lane], "NULL", TIME2STEPS(300)); + } } } } @@ -108,19 +112,24 @@ MSActuatedTrafficLightLogic::~MSActuatedTrafficLightLogic() { - for (InductLoopMap::iterator i = myInductLoops.begin(); i != myInductLoops.end(); ++i) { - delete(*i).second; + if (!myShowDetectors) { + for (InductLoopMap::iterator i = myInductLoops.begin(); i != myInductLoops.end(); ++i) { + delete(*i).second; + } } } // ------------ Switching and setting current rows SUMOTime -MSActuatedTrafficLightLogic::trySwitch(bool) { +MSActuatedTrafficLightLogic::trySwitch() { // checks if the actual phase should be continued - gapControl(); - if (myContinue) { - return duration(); + // @note any vehicles which arrived during the previous phases which are now waiting between the detector and the stop line are not + // considere here. RiLSA recommends to set minDuration in a way that lets all vehicles pass the detector + // @todo: it would be nice to warn users if (inductLoopPosition / defaultLengthWithGap * myPassingTime > minDuration) + const SUMOReal detectionGap = gapControl(); + if (detectionGap < std::numeric_limits::max()) { + return duration(detectionGap); } // increment the index to the current phase myStep++; @@ -137,52 +146,38 @@ // ------------ "actuated" algorithm methods SUMOTime -MSActuatedTrafficLightLogic::duration() const { - assert(myContinue); +MSActuatedTrafficLightLogic::duration(const SUMOReal detectionGap) const { assert(getCurrentPhaseDef().isGreenPhase()); assert(myPhases.size() > myStep); - // define the duration depending from the number of waiting vehicles of the actual phase - int newduration = (int) getCurrentPhaseDef().minDuration; - 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); - if (lanes.empty()) { - break; - } - for (LaneVector::const_iterator j = lanes.begin(); j != lanes.end(); j++) { - InductLoopMap::const_iterator k = myInductLoops.find(*j); - assert(k != myInductLoops.end()); - SUMOReal waiting = (SUMOReal)(*k).second->getCurrentPassedNumber(); - SUMOReal tmpdur = myPassingTime * waiting; - if (tmpdur > newduration) { - // here we cut the decimal places, because we have to return an integer - newduration = (int) tmpdur; - } - if (newduration > (int) getCurrentPhaseDef().maxDuration) { - return getCurrentPhaseDef().maxDuration; - } - } - } - } - return newduration; + const SUMOTime actDuration = MSNet::getInstance()->getCurrentTimeStep() - myPhases[myStep]->myLastSwitch; + // ensure that minimum duration is kept + SUMOTime newDuration = getCurrentPhaseDef().minDuration - actDuration; + // try to let the last detected vehicle pass the intersection (duration must be positive) + newDuration = MAX3(newDuration, TIME2STEPS(myDetectorGap - detectionGap), 1); + // cut the decimal places to ensure that phases always have integer duration + if (newDuration % 1000 != 0) { + const SUMOTime totalDur = newDuration + actDuration; + newDuration = (totalDur / 1000 + 1) * 1000 - actDuration; + } + // ensure that the maximum duration is not exceeded + newDuration = MIN2(newDuration, getCurrentPhaseDef().maxDuration - actDuration); + return newDuration; } -void +SUMOReal MSActuatedTrafficLightLogic::gapControl() { //intergreen times should not be lenghtend assert(myPhases.size() > myStep); + SUMOReal result = std::numeric_limits::max(); if (!getCurrentPhaseDef().isGreenPhase()) { - myContinue = false; - return; + return result; // end current phase } // Checks, if the maxDuration is kept. No phase should longer send than maxDuration. SUMOTime actDuration = MSNet::getInstance()->getCurrentTimeStep() - myPhases[myStep]->myLastSwitch; if (actDuration >= getCurrentPhaseDef().maxDuration) { - myContinue = false; - return; + return result; // end current phase } // now the gapcontrol starts @@ -190,9 +185,6 @@ 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); - if (lanes.empty()) { - break; - } for (LaneVector::const_iterator j = lanes.begin(); j != lanes.end(); j++) { if (myInductLoops.find(*j) == myInductLoops.end()) { continue; @@ -200,13 +192,12 @@ SUMOReal actualGap = myInductLoops.find(*j)->second->getTimestepsSinceLastDetection(); if (actualGap < myMaxGap) { - myContinue = true; - return; + result = MIN2(result, actualGap); } } } } - myContinue = false; + return result; } diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: MSActuatedTrafficLightLogic.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSActuatedTrafficLightLogic.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An actuated (adaptive) traffic light logic /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -93,11 +93,10 @@ /// @{ /** @brief Switches to the next phase - * @param[in] isActive Whether this program is the currently used one * @return The time of the next switch * @see MSTrafficLightLogic::trySwitch */ - SUMOTime trySwitch(bool isActive); + SUMOTime trySwitch(); /// @} @@ -105,15 +104,16 @@ /// @name "actuated" algorithm methods /// @{ - /** @brief Returns the duration of the given step - * @return The wanted duration of the current step + /** @brief Returns the minimum duration of the current phase + * @param[in] detectionGap The minimum detection gap for the current phase + * @return The minimum duration of the current phase */ - SUMOTime duration() const; + SUMOTime duration(const SUMOReal detectionGap) const; - /** @brief Decides, whether a phase should be continued by checking the gaps of vehicles having green + /** @brief Return the minimum detection gap of all detectors if the current phase should be extended and SUMOReal::max otherwise */ - void gapControl(); + SUMOReal gapControl(); /// @} @@ -121,18 +121,18 @@ /// A map from lanes to induct loops lying on them InductLoopMap myInductLoops; - /// information whether the current phase should be lenghtend - bool myContinue; - - /// The maximum gap to check + /// The maximum gap to check in seconds SUMOReal myMaxGap; - /// The passing time used + /// The passing time used in seconds SUMOReal myPassingTime; - /// The detector distance + /// The detector distance in seconds SUMOReal myDetectorGap; + /// Whether the detectors shall be shown in the GUI + bool myShowDetectors; + }; diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.cpp --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.cpp 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,398 +0,0 @@ -/****************************************************************************/ -/// @file MSAgentbasedTrafficLightLogic.cpp -/// @author Julia Ringel -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @author Laura Bieker -/// @date Wed, 01. Oct 2003 -/// @version $Id: MSAgentbasedTrafficLightLogic.cpp 15692 2014-02-22 09:17:02Z behrisch $ -/// -// An agentbased traffic light logic -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 "MSTrafficLightLogic.h" -#include "MSAgentbasedTrafficLightLogic.h" -#include -#include - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// parameter defaults definitions -// =========================================================================== -#define DEFAULT_T_DECIDE "1" -#define DEFAULT_LEARN_HORIZON "3" -#define DEFAULT_CYCLE_TIME "90" -#define DEFAULT_MIN_DIFF "1" -#define DEFAULT_DETECTOR_OFFSET "0" - - -// =========================================================================== -// member method definitions -// =========================================================================== -MSAgentbasedTrafficLightLogic::MSAgentbasedTrafficLightLogic( - MSTLLogicControl& tlcontrol, - const std::string& id, const std::string& programID, - const Phases& phases, unsigned int step, SUMOTime delay, - const std::map& parameter) : - MSSimpleTrafficLightLogic(tlcontrol, id, programID, phases, step, delay, parameter), - tSinceLastDecision(0), stepOfLastDecision(0) { - - tDecide = TplConvert::_2int(getParameter("decision-horizon", DEFAULT_T_DECIDE).c_str()); - numberOfValues = TplConvert::_2int(getParameter("learn-horizon", DEFAULT_LEARN_HORIZON).c_str()); - tCycle = TplConvert::_2int(getParameter("tcycle", DEFAULT_CYCLE_TIME).c_str()); - deltaLimit = TplConvert::_2SUMOReal(getParameter("min-diff", DEFAULT_MIN_DIFF).c_str()); -} - - -void -MSAgentbasedTrafficLightLogic::init(NLDetectorBuilder& nb) { - MSTrafficLightLogic::init(nb); - SUMOReal det_offset = TplConvert::_2SUMOReal(getParameter("detector_offset", DEFAULT_DETECTOR_OFFSET).c_str()); - LaneVectorVector::const_iterator i2; - LaneVector::const_iterator i; - // build the detectors - for (i2 = myLanes.begin(); i2 != myLanes.end(); ++i2) { - const LaneVector& lanes = *i2; - for (i = lanes.begin(); i != lanes.end(); i++) { - MSLane* lane = (*i); - // Build the lane state detetcor and set it into the container - std::string id = "TL_" + myID + "_" + myProgramID + "_E2OverLanesDetectorStartingAt_" + lane->getID(); - - if (myE2Detectors.find(lane) == myE2Detectors.end()) { - MSDetectorFileOutput* det = - nb.buildMultiLaneE2Det(id, - DU_TL_CONTROL, lane, 0, det_offset, - /*haltingTimeThreshold!!!*/ 1, - /*haltingSpeedThreshold!!!*/(SUMOReal)(5.0 / 3.6), - /*jamDistThreshold!!!*/ 10); - myE2Detectors[lane] = static_cast(det); - } - } - } - - - // initialise the duration - unsigned int tCycleIst = 0; // the actual cycletime - unsigned int tCycleMin = 0; // the minimum cycle time - unsigned int tDeltaGreen = 0; // the difference between the actual cycle time and the required cycle time - - /// Calculation of starting values - for (unsigned int actStep = 0; actStep != myPhases.size(); actStep++) { - unsigned int dur = (unsigned int) myPhases[actStep]->duration; - tCycleIst = tCycleIst + dur; - if (myPhases[actStep]->isGreenPhase()) { - unsigned int mindur = (unsigned int) myPhases[actStep]->minDuration; - tCycleMin = tCycleMin + mindur; - } else { - tCycleMin = tCycleMin + dur; - } - } - if (tCycle < tCycleMin) { - tCycle = tCycleMin; - } - if (tCycleIst < tCycle) { - tDeltaGreen = tCycle - tCycleIst; - lengthenCycleTime(tDeltaGreen); - } - if (tCycleIst > tCycle) { - tDeltaGreen = tCycleIst - tCycle; - cutCycleTime(tDeltaGreen); - } -} - - -MSAgentbasedTrafficLightLogic::~MSAgentbasedTrafficLightLogic() {} - - -// ------------ Switching and setting current rows -SUMOTime -MSAgentbasedTrafficLightLogic::trySwitch(bool) { - assert(getCurrentPhaseDef().minDuration >= 0); - assert(getCurrentPhaseDef().minDuration <= getCurrentPhaseDef().duration); - if (myPhases[myStep]->isGreenPhase()) { - // collects the data for the signal control - collectData(); - // decides wheter greentime shall distributed between phases - if (tDecide <= tSinceLastDecision) { - calculateDuration(); - } - } - // increment the index to the current phase - nextStep(); - // set the next event - while (getCurrentPhaseDef().duration == 0) { - nextStep(); - } - assert(myPhases.size() > myStep); - return getCurrentPhaseDef().duration; -} - - -// ------------ "agentbased" algorithm methods -unsigned int -MSAgentbasedTrafficLightLogic::nextStep() { - // increment the index to the current phase - myStep++; - assert(myStep <= myPhases.size()); - if (myStep == myPhases.size()) { - myStep = 0; - } - // increment the number of cycles since last decision - if (myStep == stepOfLastDecision) { - tSinceLastDecision = tSinceLastDecision + 1; - } - return myStep; -} - - -void -MSAgentbasedTrafficLightLogic::collectData() { - const std::string& state = getCurrentPhaseDef().getState(); - // finds the maximum QUEUE_LENGTH_AHEAD_OF_TRAFFIC_LIGHTS_IN_VEHICLES of one phase - SUMOReal maxPerPhase = 0; - 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); - if (lanes.empty()) { - break; - } - SUMOReal maxPerBit = 0; - for (LaneVector::const_iterator j = lanes.begin(); j != lanes.end(); j++) { - if ((*j)->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { - continue; - } - /*!!! - SUMOReal tmp = currentForLane(E2::QUEUE_LENGTH_AHEAD_OF_TRAFFIC_LIGHTS_IN_VEHICLES, *j); - if (maxPerBit < tmp) { - maxPerBit = tmp; - } - E2DetectorMap::const_iterator it=myE2Detectors.find(*j); - (*it).second->resetQueueLengthAheadOfTrafficLights(); - */ - } - if (maxPerPhase < maxPerBit) { - maxPerPhase = maxPerBit; - } - } - } - // if still no entry for the phase exists a new entry with an empty value is created - if (myRawDetectorData.find(myStep) == myRawDetectorData.end()) { - ValueType firstData; - myRawDetectorData[myStep] = firstData; - } - /* checks whether the number of values that are already in the dataqueue is - the same number of values taht shall be consideres in the traffic control - if both numbers are the same, the oldest value is deleted */ - if (myRawDetectorData[myStep].size() == numberOfValues) { - myRawDetectorData[myStep].pop_back(); - } - // adds the detectorvalue of the considered phase - myRawDetectorData[myStep].push_front(maxPerPhase); -} - - -void -MSAgentbasedTrafficLightLogic::aggregateRawData() { - for (PhaseValueMap::const_iterator i = myRawDetectorData.begin(); i != myRawDetectorData.end(); i++) { - SUMOReal sum = 0; - for (ValueType:: const_iterator it = myRawDetectorData[(*i).first].begin(); it != myRawDetectorData[(*i).first].end(); it ++) { - sum = sum + *it; - } - SUMOReal meanvalue = sum / myRawDetectorData[(*i).first].size(); - myMeanDetectorData[(*i).first] = meanvalue; - } -} - - -void -MSAgentbasedTrafficLightLogic::calculateDuration() { - aggregateRawData(); - unsigned int stepOfMaxValue = findStepOfMaxValue(); - if (stepOfMaxValue == myPhases.size()) { - return; - } - unsigned int stepOfMinValue = findStepOfMinValue(); - if (stepOfMinValue == myPhases.size()) { - return; - } - if (stepOfMinValue == stepOfMaxValue) { - return; - } - SUMOReal deltaIst = (myMeanDetectorData[stepOfMaxValue] - myMeanDetectorData[stepOfMinValue]) - / myMeanDetectorData[stepOfMaxValue]; - if (deltaIst > deltaLimit) { - myPhases[stepOfMaxValue]->duration = myPhases[stepOfMaxValue]->duration + 1; - myPhases[stepOfMinValue]->duration = myPhases[stepOfMinValue]->duration - 1; - tSinceLastDecision = 0; - stepOfLastDecision = myStep; - } -} - - -void -MSAgentbasedTrafficLightLogic::lengthenCycleTime(unsigned int toLengthen) { - typedef std::pair contentType; - typedef std::vector< std::pair > GreenPhasesVector; - GreenPhasesVector tmp_phases(myPhases.size()); - tmp_phases.clear(); - unsigned int maxLengthen = 0; // the sum of all times, that is possible to lengthen - - /* fills the vector tmp_phases with the difference between - duration and maxduration and the myStep of the phases. - only phases with duration < maxDuration are written in the vector. - sorts the vector after the difference. */ - for (unsigned int i_Step = 0; i_Step != myPhases.size(); i_Step++) { - if (myPhases[i_Step]->isGreenPhase()) { - unsigned int dur = (unsigned int) myPhases[i_Step]->duration; - unsigned int maxdur = (unsigned int) myPhases[i_Step]->maxDuration; - if (dur < maxdur) { - contentType tmp; - tmp.second = i_Step; - tmp.first = maxdur - dur; - tmp_phases.push_back(tmp); - maxLengthen = maxLengthen + tmp.first; - } - } - } - sort(tmp_phases.begin(), tmp_phases.end()); - //lengthens the phases acording to the difference between duration and maxDuration - for (GreenPhasesVector::iterator i = tmp_phases.begin(); i != tmp_phases.end(); i++) { - SUMOTime toLengthenPerPhase = 0; - SUMOReal tmpdb = ((*i).first * toLengthen / SUMOReal(maxLengthen)) + (SUMOReal) 0.5; - toLengthenPerPhase = static_cast(tmpdb); - toLengthen = toLengthen - (unsigned int) toLengthenPerPhase; - maxLengthen = maxLengthen - (*i).first; - SUMOTime newDur = myPhases[(*i).second]->duration + toLengthenPerPhase; - myPhases[(*i).second]->duration = newDur; - } -} - - -void -MSAgentbasedTrafficLightLogic::cutCycleTime(unsigned int toCut) { - typedef std::pair contentType; - typedef std::vector< std::pair > GreenPhasesVector; - GreenPhasesVector tmp_phases(myPhases.size()); - tmp_phases.clear(); - unsigned maxCut = 0; // the sum of all times, that is possible to cut - - /* fills the vector tmp_phases with the difference between - duration and minduration and the myStep of the phases. - only phases with duration > minDuration are written in the vector. - sorts the vector after the difference. */ - for (unsigned i_Step = 0; i_Step != myPhases.size(); i_Step++) { - if (myPhases[i_Step]->isGreenPhase()) { - unsigned int dur = (unsigned int) myPhases[i_Step]->duration; - unsigned int mindur = (unsigned int) myPhases[i_Step]->minDuration; - if (dur > mindur) { - contentType tmp; - tmp.second = i_Step; - tmp.first = dur - mindur; - tmp_phases.push_back(tmp); - maxCut = maxCut + tmp.first; - } - } - } - std::sort(tmp_phases.begin(), tmp_phases.end()); - //cuts the phases acording to the difference between duration and minDuration - for (GreenPhasesVector::iterator i = tmp_phases.begin(); i != tmp_phases.end(); i++) { - SUMOTime toCutPerPhase = 0; - SUMOReal tmpdb = ((*i).first * toCut / SUMOReal(maxCut)) + (SUMOReal) 0.5; - toCutPerPhase = static_cast(tmpdb); - toCut = toCut - (unsigned int) toCutPerPhase; - maxCut = maxCut - (*i).first; - SUMOTime newDur = myPhases[(*i).second]->duration - toCutPerPhase; - myPhases[(*i).second]->duration = newDur; - } -} - - -unsigned int -MSAgentbasedTrafficLightLogic::findStepOfMaxValue() const { - unsigned int StepOfMaxValue = (unsigned int) myPhases.size(); - SUMOReal MaxValue = -1; - for (MeanDataMap::const_iterator it = myMeanDetectorData.begin(); it != myMeanDetectorData.end(); it++) { - // checks whether the actual duruation is shorter than maxduration - // otherwise the phase can't be lenghten - unsigned int maxDur = (unsigned int) myPhases[(*it).first]->maxDuration; - unsigned int actDur = (unsigned int) myPhases[(*it).first]->duration; - if (actDur >= maxDur) { - continue; - } - if ((*it).second > MaxValue) { - MaxValue = (*it).second; - StepOfMaxValue = (*it).first; - } - } - return StepOfMaxValue; -} - - -unsigned int -MSAgentbasedTrafficLightLogic::findStepOfMinValue() const { - unsigned int StepOfMinValue = (unsigned int) myPhases.size(); - SUMOReal MinValue = 9999; - for (MeanDataMap::const_iterator it = myMeanDetectorData.begin(); it != myMeanDetectorData.end(); it++) { - // checks whether the actual duruation is longer than minduration - // otherwise the phase can't be cut - unsigned int minDur = (unsigned int) myPhases[(*it).first]->minDuration; - unsigned int actDur = (unsigned int) myPhases[(*it).first]->duration; - if (actDur <= minDur) { - continue; - } - if ((*it).second < MinValue) { - MinValue = (*it).second; - StepOfMinValue = (*it).first; - } - } - return StepOfMinValue; -} - - -/* -SUMOReal -MSAgentbasedTrafficLightLogic::currentForLane(E2::DetType what, - MSLane *lane) const -{ - - E2DetectorMap::const_iterator i=myE2Detectors.find(lane); - return (*i).second->getCurrent(what); -} -*/ - - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.h --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSAgentbasedTrafficLightLogic.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ -/****************************************************************************/ -/// @file MSAgentbasedTrafficLightLogic.h -/// @author Julia Ringel -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @author Jakob Erdmann -/// @date Wed, 01. Oct 2003 -/// @version $Id: MSAgentbasedTrafficLightLogic.h 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// An agentbased traffic light logic -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 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 MSAgentbasedTrafficLightLogic_h -#define MSAgentbasedTrafficLightLogic_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include "MSTrafficLightLogic.h" -#include "MSSimpleTrafficLightLogic.h" -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class MSLane; -class MSAgentbasedPhaseDefinition; -class NLDetectorBuilder; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class MSAgentbasedTrafficLightLogic - * @brief An agentbased traffic light logic - */ -class MSAgentbasedTrafficLightLogic : - public MSSimpleTrafficLightLogic { -public: - /// @brief Definition of a map from lanes to lane state detectors lying on them - typedef std::map E2DetectorMap; - - /// @brief Definition of a map which stores the detector values of one single phase - typedef std::deque ValueType; - - /// @brief Definition of a map which stores the step of the greenphases and their detector values - typedef std::map PhaseValueMap; - - /// @brief Definition of a map which stores the mean data of several (numberOfValues) cycles - typedef std::map MeanDataMap; - -public: - /** @brief Constructor - * @param[in] tlcontrol The tls control responsible for this tls - * @param[in] id This tls' id - * @param[in] programID This tls' sub-id (program id) - * @param[in] phases Definitions of the phases - * @param[in] step The initial phase index - * @param[in] delay The time to wait before the first switch - * @param[in] parameter The parameter to use for tls set-up - */ - MSAgentbasedTrafficLightLogic(MSTLLogicControl& tlcontrol, - const std::string& id, const std::string& programID, - const MSSimpleTrafficLightLogic::Phases& phases, - unsigned int step, SUMOTime delay, - const std::map& parameter); - - - /** @brief Initialises the tls with information about incoming lanes - * @param[in] nb The detector builder - * @param[in] edgeContinuations Information about edge predecessors/successors - * @exception ProcessError If something fails on initialisation - */ - void init(NLDetectorBuilder& nb); - - - /// @brief Destructor - ~MSAgentbasedTrafficLightLogic(); - - - - /// @name Switching and setting current rows - /// @{ - - /** @brief Switches to the next phase - * @param[in] isActive Whether this program is the currently used one - * @return The time of the next switch - * @see MSTrafficLightLogic::trySwitch - */ - SUMOTime trySwitch(bool isActive); - /// @} - - -protected: - /// @name "agentbased" algorithm methods - /// @{ - - /** @brief Returns the index of the phase next to the given phase - * - * Stores the duration of the phase, which was just sent - * or stores the activation-time in myLastphase of the phase next - * @return The index of the next step - */ - unsigned int nextStep(); - - - /** @brief Collects the traffic data - */ - void collectData(); - - - /** @brief Aggregates the data of one phase, collected during different cycles - */ - void aggregateRawData(); - - - /** @brief Calculates the duration for all real phases except intergreen phases - */ - void calculateDuration(); - - - /** @brief lenghtens the actual cycle by an given value - * @param[in] toLenghten The time increase - */ - void lengthenCycleTime(unsigned int toLenghten); - - - /** @brief cuts the actual cycle by an given value - * @param[in] toCut The time decrease - */ - void cutCycleTime(unsigned int toCut); - - - /** @brief Returns the step of the phase with the longest Queue_Lengt_Ahead_Of_Traffic_Lights - * @return Which step has the longest queue - */ - unsigned int findStepOfMaxValue() const; - - - /** @brief Returns the step of the phase with the shortest Queue_Lengt_Ahead_Of_Traffic_Lights - * @return Which step has the shortest queue - */ - unsigned int findStepOfMinValue() const; - /// @} - - -protected: - /// @brief A map from lanes to E2 detectors lying on them - E2DetectorMap myE2Detectors; - - /// @brief A map of the step of the greenphases and their detectorvalues for several (mumberofValues) cycles - PhaseValueMap myRawDetectorData; - - /// @brief A map of the step of the greenphases and their aggregated detectordata - MeanDataMap myMeanDetectorData; - - /** @brief the interval in which the traffic light can make a decision - * - * The interval is given in integer numbers of cycles */ - unsigned int tDecide; - - /// @brief The number of cycles, before the last decision was made - unsigned int tSinceLastDecision; - - /// @brief Stores the step of the phase, when the last decision was made - unsigned int stepOfLastDecision; - - /** @brief The number of detector values whivh is considered to make a decision - * - * it's only possible to get one value per cycle per greenphase */ - unsigned int numberOfValues; - - /// @brief The cycletime of the trafficlight - unsigned int tCycle; - - /* @brief The minimum difference between the shortest and the longest que - * - * Queue_Lengt_Ahead_Of_Traffic_Lights of a phase before greentime is given - * from the phase with the shortest Queue_Lengt_Ahead_Of_Traffic_Lights to the phase with - * the longest Queue_Lengt_Ahead_Of_Traffic_Lights */ - SUMOReal deltaLimit; - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 08.05.2007 -/// @version $Id: MSOffTrafficLightLogic.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSOffTrafficLightLogic.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A traffic lights logic which represents a tls in an off-mode /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSOffTrafficLightLogic.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSOffTrafficLightLogic.h --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSOffTrafficLightLogic.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSOffTrafficLightLogic.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 08.05.2007 -/// @version $Id: MSOffTrafficLightLogic.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSOffTrafficLightLogic.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A traffic lights logic which represents a tls in an off-mode /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -88,12 +88,10 @@ /// @{ /** @brief Switches to the next phase - * @param[in] isActive Whether this program is the currently used one * @return The time of the next switch (always 120) * @see MSTrafficLightLogic::trySwitch */ - SUMOTime trySwitch(bool isActive) { - UNUSED_PARAMETER(isActive); + SUMOTime trySwitch() { return 120 * DELTA_T; } @@ -123,6 +121,13 @@ * @see MSTrafficLightLogic::getPhase */ const MSPhaseDefinition& getPhase(unsigned int givenstep) const; + + /** @brief Returns the type of the logic as a string + * @return The type of the logic + */ + const std::string getLogicType() const { + return "offTrafficLightLogic"; + } /// @} diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSPhaseDefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSPhaseDefinition.h --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSPhaseDefinition.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSPhaseDefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Jan 2004 -/// @version $Id: MSPhaseDefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSPhaseDefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The definition of a single phase of a tls logic /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSRailSignal.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSRailSignal.cpp --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSRailSignal.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSRailSignal.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,279 @@ +/****************************************************************************/ +/// @file MSRailSignal.cpp +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Jan 2015 +/// @version $Id: MSRailSignal.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// A rail signal logic +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "MSTrafficLightLogic.h" +#include "MSRailSignal.h" +#include +#include "MSPhaseDefinition.h" +#include "MSTLLogicControl.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + + +// =========================================================================== +// method definitions +// =========================================================================== +MSRailSignal::MSRailSignal(MSTLLogicControl& tlcontrol, + const std::string& id, const std::string& subid, + const std::map& parameters) : + MSTrafficLightLogic(tlcontrol, id, subid, DELTA_T, parameters), + myCurrentPhase(DELTA_T, "") { + myDefaultCycleTime = DELTA_T; +} + +void +MSRailSignal::init(NLDetectorBuilder&) { + assert(myLanes.size() > 0); + LinkVectorVector::iterator i2; //iterator of the link indices of this junction (most likely there is just one link per index) + // find all outgoing lanes from the junction and its succeeding lanes leading to the next rail signal + // and find for every link at the junction all lanes leading from a previous signal to this link + for (i2 = myLinks.begin(); i2 != myLinks.end(); ++i2) { //for every link index + const LinkVector& links = *i2; + LinkVector::const_iterator i; //iterator of the links that belong to the same link index + for (i = links.begin(); i != links.end(); i++) { //for every link that belongs to the current index + MSLink* link = (*i); + MSLane* toLane = link->getLane(); //the lane this link is leading to + myLinksToLane[toLane].push_back(link); + myLinkIndices[link] = (unsigned int)std::distance(myLinks.begin(), i2); //assign the index of link to link + + //find all lanes leading from a previous signal to link (we presume that there exists only one path from a previous signal to link) + std::vector afferentBlock; //the vector of lanes leading from a previous signal to link + bool noRailSignal = true; //true if the considered lane is not outgoing from a rail signal + //get the approaching lane of the link + MSLane* approachingLane = link->getApproachingLane(); //the lane this link is coming from + afferentBlock.push_back(approachingLane); + const MSLane* currentLane = approachingLane; + //look recursively for all lanes that lie before approachingLane and add them to afferentBlock until a rail signal is found + while (noRailSignal) { + std::vector incomingLanes = currentLane->getIncomingLanes(); + MSLane* precedentLane; + if (!incomingLanes.empty()) { + precedentLane = incomingLanes.front().lane; + } else { + precedentLane = 0; + } + if (precedentLane == 0) { //if there is no preceeding lane + noRailSignal = false; + } else { + const MSJunction* junction = MSLinkContHelper::getConnectingLink(*precedentLane, *currentLane)->getJunction(); //the junction between precentLane and currentLane + if ((junction != 0) && (junction->getType() == NODETYPE_RAIL_SIGNAL)) { //if this junction exists and if it has a rail signal + noRailSignal = false; + } else { + afferentBlock.push_back(precedentLane); + currentLane = precedentLane; + } + } + } + myAfferentBlocks[link] = afferentBlock; + + //find all lanes leading from toLane to the next signal if it was not already done + if (std::find(myOutgoingLanes.begin(), myOutgoingLanes.end(), toLane) == myOutgoingLanes.end()) { //if toLane was not already contained in myOutgoingLanes + myOutgoingLanes.push_back(toLane); + std::vector succeedingBlock; //the vector of lanes leading to the next rail signal + succeedingBlock.push_back(toLane); + currentLane = toLane; + bool noRailSignal = true; //true if the considered lane is not ending at a rail signal + while (noRailSignal) { + //check first if the current lane is ending at a rail signal + std::vector outGoingLinks = currentLane->getLinkCont(); + std::vector::const_iterator j; + for (j = outGoingLinks.begin(); j != outGoingLinks.end(); j++) { + const MSJunction* junction = currentLane->getEdge().getToJunction(); + if ((junction != 0) && (junction->getType() == NODETYPE_RAIL_SIGNAL)) { //if this junctions exists and if it has a rail signal + noRailSignal = false; + break; + } + } + if (noRailSignal) { //if currentLane is not ending at a railSignal + //get the next lane + std::vector outGoingLanes = currentLane->getOutgoingLanes(); + if (outGoingLanes.size() == 0) { //if the current lane has no outgoing lanes (deadend) + noRailSignal = false; + } else { + if (outGoingLanes.size() > 1) { + WRITE_WARNING("Rail lane " + currentLane->getID() + " has more than one outgoing lane but does not have a rail signal at its end"); + } + const MSLane* nextLane = outGoingLanes.front(); + succeedingBlock.push_back(nextLane); + currentLane = nextLane; + } + } + } + mySucceedingBlocks[toLane] = succeedingBlock; + } + } + } + updateCurrentPhase(); //check if this is necessary or if will be done already at another stage + setTrafficLightSignals(MSNet::getInstance()->getCurrentTimeStep()); +} + + +MSRailSignal::~MSRailSignal() {} + + +// ----------- Handling of controlled links +void +MSRailSignal::adaptLinkInformationFrom(const MSTrafficLightLogic& logic) { + MSTrafficLightLogic::adaptLinkInformationFrom(logic); + updateCurrentPhase(); +} + + +// ------------ Switching and setting current rows +SUMOTime +MSRailSignal::trySwitch() { + updateCurrentPhase(); + setTrafficLightSignals(MSNet::getInstance()->getCurrentTimeStep()); + return DELTA_T; +} + +std::string +MSRailSignal::getAppropriateState() { + std::string state(myLinks.size(), 'G'); //the state of the phase definition (all signal are green) + std::vector::const_iterator i; //the iterator of outgoing lanes of this junction + for (i = myOutgoingLanes.begin(); i != myOutgoingLanes.end(); i++) { //for every outgoing lane + MSLane* lane = (*i); + + //check if the succeeding block is used by a train + bool succeedingBlockOccupied = false; + std::vector::const_iterator j; + for (j = mySucceedingBlocks.at(lane).begin(); j != mySucceedingBlocks.at(lane).end(); j++) { //for every lane in the block between the current signal and the next signal + if (!(*j)->isEmpty()) { //if this lane is not empty + succeedingBlockOccupied = true; + break; + } + } + + /*-if the succeeding block is occupied the signals for all links leading to lane will be set to red. + -if the succeeding block is not occupied and all blocks leading to lane are not occupied all signal + will keep green. + -if the succeeding block is not occupied and there is only one block leading to lane its signal will + keep green (no matter if this block is occupied or not). + -if the succeeding block is not occupied and there is more than one block leading to lane and some + of them are occupied the signals for all links leading to lane, except one whose corresponding block + is occupied, will be set to red. the signal for the remaining block will keep green*/ + if (succeedingBlockOccupied) { //if the succeeding block is used by a train + std::vector::const_iterator k; + for (k = myLinksToLane[lane].begin(); k != myLinksToLane[lane].end(); k++) { //for every link leading to this lane + state.replace(myLinkIndices[*k], 1, "r"); //set the signal of the link (*k) to red + } + } else { + if (myLinksToLane[lane].size() > 1) { //if there is more than one link leading to lane + bool hasOccupiedBlock = false; + std::vector::const_iterator k; + for (k = myLinksToLane[lane].begin(); k != myLinksToLane[lane].end(); k++) { //for every link leading to lane + std::vector::const_iterator l; + for (l = myAfferentBlocks[(*k)].begin(); l != myAfferentBlocks[(*k)].end(); l++) { //for every lane of the block leading from a previous signal to the link (*k) + if (!(*l)->isEmpty()) { //if this lane is not empty + hasOccupiedBlock = true; + //set the signals for all links leading to lane, except for (*k), to red; the signal for (*k) will remain green + std::vector::const_iterator m; + for (m = myLinksToLane[lane].begin(); m != myLinksToLane[lane].end(); m++) { //for every link leading to lane + if (*m != *k) { //if this link is not the one corresponding to occupiedBlock + state.replace(myLinkIndices[*m], 1, "r"); //set the signal of this link to red + } + } + break; // we don't have to check the other lanes of this block anymore + } + } + if (hasOccupiedBlock) { //we don't have to check the other blocks anymore + break; + } + } + } + } + } + return state; +} + + +void +MSRailSignal::updateCurrentPhase() { + myCurrentPhase = MSPhaseDefinition(DELTA_T, getAppropriateState()); +} + + +// ------------ Static Information Retrieval +unsigned int +MSRailSignal::getPhaseNumber() const { + return 0; +} + +const MSTrafficLightLogic::Phases& +MSRailSignal::getPhases() const { + return myPhases; +} + +const MSPhaseDefinition& +MSRailSignal::getPhase(unsigned int) const { + return myCurrentPhase; +} + +// ------------ Dynamic Information Retrieval +unsigned int +MSRailSignal::getCurrentPhaseIndex() const { + return 0; +} + +const MSPhaseDefinition& +MSRailSignal::getCurrentPhaseDef() const { + return myCurrentPhase; +} + +// ------------ Conversion between time and phase +SUMOTime +MSRailSignal::getPhaseIndexAtTime(SUMOTime) const { + return 0; +} + +SUMOTime +MSRailSignal::getOffsetFromIndex(unsigned int) const { + return 0; +} + +unsigned int +MSRailSignal::getIndexFromOffset(SUMOTime) const { + return 0; +} + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSRailSignal.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSRailSignal.h --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSRailSignal.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSRailSignal.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,245 @@ +/****************************************************************************/ +/// @file MSRailSignal.h +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Jan 2015 +/// @version $Id: MSRailSignal.h 18096 2015-03-17 09:50:59Z behrisch $ +/// +// A rail signal logic +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 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 MSRailSignal_h +#define MSRailSignal_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +//#include +//#include +//#include +//#include +//#include +#include +//#include "MSSimpleTrafficLightLogic.h" +#include "MSPhaseDefinition.h" +#include "MSTLLogicControl.h" +//#include + + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSRailSignal + * @brief A signal for rails + */ +class MSRailSignal : public MSTrafficLightLogic { +public: + /** @brief Constructor + * @param[in] tlcontrol The tls control responsible for this tls + * @param[in] id This tls' id + * @param[in] subid This tls' sub-id (program id) + * @param[in] parameters This tls' parameters + */ + MSRailSignal(MSTLLogicControl& tlcontrol, + const std::string& id, const std::string& subid, + const std::map& parameters); + + + /** @brief Initialises the rail signal with information about adjacent rail signals + * @param[in] nb The detector builder + * @exception ProcessError If something fails on initialisation + */ + void init(NLDetectorBuilder& nb); + + + /// @brief Destructor + ~MSRailSignal(); + + /// @name Handling of controlled links + /// @{ + + /** @brief Applies information about controlled links and lanes from the given logic + * @param[in] logic The logic to use the information about controlled links/lanes from + * @see MSTrafficLightLogic::adaptLinkInformationFrom + */ + void adaptLinkInformationFrom(const MSTrafficLightLogic& logic); + /// @} + + + /// @name Switching and setting current rows + /// @{ + + + /** @brief returns the state of the signal that actually required + * + * Returns the state of the rail signal that is actually required based on the + * occupation of the adjoining blocks. + * + * @return The state actually required for this signal. + */ + std::string getAppropriateState(); + + /// @brief updates the current phase of the signal + void updateCurrentPhase(); + + /** @brief Switches to the next phase + * @return The time of the next switch (always the next step) + * @see MSTrafficLightLogic::trySwitch + */ + SUMOTime trySwitch(); + + /// @} + + + /// @name Static Information Retrieval + /// @{ + + /** @brief Returns the number of phases + * @return The number of this tls program's phases (always zero) + * @see MSTrafficLightLogic::getPhaseNumber + */ + unsigned int getPhaseNumber() const; + + + /** @brief Returns the phases of this tls program + * @return The phases of this tls program + * @see MSTrafficLightLogic::getPhases + */ + const Phases& getPhases() const; + + /** @brief Returns the definition of the phase from the given position within the plan + * + * Returns the current phase as there does not exist a plan of the phases. + * + * @param[in] givenstep The index of the phase within the plan + * @return The definition of the phase at the given position + * @see MSTrafficLightLogic::getPhase + */ + const MSPhaseDefinition& getPhase(unsigned int givenstep) const; + + /** @brief Returns the type of the logic as a string + * @return The type of the logic + */ + const std::string getLogicType() const { + return "railSignal"; + } + /// @} + + + /// @name Dynamic Information Retrieval + /// @{ + + /** @brief Returns the current index within the program + * @return The index of the current phase within the tls (here, always zero will be returned) + * @see MSTrafficLightLogic::getCurrentPhaseIndex + */ + unsigned int getCurrentPhaseIndex() const; + + + /** @brief Returns the definition of the current phase + * @return The current phase + */ + const MSPhaseDefinition& getCurrentPhaseDef() const; + /// @} + + + /// @name Conversion between time and phase + /// @{ + + /** @brief Returns the index of the logic at the given simulation step + * @return The (estimated) index of the tls at the given simulation time step (here, always zero will be returned) + * @see MSTrafficLightLogic::getPhaseIndexAtTime + */ + SUMOTime getPhaseIndexAtTime(SUMOTime simStep) const; + + + /** @brief Returns the position (start of a phase during a cycle) from of a given step + * @param[in] index The index of the phase to return the begin of + * @return The begin time of the phase (here, always zero will be returned) + * @see MSTrafficLightLogic::getOffsetFromIndex + */ + SUMOTime getOffsetFromIndex(unsigned int index) const; + + + /** @brief Returns the step (the phasenumber) of a given position of the cycle + * @param[in] offset The offset (time) for which the according phase shall be returned + * @return The according phase (here, always zero will be returned) + * @see MSTrafficLightLogic::getIndexFromOffset + */ + unsigned int getIndexFromOffset(SUMOTime offset) const; + /// @} + + + /// @name Changing phases and phase durations + /// @{ + + /** @brief Changes the current phase and her duration + * @param[in] tlcontrol The responsible traffic lights control + * @param[in] simStep The current simulation step + * @param[in] step Index of the phase to use + * @param[in] stepDuration The left duration of the phase + * @see MSTrafficLightLogic::changeStepAndDuration + */ + void changeStepAndDuration(MSTLLogicControl& tlcontrol, SUMOTime simStep, unsigned int step, SUMOTime stepDuration) { + UNUSED_PARAMETER(tlcontrol); + UNUSED_PARAMETER(simStep); + UNUSED_PARAMETER(step); + UNUSED_PARAMETER(stepDuration); + } + /// @} + +protected: + + /// The set of lanes going out from the junction + std::vector myOutgoingLanes; + + /// A map that maps a link to its link index + std::map myLinkIndices; + + /// A map that maps an outgoing lane from the junction to its set of links that lead to this lane + std::map > myLinksToLane; + + /// A map that maps a link from the junction to its vector of lanes leading from a previous signal to this link + std::map > myAfferentBlocks; + + /// A map that maps an outgoing lane from the junction to its vector of lanes leading to the next signal + std::map > mySucceedingBlocks; + + +protected: + + /** @brief The list of phases this logic uses + * + * This vector is always empty and only constructed because the superclass MSTrafficLightLogic requires it. + */ + Phases myPhases; + + /// @brief The current phase + MSPhaseDefinition myCurrentPhase; + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Friedemann Wesner /// @date Sept 2002 -/// @version $Id: MSSimpleTrafficLightLogic.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSSimpleTrafficLightLogic.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A fixed traffic light logic /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -70,7 +70,7 @@ // ------------ Switching and setting current rows SUMOTime -MSSimpleTrafficLightLogic::trySwitch(bool) { +MSSimpleTrafficLightLogic::trySwitch() { // check whether the current duration shall be increased if (myCurrentDurationIncrement > 0) { SUMOTime delay = myCurrentDurationIncrement; @@ -142,7 +142,7 @@ SUMOTime MSSimpleTrafficLightLogic::getPhaseIndexAtTime(SUMOTime simStep) const { SUMOTime position = 0; - if (myStep > 0) { + if (myStep > 0) { for (unsigned int i = 0; i < myStep; i++) { position = position + getPhase(i).duration; } @@ -161,7 +161,7 @@ return 0; } unsigned int pos = 0; - for (unsigned int i = 0; i < index; i++) { + for (unsigned int i = 0; i < index; i++) { pos += getPhase(i).duration; } return pos; @@ -175,7 +175,7 @@ return 0; } SUMOTime testPos = 0; - for (unsigned int i = 0; i < myPhases.size(); i++) { + for (unsigned int i = 0; i < myPhases.size(); i++) { testPos = testPos + getPhase(i).duration; if (testPos > offset) { return i; @@ -200,7 +200,7 @@ setTrafficLightSignals(simStep); tlcontrol.get(getID()).executeOnSwitchActions(); } - MSNet::getInstance()->getBeginOfTimestepEvents().addEvent( + MSNet::getInstance()->getBeginOfTimestepEvents()->addEvent( mySwitchCommand, stepDuration + simStep, MSEventControl::ADAPT_AFTER_EXECUTION); } diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Friedemann Wesner /// @date Sept 2002 -/// @version $Id: MSSimpleTrafficLightLogic.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSSimpleTrafficLightLogic.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A fixed traffic light logic /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -81,11 +81,10 @@ /// @{ /** @brief Switches to the next phase - * @param[in] isActive Whether this program is the currently used one * @return The time of the next switch * @see MSTrafficLightLogic::trySwitch */ - SUMOTime trySwitch(bool isActive); + SUMOTime trySwitch(); /// @} @@ -120,6 +119,13 @@ * @see MSTrafficLightLogic::getPhase */ const MSPhaseDefinition& getPhase(unsigned int givenstep) const; + + /** @brief Returns the type of the logic as a string + * @return The type of the logic + */ + const std::string getLogicType() const { + return "simpleTrafficLightLogic"; + } /// @} diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSTLLogicControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSTLLogicControl.cpp --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSTLLogicControl.cpp 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSTLLogicControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -8,12 +8,12 @@ /// @author Michael Behrisch /// @author Sascha Krieg /// @date Sept 2002 -/// @version $Id: MSTLLogicControl.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSTLLogicControl.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A class that stores and controls tls and switching of their programs /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -427,7 +427,7 @@ SUMOTime begin = TIME2STEPS(def.begin); unsigned int end = TIME2STEPS(def.end); size_t stepOfBegin = myTo->getIndexFromOffset(begin); - if (stepOfBegin == actStep) { + if (stepOfBegin == actStep) { if (begin < startPos) { toCut = end - startPos; } else { @@ -771,7 +771,7 @@ // activate the first one if (first != w->switches.end()) { std::vector::const_iterator mbegin = w->switches.begin(); - MSNet::getInstance()->getBeginOfTimestepEvents().addEvent( + MSNet::getInstance()->getBeginOfTimestepEvents()->addEvent( new SwitchInitCommand(*this, wautid, (unsigned int)distance(mbegin, first)), (*first).when, MSEventControl::NO_CHANGE); } diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSTLLogicControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSTLLogicControl.h --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSTLLogicControl.h 2014-02-22 23:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSTLLogicControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Friedemann Wesner /// @date Sept 2002 -/// @version $Id: MSTLLogicControl.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSTLLogicControl.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A class that stores and controls tls and switching of their programs /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSTrafficLightLogic.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSTrafficLightLogic.cpp --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSTrafficLightLogic.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSTrafficLightLogic.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSTrafficLightLogic.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MSTrafficLightLogic.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // The parent class for traffic light logics /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -45,6 +45,10 @@ #include #endif // CHECK_MEMORY_LEAKS +// =========================================================================== +// static value definitions +// =========================================================================== +const MSTrafficLightLogic::LaneVector MSTrafficLightLogic::myEmptyLaneVector; // =========================================================================== // member method definitions @@ -69,9 +73,9 @@ return 0; } // - bool isActive = myTLControl.isActive(myTLLogic); + const bool isActive = myTLControl.isActive(myTLLogic); size_t step1 = myTLLogic->getCurrentPhaseIndex(); - SUMOTime next = myTLLogic->trySwitch(isActive); + SUMOTime next = myTLLogic->trySwitch(); size_t step2 = myTLLogic->getCurrentPhaseIndex(); if (step1 != step2) { if (isActive) { @@ -107,7 +111,7 @@ myCurrentDurationIncrement(-1), myDefaultCycleTime(0) { mySwitchCommand = new SwitchCommand(tlcontrol, this, delay); - MSNet::getInstance()->getBeginOfTimestepEvents().addEvent( + MSNet::getInstance()->getBeginOfTimestepEvents()->addEvent( mySwitchCommand, delay, MSEventControl::NO_CHANGE); } @@ -116,13 +120,20 @@ MSTrafficLightLogic::init(NLDetectorBuilder&) { const Phases& phases = getPhases(); if (phases.size() > 1) { + bool haveWarnedAboutUnusedStates = false; // warn about transistions from green to red without intermediate yellow for (int i = 0; i < (int)phases.size(); ++i) { const int iNext = (i + 1) % phases.size(); const std::string& state1 = phases[i]->getState(); const std::string& state2 = phases[iNext]->getState(); assert(state1.size() == state2.size()); - for (int j = 0; j < (int)MIN2(state1.size(), state2.size()); ++j) { + if (!haveWarnedAboutUnusedStates && state1.size() > myLanes.size()) { + WRITE_WARNING("Unused states in tlLogic '" + getID() + + "', program '" + getProgramID() + "' in phase " + toString(i) + + " after tl-index " + toString((int)myLanes.size() - 1)); + haveWarnedAboutUnusedStates = true; + } + for (int j = 0; j < (int)MIN3(state1.size(), state2.size(), myLanes.size()); ++j) { if ((LinkState)state2[j] == LINKSTATE_TL_RED && ((LinkState)state1[j] == LINKSTATE_TL_GREEN_MAJOR || (LinkState)state1[j] == LINKSTATE_TL_GREEN_MINOR)) { diff -Nru sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSTrafficLightLogic.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSTrafficLightLogic.h --- sumo-0.21.0+dfsg/src/microsim/traffic_lights/MSTrafficLightLogic.h 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/traffic_lights/MSTrafficLightLogic.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Friedemann Wesner /// @date Sept 2002 -/// @version $Id: MSTrafficLightLogic.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: MSTrafficLightLogic.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The parent class for traffic light logics /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -151,7 +151,7 @@ * @param[in] isActive Whether this program is the currently used one * @return The time of the next switch */ - virtual SUMOTime trySwitch(bool isActive) = 0; + virtual SUMOTime trySwitch() = 0; /** @brief Applies the current signal states to controlled links @@ -189,7 +189,11 @@ * @return The lanes controlled by the signal at the given index */ const LaneVector& getLanesAt(unsigned int i) const { - return myLanes[i]; + if ((size_t)i < myLanes.size()) { + return myLanes[i]; + } else { + return myEmptyLaneVector; + } } @@ -234,6 +238,11 @@ * @return The definition of the phase at the given position */ virtual const MSPhaseDefinition& getPhase(unsigned int givenstep) const = 0; + + /** @brief Returns the type of the logic as a string + * @return The type of the logic + */ + virtual const std::string getLogicType() const = 0; /// @} @@ -389,10 +398,10 @@ /// @brief The id of the logic std::string myProgramID; - /// @brief The list of links which do participate in this traffic light + /// @brief The list of LinkVectors; each vector contains the links that belong to the same link index LinkVectorVector myLinks; - /// @brief The list of links which do participate in this traffic light + /// @brief The list of LaneVectors; each vector contains the incoming lanes that belong to the same link index LaneVectorVector myLanes; /// @brief A list of duration overrides @@ -407,6 +416,9 @@ /// @brief The cycle time (without changes) SUMOTime myDefaultCycleTime; + /// @brief An empty lane vector + static const LaneVector myEmptyLaneVector; + private: /// @brief invalidated copy constructor diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/Makefile.am --- sumo-0.21.0+dfsg/src/microsim/trigger/Makefile.am 2013-08-05 10:53:35.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -2,7 +2,8 @@ libmicrosimtrigger_a_SOURCES = MSBusStop.cpp MSBusStop.h \ MSCalibrator.cpp MSCalibrator.h \ +MSContainerStop.cpp MSContainerStop.h \ +MSContainerTerminal.cpp MSContainerTerminal.h \ MSLaneSpeedTrigger.cpp MSLaneSpeedTrigger.h \ MSTrigger.h MSTrigger.cpp \ -MSTriggeredReader.cpp MSTriggeredReader.h \ MSTriggeredRerouter.cpp MSTriggeredRerouter.h diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/Makefile.in --- sumo-0.21.0+dfsg/src/microsim/trigger/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -99,9 +99,9 @@ libmicrosimtrigger_a_AR = $(AR) $(ARFLAGS) libmicrosimtrigger_a_LIBADD = am_libmicrosimtrigger_a_OBJECTS = MSBusStop.$(OBJEXT) \ - MSCalibrator.$(OBJEXT) MSLaneSpeedTrigger.$(OBJEXT) \ - MSTrigger.$(OBJEXT) MSTriggeredReader.$(OBJEXT) \ - MSTriggeredRerouter.$(OBJEXT) + MSCalibrator.$(OBJEXT) MSContainerStop.$(OBJEXT) \ + MSContainerTerminal.$(OBJEXT) MSLaneSpeedTrigger.$(OBJEXT) \ + MSTrigger.$(OBJEXT) MSTriggeredRerouter.$(OBJEXT) libmicrosimtrigger_a_OBJECTS = $(am_libmicrosimtrigger_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -223,6 +223,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -233,7 +235,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -330,9 +331,10 @@ noinst_LIBRARIES = libmicrosimtrigger.a libmicrosimtrigger_a_SOURCES = MSBusStop.cpp MSBusStop.h \ MSCalibrator.cpp MSCalibrator.h \ +MSContainerStop.cpp MSContainerStop.h \ +MSContainerTerminal.cpp MSContainerTerminal.h \ MSLaneSpeedTrigger.cpp MSLaneSpeedTrigger.h \ MSTrigger.h MSTrigger.cpp \ -MSTriggeredReader.cpp MSTriggeredReader.h \ MSTriggeredRerouter.cpp MSTriggeredRerouter.h all: all-am @@ -386,9 +388,10 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSBusStop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSCalibrator.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSContainerStop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSContainerTerminal.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@ .cpp.o: diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSBusStop.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSBusStop.cpp --- sumo-0.21.0+dfsg/src/microsim/trigger/MSBusStop.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSBusStop.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 13.12.2005 -/// @version $Id: MSBusStop.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSBusStop.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A lane area vehicles can halt at /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -32,7 +32,7 @@ #include #include "MSTrigger.h" #include "MSBusStop.h" -#include +#include #include #ifdef CHECK_MEMORY_LEAKS diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSBusStop.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSBusStop.h --- sumo-0.21.0+dfsg/src/microsim/trigger/MSBusStop.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSBusStop.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 13.12.2005 -/// @version $Id: MSBusStop.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSBusStop.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A lane area vehicles can halt at /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -141,10 +141,12 @@ return static_cast(myWaitingPersons.size()); } + /// @brief adds a person to this stop void addPerson(MSPerson* p) { myWaitingPersons.push_back(p); } + /// @brief Removes a person from this stop void removePerson(MSPerson* p) { std::vector::iterator i = std::find(myWaitingPersons.begin(), myWaitingPersons.end(), p); if (i != myWaitingPersons.end()) { diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSCalibrator.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSCalibrator.cpp --- sumo-0.21.0+dfsg/src/microsim/trigger/MSCalibrator.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSCalibrator.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, May 2005 -/// @version $Id: MSCalibrator.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSCalibrator.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Calibrates the flow on an edge by removing an inserting vehicles /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include "MSCalibrator.h" #ifdef CHECK_MEMORY_LEAKS @@ -115,7 +115,7 @@ } myCurrentStateInterval = myIntervals.begin(); // calibration should happen after regular insertions have taken place - MSNet::getInstance()->getEndOfTimestepEvents().addEvent(this, + MSNet::getInstance()->getEndOfTimestepEvents()->addEvent(this, MSNet::getInstance()->getCurrentTimeStep(), MSEventControl::ADAPT_AFTER_EXECUTION); } else { @@ -370,7 +370,7 @@ newPars->depart = currentTime; newPars->routeid = route->getID(); MSVehicle* vehicle = dynamic_cast(MSNet::getInstance()->getVehicleControl().buildVehicle( - newPars, route, vtype)); + newPars, route, vtype, true, false)); #ifdef MSCalibrator_DEBUG std::cout << " resetting route pos: " << routeIndex << "\n"; #endif diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSCalibrator.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSCalibrator.h --- sumo-0.21.0+dfsg/src/microsim/trigger/MSCalibrator.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSCalibrator.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, May 2005 -/// @version $Id: MSCalibrator.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSCalibrator.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Calibrates the flow on an edge by removing an inserting vehicles /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSContainerStop.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSContainerStop.cpp --- sumo-0.21.0+dfsg/src/microsim/trigger/MSContainerStop.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSContainerStop.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,115 @@ +/****************************************************************************/ +/// @file MSContainerStop.cpp +/// @author Daniel Krajzewicz +/// @author Michael Behrisch +/// @date Mon, 13.12.2005 +/// @version $Id: MSContainerStop.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// A lane area vehicles can halt at +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 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 "MSTrigger.h" +#include "MSContainerStop.h" +#include +#include + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +MSContainerStop::MSContainerStop(const std::string& id, + const std::vector& lines, + MSLane& lane, + SUMOReal begPos, SUMOReal endPos) + : Named(id), myLines(lines), myLane(lane), + myBegPos(begPos), myEndPos(endPos), myLastFreePos(endPos) { + computeLastFreePos(); +} + + +MSContainerStop::~MSContainerStop() {} + + +const MSLane& +MSContainerStop::getLane() const { + return myLane; +} + + +SUMOReal +MSContainerStop::getBeginLanePosition() const { + return myBegPos; +} + + +SUMOReal +MSContainerStop::getEndLanePosition() const { + return myEndPos; +} + + +void +MSContainerStop::enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end) { + myEndPositions[what] = std::pair(beg, end); + computeLastFreePos(); +} + + +SUMOReal +MSContainerStop::getLastFreePos(const SUMOVehicle& forVehicle) const { + if (myLastFreePos != myEndPos) { + return myLastFreePos - forVehicle.getVehicleType().getMinGap(); + } + return myLastFreePos; +} + + +void +MSContainerStop::leaveFrom(SUMOVehicle* what) { + assert(myEndPositions.find(what) != myEndPositions.end()); + myEndPositions.erase(myEndPositions.find(what)); + computeLastFreePos(); +} + + +void +MSContainerStop::computeLastFreePos() { + myLastFreePos = myEndPos; + std::map >::iterator i; + for (i = myEndPositions.begin(); i != myEndPositions.end(); i++) { + if (myLastFreePos > (*i).second.second) { + myLastFreePos = (*i).second.second; + } + } +} + + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSContainerStop.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSContainerStop.h --- sumo-0.21.0+dfsg/src/microsim/trigger/MSContainerStop.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSContainerStop.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,205 @@ +/****************************************************************************/ +/// @file MSContainerStop.h +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Mon, 13.12.2005 +/// @version $Id: MSContainerStop.h 18096 2015-03-17 09:50:59Z behrisch $ +/// +// A lane area vehicles can halt at and load and unload containers +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 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 MSContainerStop_h +#define MSContainerStop_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSLane; +class SUMOVehicle; +class MSContainer; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSContainerStop + * @brief A lane area vehicles can halt at and load and unload containers + * + * A container stop tracks the last free space a vehicle may halt at by being + * informed about a vehicle's entering and depart. It keeps the information + * about entered vehicles' begin and end position within an internal + * container ("myEndPositions") and is so able to compute the last free space. + * + * Please note that using the last free space disallows vehicles to enter a + * free space in between other vehicles. + */ +class MSContainerStop : public Named { +public: + /** @brief Constructor + * + * @param[in] id The id of the container stop + * @param[in] net The net the container stop belongs to + * @param[in] lines Names of the vehicle lines that halt on this container stop + * @param[in] lane The lane the container stop is placed on + * @param[in] begPos Begin position of the container stop on the lane + * @param[in] endPos End position of the container stop on the lane + */ + MSContainerStop(const std::string& id, + const std::vector& lines, MSLane& lane, + SUMOReal begPos, SUMOReal endPos); + + + /// @brief Destructor + virtual ~MSContainerStop(); + + + /** @brief Returns the lane this container stop is located at + * + * @return Reference to the lane the container stop is located at + */ + const MSLane& getLane() const; + + + /** @brief Returns the begin position of this container stop + * + * @return The position the container stop begins at + */ + SUMOReal getBeginLanePosition() const; + + + /** @brief Returns the end position of this container stop + * + * @return The position the container stop ends at + */ + SUMOReal getEndLanePosition() const; + + + /** @brief Called if a vehicle enters this stop + * + * Stores the position of the entering vehicle in myEndPositions. + * + * Recomputes the free space using "computeLastFreePos" then. + * + * @param[in] what The vehicle that enters the container stop + * @param[in] beg The begin halting position of the vehicle + * @param[in] what The end halting position of the vehicle + * @see computeLastFreePos + */ + void enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end); + + + /** @brief Called if a vehicle leaves this stop + * + * Removes the position of the vehicle from myEndPositions. + * + * Recomputes the free space using "computeLastFreePos" then. + * + * @param[in] what The vehicle that leaves the container stop + * @see computeLastFreePos + */ + void leaveFrom(SUMOVehicle* what); + + + /** @brief Returns the last free position on this stop + * + * @return The last free position of this container stop + */ + SUMOReal getLastFreePos(const SUMOVehicle& forVehicle) const; + + + /** @brief Returns the number of containers waiting on this stop + */ + unsigned int getContainerNumber() const { + return static_cast(myWaitingContainers.size()); + } + + /// @brief Adds a container to this stop + void addContainer(MSContainer* container) { + myWaitingContainers.push_back(container); + } + + /// @brief Removes a container from this stop + void removeContainer(MSContainer* container) { + std::vector::iterator i = std::find(myWaitingContainers.begin(), myWaitingContainers.end(), container); + if (i != myWaitingContainers.end()) { + myWaitingContainers.erase(i); + } + } + +protected: + /** @brief Computes the last free position on this stop + * + * The last free position is the one, the last vehicle ends at. + * It is stored in myLastFreePos. If no vehicle halts, the last free + * position gets the value of myEndPos. + */ + void computeLastFreePos(); + + +protected: + /// @brief The list of lines that are assigned to this stop + std::vector myLines; + + /// @brief A map from objects (vehicles) to the areas they acquire after entering the stop + std::map > myEndPositions; + + /// @brief The lane this stop is located at + MSLane& myLane; + + /// @brief The begin position this stop is located at + SUMOReal myBegPos; + + /// @brief The end position this stop is located at + SUMOReal myEndPos; + + /// @brief The last free position at this stop (variable) + SUMOReal myLastFreePos; + + /// @brief Containers waiting at this stop + std::vector myWaitingContainers; + + +private: + /// @brief Invalidated copy constructor. + MSContainerStop(const MSContainerStop&); + + /// @brief Invalidated assignment operator. + MSContainerStop& operator=(const MSContainerStop&); + + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSContainerTerminal.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSContainerTerminal.cpp --- sumo-0.21.0+dfsg/src/microsim/trigger/MSContainerTerminal.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSContainerTerminal.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,111 @@ +/****************************************************************************/ +/// @file MSContainerTerminal.cpp +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Mon, 13.12.2005 +/// @version $Id: MSContainerTerminal.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// A collection of stops for container where containers can be transhiped +// from one stop to another within the terminal. +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 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 "MSTrigger.h" +#include "MSContainerTerminal.h" +//#include +//#include + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +MSContainerTerminal::MSContainerTerminal(const std::string& id, + const std::set stops) + : Named(id), myStops(stops) {} + + +MSContainerTerminal::~MSContainerTerminal() {} + +// +//const MSLane& +//MSContainerTerminal::getLane() const { +// return myLane; +//} +// +// +//SUMOReal +//MSContainerTerminal::getBeginLanePosition() const { +// return myBegPos; +//} +// +// +//SUMOReal +//MSContainerTerminal::getEndLanePosition() const { +// return myEndPos; +//} +// +// +//void +//MSContainerTerminal::enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end) { +// myEndPositions[what] = std::pair(beg, end); +// computeLastFreePos(); +//} +// +// +//SUMOReal +//MSContainerTerminal::getLastFreePos(const SUMOVehicle& forVehicle) const { +// if (myLastFreePos != myEndPos) { +// return myLastFreePos - forVehicle.getVehicleType().getMinGap(); +// } +// return myLastFreePos; +//} +// +// +//void +//MSContainerTerminal::leaveFrom(SUMOVehicle* what) { +// assert(myEndPositions.find(what) != myEndPositions.end()); +// myEndPositions.erase(myEndPositions.find(what)); +// computeLastFreePos(); +//} +// +// +//void +//MSContainerTerminal::computeLastFreePos() { +// myLastFreePos = myEndPos; +// std::map >::iterator i; +// for (i = myEndPositions.begin(); i != myEndPositions.end(); i++) { +// if (myLastFreePos > (*i).second.second) { +// myLastFreePos = (*i).second.second; +// } +// } +//} + + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSContainerTerminal.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSContainerTerminal.h --- sumo-0.21.0+dfsg/src/microsim/trigger/MSContainerTerminal.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSContainerTerminal.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,179 @@ +/****************************************************************************/ +/// @file MSContainerTerminal.h +/// @author Melanie Weber +/// @author Andreas Kendziorra +/// @date Mon, 13.12.2005 +/// @version $Id: MSContainerTerminal.h 18096 2015-03-17 09:50:59Z behrisch $ +/// +// A collection of stops for container where containers can be transhiped +// from one stop to another within the terminal. +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 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 MSContainerTerminal_h +#define MSContainerTerminal_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +//#include +////#include +//#include +//#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +//class MSLane; +//class SUMOVehicle; +class MSContainerStop; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MSContainerTerminal + * @brief A collection of stops for containers where containers can be + * transhiped from one stop to another within the terminal. + * + * A container terminal consists of several container stops. See MSContainerStop. + * + * Once a container arrives at the terminal (either by insertion or by arriving + * via a vehicle at a certain stop of the terminal), the container teleports + * immediately to the stop it has to depart from. + * + */ +class MSContainerTerminal : public Named { +public: + /** @brief Constructor + * + * @param[in] id The id of the container terminal + * @param[in] myStops The set of stops that belong to the container terminal + */ + MSContainerTerminal(const std::string& id, + const std::set stops); + + + /// @brief Destructor + virtual ~MSContainerTerminal(); +// +// +// /** @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; +// +// +// /** @brief Returns the begin position of this bus stop +// * +// * @return The position the bus stop begins at +// */ +// SUMOReal getBeginLanePosition() const; +// +// +// /** @brief Returns the end position of this bus stop +// * +// * @return The position the bus stop ends at +// */ +// SUMOReal getEndLanePosition() const; +// +// +// /** @brief Called if a vehicle enters this stop +// * +// * Stores the position of the entering vehicle in myEndPositions. +// * +// * Recomputes the free space using "computeLastFreePos" then. +// * +// * @param[in] what The vehicle that enters the bus stop +// * @param[in] beg The begin halting position of the vehicle +// * @param[in] what The end halting position of the vehicle +// * @see computeLastFreePos +// */ +// void enter(SUMOVehicle* what, SUMOReal beg, SUMOReal end); +// +// +// /** @brief Called if a vehicle leaves this stop +// * +// * Removes the position of the vehicle from myEndPositions. +// * +// * Recomputes the free space using "computeLastFreePos" then. +// * +// * @param[in] what The vehicle that leaves the bus stop +// * @see computeLastFreePos +// */ +// void leaveFrom(SUMOVehicle* what); +// +// +// /** @brief Returns the last free position on this stop +// * +// * @return The last free position of this bus stop +// */ +// SUMOReal getLastFreePos(const 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 +// * +// * The last free position is the one, the last vehicle ends at. +// * It is stored in myLastFreePos. If no vehicle halts, the last free +// * position gets the value of myEndPos. +// */ +// void computeLastFreePos(); +// +// +protected: + /// @brief The set of stops of this terminal + std::set myStops; + +private: + /// @brief Invalidated copy constructor. + MSContainerTerminal(const MSContainerTerminal&); + + /// @brief Invalidated assignment operator. + MSContainerTerminal& operator=(const MSContainerTerminal&); + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSLaneSpeedTrigger.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSLaneSpeedTrigger.cpp --- sumo-0.21.0+dfsg/src/microsim/trigger/MSLaneSpeedTrigger.cpp 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSLaneSpeedTrigger.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: MSLaneSpeedTrigger.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSLaneSpeedTrigger.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Changes the speed allowed on a set of lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -96,7 +96,7 @@ } // add the processing to the event handler - MSNet::getInstance()->getBeginOfTimestepEvents().addEvent( + MSNet::getInstance()->getBeginOfTimestepEvents()->addEvent( new WrappingCommand(this, &MSLaneSpeedTrigger::execute), (*myCurrentEntry).first, MSEventControl::NO_CHANGE); myDidInit = true; diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSLaneSpeedTrigger.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSLaneSpeedTrigger.h --- sumo-0.21.0+dfsg/src/microsim/trigger/MSLaneSpeedTrigger.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSLaneSpeedTrigger.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: MSLaneSpeedTrigger.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSLaneSpeedTrigger.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Changes the speed allowed on a set of lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSTrigger.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSTrigger.cpp --- sumo-0.21.0+dfsg/src/microsim/trigger/MSTrigger.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSTrigger.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2012 -/// @version $Id: MSTrigger.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MSTrigger.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An abstract device that changes the state of the micro simulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSTriggeredReader.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSTriggeredReader.cpp --- sumo-0.21.0+dfsg/src/microsim/trigger/MSTriggeredReader.cpp 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSTriggeredReader.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,98 +0,0 @@ -/****************************************************************************/ -/// @file MSTriggeredReader.cpp -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @date Sept 2002 -/// @version $Id: MSTriggeredReader.cpp 15692 2014-02-22 09:17:02Z behrisch $ -/// -// The basic class for classes that read triggers -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 "MSTriggeredReader.h" - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// method definitions -// =========================================================================== -MSTriggeredReader::MSTriggeredReader(MSNet&) - : myOffset(0), myWasInitialised(false) {} - - -MSTriggeredReader::~MSTriggeredReader() {} - - -void -MSTriggeredReader::init() { - myInit(); - myWasInitialised = true; -} - - -bool -MSTriggeredReader::isInitialised() const { - return myWasInitialised; -} - - -SUMOTime -MSTriggeredReader::wrappedExecute(SUMOTime current) { - if (!isInitialised()) { - init(); - } - SUMOTime next = current; - // loop until the next action lies in the future - while (current == next) { - // run the next action - // if it could be accomplished... - if (processNextEntryReaderTriggered()) { - // read the next one - if (readNextTriggered()) { - // set the time for comparison if a next one exists - next = myOffset; - } else { - // leave if no further exists - return 0; - } - } else { - // action could not be accomplished; try next time step - return DELTA_T; - } - } - // come back if the next action shall be executed - if (myOffset - current <= 0) { - // current is delayed; - return DELTA_T; - } - return myOffset - current; -} - - - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSTriggeredReader.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSTriggeredReader.h --- sumo-0.21.0+dfsg/src/microsim/trigger/MSTriggeredReader.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSTriggeredReader.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -/****************************************************************************/ -/// @file MSTriggeredReader.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @date Sept 2002 -/// @version $Id: MSTriggeredReader.h 15692 2014-02-22 09:17:02Z behrisch $ -/// -// The basic class for classes that read triggers -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 MSTriggeredReader_h -#define MSTriggeredReader_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class MSTriggeredReader - * Superclass for structures that read from a file where the times the next - * reading is performed are triggered by events, - */ -class MSTriggeredReader { -public: - /// Destructor - virtual ~MSTriggeredReader(); - - void init(); - bool isInitialised() const; - SUMOTime wrappedExecute(SUMOTime current); - -protected: - /// Constructor (for an abstract class) - MSTriggeredReader(MSNet& net); - - /** @brief Processes the next event - Returns true if the next element shall be read (a new timestemp is then available also) - Returns false if the action could not be accomplished; this method is then called in the next step again */ - virtual bool processNextEntryReaderTriggered() = 0; - - /// Reads from the file - virtual bool readNextTriggered() = 0; - - virtual void myInit() = 0; - - virtual void inputEndReached() = 0; - - -protected: - /// The offset to the next event - SUMOTime myOffset; - bool myWasInitialised; - -private: - /// @brief Invalidated copy constructor. - MSTriggeredReader(const MSTriggeredReader&); - - /// @brief Invalidated assignment operator. - MSTriggeredReader& operator=(const MSTriggeredReader&); - - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSTriggeredRerouter.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSTriggeredRerouter.cpp --- sumo-0.21.0+dfsg/src/microsim/trigger/MSTriggeredRerouter.cpp 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSTriggeredRerouter.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 25 July 2005 -/// @version $Id: MSTriggeredRerouter.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSTriggeredRerouter.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Reroutes vehicles passing an edge /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -37,11 +37,11 @@ #include #include #include -#include #include #include -#include +#include #include +#include #include #include #include @@ -64,25 +64,21 @@ // =========================================================================== // static member defintion // =========================================================================== -MSEdge MSTriggeredRerouter::mySpecialDest_keepDestination("MSTriggeredRerouter_keepDestination", -1, MSEdge::EDGEFUNCTION_UNKNOWN); -MSEdge MSTriggeredRerouter::mySpecialDest_terminateRoute("MSTriggeredRerouter_terminateRoute", -1, MSEdge::EDGEFUNCTION_UNKNOWN); +MSEdge MSTriggeredRerouter::mySpecialDest_keepDestination("MSTriggeredRerouter_keepDestination", -1, MSEdge::EDGEFUNCTION_UNKNOWN, "", "", -1); +MSEdge MSTriggeredRerouter::mySpecialDest_terminateRoute("MSTriggeredRerouter_terminateRoute", -1, MSEdge::EDGEFUNCTION_UNKNOWN, "", "", -1); // =========================================================================== // method definitions // =========================================================================== MSTriggeredRerouter::MSTriggeredRerouter(const std::string& id, - const std::vector& edges, + const MSEdgeVector& edges, SUMOReal prob, const std::string& file, bool off) : MSTrigger(id), MSMoveReminder(id), SUMOSAXHandler(file), myProbability(prob), myUserProbability(prob), myAmInUserMode(false) { - // read in the trigger description - if (file != "" && !XMLSubSys::runParser(*this, file)) { - throw ProcessError(); - } // build actors - for (std::vector::const_iterator j = edges.begin(); j != edges.end(); ++j) { + for (MSEdgeVector::const_iterator j = edges.begin(); j != edges.end(); ++j) { #ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { MESegment* s = MSGlobals::gMesoNet->getSegmentForEdge(**j); @@ -147,14 +143,15 @@ if (element == SUMO_TAG_CLOSING_REROUTE) { // by closing std::string closed_id = attrs.getStringSecure(SUMO_ATTR_ID, ""); - if (closed_id == "") { - throw ProcessError("MSTriggeredRerouter " + getID() + ": closed edge id given."); - } MSEdge* closed = MSEdge::dictionary(closed_id); if (closed == 0) { throw ProcessError("MSTriggeredRerouter " + getID() + ": Edge '" + closed_id + "' to close is not known."); } myCurrentClosed.push_back(closed); + bool ok; + const std::string allow = attrs.getOpt(SUMO_ATTR_ALLOW, getID().c_str(), ok, "", false); + const std::string disallow = attrs.getOpt(SUMO_ATTR_DISALLOW, getID().c_str(), ok, ""); + myCurrentPermissions = parseVehicleClasses(allow, disallow); } if (element == SUMO_TAG_ROUTE_PROB_REROUTE) { @@ -193,10 +190,16 @@ ri.closed = myCurrentClosed; ri.edgeProbs = myCurrentEdgeProb; ri.routeProbs = myCurrentRouteProb; + ri.permissions = myCurrentPermissions; myCurrentClosed.clear(); myCurrentEdgeProb.clear(); myCurrentRouteProb.clear(); myIntervals.push_back(ri); + if (!ri.closed.empty() && ri.permissions != SVCAll) { + MSNet::getInstance()->getBeginOfTimestepEvents()->addEvent( + new WrappingCommand(this, &MSTriggeredRerouter::setPermissions), ri.begin, + MSEventControl::ADAPT_AFTER_EXECUTION); + } } } @@ -204,67 +207,62 @@ // ------------ loading end -bool -MSTriggeredRerouter::hasCurrentReroute(SUMOTime time, SUMOVehicle& veh) const { - std::vector::const_iterator i = myIntervals.begin(); - const MSRoute& route = veh.getRoute(); - while (i != myIntervals.end()) { - if ((*i).begin <= time && (*i).end >= time) { - 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; +SUMOTime +MSTriggeredRerouter::setPermissions(const SUMOTime currentTime) { + for (std::vector::iterator i = myIntervals.begin(); i != myIntervals.end(); ++i) { + if (i->begin == currentTime && !i->closed.empty() && i->permissions != SVCAll) { + for (MSEdgeVector::iterator e = i->closed.begin(); e != i->closed.end(); ++e) { + for (std::vector::const_iterator l = (*e)->getLanes().begin(); l != (*e)->getLanes().end(); ++l) { + i->prevPermissions.push_back((*l)->getPermissions()); + (*l)->setPermissions(i->permissions); + } + (*e)->rebuildAllowedLanes(); } - } - i++; - } - return false; -} - - -bool -MSTriggeredRerouter::hasCurrentReroute(SUMOTime time) const { - std::vector::const_iterator i = myIntervals.begin(); - while (i != myIntervals.end()) { - if ((*i).begin <= time && (*i).end >= time) { - if ((*i).edgeProbs.getOverallProb() != 0 || (*i).routeProbs.getOverallProb() != 0 || (*i).closed.size() != 0) { - return true; + MSNet::getInstance()->getBeginOfTimestepEvents()->addEvent( + new WrappingCommand(this, &MSTriggeredRerouter::setPermissions), i->end, + MSEventControl::ADAPT_AFTER_EXECUTION); + } + if (i->end == currentTime && !i->closed.empty() && i->permissions != SVCAll) { + for (MSEdgeVector::iterator e = i->closed.begin(); e != i->closed.end(); ++e) { + std::vector::const_iterator p = i->prevPermissions.begin(); + for (std::vector::const_iterator l = (*e)->getLanes().begin(); l != (*e)->getLanes().end(); ++l, ++p) { + (*l)->setPermissions(*p); + } + (*e)->rebuildAllowedLanes(); } } - i++; } - return false; + return 0; } -const MSTriggeredRerouter::RerouteInterval& +const MSTriggeredRerouter::RerouteInterval* MSTriggeredRerouter::getCurrentReroute(SUMOTime time, SUMOVehicle& veh) const { - std::vector::const_iterator i = myIntervals.begin(); - 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)) { - return *i; + for (std::vector::const_iterator i = myIntervals.begin(); i != myIntervals.end(); ++i) { + if (i->begin <= time && i->end > time) { + if ( + // affected by closingReroute, possibly combined with destProbReroute (route prob makes no sense) + veh.getRoute().containsAnyOf(i->closed) || + // no closingReroute but destProbReroute or routeProbReroute + i->edgeProbs.getOverallProb() > 0 || i->routeProbs.getOverallProb() > 0) { + return &*i; } } - i++; } - throw 1; + return 0; } -const MSTriggeredRerouter::RerouteInterval& -MSTriggeredRerouter::getCurrentReroute(SUMOTime) const { - std::vector::const_iterator i = myIntervals.begin(); - while (i != myIntervals.end()) { - if ((*i).edgeProbs.getOverallProb() != 0 || (*i).routeProbs.getOverallProb() != 0 || (*i).closed.size() != 0) { - return *i; +const MSTriggeredRerouter::RerouteInterval* +MSTriggeredRerouter::getCurrentReroute(SUMOTime time) const { + for (std::vector::const_iterator i = myIntervals.begin(); i != myIntervals.end(); ++i) { + if (i->begin <= time && i->end > time) { + if (i->edgeProbs.getOverallProb() != 0 || i->routeProbs.getOverallProb() != 0 || !i->closed.empty()) { + return &*i; + } } - i++; } - throw 1; + return 0; } @@ -275,8 +273,9 @@ return false; } // check whether the vehicle shall be rerouted - SUMOTime time = MSNet::getInstance()->getCurrentTimeStep(); - if (!hasCurrentReroute(time, veh)) { + const SUMOTime time = MSNet::getInstance()->getCurrentTimeStep(); + const MSTriggeredRerouter::RerouteInterval* rerouteDef = getCurrentReroute(time, veh); + if (rerouteDef == 0) { return false; } @@ -289,8 +288,7 @@ const MSRoute& route = veh.getRoute(); const MSEdge* lastEdge = route.getLastEdge(); // get rerouting params - const MSTriggeredRerouter::RerouteInterval& rerouteDef = getCurrentReroute(time, veh); - const MSRoute* newRoute = rerouteDef.routeProbs.getOverallProb() > 0 ? rerouteDef.routeProbs.get() : 0; + const MSRoute* newRoute = rerouteDef->routeProbs.getOverallProb() > 0 ? rerouteDef->routeProbs.get() : 0; // we will use the route if given rather than calling our own dijsktra... if (newRoute != 0) { veh.replaceRoute(newRoute); @@ -298,10 +296,10 @@ } const MSEdge* newEdge = lastEdge; // ok, try using a new destination - const bool destUnreachable = std::find(rerouteDef.closed.begin(), rerouteDef.closed.end(), lastEdge) != rerouteDef.closed.end(); + 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 (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) { @@ -317,8 +315,8 @@ } } // we have a new destination, let's replace the vehicle route - std::vector edges; - MSNet::getInstance()->getRouterTT(rerouteDef.closed).compute( + ConstMSEdgeVector edges; + MSNet::getInstance()->getRouterTT(rerouteDef->closed).compute( veh.getEdge(), newEdge, &veh, MSNet::getInstance()->getCurrentTimeStep(), edges); veh.replaceRouteEdges(edges); return false; diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSTriggeredRerouter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSTriggeredRerouter.h --- sumo-0.21.0+dfsg/src/microsim/trigger/MSTriggeredRerouter.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSTriggeredRerouter.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 25 July 2005 -/// @version $Id: MSTriggeredRerouter.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSTriggeredRerouter.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Reroutes vehicles passing an edge /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -76,7 +76,7 @@ * @param[in] file The file to read the reroute definitions from */ MSTriggeredRerouter(const std::string& id, - const std::vector& edges, + const MSEdgeVector& edges, SUMOReal prob, const std::string& file, bool off); @@ -94,11 +94,15 @@ /// The end time these definitions are valid SUMOTime end; /// The list of closed edges - std::vector closed; + MSEdgeVector closed; /// The distributions of new destinations to use RandomDistributor edgeProbs; /// The distributions of new routes to use RandomDistributor routeProbs; + /// The permissions to use + SVCPermissions permissions; + /// The old permissions for all lanes + std::vector prevPermissions; }; /** @brief Tries to reroute the vehicle @@ -117,17 +121,14 @@ */ 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; + /// Returns the rerouting definition valid for the given time and vehicle, 0 if none + const RerouteInterval* getCurrentReroute(SUMOTime time, SUMOVehicle& veh) const; - /// Returns the rerouting definition valid for the given time and vehicle - const RerouteInterval& getCurrentReroute(SUMOTime time, SUMOVehicle& veh) const; + /// Sets the edge permission if there are any defined in the closingEdge + SUMOTime setPermissions(const SUMOTime currentTime); - /// Returns whether a rerouting definition is valid for the given time - bool hasCurrentReroute(SUMOTime time) const; - - /// Returns the rerouting definition valid for the given time and vehicle - const RerouteInterval& getCurrentReroute(SUMOTime time) const; + /// Returns the rerouting definition valid for the given time, 0 if none + const RerouteInterval* getCurrentReroute(SUMOTime time) const; /// Sets whether the process is currently steered by the user void setUserMode(bool val); @@ -165,7 +166,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myEndElement */ - void myEndElement(int element); + virtual void myEndElement(int element); //@} protected: @@ -184,7 +185,9 @@ /// The first and the last time steps of the interval SUMOTime myCurrentIntervalBegin, myCurrentIntervalEnd; /// List of closed edges - std::vector myCurrentClosed; + MSEdgeVector myCurrentClosed; + /// List of permissions for closed edges + SVCPermissions myCurrentPermissions; /// new destinations with probabilities RandomDistributor myCurrentEdgeProb; /// new routes with probabilities diff -Nru sumo-0.21.0+dfsg/src/microsim/trigger/MSTrigger.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSTrigger.h --- sumo-0.21.0+dfsg/src/microsim/trigger/MSTrigger.h 2014-02-22 23:02:19.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/microsim/trigger/MSTrigger.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: MSTrigger.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MSTrigger.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An abstract device that changes the state of the micro simulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/Makefile.am --- sumo-0.21.0+dfsg/src/netbuild/Makefile.am 2013-05-03 20:25:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -7,6 +7,7 @@ NBDistribution.cpp NBDistribution.h NBDistrict.cpp NBDistrict.h \ NBDistrictCont.cpp NBDistrictCont.h NBEdge.cpp NBEdge.h \ NBEdgeCont.cpp NBEdgeCont.h NBFrame.cpp NBFrame.h \ +NBHeightMapper.cpp NBHeightMapper.h \ NBHelpers.cpp NBHelpers.h \ NBLinkPossibilityMatrix.h NBNode.cpp NBNode.h \ NBNodeCont.cpp NBNodeCont.h \ diff -Nru sumo-0.21.0+dfsg/src/netbuild/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/Makefile.in --- sumo-0.21.0+dfsg/src/netbuild/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -102,10 +102,10 @@ 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) \ + NBEdgeCont.$(OBJEXT) NBFrame.$(OBJEXT) \ + NBHeightMapper.$(OBJEXT) NBHelpers.$(OBJEXT) NBNode.$(OBJEXT) \ + NBNodeCont.$(OBJEXT) NBNodeShapeComputer.$(OBJEXT) \ + NBRequest.$(OBJEXT) NBTrafficLightDefinition.$(OBJEXT) \ NBTrafficLightLogic.$(OBJEXT) \ NBTrafficLightLogicCont.$(OBJEXT) NBTypeCont.$(OBJEXT) \ NBSign.$(OBJEXT) NBOwnTLDef.$(OBJEXT) NBLoadedTLDef.$(OBJEXT) \ @@ -232,6 +232,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -242,7 +244,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -344,6 +345,7 @@ NBDistribution.cpp NBDistribution.h NBDistrict.cpp NBDistrict.h \ NBDistrictCont.cpp NBDistrictCont.h NBEdge.cpp NBEdge.h \ NBEdgeCont.cpp NBEdgeCont.h NBFrame.cpp NBFrame.h \ +NBHeightMapper.cpp NBHeightMapper.h \ NBHelpers.cpp NBHelpers.h \ NBLinkPossibilityMatrix.h NBNode.cpp NBNode.h \ NBNodeCont.cpp NBNodeCont.h \ @@ -419,6 +421,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBEdge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBEdgeCont.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBFrame.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBHeightMapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBHelpers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBJoinedEdgesMap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NBLoadedSUMOTLDef.Po@am__quote@ diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBAlgorithms.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBAlgorithms.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBAlgorithms.cpp 2014-05-05 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBAlgorithms.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date 02. March 2012 -/// @version $Id: NBAlgorithms.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: NBAlgorithms.cpp 18120 2015-03-20 13:44:18Z namdre $ /// // Algorithms for network computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -68,22 +68,16 @@ 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)) { - // 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 - // such pairs, too, and it probably would increase the accuracy. But there is - // no mechanism implemented, yet, which would avoid adding them as turnarounds though - // no connection is specified. - continue; - } - // @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) { + const SUMOReal signedAngle = NBHelpers::normRelAngle(e->getAngleAtNode(node), outedge->getAngleAtNode(node)); + if (signedAngle > 0 && signedAngle < 177 && e->getGeometry().back().distanceTo2D(outedge->getGeometry().front()) < POSITION_EPS) { + // backwards curving edges can only be turnaround when there are + // non-default endpoints continue; } - if (e->getFromNode() == outedge->getToNode()) { + SUMOReal angle = fabs(signedAngle); + // std::cout << "incoming=" << e->getID() << " outgoing=" << outedge->getID() << " relAngle=" << NBHelpers::relAngle(e->getAngleAtNode(node), outedge->getAngleAtNode(node)) << "\n"; + if (e->getFromNode() == outedge->getToNode() && angle > 120) { // they connect the same nodes; should be the turnaround direction // we'll assign a maximum number // @@ -96,6 +90,9 @@ // be realistic in any means; we will warn, here. angle += 360; } + if (angle < 160) { + continue; + } Combination c; c.from = e; c.to = outedge; @@ -120,7 +117,9 @@ seen.insert((*j).from); seen.insert((*j).to); // set turnaround information - (*j).from->setTurningDestination((*j).to); + bool onlyPossible = (*j).from->getConnections().size() != 0 && !(*j).from->isConnectedTo((*j).to); + //std::cout << " setTurningDestination from=" << (*j).from->getID() << " to=" << (*j).to->getID() << " onlyPossible=" << onlyPossible << "\n"; + (*j).from->setTurningDestination((*j).to, onlyPossible); } } @@ -129,7 +128,7 @@ // NBNodesEdgesSorter // --------------------------------------------------------------------------- void -NBNodesEdgesSorter::sortNodesEdges(NBNodeCont& nc, bool leftHand) { +NBNodesEdgesSorter::sortNodesEdges(NBNodeCont& nc, bool leftHand, bool useNodeShape) { for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { NBNode* n = (*i).second; if (n->myAllEdges.size() == 0) { @@ -139,19 +138,41 @@ EdgeVector& incoming = (*i).second->myIncomingEdges; EdgeVector& outgoing = (*i).second->myOutgoingEdges; std::vector& crossings = (*i).second->myCrossings; - // 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)); - std::sort(outgoing.begin(), outgoing.end(), edge_by_junction_angle_sorter(n)); - std::vector::iterator j; - for (j = allEdges.begin(); j != allEdges.end() - 1 && j != allEdges.end(); ++j) { - swapWhenReversed(n, leftHand, j, j + 1); - } - if (allEdges.size() > 1 && j != allEdges.end()) { - swapWhenReversed(n, leftHand, allEdges.end() - 1, allEdges.begin()); + + if (!useNodeShape || n->getShape().area() < 1) { + // if the area is to small (i.e. for simple-continuation nodes) we better not use it + // sort by the angle of the adjoining line segment of the edge geometry + // 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)); + std::sort(outgoing.begin(), outgoing.end(), edge_by_junction_angle_sorter(n)); + std::vector::iterator j; + for (j = allEdges.begin(); j != allEdges.end() - 1 && j != allEdges.end(); ++j) { + swapWhenReversed(n, leftHand, j, j + 1); + } + if (allEdges.size() > 1 && j != allEdges.end()) { + swapWhenReversed(n, leftHand, allEdges.end() - 1, allEdges.begin()); + } + } else { + NBEdge* firstOfAll = allEdges.front(); + NBEdge* firstOfIncoming = incoming.size() > 0 ? incoming.front() : 0; + NBEdge* firstOfOutgoing = outgoing.size() > 0 ? outgoing.front() : 0; + // sort by the angle between the node shape center and the point where the edge meeds the node shape + sort(allEdges.begin(), allEdges.end(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter(n)); + sort(incoming.begin(), incoming.end(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter(n)); + sort(outgoing.begin(), outgoing.end(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter(n)); + // let the first edge remain the first + rotate(allEdges.begin(), std::find(allEdges.begin(), allEdges.end(), firstOfAll), allEdges.end()); + if (firstOfIncoming != 0) { + rotate(incoming.begin(), std::find(incoming.begin(), incoming.end(), firstOfIncoming), incoming.end()); + } + if (firstOfOutgoing != 0) { + rotate(outgoing.begin(), std::find(outgoing.begin(), outgoing.end(), firstOfOutgoing), outgoing.end()); + } } + // sort the crossings - std::sort(crossings.begin(), crossings.end(), crossing_by_junction_angle_sorter(allEdges)); + std::sort(crossings.begin(), crossings.end(), crossing_by_junction_angle_sorter(n, allEdges)); // DEBUG //if (n->getID() == "cluster_492462300_671564296") { // if (crossings.size() > 0) { @@ -179,7 +200,7 @@ // is not nice. Maybe we could get rid of it if we would always mark edges // as turnarounds, even if they do not have to be added, as mentioned in // notes on NBTurningDirectionsComputer::computeTurnDirectionsForNode - if (e2->getToNode() == n && e2->isTurningDirectionAt(n, e1)) { + if (e2->getToNode() == n && e2->isTurningDirectionAt(e1)) { std::swap(*i1, *i2); } } @@ -281,6 +302,13 @@ bestOutgoing.push_back(*outgoing.begin()); outgoing.erase(outgoing.begin()); } + // special case: user input makes mainDirection unambiguous + const bool mainDirectionExplicit = ( + bestIncoming.size() == 1 && n.myIncomingEdges.size() <= 2 + && (incoming.size() == 0 || bestIncoming[0]->getPriority() > incoming[0]->getPriority()) + && bestOutgoing.size() == 1 && n.myOutgoingEdges.size() <= 2 + && (outgoing.size() == 0 || bestOutgoing[0]->getPriority() > outgoing[0]->getPriority()) + && !bestIncoming[0]->isTurningDirectionAt(bestOutgoing[0])); // now, let's compute for each of the best incoming edges // the incoming which is most opposite // the outgoing which is most opposite @@ -300,7 +328,7 @@ if (bestIncoming.size() == 1) { // let's mark this road as the best NBEdge* best1 = extractAndMarkFirst(n, bestIncoming); - if (counterIncomingEdges.find(best1) != counterIncomingEdges.end()) { + if (!mainDirectionExplicit && 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 @@ -309,15 +337,15 @@ s->setJunctionPriority(&n, 1); } } - if (bestOutgoing.size() != 0) { - // 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) { - s->setJunctionPriority(&n, 1); - } + assert(bestOutgoing.size() != 0); + // mark the best outgoing as the continuation + sort(bestOutgoing.begin(), bestOutgoing.end(), NBContHelper::edge_similar_direction_sorter(best1)); + // assign extra priority if the priorities are unambiguous (regardless of geometry) + best1 = extractAndMarkFirst(n, bestOutgoing); + if (!mainDirectionExplicit && 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); } } return; @@ -334,13 +362,13 @@ for (i = bestIncoming.begin(); i != bestIncoming.end(); ++i) { EdgeVector::iterator j; NBEdge* t1 = *i; - SUMOReal angle1 = t1->getTotalAngle() + 180; + SUMOReal angle1 = t1->getAngleAtNode(&n) + 180; if (angle1 >= 360) { angle1 -= 360; } for (j = i + 1; j != bestIncoming.end(); ++j) { NBEdge* t2 = *j; - SUMOReal angle2 = t2->getTotalAngle() + 180; + SUMOReal angle2 = t2->getAngleAtNode(&n) + 180; if (angle2 >= 360) { angle2 -= 360; } @@ -367,13 +395,13 @@ NBEdge* -NBEdgePriorityComputer::extractAndMarkFirst(NBNode& n, std::vector& s) { +NBEdgePriorityComputer::extractAndMarkFirst(NBNode& n, std::vector& s, int prio) { if (s.size() == 0) { return 0; } NBEdge* ret = s.front(); s.erase(s.begin()); - ret->setJunctionPriority(&n, 1); + ret->setJunctionPriority(&n, prio); return ret; } @@ -393,5 +421,14 @@ } +NBNodesEdgesSorter::crossing_by_junction_angle_sorter::crossing_by_junction_angle_sorter(const NBNode* node, const EdgeVector& ordering) { + // reorder based on getAngleAtNodeToCenter + myOrdering = ordering; + sort(myOrdering.begin(), myOrdering.end(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter(node)); + // let the first edge remain the first + rotate(myOrdering.begin(), std::find(myOrdering.begin(), myOrdering.end(), ordering.front()), myOrdering.end()); +} + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBAlgorithms.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBAlgorithms.h --- sumo-0.21.0+dfsg/src/netbuild/NBAlgorithms.h 2014-05-22 22:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBAlgorithms.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date 02. March 2012 -/// @version $Id: NBAlgorithms.h 16410 2014-05-22 07:07:42Z behrisch $ +/// @version $Id: NBAlgorithms.h 18096 2015-03-17 09:50:59Z behrisch $ /// // Algorithms for network computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -108,8 +108,9 @@ /** @brief Sorts a node's edges clockwise regarding driving direction * @param[in] nc The container of nodes to loop along * @param[in] leftHand Whether the network is left-handed + * @param[in] useNodeShape Whether to sort based on the node shape (instead of only the edge angle) */ - static void sortNodesEdges(NBNodeCont& nc, bool leftHand); + static void sortNodesEdges(NBNodeCont& nc, bool leftHand, bool useNodeShape = false); /** @class crossing_by_junction_angle_sorter * @brief Sorts crossings by minimum clockwise clockwise edge angle. Use the @@ -117,7 +118,8 @@ */ class crossing_by_junction_angle_sorter { public: - explicit crossing_by_junction_angle_sorter(const EdgeVector& ordering) : myOrdering(ordering) {} + explicit crossing_by_junction_angle_sorter(const NBNode* node, const EdgeVector& ordering); + int operator()(const NBNode::Crossing& c1, const NBNode::Crossing& c2) const { return (int)(getMinRank(c1.edges) < getMinRank(c2.edges)); } @@ -134,7 +136,7 @@ } private: - const EdgeVector& myOrdering; + EdgeVector myOrdering; private: /// @brief invalidated assignment operator @@ -233,9 +235,10 @@ /** @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 + * @param[in] prio The priority to assign * @return The vector's first edge */ - static NBEdge* extractAndMarkFirst(NBNode& n, std::vector& s); + static NBEdge* extractAndMarkFirst(NBNode& n, std::vector& s, int prio = 1); /** @brief Returns whether both edges have the same priority * @param[in] e1 The first edge diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBAlgorithms_Ramps.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBAlgorithms_Ramps.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBAlgorithms_Ramps.cpp 2014-05-08 22:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBAlgorithms_Ramps.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 29. March 2012 -/// @version $Id: NBAlgorithms_Ramps.cpp 16332 2014-05-08 21:45:35Z behrisch $ +/// @version $Id: NBAlgorithms_Ramps.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Algorithms for highway on-/off-ramps computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -167,7 +167,7 @@ if (curr->getNumLanes() != firstLaneNumber) { // the number of lanes changes along the computation; we'll stop... curr = 0; - } else if (curr->isTurningDirectionAt(nextN, last)) { + } else if (curr->isTurningDirectionAt(last)) { // turnarounds certainly should not be included in a ramp curr = 0; } else if (curr == potHighway || curr == potRamp) { @@ -195,7 +195,6 @@ } //ec.retrieve(name)->invalidateConnections(); curr = ec.retrieve(name + ADDED_ON_RAMP_EDGE); - curr->invalidateConnections(true); incremented.insert(curr); last = curr; moveRampRight(curr, toAdd); @@ -220,14 +219,6 @@ 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); - } - } } @@ -258,7 +249,7 @@ if (curr->getNumLanes() != firstLaneNumber) { // the number of lanes changes along the computation; we'll stop... curr = 0; - } else if (last->isTurningDirectionAt(prevN, curr)) { + } else if (last->isTurningDirectionAt(curr)) { // turnarounds certainly should not be included in a ramp curr = 0; } else if (curr == potHighway || curr == potRamp) { @@ -286,7 +277,6 @@ return; } curr = ec.retrieve(name + "-AddedOffRampEdge"); - curr->invalidateConnections(true); incremented.insert(curr); last = curr; moveRampRight(curr, toAdd); @@ -311,14 +301,6 @@ 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); - } - } } @@ -329,8 +311,9 @@ } try { PositionVector g = ramp->getGeometry(); - SUMOReal factor = SUMO_const_laneWidthAndOffset * (SUMOReal)(addedLanes - 1) + SUMO_const_halfLaneAndOffset * (SUMOReal)(addedLanes % 2); - g.move2side(factor); + const SUMOReal offset = (0.5 * addedLanes * + (ramp->getLaneWidth() == NBEdge::UNSPECIFIED_WIDTH ? SUMO_const_laneWidth : ramp->getLaneWidth())); + g.move2side(offset); ramp->setGeometry(g); } catch (InvalidArgument&) { WRITE_WARNING("For edge '" + ramp->getID() + "': could not compute shape."); @@ -439,14 +422,14 @@ // is any of the connections a turnaround? if (other->getToNode() == potHighway->getFromNode()) { // off ramp - if (other->isTurningDirectionAt(other->getToNode(), potHighway) || - other->isTurningDirectionAt(other->getToNode(), potRamp)) { + if (other->isTurningDirectionAt(potHighway) || + other->isTurningDirectionAt(potRamp)) { return false; } } else { // on ramp - if (other->isTurningDirectionAt(other->getFromNode(), potHighway) || - other->isTurningDirectionAt(other->getFromNode(), potRamp)) { + if (other->isTurningDirectionAt(potHighway) || + other->isTurningDirectionAt(potRamp)) { return false; } } diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBAlgorithms_Ramps.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBAlgorithms_Ramps.h --- sumo-0.21.0+dfsg/src/netbuild/NBAlgorithms_Ramps.h 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBAlgorithms_Ramps.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date 29. March 2012 -/// @version $Id: NBAlgorithms_Ramps.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NBAlgorithms_Ramps.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Algorithms for highway on-/off-ramps computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBCapacity2Lanes.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBCapacity2Lanes.h --- sumo-0.21.0+dfsg/src/netbuild/NBCapacity2Lanes.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBCapacity2Lanes.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Sascha Krieg /// @date Fri, 19 Jul 2002 -/// @version $Id: NBCapacity2Lanes.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBCapacity2Lanes.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A helper class which computes the lane number from given capacity /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBConnection.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBConnection.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBConnection.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBConnection.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBConnection.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBConnection.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The class holds a description of a connection between two edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBConnectionDefs.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBConnectionDefs.h --- sumo-0.21.0+dfsg/src/netbuild/NBConnectionDefs.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBConnectionDefs.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NBConnectionDefs.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NBConnectionDefs.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBConnectionDefs.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some container for connections /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBConnection.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBConnection.h --- sumo-0.21.0+dfsg/src/netbuild/NBConnection.h 2014-05-05 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBConnection.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Sascha Krieg /// @date Sept 2002 -/// @version $Id: NBConnection.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: NBConnection.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The class holds a description of a connection between two edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBCont.h --- sumo-0.21.0+dfsg/src/netbuild/NBCont.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Sascha Krieg /// @date Mon, 17 Dec 2001 -/// @version $Id: NBCont.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBCont.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some list definitions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -25,6 +25,9 @@ // =========================================================================== // included modules // =========================================================================== +#include +#include + #ifdef _MSC_VER #include #else @@ -44,6 +47,9 @@ /** container for (sorted) edges */ typedef std::vector EdgeVector; +/** container for unique edges */ +typedef std::set EdgeSet; + /** container for (sorted) lanes. The lanes are sorted from rightmost (id=0) to leftmost (id=nolanes-1) */ diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBContHelper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBContHelper.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBContHelper.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBContHelper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBContHelper.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBContHelper.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Some methods for traversing lists of edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -258,8 +258,26 @@ NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter::operator()(const NBEdge* e1, const NBEdge* e2) const { assert(e1->getFromNode() == myNode || e1->getToNode() == myNode); assert(e2->getFromNode() == myNode || e2->getToNode() == myNode); - const SUMOReal angle1 = e1->getFromNode() == myNode ? e1->getStartAngle() : e1->getEndAngle(); - const SUMOReal angle2 = e2->getFromNode() == myNode ? e2->getStartAngle() : e2->getEndAngle(); + const SUMOReal angle1 = e1->getAngleAtNodeToCenter(myNode); + const SUMOReal angle2 = e2->getAngleAtNodeToCenter(myNode); + const SUMOReal absDiff = abs(angle1 - angle2); + + // cannot trust the angle difference hence a heuristic: + if (absDiff < 2 || absDiff > (360 - 2)) { + const bool sameDir = ((e1->getFromNode() == myNode && e2->getFromNode() == myNode) + || (e1->getToNode() == myNode && e2->getToNode() == myNode)); + if (sameDir) { + // put edges that allow pedestrians on the 'outside' + if (e1->getToNode() == myNode) { + return (e1->getPermissions() & SVC_PEDESTRIAN) != 0; + } else { + return (e1->getPermissions() & SVC_PEDESTRIAN) == 0; + } + } else { + // sort incoming before outgoing + return e1->getToNode() == myNode; + } + } return angle1 < angle2; } diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBContHelper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBContHelper.h --- sumo-0.21.0+dfsg/src/netbuild/NBContHelper.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBContHelper.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: NBContHelper.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBContHelper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some methods for traversing lists of edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -353,17 +353,16 @@ class opposite_finder { public: /// constructor - opposite_finder(NBEdge* edge, const NBNode* n) - : myReferenceEdge(edge), myAtNode(n) { } + opposite_finder(NBEdge* edge) + : myReferenceEdge(edge) { } bool operator()(NBEdge* e) const { - return e->isTurningDirectionAt(myAtNode, myReferenceEdge) || - myReferenceEdge->isTurningDirectionAt(myAtNode, e); + return e->isTurningDirectionAt(myReferenceEdge) || + myReferenceEdge->isTurningDirectionAt(e); } private: NBEdge* myReferenceEdge; - const NBNode* myAtNode; }; @@ -374,7 +373,7 @@ class edge_by_angle_to_nodeShapeCentroid_sorter { public: /// constructor - explicit edge_by_angle_to_nodeShapeCentroid_sorter(NBNode* n) : myNode(n) {} + explicit edge_by_angle_to_nodeShapeCentroid_sorter(const NBNode* n) : myNode(n) {} public: /// comparing operation @@ -382,7 +381,7 @@ private: /// the edge to compute the relative angle of - NBNode* myNode; + const NBNode* myNode; }; }; diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBDistribution.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBDistribution.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBDistribution.cpp 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBDistribution.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NBDistribution.cpp /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NBDistribution.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBDistribution.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The base class for statistical distribution descriptions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBDistribution.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBDistribution.h --- sumo-0.21.0+dfsg/src/netbuild/NBDistribution.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBDistribution.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Sascha Krieg /// @date Sept 2002 -/// @version $Id: NBDistribution.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBDistribution.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The base class for statistical distribution descriptions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBDistrictCont.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBDistrictCont.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBDistrictCont.cpp 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBDistrictCont.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBDistrictCont.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBDistrictCont.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A container for districts /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBDistrictCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBDistrictCont.h --- sumo-0.21.0+dfsg/src/netbuild/NBDistrictCont.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBDistrictCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBDistrictCont.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBDistrictCont.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A container for districts /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBDistrict.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBDistrict.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBDistrict.cpp 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBDistrict.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBDistrict.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBDistrict.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A class representing a single district /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBDistrict.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBDistrict.h --- sumo-0.21.0+dfsg/src/netbuild/NBDistrict.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBDistrict.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBDistrict.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBDistrict.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A class representing a single district /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBEdgeCont.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBEdgeCont.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBEdgeCont.cpp 2014-05-22 22:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBEdgeCont.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBEdgeCont.cpp 16408 2014-05-22 07:00:50Z behrisch $ +/// @version $Id: NBEdgeCont.cpp 18172 2015-03-27 17:02:39Z behrisch $ /// // Storage for edges, including some functionality operating on multiple edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -86,6 +86,18 @@ // set edges dismiss/accept options myEdgesMinSpeed = oc.isSet("keep-edges.min-speed") ? oc.getFloat("keep-edges.min-speed") : -1; myRemoveEdgesAfterJoining = oc.exists("keep-edges.postload") && oc.getBool("keep-edges.postload"); + // we possibly have to load the edges to keep + if (oc.isSet("keep-edges.input-file")) { + std::ifstream strm(oc.getString("keep-edges.input-file").c_str()); + if (!strm.good()) { + throw ProcessError("Could not load names of edges too keep from '" + oc.getString("keep-edges.input-file") + "'."); + } + while (strm.good()) { + std::string name; + strm >> name; + myEdges2Keep.insert(name); + } + } if (oc.isSet("keep-edges.explicit")) { const std::vector edges = oc.getStringVector("keep-edges.explicit"); myEdges2Keep.insert(edges.begin(), edges.end()); @@ -229,6 +241,7 @@ } else { WRITE_ERROR("Cannot prune edges using a geo-boundary because no projection has been loaded"); } + myNeedGeoTransformedPrunningBoundary = false; } if (!(edge->getGeometry().getBoxBoundary().grow((SUMOReal) POSITION_EPS).overlapsWith(myPrunningBoundary))) { return true; @@ -398,7 +411,9 @@ NBEdgeCont::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, + const SUMOReal speed, + const int changedLeft) { SUMOReal pos; pos = edge->getGeometry().nearest_offset_to_point2D(node->getPosition()); if (pos <= 0) { @@ -410,7 +425,7 @@ return false; } return splitAt(dc, edge, pos, node, firstEdgeName, secondEdgeName, - noLanesFirstEdge, noLanesSecondEdge); + noLanesFirstEdge, noLanesSecondEdge, speed, changedLeft); } @@ -419,7 +434,14 @@ NBEdge* edge, SUMOReal pos, NBNode* node, const std::string& firstEdgeName, const std::string& secondEdgeName, - unsigned int noLanesFirstEdge, unsigned int noLanesSecondEdge) { + unsigned int noLanesFirstEdge, unsigned int noLanesSecondEdge, + const SUMOReal speed, + const int changedLeft + ) { + // there must be at least some overlap between first and second edge + assert(changedLeft > -((int)noLanesFirstEdge)); + assert(changedLeft < (int)noLanesSecondEdge); + // build the new edges' geometries std::pair geoms = edge->getGeometry().splitAt(pos); @@ -436,6 +458,9 @@ NBEdge* one = new NBEdge(firstEdgeName, edge->myFrom, node, edge, geoms.first, noLanesFirstEdge); NBEdge* two = new NBEdge(secondEdgeName, node, edge->myTo, edge, geoms.second, noLanesSecondEdge); two->copyConnectionsFrom(edge); + if (speed != -1.) { + two->setSpeed(-1, speed); + } // replace information about this edge within the nodes edge->myFrom->replaceOutgoing(edge, one, 0); edge->myTo->replaceIncoming(edge, two, 0); @@ -444,20 +469,14 @@ edge->myFrom->removeDoubleEdges(); edge->myTo->removeDoubleEdges(); // add connections from the first to the second edge - // check special case: - // one in, one out, the outgoing has one lane more - if (noLanesFirstEdge == noLanesSecondEdge - 1) { - for (unsigned int i = 0; i < one->getNumLanes(); i++) { - if (!one->addLane2LaneConnection(i, two, i + 1, NBEdge::L2L_COMPUTED)) { // !!! Bresenham, here!!! - throw ProcessError("Could not set connection!"); - } - } - one->addLane2LaneConnection(0, two, 0, NBEdge::L2L_COMPUTED); - } else { - for (unsigned int i = 0; i < one->getNumLanes() && i < two->getNumLanes(); i++) { - if (!one->addLane2LaneConnection(i, two, i, NBEdge::L2L_COMPUTED)) {// !!! Bresenham, here!!! - throw ProcessError("Could not set connection!"); - } + // there will be as many connections as there are lanes on the second edge + // by default lanes will be added / discontinued on the right side + // (appropriate for highway on-/off-ramps) + const int offset = (int)one->getNumLanes() - (int)two->getNumLanes() + changedLeft; + for (int i2 = 0; i2 < (int)two->getNumLanes(); i2++) { + const int i1 = MIN2(MAX2((int)0, i2 + offset), (int)one->getNumLanes()); + if (!one->addLane2LaneConnection(i1, two, i2, NBEdge::L2L_COMPUTED)) { + throw ProcessError("Could not set connection!"); } } if (myRemoveEdgesAfterJoining) { @@ -649,11 +668,20 @@ } speed /= edges.size(); // build the new edge - // @bug new edge does not know about allowed vclass of old edges - // @bug both the width and the offset are not regarded NBEdge* newEdge = new NBEdge(id, from, to, "", speed, nolanes, priority, NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, tpledge->getStreetName(), tpledge->myLaneSpreadFunction); + // copy lane attributes + int laneIndex = 0; + for (i = edges.begin(); i != edges.end(); ++i) { + const std::vector& lanes = (*i)->getLanes(); + for (int j = 0; j < (int)lanes.size(); ++j) { + newEdge->setPermissions(lanes[j].permissions, laneIndex); + newEdge->setLaneWidth(laneIndex, lanes[j].width); + newEdge->setEndOffset(laneIndex, lanes[j].endOffset); + laneIndex++; + } + } insert(newEdge, true); // replace old edge by current within the nodes // and delete the old @@ -789,13 +817,19 @@ void -NBEdgeCont::guessRoundabouts(std::vector& marked) { - // step 1: keep only those edges which have no turnarounds +NBEdgeCont::guessRoundabouts() { + myGuessedRoundabouts.clear(); + std::set loadedRoundaboutEdges; + for (std::set::const_iterator it = myRoundabouts.begin(); it != myRoundabouts.end(); ++it) { + loadedRoundaboutEdges.insert(it->begin(), it->end()); + } + // step 1: keep only those edges which have no turnarounds and which are not + // part of a loaded roundabout std::set candidates; for (EdgeCont::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) { NBEdge* e = (*i).second; NBNode* const to = e->getToNode(); - if (e->getTurnDestination() == 0 && to->getConnectionTo(e->getFromNode()) == 0) { + if (e->getTurnDestination() == 0 && to->getConnectionTo(e->getFromNode()) == 0 && loadedRoundaboutEdges.count(e) == 0) { candidates.insert(e); } } @@ -866,33 +900,58 @@ e = left; } } while (doLoop); - // mark collected edges in the case a loop (roundabout) was found 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 - NBNode* node = (*j)->getToNode(); - const EdgeVector& incoming = node->getIncomingEdges(); - for (EdgeVector::const_iterator k = incoming.begin(); k != incoming.end(); ++k) { - NBEdge* inEdge = *k; - if (loopEdgesSet.count(inEdge) > 0) { - continue; - } - if ((inEdge)->getStep() >= NBEdge::LANES2LANES_USER) { - continue; - } - inEdge->removeFromConnections(inEdge->getTurnDestination(), -1); + // collected edges are marked in markRoundabouts + myGuessedRoundabouts.insert(EdgeSet(loopEdges.begin(), loopEdges.end())); + } + } +} + + +const std::set +NBEdgeCont::getRoundabouts() const { + std::set result = myRoundabouts; + result.insert(myGuessedRoundabouts.begin(), myGuessedRoundabouts.end()); + return result; +} + + +void +NBEdgeCont::addRoundabout(const EdgeSet& roundabout) { + if (find(myRoundabouts.begin(), myRoundabouts.end(), roundabout) != myRoundabouts.end()) { + WRITE_WARNING("Ignoring duplicate roundabout: " + toString(roundabout)); + } else { + myRoundabouts.insert(roundabout); + } +} + + +void +NBEdgeCont::markRoundabouts() { + const std::set roundabouts = getRoundabouts(); + for (std::set::const_iterator it = roundabouts.begin(); it != roundabouts.end(); ++it) { + const EdgeSet roundaboutSet = *it; + for (std::set::const_iterator j = roundaboutSet.begin(); j != roundaboutSet.end(); ++j) { + // disable turnarounds on incoming edges + NBNode* node = (*j)->getToNode(); + const EdgeVector& incoming = node->getIncomingEdges(); + for (EdgeVector::const_iterator k = incoming.begin(); k != incoming.end(); ++k) { + NBEdge* inEdge = *k; + if (roundaboutSet.count(inEdge) > 0) { + continue; + } + if ((inEdge)->getStep() >= NBEdge::LANES2LANES_USER) { + continue; } - // let the connections to succeeding roundabout edge have a higher priority - (*j)->setJunctionPriority(node, 1000); - node->setRoundabout(); + inEdge->removeFromConnections(inEdge->getTurnDestination(), -1); } - marked.push_back(loopEdges); + // let the connections to succeeding roundabout edge have a higher priority + (*j)->setJunctionPriority(node, 1000); + node->setRoundabout(); } } } - void NBEdgeCont::generateStreetSigns() { for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); ++i) { @@ -932,11 +991,17 @@ int -NBEdgeCont::guessSidewalks(SUMOReal width, SUMOReal minSpeed, SUMOReal maxSpeed) { +NBEdgeCont::guessSidewalks(SUMOReal width, SUMOReal minSpeed, SUMOReal maxSpeed, bool fromPermissions) { int sidewalksCreated = 0; for (EdgeCont::iterator it = myEdges.begin(); it != myEdges.end(); it++) { NBEdge* edge = it->second; - if (edge->getSpeed() > minSpeed && edge->getSpeed() <= maxSpeed && edge->getPermissions(0) != SVC_PEDESTRIAN) { + if (( + // guess.from-permissions + (fromPermissions && (edge->getPermissions() & SVC_PEDESTRIAN) != 0) + // guess from speed + || (!fromPermissions && edge->getSpeed() > minSpeed && edge->getSpeed() <= maxSpeed)) + // does not yet have a sidewalk + && edge->getPermissions(0) != SVC_PEDESTRIAN) { edge->addSidewalk(width); sidewalksCreated += 1; } diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBEdgeCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBEdgeCont.h --- sumo-0.21.0+dfsg/src/netbuild/NBEdgeCont.h 2014-05-22 22:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBEdgeCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBEdgeCont.h 16408 2014-05-22 07:00:50Z behrisch $ +/// @version $Id: NBEdgeCont.h 18096 2015-03-17 09:50:59Z behrisch $ /// // Storage for edges, including some functionality operating on multiple edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -237,13 +237,17 @@ * @param[in] secondEdgeName The id the second part of the split edge shall have * @param[in] noLanesFirstEdge The number of lanes the second part of the split edge shall have * @param[in] noLanesSecondEdge The number of lanes the second part of the split edge shall have + * @param[in] speed The speed for the edge after the split + * @param[in] changedLeft The number of lanes that is added or removed on the left side of the edge + * (By default all added/removed lanes are assumed to be on the right when computing connections) * @return Whether the edge could be split * @exception ProcessError If connections between the edges can not be built * @see NBEdge::splitAt(NBDistrictCont &, NBEdge *, SUMOReal, NBNode *, const std::string &, const std::string &, unsigned int , unsigned int) */ 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, + const SUMOReal speed = -1., const int changedLeft = 0); /** @brief Splits the edge at the position nearest to the given node using the given modifications @@ -255,12 +259,16 @@ * @param[in] secondEdgeName The id the second part of the split edge shall have * @param[in] noLanesFirstEdge The number of lanes the second part of the split edge shall have * @param[in] noLanesSecondEdge The number of lanes the second part of the split edge shall have + * @param[in] speed The speed for the edge after the split + * @param[in] changedLeft The number of lanes that is added or removed on the left side of the edge + * (By default all added/removed lanes are assumed to be on the right when computing connections) * @return Whether the edge could be split * @exception ProcessError If connections between the edges can not be built */ 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, + const SUMOReal speed = -1., const int changedLeft = 0); /// @} @@ -446,7 +454,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(); /** @brief Returns whether the built edges are left-handed @@ -498,10 +506,21 @@ /// @brief assigns street signs to edges based on toNode types void generateStreetSigns(); - /// @brief add sidwalks to edges within the given limits and return the number of edges affected - int guessSidewalks(SUMOReal width, SUMOReal minSpeed, SUMOReal maxSpeed); + /// @brief add sidwalks to edges within the given limits or permissions and return the number of edges affected + int guessSidewalks(SUMOReal width, SUMOReal minSpeed, SUMOReal maxSpeed, bool fromPermissions); + /** @brief Returns the determined roundabouts + * @return The list of roundabout edges + */ + const std::set getRoundabouts() const; + + /// @brief add user specified roundabout + void addRoundabout(const EdgeSet& roundabout); + + /// @brief mark edge priorities and prohibit turn-arounds for all roundabout edges + void markRoundabouts(); + private: /** @brief Returns the edges which have been built by splitting the edge of the given id * @@ -515,7 +534,6 @@ /// @brief Returns true if this edge matches one of the removal criteria bool ignoreFilterMatch(NBEdge* edge); - private: /// @brief The network builder; used to obtain type information NBTypeCont& myTypeCont; @@ -604,6 +622,11 @@ bool myNeedGeoTransformedPrunningBoundary; /// @} + /// @brief Edges marked as belonging to a roundabout by the user (each EdgeVector is a roundabout) + std::set myRoundabouts; + /// @brief Edges marked as belonging to a roundabout after guessing + std::set myGuessedRoundabouts; + private: /// @brief invalidated copy constructor diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBEdge.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBEdge.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBEdge.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBEdge.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Tue, 20 Nov 2001 -/// @version $Id: NBEdge.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBEdge.cpp 18122 2015-03-20 16:03:12Z namdre $ /// // Methods for the representation of a single edge /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -62,9 +62,11 @@ // static members // =========================================================================== const SUMOReal NBEdge::UNSPECIFIED_WIDTH = -1; -const SUMOReal NBEdge::UNSPECIFIED_LOADED_LENGTH = -1; const SUMOReal NBEdge::UNSPECIFIED_OFFSET = 0; +const SUMOReal NBEdge::UNSPECIFIED_SPEED = -1; + const SUMOReal NBEdge::UNSPECIFIED_SIGNAL_OFFSET = -1; +const SUMOReal NBEdge::UNSPECIFIED_LOADED_LENGTH = -1; const SUMOReal NBEdge::ANGLE_LOOKAHEAD = 10.0; // =========================================================================== @@ -189,6 +191,7 @@ myStartAngle(0), myEndAngle(0), myTotalAngle(0), myPriority(priority), mySpeed(speed), myTurnDestination(0), + myPossibleTurnDestination(0), myFromJunctionPriority(-1), myToJunctionPriority(-1), myLaneSpreadFunction(spread), myEndOffset(offset), myLaneWidth(laneWidth), myLoadedLength(UNSPECIFIED_LOADED_LENGTH), myAmLeftHand(false), @@ -212,6 +215,7 @@ myStartAngle(0), myEndAngle(0), myTotalAngle(0), myPriority(priority), mySpeed(speed), myTurnDestination(0), + myPossibleTurnDestination(0), myFromJunctionPriority(-1), myToJunctionPriority(-1), myGeom(geom), myLaneSpreadFunction(spread), myEndOffset(offset), myLaneWidth(laneWidth), myLoadedLength(UNSPECIFIED_LOADED_LENGTH), myAmLeftHand(false), @@ -230,6 +234,7 @@ myStartAngle(0), myEndAngle(0), myTotalAngle(0), myPriority(tpl->getPriority()), mySpeed(tpl->getSpeed()), myTurnDestination(0), + myPossibleTurnDestination(0), myFromJunctionPriority(-1), myToJunctionPriority(-1), myGeom(geom), myLaneSpreadFunction(tpl->getLaneSpreadFunction()), @@ -271,18 +276,34 @@ myFrom = from; myTo = to; myPriority = priority; - mySpeed = speed; //?myTurnDestination(0), //?myFromJunctionPriority(-1), myToJunctionPriority(-1), myGeom = geom; myLaneSpreadFunction = spread; - myEndOffset = offset; - myLaneWidth = laneWidth; myLoadedLength = UNSPECIFIED_LOADED_LENGTH; myStreetName = streetName; //?, myAmTurningWithAngle(0), myAmTurningOf(0), //?myAmInnerEdge(false), myAmMacroscopicConnector(false) + + // preserve lane-specific settings (geometry must be recomputed) + // if new lanes are added they copy the values from the leftmost lane (if specified) + const std::vector oldLanes = myLanes; init(nolanes, tryIgnoreNodePositions); + for (int i = 0; i < (int)nolanes; ++i) { + PositionVector newShape = myLanes[i].shape; + myLanes[i] = oldLanes[MIN2(i, (int)oldLanes.size() - 1)]; + myLanes[i].shape = newShape; + } + // however, if the new edge defaults are explicityly given, they override the old settings + if (offset != UNSPECIFIED_OFFSET) { + setEndOffset(-1, offset); + } + if (laneWidth != UNSPECIFIED_WIDTH) { + setLaneWidth(-1, laneWidth); + } + if (speed != UNSPECIFIED_SPEED) { + setSpeed(-1, speed); + } } @@ -766,6 +787,15 @@ } } } + for (std::vector::iterator it = myConnectionsToDelete.begin(); it != myConnectionsToDelete.end(); ++it) { + if (it->fromLane < 0 && it->toLane < 0) { + // found an edge that shall not be connected + EdgeVector::iterator forbidden = find(outgoing.begin(), outgoing.end(), it->toEdge); + if (forbidden != outgoing.end()) { + outgoing.erase(forbidden); + } + } + } // allocate the sorted container unsigned int size = (unsigned int) outgoing.size(); EdgeVector* edges = new EdgeVector(); @@ -853,6 +883,9 @@ if (myTurnDestination == toEdge && fromLane < 0) { myTurnDestination = 0; } + if (myPossibleTurnDestination == toEdge && fromLane < 0) { + myPossibleTurnDestination = 0; + } if (tryLater) { myConnectionsToDelete.push_back(Connection(fromLane, toEdge, toLane)); } @@ -1024,10 +1057,12 @@ toEdge = (*i).toEdge; internalLaneIndex = 0; } - PositionVector shape = n.computeInternalLaneShape(this, con.fromLane, con.toEdge, con.toLane); + PositionVector shape = n.computeInternalLaneShape(this, con); std::vector foeInternalLinks; LinkDirection dir = n.getDirection(this, con.toEdge); + const bool isRightTurn = (dir == LINKDIR_RIGHT || dir == LINKDIR_PARTRIGHT); + const bool isTurn = (isRightTurn || dir == LINKDIR_LEFT || dir == LINKDIR_PARTLEFT); if (dir != LINKDIR_STRAIGHT && shape.length() < POSITION_EPS) { WRITE_WARNING("Connection '" + getID() + "_" + toString(con.fromLane) + "->" + con.toEdge->getID() + "_" + toString(con.toLane) + "' is only " + toString(shape.length()) + " short."); } @@ -1036,6 +1071,8 @@ std::pair > crossingPositions(-1, std::vector()); std::set tmpFoeIncomingLanes; switch (dir) { + case LINKDIR_RIGHT: + case LINKDIR_PARTRIGHT: case LINKDIR_LEFT: case LINKDIR_PARTLEFT: case LINKDIR_TURN: { @@ -1047,29 +1084,34 @@ if ((*k2).toEdge == 0) { continue; } - bool needsCont = n.needsCont(this, con.toEdge, *i2, (*k2).toEdge, *k2); + bool needsCont = n.needsCont(this, *i2, con, *k2); // compute the crossing point if (needsCont) { crossingPositions.second.push_back(index); - const PositionVector otherShape = n.computeInternalLaneShape(*i2, (*k2).fromLane, (*k2).toEdge, (*k2).toLane); - const std::vector dv = shape.intersectsAtLengths2D(otherShape); - if (dv.size() > 0) { - const SUMOReal minDV = dv[0]; - if (minDV < shape.length() - POSITION_EPS && minDV > POSITION_EPS) { // !!!? - assert(minDV >= 0); - if (crossingPositions.first < 0 || crossingPositions.first > minDV) { - crossingPositions.first = minDV; - } + const PositionVector otherShape = n.computeInternalLaneShape(*i2, *k2); + // vehicles are typically less wide than the lane + // they drive on but but bicycle lanes should be kept clear for their whole width + SUMOReal width2 = (*k2).toEdge->getLaneWidth((*k2).toLane); + if ((*k2).toEdge->getPermissions((*k2).toLane) != SVC_BICYCLE) { + width2 *= 0.5; + } + const SUMOReal minDV = firstIntersection(shape, otherShape, width2); + if (minDV < shape.length() - POSITION_EPS && minDV > POSITION_EPS) { // !!!? + assert(minDV >= 0); + if (crossingPositions.first < 0 || crossingPositions.first > minDV) { + crossingPositions.first = minDV; } } } + const bool rightTurnConflict = n.rightTurnConflict( + this, con.toEdge, con.fromLane, (*i2), (*k2).toEdge, (*k2).fromLane); // compute foe internal lanes - if (n.foes(this, con.toEdge, *i2, (*k2).toEdge)) { + if (n.foes(this, con.toEdge, *i2, (*k2).toEdge) || rightTurnConflict) { foeInternalLinks.push_back(index); } // compute foe incoming lanes const bool signalised = hasSignalisedConnectionTo(con.toEdge); - if (n.forbids(*i2, (*k2).toEdge, this, con.toEdge, signalised) && (needsCont || dir == LINKDIR_TURN)) { + if ((n.forbids(*i2, (*k2).toEdge, this, con.toEdge, signalised) || rightTurnConflict) && (needsCont || dir == LINKDIR_TURN)) { tmpFoeIncomingLanes.insert((*i2)->getID() + "_" + toString((*k2).fromLane)); } index++; @@ -1078,11 +1120,25 @@ // foe pedestrian crossings const std::vector& crossings = n.getCrossings(); for (std::vector::const_iterator it_c = crossings.begin(); it_c != crossings.end(); ++it_c) { - for (EdgeVector::const_iterator it_e = (*it_c).edges.begin(); it_e != (*it_c).edges.end(); ++it_e) { + const NBNode::Crossing& crossing = *it_c; + for (EdgeVector::const_iterator it_e = crossing.edges.begin(); it_e != crossing.edges.end(); ++it_e) { const NBEdge* edge = *it_e; // compute foe internal lanes if (this == edge || con.toEdge == edge) { foeInternalLinks.push_back(index); + if (con.toEdge == edge && + ((isRightTurn && getJunctionPriority(&n) > 0) || (isTurn && n.isTLControlled()))) { + // build internal junctions (not for left turns at uncontrolled intersections) + PositionVector crossingShape = crossing.shape; + crossingShape.extrapolate(1.0); // sometimes shapes miss each other by a small margin + const SUMOReal minDV = firstIntersection(shape, crossingShape, crossing.width / 2); + if (minDV < shape.length() - POSITION_EPS && minDV > POSITION_EPS) { + assert(minDV >= 0); + if (crossingPositions.first < 0 || crossingPositions.first > minDV) { + crossingPositions.first = minDV; + } + } + } } } index++; @@ -1090,7 +1146,8 @@ if (dir == LINKDIR_TURN && crossingPositions.first < 0 && crossingPositions.second.size() != 0 && shape.length() > 2. * POSITION_EPS) { // let turnarounds wait in the middle if no other crossing point was found and it has a sensible length - crossingPositions.first = (SUMOReal) shape.length() / 2.; + // (if endOffset is used, the crossing point is in the middle of the part within the junction shape) + crossingPositions.first = (SUMOReal)(shape.length() + getEndOffset(con.fromLane)) / 2.; } } break; @@ -1137,6 +1194,32 @@ } } + +SUMOReal +NBEdge::firstIntersection(const PositionVector& v1, const PositionVector& v2, SUMOReal width2) { + SUMOReal intersect = std::numeric_limits::max(); + if (v2.length() < POSITION_EPS) { + return intersect; + } + PositionVector v2Right = v2; + v2Right.move2side(width2); + + PositionVector v2Left = v2; + v2Left.move2side(-width2); + + // intersect center line of v1 with left and right border of v2 + std::vector tmp = v1.intersectsAtLengths2D(v2Right); + if (tmp.size() > 0) { + intersect = MIN2(intersect, tmp[0]); + } + tmp = v1.intersectsAtLengths2D(v2Left); + if (tmp.size() > 0) { + intersect = MIN2(intersect, tmp[0]); + } + return intersect; +} + + // ----------- int NBEdge::getJunctionPriority(const NBNode* const node) const { @@ -1170,9 +1253,27 @@ } +SUMOReal +NBEdge::getAngleAtNodeToCenter(const NBNode* const atNode) const { + if (atNode == myFrom) { + SUMOReal res = myStartAngle - 180; + if (res < 0) { + res += 360; + } + return res; + } else { + assert(atNode == myTo); + return myEndAngle; + } +} + + void -NBEdge::setTurningDestination(NBEdge* e) { - myTurnDestination = e; +NBEdge::setTurningDestination(NBEdge* e, bool onlyPossible) { + if (!onlyPossible) { + myTurnDestination = e; + } + myPossibleTurnDestination = e; } @@ -1652,7 +1753,7 @@ bool -NBEdge::isTurningDirectionAt(const NBNode* n, const NBEdge* const edge) const { +NBEdge::isTurningDirectionAt(const NBEdge* const edge) const { // maybe it was already set as the turning direction if (edge == myTurnDestination) { return true; @@ -1660,25 +1761,10 @@ // otherwise - it's not if a turning direction exists return false; } - // if the same nodes are connected - if (myFrom == edge->myTo && myTo == edge->myFrom) { - return true; - } - // we have to check whether the connection between the nodes is - // geometrically similar - SUMOReal thisFromAngle2 = getAngleAtNode(n); - SUMOReal otherToAngle2 = edge->getAngleAtNode(n); - if (thisFromAngle2 < otherToAngle2) { - std::swap(thisFromAngle2, otherToAngle2); - } - if (thisFromAngle2 - otherToAngle2 > 170 && thisFromAngle2 - otherToAngle2 < 190) { - return true; - } - return false; + return edge == myPossibleTurnDestination; } - NBNode* NBEdge::tryGetNodeAtPosition(SUMOReal pos, SUMOReal tolerance) const { // return the from-node when the position is at the begin of the edge @@ -1816,41 +1902,41 @@ PositionVector -NBEdge::getCWBoundaryLine(const NBNode& n, SUMOReal offset) const { +NBEdge::getCWBoundaryLine(const NBNode& n) const { PositionVector ret; + SUMOReal width; if (myFrom == (&n)) { // outgoing ret = !myAmLeftHand ? myLanes[0].shape : myLanes.back().shape; + width = getLaneWidth(0); } else { // incoming ret = !myAmLeftHand ? myLanes.back().shape.reverse() : myLanes[0].shape.reverse(); + width = getLaneWidth((int)getNumLanes() - 1); } - ret.move2side(offset); + ret.move2side(width * 0.5); return ret; } PositionVector -NBEdge::getCCWBoundaryLine(const NBNode& n, SUMOReal offset) const { +NBEdge::getCCWBoundaryLine(const NBNode& n) const { PositionVector ret; + SUMOReal width; if (myFrom == (&n)) { // outgoing ret = !myAmLeftHand ? myLanes.back().shape : myLanes[0].shape; + width = getLaneWidth((int)getNumLanes() - 1); } else { // incoming ret = !myAmLeftHand ? myLanes[0].shape.reverse() : myLanes.back().shape.reverse(); + width = getLaneWidth(0); } - ret.move2side(-offset); + ret.move2side(-width * 0.5); return ret; } -SUMOReal -NBEdge::width() const { - return (SUMOReal) myLanes.size() * SUMO_const_laneWidth + (SUMOReal)(myLanes.size() - 1) * SUMO_const_laneOffset; -} - - bool NBEdge::expandableBy(NBEdge* possContinuation) const { // ok, the number of lanes must match @@ -1926,6 +2012,7 @@ myStep = e->myStep; myConnections = e->myConnections; myTurnDestination = e->myTurnDestination; + myPossibleTurnDestination = e->myPossibleTurnDestination; // set the node myTo = e->myTo; if (e->getSignalOffset() != UNSPECIFIED_SIGNAL_OFFSET) { @@ -1949,7 +2036,10 @@ NBEdge* -NBEdge::getTurnDestination() const { +NBEdge::getTurnDestination(bool possibleDestination) const { + if (myTurnDestination == 0 && possibleDestination) { + return myPossibleTurnDestination; + } return myTurnDestination; } @@ -2087,6 +2177,15 @@ SUMOReal +NBEdge::getTotalWidth() const { + SUMOReal result = 0; + for (unsigned int i = 0; i < myLanes.size(); i++) { + result += getLaneWidth(i); + } + return result; +} + +SUMOReal NBEdge::getEndOffset(int lane) const { return myLanes[lane].endOffset != UNSPECIFIED_OFFSET ? myLanes[lane].endOffset : getEndOffset(); } @@ -2195,12 +2294,15 @@ int -NBEdge::getFirstNonPedestrianLaneIndex(int direction) const { +NBEdge::getFirstNonPedestrianLaneIndex(int direction, bool exclusive) const { assert(direction == NBNode::FORWARD || direction == NBNode::BACKWARD); const int start = (direction == NBNode::FORWARD ? 0 : (int)myLanes.size() - 1); const int end = (direction == NBNode::FORWARD ? (int)myLanes.size() : - 1); for (int i = start; i != end; i += direction) { - if ((myLanes[i].permissions & SVC_PEDESTRIAN) == 0) { + // SVCAll, does not count as a sidewalk, green verges (permissions = 0) do not count as road + // in the exclusive case, lanes that allow pedestrians along with any other class also count as road + if ((exclusive && myLanes[i].permissions != SVC_PEDESTRIAN && myLanes[i].permissions != 0) + || (myLanes[i].permissions == SVCAll || ((myLanes[i].permissions & SVC_PEDESTRIAN) == 0 && myLanes[i].permissions != 0))) { return i; } } @@ -2235,9 +2337,16 @@ void NBEdge::addSidewalk(SUMOReal width) { + if (myLanes[0].permissions == SVC_PEDESTRIAN) { + WRITE_WARNING("Edge '" + getID() + "' already has a sidewalk. Not adding another one."); + return; + } if (myLaneSpreadFunction == LANESPREAD_CENTER) { myGeom.move2side(width / 2); } + // disallow pedestrians on all lanes to ensure that sidewalks are used and + // crossings can be guessed + disallowVehicleClass(-1, SVC_PEDESTRIAN); // add new lane myLanes.insert(myLanes.begin(), Lane(this)); myLanes[0].permissions = SVC_PEDESTRIAN; @@ -2269,5 +2378,26 @@ } } } + + +void +NBEdge::shiftPositionAtNode(NBNode* node, NBEdge* other) { + if (myLaneSpreadFunction == LANESPREAD_CENTER && !isRailway(getPermissions())) { + const int i = (node == myTo ? -1 : 0); + const int i2 = (node == myTo ? 0 : -1); + const SUMOReal dist = myGeom[i].distanceTo2D(node->getPosition()); + const SUMOReal neededOffset = (getTotalWidth() + getNumLanes() * SUMO_const_laneOffset) / 2; + const SUMOReal dist2 = MIN2(myGeom.distance(other->getGeometry()[i2]), + other->getGeometry().distance(myGeom[i])); + const SUMOReal neededOffset2 = neededOffset + (other->getTotalWidth() + other->getNumLanes() * SUMO_const_laneOffset) / 2; + if (dist < neededOffset && dist2 < neededOffset2) { + PositionVector tmp = myGeom; + // @note this doesn't work well for vissim networks + //tmp.move2side(MIN2(neededOffset - dist, neededOffset2 - dist2)); + tmp.move2side(neededOffset - dist); + myGeom[i] = tmp[i]; + } + } +} /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBEdge.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBEdge.h --- sumo-0.21.0+dfsg/src/netbuild/NBEdge.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBEdge.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBEdge.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBEdge.h 18096 2015-03-17 09:50:59Z behrisch $ /// // The representation of a single edge during network building /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -201,11 +201,14 @@ static const SUMOReal UNSPECIFIED_WIDTH; /// @brief unspecified lane offset static const SUMOReal UNSPECIFIED_OFFSET; - /// @brief unspecified signal offset - static const SUMOReal UNSPECIFIED_SIGNAL_OFFSET; + /// @brief unspecified lane speed + static const SUMOReal UNSPECIFIED_SPEED; + /// @brief no length override given static const SUMOReal UNSPECIFIED_LOADED_LENGTH; - /// @brief the distance at which to take the default anglen + /// @brief unspecified signal offset + static const SUMOReal UNSPECIFIED_SIGNAL_OFFSET; + /// @brief the distance at which to take the default angle static const SUMOReal ANGLE_LOOKAHEAD; public: @@ -453,6 +456,10 @@ SUMOReal getLaneWidth(int lane) const; + /** @brief Returns the combined width of all lanes of this edge + */ + SUMOReal getTotalWidth() const; + /** @brief Returns the street name of this edge */ const std::string& getStreetName() const { @@ -505,8 +512,11 @@ } //@} - /// @brief return the first lane with permissions other than SVC_PEDESTRIAN - int getFirstNonPedestrianLaneIndex(int direction) const; + /** @brief return the first lane with permissions other than SVC_PEDESTRIAN and 0 + * @param[in] direction The direction in which the lanes shall be checked + * @param[in] exclusive Whether lanes that allow pedestrians along with other classes shall be counted as non-pedestrian + */ + int getFirstNonPedestrianLaneIndex(int direction, bool exclusive = false) const; NBEdge::Lane getFirstNonPedestrianLane(int direction) const; /// @brief return the angle for computing pedestrian crossings at the given node @@ -564,6 +574,10 @@ */ void addGeometryPoint(int index, const Position& p); + /** @brief shift geometry at the given node + * to avoid overlap + */ + void shiftPositionAtNode(NBNode* node, NBEdge* opposite); /** @brief Recomputeds the lane shapes to terminate at the node shape * For every lane the intersection with the fromNode and toNode is @@ -814,12 +828,18 @@ /** @brief Returns whether the given edge is the opposite direction to this edge - * @param[in] n The node at which this may be turnaround direction * @param[in] edge The edge which may be the turnaround direction * @return Whether the given edge is this edge's turnaround direction + * (regardless of whether a connection exists) */ - bool isTurningDirectionAt(const NBNode* n, const NBEdge* const edge) const; - void setTurningDestination(NBEdge* e); + bool isTurningDirectionAt(const NBEdge* const edge) const; + + + /** @brief Sets the turing destination at the given edge + * @param[in] e The turn destination + * @param[in] onlyPossible If true, only sets myPossibleTurnDestination + */ + void setTurningDestination(NBEdge* e, bool onlyPossible = false); @@ -947,10 +967,11 @@ void addCrossingPointsAsIncomingWithGivenOutgoing(NBEdge* o, PositionVector& into); - SUMOReal width() const; + /// @brief get the outer boundary of this edge when going clock-wise around the given node + PositionVector getCWBoundaryLine(const NBNode& n) const; - PositionVector getCWBoundaryLine(const NBNode& n, SUMOReal offset) const; - PositionVector getCCWBoundaryLine(const NBNode& n, SUMOReal offset) const; + /// @brief get the outer boundary of this edge when going counter-clock-wise around the given node + PositionVector getCCWBoundaryLine(const NBNode& n) const; bool expandableBy(NBEdge* possContinuation) const; void append(NBEdge* continuation); @@ -960,7 +981,11 @@ void moveOutgoingConnectionsFrom(NBEdge* e, unsigned int laneOff); - NBEdge* getTurnDestination() const; + /* @brief return the turn destination if it exists + * @param[in] possibleDestination Wether myPossibleTurnDestination should be returned if no turnaround connection + * exists + */ + NBEdge* getTurnDestination(bool possibleDestination = false) const; std::string getLaneID(unsigned int lane) const; @@ -981,6 +1006,17 @@ SUMOReal getAngleAtNode(const NBNode* const node) const; + /** @brief Returns the angle of from the node shape center to where the edge meets + * the node shape + * + * The angle is signed, disregards 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 shape + */ + SUMOReal getAngleAtNodeToCenter(const NBNode* const node) const; + + void incLaneNo(unsigned int by); void decLaneNo(unsigned int by, int dir = 0); @@ -1197,6 +1233,11 @@ /// @brief computes the angle of this edge and stores it in myAngle void computeAngle(); + + /* @brief compute the first intersection point between the given lane + * geometries considering their rspective widths */ + static SUMOReal firstIntersection(const PositionVector& v1, const PositionVector& v2, SUMOReal width2); + private: /** @brief The building step * @see EdgeBuildingStep @@ -1232,8 +1273,10 @@ */ std::vector myConnectionsToDelete; - /// @brief The turn destination edge + /// @brief The turn destination edge (if a connection exists) NBEdge* myTurnDestination; + /// @brief The edge that would be the turn destination if there was one + NBEdge* myPossibleTurnDestination; /// @brief The priority normalised for the node the edge is outgoing of int myFromJunctionPriority; diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBFrame.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBFrame.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBFrame.cpp 2014-05-13 22:02:32.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBFrame.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 09.05.2011 -/// @version $Id: NBFrame.cpp 16360 2014-05-13 06:41:50Z namdre $ +/// @version $Id: NBFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for netbuild /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -162,9 +162,11 @@ oc.addDescription("speed.offset", "Processing", "Modifies all edge speeds by adding FLOAT"); oc.doRegister("speed.factor", new Option_Float(1)); - oc.addDescription("speed.factor", "Processing", "Modifies all edge speeds by multiplying FLOAT"); + oc.addDescription("speed.factor", "Processing", "Modifies all edge speeds by multiplying by FLOAT"); } + oc.doRegister("junctions.corner-detail", new Option_Integer(0)); + oc.addDescription("junctions.corner-detail", "Processing", "Generate INT intermediate points to smooth out intersection corners"); oc.doRegister("check-lane-foes.roundabout", new Option_Bool(true)); oc.addDescription("check-lane-foes.roundabout", "Processing", @@ -186,6 +188,10 @@ oc.addDescription("sidewalks.guess.min-speed", "Processing", "Add sidewalks for edges with a speed above the given limit"); + oc.doRegister("sidewalks.guess.from-permissions", new Option_Bool(false)); + oc.addDescription("sidewalks.guess.from-permissions", "Processing", + "Add sidewalks for edges that allow pedestrians on any of their lanes regardless of speed"); + oc.doRegister("crossings.guess", new Option_Bool(false)); oc.addDescription("crossings.guess", "Processing", "Guess pedestrian crossings based on the presence of sidewalks"); diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBFrame.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBFrame.h --- sumo-0.21.0+dfsg/src/netbuild/NBFrame.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBFrame.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 09.05.2011 -/// @version $Id: NBFrame.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBFrame.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for netbuild /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBHeightMapper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBHeightMapper.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBHeightMapper.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBHeightMapper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,368 @@ +/****************************************************************************/ +/// @file NBHeightMapper.cpp +/// @author Jakob Erdmann +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date Sept 2011 +/// @version $Id: NBHeightMapper.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Set z-values for all network positions based on data from a height map +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2011-2015 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 "NBHeightMapper.h" +#include +#include +#include + +#ifdef HAVE_GDAL +#include +#include +#include +#endif + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + +// =========================================================================== +// static members +// =========================================================================== +NBHeightMapper NBHeightMapper::Singleton; + +// =========================================================================== +// method definitions +// =========================================================================== + + +NBHeightMapper::NBHeightMapper(): + myRTree(&Triangle::addSelf), myRaster(0) +{ } + + +NBHeightMapper::~NBHeightMapper() { + clearData(); +} + + +const NBHeightMapper& +NBHeightMapper::get() { + return Singleton; +} + + +bool +NBHeightMapper::ready() const { + return myRaster != 0 || myTriangles.size() > 0; +} + + +SUMOReal +NBHeightMapper::getZ(const Position& geo) const { + if (!ready()) { + WRITE_WARNING("Cannot supply height since no height data was loaded"); + return 0; + } + if (myRaster != 0) { + SUMOReal result = -1e6; + if (myBoundary.around(geo)) { + const int xSize = int((myBoundary.xmax() - myBoundary.xmin()) / mySizeOfPixel.x() + .5); + const int iX = int((geo.x() - myBoundary.xmin()) / mySizeOfPixel.x() + .5); + const int iY = int((geo.y() - myBoundary.ymax()) / mySizeOfPixel.y() + .5); + result = myRaster[iY * xSize + iX]; + } + if (result > -1e5 && result < 1e5) { + return result; + } + } + // coordinates in degrees hence a small search window + float minB[2]; + float maxB[2]; + minB[0] = (float)geo.x() - 0.00001f; + minB[1] = (float)geo.y() - 0.00001f; + maxB[0] = (float)geo.x() + 0.00001f; + maxB[1] = (float)geo.y() + 0.00001f; + QueryResult queryResult; + int hits = myRTree.Search(minB, maxB, queryResult); + Triangles result = queryResult.triangles; + assert(hits == (int)result.size()); + UNUSED_PARAMETER(hits); // only used for assertion + + for (Triangles::iterator it = result.begin(); it != result.end(); it++) { + const Triangle* triangle = *it; + if (triangle->contains(geo)) { + return triangle->getZ(geo); + } + } + WRITE_WARNING("Could not get height data for coordinate " + toString(geo)); + return 0; +} + + +void +NBHeightMapper::addTriangle(PositionVector corners) { + Triangle* triangle = new Triangle(corners); + myTriangles.push_back(triangle); + Boundary b = corners.getBoxBoundary(); + const float cmin[2] = {(float) b.xmin(), (float) b.ymin()}; + const float cmax[2] = {(float) b.xmax(), (float) b.ymax()}; + myRTree.Insert(cmin, cmax, triangle); +} + + +void +NBHeightMapper::loadIfSet(OptionsCont& oc) { + if (oc.isSet("heightmap.geotiff")) { + // parse file(s) + std::vector files = oc.getStringVector("heightmap.geotiff"); + for (std::vector::const_iterator file = files.begin(); file != files.end(); ++file) { + PROGRESS_BEGIN_MESSAGE("Parsing from GeoTIFF '" + *file + "'"); + int numFeatures = Singleton.loadTiff(*file); + MsgHandler::getMessageInstance()->endProcessMsg( + " done (parsed " + toString(numFeatures) + + " features, Boundary: " + toString(Singleton.getBoundary()) + ")."); + } + } + if (oc.isSet("heightmap.shapefiles")) { + // parse file(s) + std::vector files = oc.getStringVector("heightmap.shapefiles"); + for (std::vector::const_iterator file = files.begin(); file != files.end(); ++file) { + PROGRESS_BEGIN_MESSAGE("Parsing from shape-file '" + *file + "'"); + int numFeatures = Singleton.loadShapeFile(*file); + MsgHandler::getMessageInstance()->endProcessMsg( + " done (parsed " + toString(numFeatures) + + " features, Boundary: " + toString(Singleton.getBoundary()) + ")."); + } + } +} + + +int +NBHeightMapper::loadShapeFile(const std::string& file) { +#ifdef HAVE_GDAL + OGRRegisterAll(); + OGRDataSource* ds = OGRSFDriverRegistrar::Open(file.c_str(), FALSE); + if (ds == NULL) { + throw ProcessError("Could not open shape file '" + file + "'."); + } + + // begin file parsing + OGRLayer* layer = ds->GetLayer(0); + layer->ResetReading(); + + // triangle coordinates are stored in WGS84 and later matched with network coordinates in WGS84 + // build coordinate transformation + OGRSpatialReference* sr_src = layer->GetSpatialRef(); + OGRSpatialReference sr_dest; + sr_dest.SetWellKnownGeogCS("WGS84"); + OGRCoordinateTransformation* toWGS84 = OGRCreateCoordinateTransformation(sr_src, &sr_dest); + if (toWGS84 == 0) { + WRITE_WARNING("Could not create geocoordinates converter; check whether proj.4 is installed."); + } + + int numFeatures = 0; + OGRFeature* feature; + layer->ResetReading(); + while ((feature = layer->GetNextFeature()) != NULL) { + OGRGeometry* geom = feature->GetGeometryRef(); + assert(geom != 0); + + // @todo gracefull handling of shapefiles with unexpected contents or any error handling for that matter + assert(std::string(geom->getGeometryName()) == std::string("POLYGON")); + // try transform to wgs84 + geom->transform(toWGS84); + OGRLinearRing* cgeom = ((OGRPolygon*) geom)->getExteriorRing(); + // assume TIN with with 4 points and point0 == point3 + assert(cgeom->getNumPoints() == 4); + PositionVector corners; + for (int j = 0; j < 3; j++) { + Position pos((SUMOReal) cgeom->getX(j), (SUMOReal) cgeom->getY(j), (SUMOReal) cgeom->getZ(j)); + corners.push_back(pos); + myBoundary.add(pos); + } + addTriangle(corners); + numFeatures++; + + /* + OGRwkbGeometryType gtype = geom->getGeometryType(); + switch (gtype) { + case wkbPolygon: { + break; + } + case wkbPoint: { + WRITE_WARNING("got wkbPoint"); + break; + } + case wkbLineString: { + WRITE_WARNING("got wkbLineString"); + break; + } + case wkbMultiPoint: { + WRITE_WARNING("got wkbMultiPoint"); + break; + } + case wkbMultiLineString: { + WRITE_WARNING("got wkbMultiLineString"); + break; + } + case wkbMultiPolygon: { + WRITE_WARNING("got wkbMultiPolygon"); + break; + } + default: + WRITE_WARNING("Unsupported shape type occured"); + break; + } + */ + OGRFeature::DestroyFeature(feature); + } + OGRDataSource::DestroyDataSource(ds); + OCTDestroyCoordinateTransformation(toWGS84); + OGRCleanupAll(); + return numFeatures; +#else + WRITE_ERROR("Cannot load shape file since SUMO was compiled without GDAL support."); + return 0; +#endif +} + + +int +NBHeightMapper::loadTiff(const std::string& file) { +#ifdef HAVE_GDAL + GDALAllRegister(); + GDALDataset* poDataset = (GDALDataset*)GDALOpen(file.c_str(), GA_ReadOnly); + if (poDataset == 0) { + WRITE_ERROR("Cannot load GeoTIFF file."); + return 0; + } + const int xSize = poDataset->GetRasterXSize(); + const int ySize = poDataset->GetRasterYSize(); + double adfGeoTransform[6]; + if (poDataset->GetGeoTransform(adfGeoTransform) == CE_None) { + Position topLeft(adfGeoTransform[0], adfGeoTransform[3]); + mySizeOfPixel.set(adfGeoTransform[1], adfGeoTransform[5]); + const double horizontalSize = xSize * mySizeOfPixel.x(); + const double verticalSize = ySize * mySizeOfPixel.y(); + myBoundary.add(topLeft); + myBoundary.add(topLeft.x() + horizontalSize, topLeft.y() + verticalSize); + } else { + WRITE_ERROR("Could not parse geo information from " + file + "."); + return 0; + } + const int picSize = xSize * ySize; + myRaster = (int16_t*)CPLMalloc(sizeof(int16_t) * picSize); + for (int i = 1; i <= poDataset->GetRasterCount(); i++) { + GDALRasterBand* poBand = poDataset->GetRasterBand(i); + if (poBand->GetColorInterpretation() != GCI_GrayIndex) { + WRITE_ERROR("Unknown color band in " + file + "."); + clearData(); + break; + } + if (poBand->GetRasterDataType() != GDT_Int16) { + WRITE_ERROR("Unknown data type in " + file + "."); + clearData(); + break; + } + assert(xSize == poBand->GetXSize() && ySize == poBand->GetYSize()); + if (poBand->RasterIO(GF_Read, 0, 0, xSize, ySize, myRaster, xSize, ySize, GDT_Int16, 0, 0) == CE_Failure) { + WRITE_ERROR("Failure in reading " + file + "."); + clearData(); + break; + } + } + GDALClose(poDataset); + return picSize; +#else + WRITE_ERROR("Cannot load GeoTIFF file since SUMO was compiled without GDAL support."); + return 0; +#endif +} + + +void +NBHeightMapper::clearData() { + for (Triangles::iterator it = myTriangles.begin(); it != myTriangles.end(); it++) { + delete *it; + } + myTriangles.clear(); +#ifdef HAVE_GDAL + if (myRaster != 0) { + CPLFree(myRaster); + myRaster = 0; + } +#endif + myBoundary.reset(); +} + + +// =========================================================================== +// Triangle member methods +// =========================================================================== +NBHeightMapper::Triangle::Triangle(const PositionVector& corners): + myCorners(corners) { + assert(myCorners.size() == 3); + // @todo assert non-colinearity +} + + +void +NBHeightMapper::Triangle::addSelf(const QueryResult& queryResult) const { + queryResult.triangles.push_back(this); +} + + +bool +NBHeightMapper::Triangle::contains(const Position& pos) const { + return myCorners.around(pos); +} + + +SUMOReal +NBHeightMapper::Triangle::getZ(const Position& geo) const { + // en.wikipedia.org/wiki/Line-plane_intersection + Position p0 = myCorners.front(); + Position line(0, 0, 1); + p0.sub(geo); // p0 - l0 + Position normal = normalVector(); + return p0.dotProduct(normal) / line.dotProduct(normal); +} + + +Position +NBHeightMapper::Triangle::normalVector() const { + // @todo maybe cache result to avoid multiple computations? + Position side1 = myCorners[1] - myCorners[0]; + Position side2 = myCorners[2] - myCorners[0]; + return side1.crossProduct(side2); +} + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBHeightMapper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBHeightMapper.h --- sumo-0.21.0+dfsg/src/netbuild/NBHeightMapper.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBHeightMapper.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,210 @@ +/****************************************************************************/ +/// @file NBHeightMapper.h +/// @author Jakob Erdmann +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date Sept 2011 +/// @version $Id: NBHeightMapper.h 18096 2015-03-17 09:50:59Z behrisch $ +/// +// Set z-values for all network positions based on data from a height map +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2011-2015 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 NBHeightMapper_h +#define NBHeightMapper_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#ifdef _MSC_VER +typedef __int16 int16_t; +#else +#include +#endif + +#include +#include +#include +#include +#include + +#define TRIANGLE_RTREE_QUAL RTree + +// =========================================================================== +// class declarations +// =========================================================================== +class OptionsCont; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class NBHeightMapper + * @brief Set z-values for all network positions based on data from a height map + * + * Importing data from '.shp'-files works only if SUMO was compiled with GDAL-support. + * If not, an error message is generated. + */ +class NBHeightMapper { + + friend class NBHeightMapperTest; + +public: + /** @brief loads heigh map data if any loading options are set + * + * @param[in] oc The options container to get further options from + * @exception ProcessError if something fails + */ + static void loadIfSet(OptionsCont& oc); + + /// @brief return the singleton instance (maybe 0) + static const NBHeightMapper& get(); + + /// @brief returns whether the NBHeightMapper has data + bool ready() const; + + /// @brief returns the convex boundary of all known triangles + const Boundary& getBoundary() { + return Singleton.myBoundary; + } + + /// @brief returns height for the given geo coordinate (WGS84) + SUMOReal getZ(const Position& geo) const; + + class QueryResult; + /* @brief content class for the rtree. Since we wish to be able to use the + * rtree for spatial querying we have to jump through some minor hoops: + * We let each found triangle callback the NBHeightMapper and add itself the + * the query result + * */ + class Triangle { + + public: + Triangle(const PositionVector& corners); + ~Triangle() {}; + + /// @brief callback for RTree search + void addSelf(const QueryResult& queryResult) const; + + /// @brief checks whether pos lies within triangle (only checks x,y) + bool contains(const Position& pos) const; + + /// @brief returns the projection of the give geoCoordinate (WGS84) onto triangle plane + SUMOReal getZ(const Position& geo) const; + + /// @brief returns the normal vector for this triangles plane + Position normalVector() const; + + /// @brief the corners of the triangle + PositionVector myCorners; + + }; + + typedef std::vector Triangles; + + /// @brief class for cirumventing the const-restriction of RTree::Search-context + class QueryResult { + public: + QueryResult() {}; + ~QueryResult() {}; + // @brief method not realy const + void add(Triangle* triangle) const { + triangles.push_back(triangle); + }; + mutable Triangles triangles; + }; + +private: + /// @brief the singleton instance + static NBHeightMapper Singleton; + + Triangles myTriangles; + + /// @brief The RTree for spatial queries + TRIANGLE_RTREE_QUAL myRTree; + + /// @brief raster height information in m + int16_t* myRaster; + + /// @brief dimensions of one pixel in raster data + Position mySizeOfPixel; + + /// @brief convex boundary of all known triangles; + Boundary myBoundary; + +private: + /// @brief private constructor and destructor (Singleton) + NBHeightMapper(); + ~NBHeightMapper(); + + /// @brief adds one triangles worth of height data + void addTriangle(PositionVector corners); + + /** @brief load height data from Arcgis-shape file and returns the number of parsed features + * @return The number of parsed features + * @throws ProcessError + */ + int loadShapeFile(const std::string& file); + + /** @brief load height data from GeoTIFF file and returns the number of non void pixels + * @return The number of valid pixels + * @throws ProcessError + */ + int loadTiff(const std::string& file); + + /// @brief clears loaded data + void clearData(); + + /// @brief Invalidated copy constructor. + NBHeightMapper(const NBHeightMapper&); + + /// @brief Invalidated assignment operator. + NBHeightMapper& operator=(const NBHeightMapper&); + +}; + + +// =========================================================================== +// RTree specialization for speedup and avoiding warnings (ripped from SUMORTree.h) +// =========================================================================== +template<> +inline float TRIANGLE_RTREE_QUAL::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); +} + +template<> +inline TRIANGLE_RTREE_QUAL::Rect TRIANGLE_RTREE_QUAL::CombineRect(Rect* a_rectA, Rect* a_rectB) { + ASSERT(a_rectA && a_rectB); + Rect newRect; + newRect.m_min[0] = rtree_min(a_rectA->m_min[0], a_rectB->m_min[0]); + newRect.m_max[0] = rtree_max(a_rectA->m_max[0], a_rectB->m_max[0]); + newRect.m_min[1] = rtree_min(a_rectA->m_min[1], a_rectB->m_min[1]); + newRect.m_max[1] = rtree_max(a_rectA->m_max[1], a_rectB->m_max[1]); + return newRect; +} + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBHelpers.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBHelpers.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBHelpers.cpp 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBHelpers.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Tue, 20 Nov 2001 -/// @version $Id: NBHelpers.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NBHelpers.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Some mathematical helper methods /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBHelpers.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBHelpers.h --- sumo-0.21.0+dfsg/src/netbuild/NBHelpers.h 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBHelpers.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Tue, 20 Nov 2001 -/// @version $Id: NBHelpers.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NBHelpers.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some mathematical helper methods /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBJoinedEdgesMap.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBJoinedEdgesMap.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBJoinedEdgesMap.cpp 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBJoinedEdgesMap.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 29.05.2005 -/// @version $Id: NBJoinedEdgesMap.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBJoinedEdgesMap.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A structure storing information about which edges were joined /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBJoinedEdgesMap.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBJoinedEdgesMap.h --- sumo-0.21.0+dfsg/src/netbuild/NBJoinedEdgesMap.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBJoinedEdgesMap.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Sascha Krieg /// @date Fri, 29.04.2005 -/// @version $Id: NBJoinedEdgesMap.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBJoinedEdgesMap.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A structure storing information about which edges were joined /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBLinkPossibilityMatrix.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBLinkPossibilityMatrix.h --- sumo-0.21.0+dfsg/src/netbuild/NBLinkPossibilityMatrix.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBLinkPossibilityMatrix.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBLinkPossibilityMatrix.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBLinkPossibilityMatrix.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A matric to describe whether two links are foes to each other /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBLoadedSUMOTLDef.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBLoadedSUMOTLDef.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBLoadedSUMOTLDef.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBLoadedSUMOTLDef.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,13 +4,13 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mar 2011 -/// @version $Id: NBLoadedSUMOTLDef.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBLoadedSUMOTLDef.cpp 18156 2015-03-26 11:58:37Z namdre $ /// // A complete traffic light logic loaded from a sumo-net. (opted to reimplement // since NBLoadedTLDef is quite vissim specific) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -60,7 +60,8 @@ NBLoadedSUMOTLDef::NBLoadedSUMOTLDef(NBTrafficLightDefinition* def, NBTrafficLightLogic* logic) : - NBTrafficLightDefinition(def->getID(), def->getProgramID(), def->getOffset(), def->getType()), + // allow for adding a new program for the same def: take the programID from the new logic + NBTrafficLightDefinition(def->getID(), logic->getProgramID(), def->getOffset(), def->getType()), myTLLogic(new NBTrafficLightLogic(logic)), myOriginalNodes(def->getNodes().begin(), def->getNodes().end()) { assert(def->getOffset() == logic->getOffset()); @@ -219,6 +220,57 @@ } +void +NBLoadedSUMOTLDef::setType(TrafficLightType type) { + myType = type; + myTLLogic->setType(type); +} + + +void +NBLoadedSUMOTLDef::collectEdges() { + if (myControlledLinks.size() == 0) { + NBTrafficLightDefinition::collectEdges(); + } + myIncomingEdges.clear(); + EdgeVector myOutgoing; + // collect the edges from the participating nodes + for (std::vector::iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) { + const EdgeVector& incoming = (*i)->getIncomingEdges(); + copy(incoming.begin(), incoming.end(), back_inserter(myIncomingEdges)); + const EdgeVector& outgoing = (*i)->getOutgoingEdges(); + copy(outgoing.begin(), outgoing.end(), back_inserter(myOutgoing)); + } + // check which of the edges are completely within the junction + // and which are uncontrolled as well (we already know myControlledLinks) + for (EdgeVector::iterator j = myIncomingEdges.begin(); j != myIncomingEdges.end();) { + NBEdge* edge = *j; + // an edge lies within the logic if it is outgoing as well as incoming + EdgeVector::iterator k = find(myOutgoing.begin(), myOutgoing.end(), edge); + if (k != myOutgoing.end()) { + if (myControlledInnerEdges.count(edge->getID()) == 0) { + bool controlled = false; + for (NBConnectionVector::iterator it = myControlledLinks.begin(); it != myControlledLinks.end(); it++) { + if ((*it).getFrom() == edge) { + controlled = true; + break; + } + } + if (controlled) { + myControlledInnerEdges.insert(edge->getID()); + } else { + myEdgesWithin.push_back(edge); + (*j)->setIsInnerEdge(); + j = myIncomingEdges.erase(j); + continue; + } + } + } + ++j; + } +} + + void NBLoadedSUMOTLDef::collectLinks() { if (myControlledLinks.size() == 0) { diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBLoadedSUMOTLDef.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBLoadedSUMOTLDef.h --- sumo-0.21.0+dfsg/src/netbuild/NBLoadedSUMOTLDef.h 2014-05-05 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBLoadedSUMOTLDef.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,13 +3,13 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mar 2011 -/// @version $Id: NBLoadedSUMOTLDef.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: NBLoadedSUMOTLDef.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A complete traffic light logic loaded from a sumo-net. (opted to reimplement // since NBLoadedTLDef is quite vissim specific) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -126,12 +126,20 @@ */ void setOffset(SUMOTime offset); + /** @brief Sets the algorithm type of this tls + * @param[in] offset The algorithm type of this tls + */ + void setType(TrafficLightType type); + protected: /** @brief Collects the links participating in this traffic light * (only if not previously loaded) */ void collectLinks(); + /** @brief Build the list of participating edges + */ + void collectEdges(); /** @brief Computes the traffic light logic finally in dependence to the type * @param[in] ec The edge container diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBLoadedTLDef.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBLoadedTLDef.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBLoadedTLDef.cpp 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBLoadedTLDef.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 29.05.2005 -/// @version $Id: NBLoadedTLDef.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBLoadedTLDef.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A loaded (complete) traffic light logic /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBLoadedTLDef.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBLoadedTLDef.h --- sumo-0.21.0+dfsg/src/netbuild/NBLoadedTLDef.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBLoadedTLDef.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Sascha Krieg /// @date Fri, 29.04.2005 -/// @version $Id: NBLoadedTLDef.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBLoadedTLDef.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A loaded (complete) traffic light logic /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBNetBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNetBuilder.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBNetBuilder.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNetBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date 20 Nov 2001 -/// @version $Id: NBNetBuilder.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBNetBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Instance responsible for building networks /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -52,10 +52,7 @@ #include #include "NBAlgorithms.h" #include "NBAlgorithms_Ramps.h" - -#ifdef HAVE_INTERNAL -#include -#endif +#include "NBHeightMapper.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -66,8 +63,7 @@ // method definitions // =========================================================================== NBNetBuilder::NBNetBuilder() : - myEdgeCont(myTypeCont), - myHaveSeenRoundabouts(false) + myEdgeCont(myTypeCont) {} @@ -76,25 +72,6 @@ void NBNetBuilder::applyOptions(OptionsCont& oc) { - // we possibly have to load the edges to keep - if (oc.isSet("keep-edges.input-file")) { - std::ifstream strm(oc.getString("keep-edges.input-file").c_str()); - if (!strm.good()) { - throw ProcessError("Could not load names of edges too keep from '" + oc.getString("keep-edges.input-file") + "'."); - } - std::ostringstream oss; - bool first = true; - while (strm.good()) { - if (!first) { - oss << ','; - } - std::string name; - strm >> name; - oss << name; - first = false; - } - oc.set("keep-edges.explicit", oss.str()); - } // apply options to type control myTypeCont.setDefaults(oc.getInt("default.lanenumber"), oc.getFloat("default.speed"), oc.getInt("default.priority")); // apply options to edge control @@ -125,7 +102,7 @@ } // if (oc.exists("keep-edges.postload") && oc.getBool("keep-edges.postload")) { - if (oc.isSet("keep-edges.explicit")) { + if (oc.isSet("keep-edges.explicit") || oc.isSet("keep-edges.input-file")) { PROGRESS_BEGIN_MESSAGE("Removing unwished edges"); myEdgeCont.removeUnwishedEdges(myDistrictCont); PROGRESS_DONE_MESSAGE(); @@ -146,18 +123,17 @@ myNodeCont.computeNodeShapes(oc.getBool("lefthand")); myEdgeCont.computeEdgeShapes(); // preliminary roundabout computations to avoid destroying roundabouts - if (oc.getBool("roundabouts.guess") || (oc.isDefault("roundabouts.guess") && myHaveSeenRoundabouts)) { - assert(myRoundabouts.size() == 0); - myEdgeCont.guessRoundabouts(myRoundabouts); - for (std::vector::const_iterator it_round = myRoundabouts.begin(); - it_round != myRoundabouts.end(); ++it_round) { - std::vector nodeIDs; - for (EdgeVector::const_iterator it_edge = it_round->begin(); it_edge != it_round->end(); ++it_edge) { - nodeIDs.push_back((*it_edge)->getToNode()->getID()); - } - myNodeCont.addJoinExclusion(nodeIDs); + if (oc.getBool("roundabouts.guess")) { + myEdgeCont.guessRoundabouts(); + } + const std::set& roundabouts = myEdgeCont.getRoundabouts(); + for (std::set::const_iterator it_round = roundabouts.begin(); + it_round != roundabouts.end(); ++it_round) { + std::vector nodeIDs; + for (EdgeSet::const_iterator it_edge = it_round->begin(); it_edge != it_round->end(); ++it_edge) { + nodeIDs.push_back((*it_edge)->getToNode()->getID()); } - myRoundabouts.clear(); + myNodeCont.addJoinExclusion(nodeIDs); } numJoined += myNodeCont.joinJunctions(oc.getFloat("junctions.join-dist"), myDistrictCont, myEdgeCont, myTLLCont); // reset geometry to avoid influencing subsequent steps (ramps.guess) @@ -213,6 +189,12 @@ myEdgeCont.splitGeometry(myNodeCont); PROGRESS_DONE_MESSAGE(); } + // turning direction + PROGRESS_BEGIN_MESSAGE("Computing turning directions"); + NBTurningDirectionsComputer::computeTurnDirections(myNodeCont); + PROGRESS_DONE_MESSAGE(); + // correct edge geometries to avoid overlap + myNodeCont.avoidOverlap(); // 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"); @@ -221,10 +203,11 @@ PROGRESS_DONE_MESSAGE(); } // guess sidewalks - if (oc.getBool("sidewalks.guess")) { + if (oc.getBool("sidewalks.guess") || oc.getBool("sidewalks.guess.from-permissions")) { const int sidewalks = myEdgeCont.guessSidewalks(oc.getFloat("default.sidewalk-width"), oc.getFloat("sidewalks.guess.min-speed"), - oc.getFloat("sidewalks.guess.max-speed")); + oc.getFloat("sidewalks.guess.max-speed"), + oc.getBool("sidewalks.guess.from-permissions")); WRITE_MESSAGE("Guessed " + toString(sidewalks) + " sidewalks."); } @@ -240,10 +223,6 @@ // GEOMETRY COMPUTATION // - PROGRESS_BEGIN_MESSAGE("Computing turning directions"); - NBTurningDirectionsComputer::computeTurnDirections(myNodeCont); - PROGRESS_DONE_MESSAGE(); - // PROGRESS_BEGIN_MESSAGE("Sorting nodes' edges"); NBNodesEdgesSorter::sortNodesEdges(myNodeCont, oc.getBool("lefthand")); PROGRESS_DONE_MESSAGE(); @@ -260,6 +239,9 @@ PROGRESS_BEGIN_MESSAGE("Computing edge shapes"); myEdgeCont.computeEdgeShapes(); PROGRESS_DONE_MESSAGE(); + // resort edges based on the node and edge shapes + NBNodesEdgesSorter::sortNodesEdges(myNodeCont, oc.getBool("lefthand"), true); + NBTurningDirectionsComputer::computeTurnDirections(myNodeCont); // APPLY SPEED MODIFICATIONS if (oc.exists("speed.offset")) { @@ -307,11 +289,12 @@ myEdgeCont.computeEdge2Edges(oc.getBool("no-left-connections")); PROGRESS_DONE_MESSAGE(); // - if (oc.getBool("roundabouts.guess") || (oc.isDefault("roundabouts.guess") && myHaveSeenRoundabouts)) { + if (oc.getBool("roundabouts.guess")) { PROGRESS_BEGIN_MESSAGE("Guessing and setting roundabouts"); - myEdgeCont.guessRoundabouts(myRoundabouts); + myEdgeCont.guessRoundabouts(); PROGRESS_DONE_MESSAGE(); } + myEdgeCont.markRoundabouts(); // PROGRESS_BEGIN_MESSAGE("Computing approaching lanes"); myEdgeCont.computeLanes2Edges(buildCrossingsAndWalkingAreas); @@ -362,7 +345,7 @@ // COMPUTING RIGHT-OF-WAY AND TRAFFIC LIGHT PROGRAMS // PROGRESS_BEGIN_MESSAGE("Computing traffic light control information"); - myTLLCont.setTLControllingInformation(myEdgeCont); + myTLLCont.setTLControllingInformation(myEdgeCont, myNodeCont); PROGRESS_DONE_MESSAGE(); // PROGRESS_BEGIN_MESSAGE("Computing node logics"); @@ -440,9 +423,8 @@ NBNetBuilder::transformCoordinates(Position& from, bool includeInBoundary, GeoConvHelper* from_srs) { Position orig(from); bool ok = GeoConvHelper::getProcessing().x2cartesian(from, includeInBoundary); -#ifdef HAVE_INTERNAL if (ok) { - const HeightMapper& hm = HeightMapper::get(); + const NBHeightMapper& hm = NBHeightMapper::get(); if (hm.ready()) { if (from_srs != 0 && from_srs->usingGeoProjection()) { from_srs->cartesian2geo(orig); @@ -451,9 +433,6 @@ from = Position(from.x(), from.y(), z); } } -#else - UNUSED_PARAMETER(from_srs); -#endif return ok; } @@ -492,4 +471,5 @@ } return ok; } + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBNetBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNetBuilder.h --- sumo-0.21.0+dfsg/src/netbuild/NBNetBuilder.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNetBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: NBNetBuilder.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBNetBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Instance responsible for building networks /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -187,15 +187,6 @@ return myDistrictCont; } - - /** @brief Returns the determined roundabouts - * @return The list of roundabout edges - */ - const std::vector& getRoundabouts() const { - return myRoundabouts; - } - - /** @brief Returns the joined edges map * @return The map of joined edges */ @@ -205,18 +196,13 @@ /// @} - /// @brief declare that roundabouts have been seen during loading - void haveSeenRoundabouts() { - myHaveSeenRoundabouts = true; - } - /** * @brief transforms loaded coordinates - * handles projections, offsets (using GeoConvHelper) and import of height data (using Heightmapper if available) + * handles projections, offsets (using GeoConvHelper) and import of height data (using NBHeightMapper) * @param[in,out] from The coordinate to be transformed * @param[in] includeInBoundary Whether to patch the convex boundary of the GeoConvHelper default instance * @param[in] from_srs The spatial reference system of the input coordinate - * @notde These methods are located outside of GeoConvHelper to avoid linker-dependecies on INTERNAL_LIBS and GDAL for libgeom + * @notde These methods are located outside of GeoConvHelper to avoid linker-dependencies on GDAL for libgeom */ static bool transformCoordinates(Position& from, bool includeInBoundary = true, GeoConvHelper* from_srs = 0); static bool transformCoordinates(PositionVector& from, bool includeInBoundary = true, GeoConvHelper* from_srs = 0); @@ -254,12 +240,6 @@ /// @brief The used container for districts NBDistrictCont myDistrictCont; - /// @brief whether a sumo network with roundabout information was loaded - bool myHaveSeenRoundabouts; - - /// @brief Edges marked as belonging to a roundabout (each EdgeVector is a roundabout) - std::vector myRoundabouts; - /// @brief Map of joined edges NBJoinedEdgesMap myJoinedEdges; diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBNodeCont.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNodeCont.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBNodeCont.cpp 2014-05-22 22:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNodeCont.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -8,12 +8,12 @@ /// @author Michael Behrisch /// @author Sascha Krieg /// @date Tue, 20 Nov 2001 -/// @version $Id: NBNodeCont.cpp 16413 2014-05-22 13:40:13Z namdre $ +/// @version $Id: NBNodeCont.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Container for nodes during the netbuilding process /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -90,22 +90,6 @@ } -Position -NBNodeCont::insert(const std::string& id) { - std::pair ret(-1.0, -1.0); - NodeCont::iterator i = myNodes.find(id); - if (i != myNodes.end()) { - return (*i).second->getPosition(); - } else { - NBNode* node = new NBNode(id, Position(-1.0, -1.0)); - myNodes[id] = node; - const float pos[2] = {(float) - 1, (float) - 1}; - myRTree.Insert(pos, pos, node); - } - return Position(-1, -1); -} - - bool NBNodeCont::insert(NBNode* node) { std::string id = node->getID(); @@ -387,6 +371,13 @@ } +void +NBNodeCont::avoidOverlap() { + for (NodeCont::iterator i = myNodes.begin(); i != myNodes.end(); i++) { + (*i).second->avoidOverlap(); + } +} + // ----------- (Helper) methods for joining nodes void NBNodeCont::generateNodeClusters(SUMOReal maxDist, NodeClusters& into) const { @@ -558,8 +549,8 @@ if (cluster.size() > 1) { // check for clusters which are to complex and probably won't work very well // we count the incoming edges of the final junction - std::set finalIncoming; - std::set finalOutgoing; + std::map finalIncomingAngles; + std::map finalOutgoingAngles; std::vector nodeIDs; for (std::set::const_iterator j = cluster.begin(); j != cluster.end(); ++j) { nodeIDs.push_back((*j)->getID()); @@ -567,48 +558,42 @@ NBEdge* edge = *it_edge; if (cluster.count(edge->getFromNode()) == 0) { // incoming edge, does not originate in the cluster - finalIncoming.insert(edge); + finalIncomingAngles[edge->getID()] = edge->getAngleAtNode(edge->getToNode()); } } for (EdgeVector::const_iterator it_edge = (*j)->getOutgoingEdges().begin(); it_edge != (*j)->getOutgoingEdges().end(); ++it_edge) { NBEdge* edge = *it_edge; if (cluster.count(edge->getToNode()) == 0) { // outgoing edge, does not end in the cluster - finalOutgoing.insert(edge); + finalOutgoingAngles[edge->getID()] = edge->getAngleAtNode(edge->getFromNode()); } } } - if (finalIncoming.size() > 4) { + if (finalIncomingAngles.size() > 4) { std::sort(nodeIDs.begin(), nodeIDs.end()); - WRITE_WARNING("Not joining junctions " + joinToStringSorting(nodeIDs, ',') + " because the cluster is too complex (" + toString(finalIncoming.size()) + " incoming edges)"); + WRITE_WARNING("Not joining junctions " + joinToStringSorting(nodeIDs, ',') + " because the cluster is too complex (" + toString(finalIncomingAngles.size()) + " incoming edges)"); } else { // check for incoming parallel edges const SUMOReal PARALLEL_INCOMING_THRESHOLD = 10.0; bool foundParallel = false; - for (std::set::const_iterator j = finalIncoming.begin(); j != finalIncoming.end() && !foundParallel; ++j) { - for (std::set::const_iterator k = finalIncoming.begin(); k != finalIncoming.end() && !foundParallel; ++k) { - if ((*j) != (*k) && fabs((*j)->getAngleAtNode((*j)->getToNode()) - (*k)->getAngleAtNode((*k)->getToNode())) < PARALLEL_INCOMING_THRESHOLD) { - std::vector parallelEdgeIDs; - parallelEdgeIDs.push_back((*j)->getID()); - parallelEdgeIDs.push_back((*k)->getID()); - std::sort(parallelEdgeIDs.begin(), parallelEdgeIDs.end()); + for (std::map::const_iterator j = finalIncomingAngles.begin(); j != finalIncomingAngles.end() && !foundParallel; ++j) { + std::map::const_iterator k = j; + for (++k; k != finalIncomingAngles.end() && !foundParallel; ++k) { + if (fabs(j->second - k->second) < PARALLEL_INCOMING_THRESHOLD) { WRITE_WARNING("Not joining junctions " + joinToStringSorting(nodeIDs, ',') + " because the cluster is too complex (parallel incoming " - + joinToString(parallelEdgeIDs, ',') + ")"); + + j->first + "," + k->first + ")"); foundParallel = true; } } } // check for outgoing parallel edges - for (std::set::const_iterator j = finalOutgoing.begin(); j != finalOutgoing.end() && !foundParallel; ++j) { - for (std::set::const_iterator k = finalOutgoing.begin(); k != finalOutgoing.end() && !foundParallel; ++k) { - if ((*j) != (*k) && fabs((*j)->getAngleAtNode((*j)->getFromNode()) - (*k)->getAngleAtNode((*k)->getFromNode())) < PARALLEL_INCOMING_THRESHOLD) { - std::vector parallelEdgeIDs; - parallelEdgeIDs.push_back((*j)->getID()); - parallelEdgeIDs.push_back((*k)->getID()); - std::sort(parallelEdgeIDs.begin(), parallelEdgeIDs.end()); + for (std::map::const_iterator j = finalOutgoingAngles.begin(); j != finalOutgoingAngles.end() && !foundParallel; ++j) { + std::map::const_iterator k = j; + for (++k; k != finalOutgoingAngles.end() && !foundParallel; ++k) { + if (fabs(j->second - k->second) < PARALLEL_INCOMING_THRESHOLD) { WRITE_WARNING("Not joining junctions " + joinToStringSorting(nodeIDs, ',') + " because the cluster is too complex (parallel outgoing " - + joinToStringSorting(parallelEdgeIDs, ',') + ")"); + + j->first + "," + k->first + ")"); foundParallel = true; } } @@ -1073,6 +1058,7 @@ int numPriorityJunctions = 0; int numRightBeforeLeftJunctions = 0; int numAllWayStopJunctions = 0; + int numRailSignals = 0; for (NodeCont::const_iterator i = myNodes.begin(); i != myNodes.end(); i++) { switch ((*i).second->getType()) { case NODETYPE_NOJUNCTION: @@ -1098,6 +1084,9 @@ break; case NODETYPE_UNKNOWN: break; + case NODETYPE_RAIL_SIGNAL: + ++numRailSignals; + break; default: break; } @@ -1112,6 +1101,9 @@ if (numAllWayStopJunctions > 0) { WRITE_MESSAGE(" All-way stop junctions : " + toString(numAllWayStopJunctions)); } + if (numRailSignals > 0) { + WRITE_MESSAGE(" Rail signal junctions : " + toString(numRailSignals)); + } } diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBNodeCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNodeCont.h --- sumo-0.21.0+dfsg/src/netbuild/NBNodeCont.h 2014-05-22 22:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNodeCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Tue, 20 Nov 2001 -/// @version $Id: NBNodeCont.h 16408 2014-05-22 07:00:50Z behrisch $ +/// @version $Id: NBNodeCont.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Container for nodes during the netbuilding process /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -86,13 +86,6 @@ /** @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); - - - /** @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) */ @@ -196,6 +189,11 @@ void joinSimilarEdges(NBDistrictCont& dc, NBEdgeCont& ec, NBTrafficLightLogicCont& tlc); + /** @brief fix overlap + */ + void avoidOverlap(); + + /** @brief Removes sequences of edges that are not connected with a junction. * Simple roads without junctions sometimes remain when converting from OpenStreetMake, * but they make no sense. Remaining empty nodes are also deleted. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBNode.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNode.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBNode.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNode.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBNode.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBNode.cpp 18167 2015-03-27 11:26:11Z namdre $ /// // The representation of a single node /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -78,6 +78,8 @@ // do not build uncontrolled crossings across edges with a speed above the threshold #define UNCONTROLLED_CROSSING_SPEED_THRESHOLD 13.89 // meters/second +#define DEBUGID "C" + // =========================================================================== // static members // =========================================================================== @@ -85,6 +87,8 @@ const int NBNode::FORWARD(1); const int NBNode::BACKWARD(-1); const SUMOReal NBNode::DEFAULT_CROSSING_WIDTH(4); +const SUMOReal NBNode::UNSPECIFIED_RADIUS = -1; +const SUMOReal NBNode::DEFAULT_RADIUS = 1.5; // =========================================================================== // method definitions @@ -232,7 +236,8 @@ myType(type), myDistrict(0), myHaveCustomPoly(false), - myRequest(0) + myRequest(0), + myRadius(UNSPECIFIED_RADIUS) { } @@ -242,7 +247,8 @@ myType(district == 0 ? NODETYPE_UNKNOWN : NODETYPE_DISTRICT), myDistrict(district), myHaveCustomPoly(false), - myRequest(0) + myRequest(0), + myRadius(UNSPECIFIED_RADIUS) { } @@ -288,7 +294,7 @@ void NBNode::addTrafficLight(NBTrafficLightDefinition* tlDef) { myTrafficLights.insert(tlDef); - if (myType != NODETYPE_TRAFFIC_LIGHT_NOJUNCTION) { + if (myType != NODETYPE_TRAFFIC_LIGHT_NOJUNCTION && myType != NODETYPE_RAIL_SIGNAL) { myType = NODETYPE_TRAFFIC_LIGHT; } } @@ -427,7 +433,7 @@ if (myIncomingEdges.size() == 2 && myOutgoingEdges.size() == 2) { for (EdgeVector::const_iterator i = myIncomingEdges.begin(); i != myIncomingEdges.end(); i++) { NBEdge* in = *i; - EdgeVector::const_iterator opposite = find_if(myOutgoingEdges.begin(), myOutgoingEdges.end(), NBContHelper::opposite_finder(in, this)); + EdgeVector::const_iterator opposite = find_if(myOutgoingEdges.begin(), myOutgoingEdges.end(), NBContHelper::opposite_finder(in)); // must have an opposite edge if (opposite == myOutgoingEdges.end()) { return false; @@ -446,32 +452,30 @@ PositionVector -NBNode::computeInternalLaneShape(NBEdge* fromE, int fromL, - NBEdge* toE, int toL, int numPoints) const { - if (fromL >= (int) fromE->getNumLanes()) { - throw ProcessError("Connection '" + fromE->getID() + "_" + toString(fromL) + "->" + toE->getID() + "_" + toString(toL) + "' starts at a not existing lane."); - } - if (toL >= (int) toE->getNumLanes()) { - throw ProcessError("Connection '" + fromE->getID() + "_" + toString(fromL) + "->" + toE->getID() + "_" + toString(toL) + "' yields in a not existing lane."); - } - bool noSpline = false; +NBNode::computeSmoothShape(const PositionVector& begShape, + const PositionVector& endShape, + int numPoints, + bool isTurnaround, + SUMOReal extrapolateBeg, + SUMOReal extrapolateEnd) const { + + const Position beg = begShape.back(); + const Position end = endShape.front(); PositionVector ret; PositionVector init; - Position beg = fromE->getLaneShape(fromL).back(); - Position end = toE->getLaneShape(toL).front(); - Position intersection; unsigned int noInitialPoints = 0; + bool noSpline = false; if (beg.distanceTo(end) <= POSITION_EPS) { noSpline = true; } else { - if (fromE->getTurnDestination() == toE) { + if (isTurnaround) { // turnarounds: // - end of incoming lane // - position between incoming/outgoing end/begin shifted by the distance orthogonally // - begin of outgoing lane noInitialPoints = 3; init.push_back(beg); - Line straightConn(fromE->getLaneShape(fromL)[-1], toE->getLaneShape(toL)[0]); + Line straightConn(begShape[-1], endShape[0]); Position straightCenter = straightConn.getPositionAtDistance((SUMOReal) straightConn.length() / (SUMOReal) 2.); Position center = straightCenter;//.add(straightCenter); Line cross(straightConn); @@ -481,25 +485,25 @@ init.push_back(center); init.push_back(end); } else { - const SUMOReal angle = fabs(fromE->getLaneShape(fromL).getEndLine().atan2Angle() - toE->getLaneShape(toL).getBegLine().atan2Angle()); + const SUMOReal angle = fabs(begShape.getEndLine().atan2Angle() - endShape.getBegLine().atan2Angle()); if (angle < M_PI / 4. || angle > 7. / 4.*M_PI) { // very low angle: almost straight noInitialPoints = 4; init.push_back(beg); - Line begL = fromE->getLaneShape(fromL).getEndLine(); + Line begL = begShape.getEndLine(); begL.extrapolateSecondBy(100); - Line endL = toE->getLaneShape(toL).getBegLine(); + Line endL = endShape.getBegLine(); endL.extrapolateFirstBy(100); SUMOReal distance = beg.distanceTo(end); if (distance > 10) { { - SUMOReal off1 = fromE->getLaneShape(fromL).getEndLine().length() + (SUMOReal) 5. * (SUMOReal) fromE->getNumLanes(); - off1 = MIN2(off1, (SUMOReal)(fromE->getLaneShape(fromL).getEndLine().length() + distance / 2.)); + SUMOReal off1 = begShape.getEndLine().length() + extrapolateBeg; + off1 = MIN2(off1, (SUMOReal)(begShape.getEndLine().length() + distance / 2.)); Position tmp = begL.getPositionAtDistance(off1); init.push_back(tmp); } { - SUMOReal off1 = (SUMOReal) 100. - (SUMOReal) 5. * (SUMOReal) toE->getNumLanes(); + SUMOReal off1 = (SUMOReal) 100. - extrapolateEnd; off1 = MAX2(off1, (SUMOReal)(100. - distance / 2.)); Position tmp = endL.getPositionAtDistance(off1); init.push_back(tmp); @@ -516,8 +520,8 @@ // attention: if there is no intersection, use a straight line noInitialPoints = 3; init.push_back(beg); - Line begL = fromE->getLaneShape(fromL).getEndLine(); - Line endL = toE->getLaneShape(toL).getBegLine(); + Line begL = begShape.getEndLine(); + Line endL = endShape.getBegLine(); bool check = !begL.p1().almostSame(begL.p2()) && !endL.p1().almostSame(endL.p2()); if (check) { begL.extrapolateSecondBy(100); @@ -536,8 +540,8 @@ } // if (noSpline) { - ret.push_back(fromE->getLaneShape(fromL).back()); - ret.push_back(toE->getLaneShape(toL).front()); + ret.push_back(begShape.back()); + ret.push_back(endShape.front()); } else { SUMOReal* def = new SUMOReal[1 + noInitialPoints * 3]; for (int i = 0; i < (int) init.size(); ++i) { @@ -551,15 +555,50 @@ delete[] def; Position prev; for (int i = 0; i < (int) numPoints; i++) { - Position current(ret_buf[i * 3 + 1], ret_buf[i * 3 + 3]); - if (prev != current) { + Position current(ret_buf[i * 3 + 1], ret_buf[i * 3 + 3], myPosition.z()); + if (prev != current && !ISNAN(current.x()) && !ISNAN(current.y())) { ret.push_back(current); } prev = current; } delete[] ret_buf; } - const NBEdge::Lane& lane = fromE->getLaneStruct(fromL); + return ret; +} + + +PositionVector +NBNode::computeInternalLaneShape(NBEdge* fromE, const NBEdge::Connection& con, int numPoints) const { + if (con.fromLane >= (int) fromE->getNumLanes()) { + throw ProcessError("Connection '" + fromE->getID() + "_" + toString(con.fromLane) + "->" + con.toEdge->getID() + "_" + toString(con.toLane) + "' starts at a non-existant lane."); + } + if (con.toLane >= (int) con.toEdge->getNumLanes()) { + throw ProcessError("Connection '" + fromE->getID() + "_" + toString(con.fromLane) + "->" + con.toEdge->getID() + "_" + toString(con.toLane) + "' targets a non-existant lane."); + } + PositionVector ret; + if (myCustomLaneShapes.size() > 0 && con.id != "") { + // this is the second pass (ids and shapes are already set + assert(con.shape.size() > 0); + CustomShapeMap::const_iterator it = myCustomLaneShapes.find(con.getInternalLaneID()); + if (it != myCustomLaneShapes.end()) { + ret = it->second; + } else { + ret = con.shape; + } + it = myCustomLaneShapes.find(con.viaID + "_0"); + if (it != myCustomLaneShapes.end()) { + ret.append(it->second); + } else { + ret.append(con.viaShape); + } + return ret; + } + + ret = computeSmoothShape(fromE->getLaneShape(con.fromLane), con.toEdge->getLaneShape(con.toLane), + numPoints, fromE->getTurnDestination() == con.toEdge, + (SUMOReal) 5. * (SUMOReal) fromE->getNumLanes(), + (SUMOReal) 5. * (SUMOReal) con.toEdge->getNumLanes()); + const NBEdge::Lane& lane = fromE->getLaneStruct(con.fromLane); if (lane.endOffset > 0) { PositionVector beg = lane.shape.getSubpart(lane.shape.length() - lane.endOffset, lane.shape.length());; beg.append(ret); @@ -570,29 +609,45 @@ bool -NBNode::needsCont(NBEdge* fromE, NBEdge* toE, NBEdge* otherFromE, NBEdge* otherToE, const NBEdge::Connection& c) const { - if (myType == NODETYPE_RIGHT_BEFORE_LEFT) { +NBNode::needsCont(const NBEdge* fromE, const NBEdge* otherFromE, + const NBEdge::Connection& c, const NBEdge::Connection& otherC) const { + const NBEdge* toE = c.toEdge; + const NBEdge* otherToE = otherC.toEdge; + + if (myType == NODETYPE_RIGHT_BEFORE_LEFT || myType == NODETYPE_ALLWAY_STOP) { return false; } - if (fromE == otherFromE) { - // ignore same edge links + LinkDirection d1 = getDirection(fromE, toE); + const bool thisRight = (d1 == LINKDIR_RIGHT || d1 == LINKDIR_PARTRIGHT); + const bool rightTurnConflict = (thisRight && + myRequest->rightTurnConflict(fromE, toE, c.fromLane, otherFromE, otherToE, otherC.fromLane)); + if (thisRight && !rightTurnConflict) { return false; } - if (!foes(otherFromE, otherToE, fromE, toE)) { + if (!(foes(otherFromE, otherToE, fromE, toE) || myRequest == 0 || rightTurnConflict)) { // if they do not cross, no waiting place is needed return false; } - LinkDirection d1 = getDirection(fromE, toE); LinkDirection d2 = getDirection(otherFromE, otherToE); - bool thisLeft = (d1 == LINKDIR_LEFT || d1 == LINKDIR_TURN); - bool otherLeft = (d2 == LINKDIR_LEFT || d2 == LINKDIR_TURN); - bool bothLeft = thisLeft && otherLeft; + if (d2 == LINKDIR_TURN) { + return false; + } + const bool thisLeft = (d1 == LINKDIR_LEFT || d1 == LINKDIR_TURN); + const bool otherLeft = (d2 == LINKDIR_LEFT || d2 == LINKDIR_TURN); + const bool bothLeft = thisLeft && otherLeft; + if (fromE == otherFromE && !thisRight) { + // ignore same edge links except for right-turns + return false; + } + if (thisRight && d2 != LINKDIR_STRAIGHT) { + return false; + } if (c.tlID != "" && !bothLeft) { - // tls-controlled links will have space - return true; + assert(myTrafficLights.size() > 0); + return (*myTrafficLights.begin())->needsCont(fromE, toE, otherFromE, otherToE); } if (fromE->getJunctionPriority(this) > 0 && otherFromE->getJunctionPriority(this) > 0) { - return mustBrake(fromE, toE, c.toLane); + return mustBrake(fromE, toE, c.fromLane, false); } return false; } @@ -605,6 +660,12 @@ if (myIncomingEdges.size() == 0 || myOutgoingEdges.size() == 0) { // no logic if nothing happens here myType = NODETYPE_NOJUNCTION; + std::set trafficLights = myTrafficLights; // make a copy because we will modify the original + removeTrafficLights(); + for (std::set::const_iterator i = trafficLights.begin(); i != trafficLights.end(); ++i) { + (*i)->setParticipantsInformation(); + (*i)->setTLControllingInformation(ec); + } return; } // check whether the node was set to be unregulated by the user @@ -683,6 +744,7 @@ // special case a): // one in, one out, the outgoing has one lane more if (myIncomingEdges.size() == 1 && myOutgoingEdges.size() == 1 + && myIncomingEdges[0]->getStep() <= NBEdge::LANES2EDGES && myIncomingEdges[0]->getNumLanes() == myOutgoingEdges[0]->getNumLanes() - 1 && myIncomingEdges[0] != myOutgoingEdges[0] && myIncomingEdges[0]->isConnectedTo(myOutgoingEdges[0])) { @@ -703,53 +765,57 @@ // special case b): // two in, one out, the outgoing has the same number of lanes as the sum of the incoming // --> 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) { - NBEdge* inc1 = myIncomingEdges[0]; - NBEdge* inc2 = myIncomingEdges[1]; - // for internal: check which one is the rightmost - SUMOReal a1 = inc1->getAngleAtNode(this); - SUMOReal a2 = inc2->getAngleAtNode(this); - SUMOReal ccw = GeomHelper::getCCWAngleDiff(a1, a2); - SUMOReal cw = GeomHelper::getCWAngleDiff(a1, a2); - if (ccw > cw) { - std::swap(inc1, inc2); + NBEdge* out = myOutgoingEdges[0]; + NBEdge* in1 = myIncomingEdges[0]; + NBEdge* in2 = myIncomingEdges[1]; + if (in1->getNumLanes() + in2->getNumLanes() == out->getNumLanes() + && (in1->getStep() <= NBEdge::LANES2EDGES) + && (in2->getStep() <= NBEdge::LANES2EDGES) + && in1 != out + && in2 != out + && in1->isConnectedTo(out) + && in2->isConnectedTo(out)) { + // for internal: check which one is the rightmost + SUMOReal a1 = in1->getAngleAtNode(this); + SUMOReal a2 = in2->getAngleAtNode(this); + SUMOReal ccw = GeomHelper::getCCWAngleDiff(a1, a2); + SUMOReal cw = GeomHelper::getCWAngleDiff(a1, a2); + if (ccw > cw) { + std::swap(in1, in2); + } + const int outOffset = MAX2(0, out->getFirstNonPedestrianLaneIndex(FORWARD, true)); + const int in1Offset = MAX2(0, in1->getFirstNonPedestrianLaneIndex(FORWARD, true)); + const int in2Offset = MAX2(0, in2->getFirstNonPedestrianLaneIndex(FORWARD, true)); + in1->addLane2LaneConnections(in1Offset, out, outOffset, in1->getNumLanes() - in1Offset, NBEdge::L2L_VALIDATED, true, true); + in2->addLane2LaneConnections(in2Offset, out, in1->getNumLanes() + outOffset - in1Offset, in2->getNumLanes() - in2Offset, NBEdge::L2L_VALIDATED, true, true); + return; } - 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* in = myIncomingEdges[0]; NBEdge* out1 = myOutgoingEdges[0]; NBEdge* out2 = myOutgoingEdges[1]; - // for internal: check which one is the rightmost - if (NBContHelper::relative_outgoing_edge_sorter(myIncomingEdges[0])(out2, out1)) { - std::swap(out1, out2); + if (in->getNumLanes() == out2->getNumLanes() + out1->getNumLanes() + && (in->getStep() <= NBEdge::LANES2EDGES) + && in != out1 + && in != out2 + && in->isConnectedTo(out1) + && in->isConnectedTo(out2)) { + // for internal: check which one is the rightmost + if (NBContHelper::relative_outgoing_edge_sorter(in)(out2, out1)) { + std::swap(out1, out2); + } + const int inOffset = MAX2(0, in->getFirstNonPedestrianLaneIndex(FORWARD, true)); + const int out1Offset = MAX2(0, out1->getFirstNonPedestrianLaneIndex(FORWARD, true)); + const int out2Offset = MAX2(0, out2->getFirstNonPedestrianLaneIndex(FORWARD, true)); + in->addLane2LaneConnections(inOffset, out1, out1Offset, out1->getNumLanes() - out1Offset, NBEdge::L2L_VALIDATED, true, true); + in->addLane2LaneConnections(out1->getNumLanes() + inOffset - out1Offset, out2, out2Offset, out2->getNumLanes() - out2Offset, NBEdge::L2L_VALIDATED, false, true); + return; } - 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 @@ -1098,16 +1164,7 @@ bool -NBNode::mustBrake(const NBEdge* const from, const NBEdge* const to, int /* toLane */) const { - // check whether it is participant to a traffic light - // - controlled links are set by the traffic lights, not the normal - // right-of-way rules - // - uncontrolled participants (spip lanes etc.) should always break - if (myTrafficLights.size() != 0) { - // ok, we have a traffic light, return true by now, it will be later - // controlled by the tls - return true; - } +NBNode::mustBrake(const NBEdge* const from, const NBEdge* const to, int fromLane, bool includePedCrossings) const { // unregulated->does not need to brake if (myRequest == 0) { return false; @@ -1117,7 +1174,7 @@ return true; } // check whether any other connection on this node prohibits this connection - return myRequest->mustBrake(from, to); + return myRequest->mustBrake(from, to, fromLane, includePedCrossings); } bool @@ -1127,6 +1184,13 @@ bool +NBNode::rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane, + const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane) const { + return myRequest->rightTurnConflict(from, to, fromLane, prohibitorFrom, prohibitorTo, prohibitorFromLane); +} + + +bool NBNode::isLeftMover(const NBEdge* const from, const NBEdge* const to) const { // when the junction has only one incoming edge, there are no // problems caused by left blockings @@ -1140,7 +1204,7 @@ std::vector::const_iterator i = std::find(myAllEdges.begin(), myAllEdges.end(), from); do { NBContHelper::nextCW(myAllEdges, i); - } while ((!hasOutgoing(*i) || from->isTurningDirectionAt(this, *i)) && *i != from); + } while ((!hasOutgoing(*i) || from->isTurningDirectionAt(*i)) && *i != from); return cw < ccw && (*i) == to && myOutgoingEdges.size() > 2; } @@ -1250,7 +1314,7 @@ return LINKDIR_NODIR; } // turning direction - if (incoming->isTurningDirectionAt(this, outgoing)) { + if (incoming->isTurningDirectionAt(outgoing)) { return LINKDIR_TURN; } // get the angle between incoming/outgoing at the junction @@ -1280,7 +1344,7 @@ find(myAllEdges.begin(), myAllEdges.end(), outgoing); NBContHelper::nextCCW(myAllEdges, i); while ((*i) != incoming) { - if ((*i)->getFromNode() == this && !incoming->isTurningDirectionAt(this, *i)) { + if ((*i)->getFromNode() == this && !incoming->isTurningDirectionAt(*i)) { return LINKDIR_PARTLEFT; } NBContHelper::nextCCW(myAllEdges, i); @@ -1304,7 +1368,7 @@ if (myType == NODETYPE_ALLWAY_STOP) { return LINKSTATE_ALLWAY_STOP; // all drive, first one to arrive may drive first } - if ((!incoming->isInnerEdge() && mustBrake(incoming, outgoing, fromlane)) && !mayDefinitelyPass) { + if ((!incoming->isInnerEdge() && mustBrake(incoming, outgoing, fromlane, true)) && !mayDefinitelyPass) { return myType == NODETYPE_PRIORITY_STOP ? LINKSTATE_STOP : LINKSTATE_MINOR; // minor road } // traffic lights are not regarded here @@ -1406,6 +1470,16 @@ } +void +NBNode::setCustomLaneShape(const std::string& laneID, const PositionVector& shape) { + if (shape.size() > 1) { + myCustomLaneShapes[laneID] = shape; + } else { + myCustomLaneShapes.erase(laneID); + } +} + + NBEdge* NBNode::getConnectionTo(NBNode* n) const { for (EdgeVector::const_iterator i = myOutgoingEdges.begin(); i != myOutgoingEdges.end(); i++) { @@ -1456,7 +1530,7 @@ int NBNode::guessCrossings() { - //gDebugFlag1 = getID() == "C"; + //gDebugFlag1 = getID() == DEBUGID; int numGuessed = 0; if (myCrossings.size() > 0) { // user supplied crossings, do not guess @@ -1465,12 +1539,10 @@ if (gDebugFlag1) { std::cout << "guess crossings for " << getID() << "\n"; } - if (gDebugFlag1) { - std::cout << "ordering of myAllEdges=" << toString(myAllEdges) << "\n"; - } + EdgeVector allEdges = getEdgesSortedByAngleAtNodeCenter(); // check for pedestrial lanes going clockwise around the node std::vector > normalizedLanes; - for (EdgeVector::const_iterator it = myAllEdges.begin(); it != myAllEdges.end(); ++it) { + for (EdgeVector::const_iterator it = allEdges.begin(); it != allEdges.end(); ++it) { NBEdge* edge = *it; const std::vector& lanes = edge->getLanes(); if (edge->getFromNode() == this) { @@ -1510,8 +1582,10 @@ candidates.push_back(edge); } else if (allowsPed) { if (candidates.size() > 0) { - hadCandidates = true; - numGuessed += checkCrossing(candidates); + if (hadCandidates || forbidsPedestriansAfter(normalizedLanes, i)) { + hadCandidates = true; + numGuessed += checkCrossing(candidates); + } candidates.clear(); } } @@ -1521,7 +1595,7 @@ numGuessed += checkCrossing(candidates); } } - std::sort(myCrossings.begin(), myCrossings.end(), NBNodesEdgesSorter::crossing_by_junction_angle_sorter(myAllEdges)); + std::sort(myCrossings.begin(), myCrossings.end(), NBNodesEdgesSorter::crossing_by_junction_angle_sorter(this, myAllEdges)); return numGuessed; } @@ -1617,8 +1691,32 @@ } +bool +NBNode::forbidsPedestriansAfter(std::vector > normalizedLanes, int startIndex) { + for (int i = startIndex; i < (int)normalizedLanes.size(); ++i) { + if (!normalizedLanes[i].second) { + return true; + } + } + return false; +} + + void NBNode::buildInnerEdges(bool buildCrossingsAndWalkingAreas) { + if (buildCrossingsAndWalkingAreas) { + buildCrossings(); + buildWalkingAreas(OptionsCont::getOptions().getInt("junctions.corner-detail")); + // ensure that all crossings are properly connected + for (std::vector::iterator it = myCrossings.begin(); it != myCrossings.end(); it++) { + if ((*it).prevWalkingArea == "" || (*it).nextWalkingArea == "") { + // there is no way to check this apart from trying to build all + // walkingAreas and there is no way to recover because the junction + // logic assumes that the crossing can be built. + throw ProcessError("Invalid crossing '" + (*it).id + "' at node '" + getID() + "' with edges '" + toString((*it).edges) + "'."); + } + } + } // build inner edges for vehicle movements across the junction unsigned int noInternalNoSplits = 0; for (EdgeVector::const_iterator i = myIncomingEdges.begin(); i != myIncomingEdges.end(); i++) { @@ -1635,37 +1733,68 @@ for (EdgeVector::const_iterator i = myIncomingEdges.begin(); i != myIncomingEdges.end(); i++) { (*i)->buildInnerEdges(*this, noInternalNoSplits, lno, splitNo); } - if (buildCrossingsAndWalkingAreas) { - buildCrossings(); - buildWalkingAreas(); - // ensure that all crossings are properly connected - for (std::vector::iterator it = myCrossings.begin(); it != myCrossings.end(); it++) { - if ((*it).prevWalkingArea == "" || (*it).nextWalkingArea == "") { - // there is no way to check this apart from trying to build all - // walkingAreas and there is no way to recover because the junction - // logic assumes that the crossing can be built. - throw ProcessError("Invalid crossing at node '" + getID() + "' with edges '" + toString((*it).edges) + "'."); - } + // if there are custom lane shapes we need to built twice: + // first to set the ids then to build intersections with the custom geometries + if (myCustomLaneShapes.size() > 0) { + unsigned int lno = 0; + unsigned int splitNo = 0; + for (EdgeVector::const_iterator i = myIncomingEdges.begin(); i != myIncomingEdges.end(); i++) { + (*i)->buildInnerEdges(*this, noInternalNoSplits, lno, splitNo); } } - } unsigned int NBNode::buildCrossings() { - //gDebugFlag1 = getID() == "C"; + //gDebugFlag1 = getID() == DEBUGID; + if (gDebugFlag1) { + std::cout << "build crossings for " << getID() << ":\n"; + } unsigned int index = 0; for (std::vector::iterator it = myCrossings.begin(); it != myCrossings.end(); it++) { (*it).id = ":" + getID() + "_c" + toString(index++); - if ((*it).edges.size() > 2) { - WRITE_ERROR("Crossings across more than 2 edges not yet implemented (" + toString((*it).edges) + ")"); - continue; + EdgeVector& edges = (*it).edges; + if (gDebugFlag1) { + std::cout << " crossing=" << (*it).id << " edges=" << toString(edges); + } + // sorting the edges in the right way is imperative. We want to sort + // them by getAngleAtNodeToCenter() but need to be extra carefull to avoid wrapping around 0 somewhere in between + std::sort(edges.begin(), edges.end(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter(this)); + if (gDebugFlag1) { + std::cout << " sortedEdges=" << toString(edges) << "\n"; + }; + // rotate the edges so that the largest relative angle difference comes at the end + SUMOReal maxAngleDiff = 0; + int maxAngleDiffIndex = 0; // index before maxDist + for (int i = 0; i < (int) edges.size(); i++) { + SUMOReal diff = NBHelpers::relAngle(edges[i]->getAngleAtNodeToCenter(this), + edges[(i + 1) % edges.size()]->getAngleAtNodeToCenter(this)); + if (diff < 0) { + diff += 360; + } + if (gDebugFlag1) { + std::cout << " i=" << i << " a1=" << edges[i]->getAngleAtNodeToCenter(this) << " a2=" << edges[(i + 1) % edges.size()]->getAngleAtNodeToCenter(this) << " diff=" << diff << "\n"; + } + if (diff > maxAngleDiff) { + maxAngleDiff = diff; + maxAngleDiffIndex = i; + } + } + if (maxAngleDiff > 2 && maxAngleDiff < 360 - 2) { + // if the angle differences is too small, we better not rotate + std::rotate(edges.begin(), edges.begin() + (maxAngleDiffIndex + 1) % edges.size(), edges.end()); + if (gDebugFlag1) { + std::cout << " rotatedEdges=" << toString(edges); + } + } + // reverse to get them in CCW order (walking direction around the node) + std::reverse(edges.begin(), edges.end()); + if (gDebugFlag1) { + std::cout << " finalEdges=" << toString(edges) << "\n"; } // compute shape - EdgeVector& edges = (*it).edges; (*it).shape.clear(); - std::sort(edges.begin(), edges.end(), edge_by_direction_sorter(this)); const int begDir = (edges.front()->getFromNode() == this ? FORWARD : BACKWARD); const int endDir = (edges.back()->getToNode() == this ? FORWARD : BACKWARD); NBEdge::Lane crossingBeg = edges.front()->getFirstNonPedestrianLane(begDir); @@ -1684,22 +1813,27 @@ void -NBNode::buildWalkingAreas() { - //gDebugFlag1 = getID() == "E"; +NBNode::buildWalkingAreas(int cornerDetail) { + //gDebugFlag1 = getID() == DEBUGID; unsigned int index = 0; myWalkingAreas.clear(); if (gDebugFlag1) { std::cout << "build walkingAreas for " << getID() << ":\n"; } - // get begin shapes of all lanes in outgoing direction ordered clockwise + if (myAllEdges.size() == 0) { + return; + } + EdgeVector allEdges = getEdgesSortedByAngleAtNodeCenter(); + // shapes are all pointing away from the intersection std::vector > normalizedLanes; - for (EdgeVector::const_iterator it = myAllEdges.begin(); it != myAllEdges.end(); ++it) { + for (EdgeVector::const_iterator it = allEdges.begin(); it != allEdges.end(); ++it) { NBEdge* edge = *it; const std::vector& lanes = edge->getLanes(); if (edge->getFromNode() == this) { for (std::vector::const_reverse_iterator it_l = lanes.rbegin(); it_l != lanes.rend(); ++it_l) { NBEdge::Lane l = *it_l; l.shape = l.shape.getSubpartByIndex(0, 2); + l.width = (l.width == NBEdge::UNSPECIFIED_WIDTH ? SUMO_const_laneWidth : l.width); normalizedLanes.push_back(std::make_pair(edge, l)); } } else { @@ -1707,6 +1841,7 @@ NBEdge::Lane l = *it_l; l.shape = l.shape.reverse(); l.shape = l.shape.getSubpartByIndex(0, 2); + l.width = (l.width == NBEdge::UNSPECIFIED_WIDTH ? SUMO_const_laneWidth : l.width); normalizedLanes.push_back(std::make_pair(edge, l)); } } @@ -1787,21 +1922,28 @@ const int count = waIndices[i].second; const int end = (start + count) % normalizedLanes.size(); - WalkingArea wa(":" + getID() + "_w" + toString(index++), DEFAULT_CROSSING_WIDTH); + WalkingArea wa(":" + getID() + "_w" + toString(index++), 1); if (gDebugFlag1) { std::cout << "build walkingArea " << wa.id << " start=" << start << " end=" << end << " count=" << count << " prev=" << prev << ":\n"; } - SUMOReal endCrossingWidth = DEFAULT_CROSSING_WIDTH; - SUMOReal startCrossingWidth = DEFAULT_CROSSING_WIDTH; + SUMOReal endCrossingWidth = 0; + SUMOReal startCrossingWidth = 0; + PositionVector endCrossingShape; + PositionVector startCrossingShape; // check for connected crossings bool connectsCrossing = false; std::vector connectedPoints; for (std::vector::iterator it = myCrossings.begin(); it != myCrossings.end(); ++it) { + if (gDebugFlag1) { + std::cout << " crossing=" << (*it).id << " sortedEdges=" << toString((*it).edges) << "\n"; + } if ((*it).edges.back() == normalizedLanes[end].first && (normalizedLanes[end].second.permissions & SVC_PEDESTRIAN) == 0) { // crossing ends (*it).nextWalkingArea = wa.id; endCrossingWidth = (*it).width; + endCrossingShape = (*it).shape; + wa.width = MAX2(wa.width, endCrossingWidth); connectsCrossing = true; connectedPoints.push_back((*it).shape[-1]); if (gDebugFlag1) { @@ -1814,6 +1956,8 @@ (*it).prevWalkingArea = wa.id; wa.nextCrossing = (*it).id; startCrossingWidth = (*it).width; + startCrossingShape = (*it).shape; + wa.width = MAX2(wa.width, startCrossingWidth); connectsCrossing = true; if (isTLControlled()) { wa.tlID = (*getControllingTLS().begin())->getID(); @@ -1833,14 +1977,13 @@ // not relevant for walking continue; } - wa.width = (endCrossingWidth + startCrossingWidth) / 2; // build shape and connections std::set connected; for (int j = 0; j < count; ++j) { const int nlI = (start + j) % normalizedLanes.size(); NBEdge* edge = normalizedLanes[nlI].first; NBEdge::Lane l = normalizedLanes[nlI].second; - l.width = (l.width == NBEdge::UNSPECIFIED_WIDTH ? SUMO_const_laneWidth : l.width); + wa.width = MAX2(wa.width, l.width); if (connected.count(edge) == 0) { if (edge->getFromNode() == this) { wa.nextSidewalks.push_back(edge->getID()); @@ -1858,15 +2001,25 @@ } if (buildExtensions) { // extension at starting crossing - NBEdge::Lane l = normalizedLanes[start].second; - l.shape.extrapolate(startCrossingWidth); - l.shape.move2side(-l.width / 2); - wa.shape.push_front(l.shape[0]); + if (startCrossingShape.size() > 0) { + if (gDebugFlag1) { + std::cout << " extension at startCrossing shape=" << startCrossingShape << "\n"; + } + startCrossingShape.move2side(startCrossingWidth / 2); + wa.shape.push_front_noDoublePos(startCrossingShape[0]); // right corner + startCrossingShape.move2side(-startCrossingWidth); + wa.shape.push_front_noDoublePos(startCrossingShape[0]); // left corner goes first + } // extension at ending crossing - l = normalizedLanes[end > 0 ? end - 1 : normalizedLanes.size() - 1].second; - l.shape.extrapolate(endCrossingWidth); - l.shape.move2side(l.width / 2); - wa.shape.push_back(l.shape[0]); + if (endCrossingShape.size() > 0) { + if (gDebugFlag1) { + std::cout << " extension at endCrossing shape=" << endCrossingShape << "\n"; + } + endCrossingShape.move2side(endCrossingWidth / 2); + wa.shape.push_back_noDoublePos(endCrossingShape[-1]); + endCrossingShape.move2side(-endCrossingWidth); + wa.shape.push_back_noDoublePos(endCrossingShape[-1]); + } } if (connected.size() == 2 && !connectsCrossing && wa.nextSidewalks.size() == 1 && wa.prevSidewalks.size() == 1) { // do not build a walkingArea since a normal connection exists @@ -1876,6 +2029,45 @@ continue; } } + // build smooth inner curve (optional) + if (cornerDetail > 0) { + int smoothEnd = end; + int smoothPrev = prev; + // extend to green verge + if (endCrossingWidth > 0 && normalizedLanes[smoothEnd].second.permissions == 0) { + smoothEnd = (smoothEnd + 1) % normalizedLanes.size(); + } + if (startCrossingWidth > 0 && normalizedLanes[smoothPrev].second.permissions == 0) { + if (smoothPrev == 0) { + smoothPrev = (int)normalizedLanes.size() - 1; + } else { + smoothPrev--; + } + } + PositionVector begShape = normalizedLanes[smoothEnd].second.shape; + begShape = begShape.reverse(); + //begShape.extrapolate(endCrossingWidth); + begShape.move2side(normalizedLanes[smoothEnd].second.width / 2); + PositionVector endShape = normalizedLanes[smoothPrev].second.shape; + endShape.move2side(normalizedLanes[smoothPrev].second.width / 2); + //endShape.extrapolate(startCrossingWidth); + PositionVector curve = computeSmoothShape(begShape, endShape, cornerDetail + 2, false, 25, 25); + if (gDebugFlag1) std::cout + << " end=" << smoothEnd << " prev=" << smoothPrev + << " endCrossingWidth=" << endCrossingWidth << " startCrossingWidth=" << startCrossingWidth + << " begShape=" << begShape << " endShape=" << endShape << " smooth curve=" << curve << "\n"; + if (curve.size() > 2) { + curve.eraseAt(0); + curve.eraseAt(-1); + if (endCrossingWidth > 0) { + wa.shape.eraseAt(-1); + } + if (startCrossingWidth > 0) { + wa.shape.eraseAt(0); + } + wa.shape.append(curve, 0); + } + } // determine length (average of all possible connections) SUMOReal lengthSum = 0; int combinations = 0; @@ -1902,6 +2094,9 @@ for (std::vector::iterator it = myCrossings.begin(); it != myCrossings.end(); ++it) { Crossing& prev = *it; Crossing& next = (it != myCrossings.begin() ? * (it - 1) : * (myCrossings.end() - 1)); + if (gDebugFlag1) { + std::cout << " checkIntermediate: prev=" << prev.id << " next=" << next.id << " prev.nextWA=" << prev.nextWalkingArea << "\n"; + } if (prev.nextWalkingArea == "") { WalkingArea wa(":" + getID() + "_w" + toString(index++), prev.width); prev.nextWalkingArea = wa.id; @@ -1925,6 +2120,9 @@ // length (special case) wa.length = MAX2(POSITION_EPS, prev.shape.back().distanceTo2D(next.shape.front())); myWalkingAreas.push_back(wa); + if (gDebugFlag1) { + std::cout << " build wa=" << wa.id << "\n"; + } } } } @@ -2002,6 +2200,20 @@ } +void +NBNode::removeCrossing(const EdgeVector& edges) { + EdgeSet edgeSet(edges.begin(), edges.end()); + for (std::vector::iterator it = myCrossings.begin(); it != myCrossings.end();) { + EdgeSet edgeSet2((*it).edges.begin(), (*it).edges.end()); + if (edgeSet == edgeSet2) { + it = myCrossings.erase(it); + } else { + ++it; + } + } +} + + const NBNode::Crossing& NBNode::getCrossing(const std::string& id) const { for (std::vector::const_iterator it = myCrossings.begin(); it != myCrossings.end(); ++it) { @@ -2044,5 +2256,62 @@ } +EdgeVector +NBNode::getEdgesSortedByAngleAtNodeCenter() const { + EdgeVector result = myAllEdges; + if (gDebugFlag1) { + std::cout << " angles:\n"; + for (EdgeVector::const_iterator it = result.begin(); it != result.end(); ++it) { + std::cout << " edge=" << (*it)->getID() << " edgeAngle=" << (*it)->getAngleAtNode(this) << " angleToShape=" << (*it)->getAngleAtNodeToCenter(this) << "\n"; + } + std::cout << " allEdges before: " << toString(result) << "\n"; + } + sort(result.begin(), result.end(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter(this)); + // let the first edge in myAllEdges remain the first + if (gDebugFlag1) { + std::cout << " allEdges sorted: " << toString(result) << "\n"; + } + rotate(result.begin(), std::find(result.begin(), result.end(), *myAllEdges.begin()), result.end()); + if (gDebugFlag1) { + std::cout << " allEdges rotated: " << toString(result) << "\n"; + } + return result; +} + + +std::string +NBNode::getNodeIDFromInternalLane(const std::string id) { + // this relies on the fact that internal ids always have the form + // :__ + // i.e. :C_3_0, :C_c1_0 :C_w0_0 + assert(id[0] == ':'); + size_t sep_index = id.rfind('_'); + if (sep_index == std::string::npos) { + WRITE_ERROR("Invalid lane id '" + id + "' (missing '_')."); + return ""; + } + sep_index = id.substr(0, sep_index).rfind('_'); + if (sep_index == std::string::npos) { + WRITE_ERROR("Invalid lane id '" + id + "' (missing '_')."); + return ""; + } + return id.substr(1, sep_index - 1); +} + + +void +NBNode::avoidOverlap() { + // simple case: edges with LANESPREAD_CENTER and a (possible) turndirection at the same node + for (EdgeVector::iterator it = myIncomingEdges.begin(); it != myIncomingEdges.end(); it++) { + NBEdge* edge = *it; + NBEdge* turnDest = edge->getTurnDestination(true); + if (turnDest != 0) { + edge->shiftPositionAtNode(this, turnDest); + turnDest->shiftPositionAtNode(this, edge); + } + } + // @todo: edges in the same direction with sharp angles starting/ending at the same position +} + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBNode.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNode.h --- sumo-0.21.0+dfsg/src/netbuild/NBNode.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNode.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Yun-Pang Floetteroed /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBNode.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBNode.h 18167 2015-03-27 11:26:11Z namdre $ /// // The representation of a single node /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -80,6 +80,8 @@ friend class NBEdgePriorityComputer; // < computes priorities of edges per intersection public: + typedef std::map CustomShapeMap; + /** * @class ApproachingDivider * @brief Computes lane-2-lane connections @@ -188,6 +190,11 @@ /// @brief default width of pedetrian crossings static const SUMOReal DEFAULT_CROSSING_WIDTH; + /// @brief the default turning radius at intersections in m + static const SUMOReal DEFAULT_RADIUS; + + /// @brief unspecified lane width + static const SUMOReal UNSPECIFIED_RADIUS; public: /// @brief maximum number of connections allowed @@ -269,6 +276,13 @@ SumoXMLNodeType getType() const { return myType; } + + /** @brief Returns the turning radius of this node + * @return The turning radius of this node + */ + SUMOReal getRadius() const { + return myRadius; + } /// @} @@ -420,10 +434,11 @@ /** @brief Returns the information whether the described flow must let any other flow pass * @param[in] from The connection's start edge * @param[in] to The connection's end edge - * @param[in] toLane The lane the connection ends at + * @param[in] fromLane The lane the connection start at + * @param[in] includePedCrossings Whether braking due to a pedestrian crossing counts * @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 fromLane, bool includePedCrossings) const; /** @brief Returns the information whether the described flow must brake for the given crossing * @param[in] from The connection's start edge @@ -433,6 +448,11 @@ */ bool mustBrakeForCrossing(const NBEdge* const from, const NBEdge* const to, const Crossing& crossing) const; + /** @brief return whether the given laneToLane connection is a right turn which must yield to a bicycle crossings + */ + bool rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane, + const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane) const; + /** @brief Returns the information whether "prohibited" flow must let "prohibitor" flow pass * @param[in] possProhibitedFrom The maybe prohibited connection's begin * @param[in] possProhibitedTo The maybe prohibited connection's end @@ -479,8 +499,21 @@ /// @brief set the junction shape void setCustomShape(const PositionVector& shape); + /// @brief sets a custom shape for an internal lane + void setCustomLaneShape(const std::string& laneID, const PositionVector& shape); + + /// @brief sets a custom shape for an internal lane + const CustomShapeMap& getCustomLaneShapes() const { + return myCustomLaneShapes; + } + + /// @brief set the turning radius + void setRadius(SUMOReal radius) { + myRadius = radius; + } + /// @brief return whether the shape was set by the user - bool hasCustomShape() { + bool hasCustomShape() const { return myHaveCustomPoly; } @@ -495,18 +528,35 @@ bool isNearDistrict() const; bool isDistrict() const; - bool needsCont(NBEdge* fromE, NBEdge* toE, NBEdge* otherFromE, NBEdge* otherToE, const NBEdge::Connection& c) const; + /// @brief whether an internal junction should be built at from and respect other + bool needsCont(const NBEdge* fromE, const NBEdge* otherFromE, + const NBEdge::Connection& c, const NBEdge::Connection& otherC) const; /** @brief Compute the shape for an internal lane * @param[in] fromE The starting edge - * @param[in] fromL The index of the starting lane - * @param[in] toE The destination edge - * @param[in] toL The index of the destination lane + * @param[in] con The connection for this internal lane * @param[in] numPoints The number of geometry points for the internal lane * @return The shape of the internal lane */ - PositionVector computeInternalLaneShape( - NBEdge* fromE, int fromL, NBEdge* toE, int toL, int numPoints = 5) const; + PositionVector computeInternalLaneShape(NBEdge* fromE, const NBEdge::Connection& con, int numPoints = 5) const; + + + /** @brief Compute a smooth curve between the given geometries + * @param[in] begShape The geometry at the start + * @param[in] endShape The geometry at the end + * @param[in] numPoints The number of geometry points for the internal lane + * @param[in] isTurnaround Whether this shall be the shape for a turnaround + * @param[in] extrapolateBeg Extrapolation distance at the beginning + * @param[in] extrapolateEnd Extrapolation distance at the end + * @return The shape of the internal lane + */ + PositionVector computeSmoothShape( + const PositionVector& begShape, + const PositionVector& endShape, + int numPoints, + bool isTurnaround, + SUMOReal extrapolateBeg, + SUMOReal extrapolateEnd) const; /** @brief Replaces occurences of the first edge within the list of incoming by the second @@ -543,10 +593,9 @@ unsigned int buildCrossings(); /* @brief build pedestrian walking areas and set connections from/to walkingAreas - * @param[in] index The starting index for naming the created internal lanes - * @param[in] tlIndex The starting traffic light index to assign to connections to controlled crossings + * @param[in] cornerDetail The detail level when generating the inner curve * */ - void buildWalkingAreas(); + void buildWalkingAreas(int cornerDetail); /// @brief return all edges that lie clockwise between the given edges EdgeVector edgesBetween(const NBEdge* e1, const NBEdge* e2) const; @@ -568,6 +617,9 @@ /// @brief add a pedestrian crossing to this node void addCrossing(EdgeVector edges, SUMOReal width, bool priority); + /// @brief remove a pedestrian crossing from this node (identified by its edges) + void removeCrossing(const EdgeVector& edges); + /// @brief return this junctions pedestrian crossings inline const std::vector& getCrossings() const { return myCrossings; @@ -587,6 +639,11 @@ /// @brief return the number of lane-to-lane connections at this junction (excluding crossings) int numNormalConnections() const; + /** @brief fix overlap + */ + void avoidOverlap(); + + /** * @class nodes_by_id_sorter * @brief Used for sorting the cells by the begin time they describe @@ -622,6 +679,9 @@ }; + /// @brief returns the node id for internal lanes, crossings and walkingareas + static std::string getNodeIDFromInternalLane(const std::string id); + private: bool isSimpleContinuation() const; @@ -643,6 +703,13 @@ NBEdge* removed, const EdgeVector& incoming, const EdgeVector& outgoing); + /// @brief return whether there is a non-sidewalk lane after the given index; + bool forbidsPedestriansAfter(std::vector > normalizedLanes, int startIndex); + + + /// @brief returns the list of all edges sorted clockwise by getAngleAtNodeToCenter + EdgeVector getEdgesSortedByAngleAtNodeCenter() const; + private: /// @brief The position the node lies at Position myPosition; @@ -681,6 +748,11 @@ std::set myTrafficLights; + /// @brief the turning radius (for all corners) at this node in m. + SUMOReal myRadius; + + CustomShapeMap myCustomLaneShapes; + private: /// @brief invalidated copy constructor NBNode(const NBNode& s); diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBNodeShapeComputer.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNodeShapeComputer.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBNodeShapeComputer.cpp 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNodeShapeComputer.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBNodeShapeComputer.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBNodeShapeComputer.cpp 18169 2015-03-27 13:40:16Z behrisch $ /// // This class computes shapes of junctions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -31,6 +31,7 @@ #endif #include +#include #include #include #include @@ -62,22 +63,22 @@ UNUSED_PARAMETER(leftHand); PositionVector ret; // check whether the node is a dead end node or a node where only turning is possible - // in this case, we will use "computeNodeShapeByCrosses" + // in this case, we will use "computeNodeShapeSmall" bool singleDirection = false; if (myNode.myAllEdges.size() == 1) { singleDirection = true; } if (myNode.myAllEdges.size() == 2 && myNode.getIncomingEdges().size() == 1) { - if (myNode.getIncomingEdges()[0]->isTurningDirectionAt(&myNode, myNode.getOutgoingEdges()[0])) { + if (myNode.getIncomingEdges()[0]->isTurningDirectionAt(myNode.getOutgoingEdges()[0])) { singleDirection = true; } } if (singleDirection) { - return computeNodeShapeByCrosses(); + return computeNodeShapeSmall(); } // check whether the node is a just something like a geometry // node (one in and one out or two in and two out, pair-wise continuations) - // also in this case "computeNodeShapeByCrosses" is used + // also in this case "computeNodeShapeSmall" is used bool geometryLike = myNode.isSimpleContinuation(); if (geometryLike) { // additionally, the angle between the edges must not be larger than 45 degrees @@ -96,15 +97,15 @@ } } if (maxAngle > 22.5) { - return computeNodeShapeByCrosses(); + return computeNodeShapeSmall(); } } // - ret = computeContinuationNodeShape(geometryLike); - // fail fall-back: use "computeNodeShapeByCrosses" + ret = computeNodeShapeDefault(geometryLike); + // fail fall-back: use "computeNodeShapeSmall" if (ret.size() < 3) { - ret = computeNodeShapeByCrosses(); + ret = computeNodeShapeSmall(); } return ret; } @@ -112,98 +113,47 @@ void computeSameEnd(PositionVector& l1, PositionVector& l2) { - Line sub(l1.lineAt(0).getPositionAtDistance(100), l1[1]); + Line sub(l1.lineAt(0).getPositionAtDistance2D(100), l1[1]); Line tmp(sub); tmp.rotateAtP1(M_PI / 2); - tmp.extrapolateBy(100); + tmp.extrapolateBy2D(100); if (l1.intersects(tmp.p1(), tmp.p2())) { SUMOReal offset1 = l1.intersectsAtLengths2D(tmp)[0]; Line tl1 = Line( - l1.lineAt(0).getPositionAtDistance(offset1), + l1.lineAt(0).getPositionAtDistance2D(offset1), l1[1]); - tl1.extrapolateBy(100); + tl1.extrapolateBy2D(100); l1.replaceAt(0, tl1.p1()); } if (l2.intersects(tmp.p1(), tmp.p2())) { SUMOReal offset2 = l2.intersectsAtLengths2D(tmp)[0]; Line tl2 = Line( - l2.lineAt(0).getPositionAtDistance(offset2), + l2.lineAt(0).getPositionAtDistance2D(offset2), l2[1]); - tl2.extrapolateBy(100); + tl2.extrapolateBy2D(100); l2.replaceAt(0, tl2.p1()); } } -void -NBNodeShapeComputer::replaceLastChecking(PositionVector& g, bool decenter, - PositionVector counter, - size_t counterLanes, SUMOReal counterDist, - int laneDiff) { - counter.extrapolate(100); - Position counterPos = counter.positionAtOffset2D(counterDist); - PositionVector t = g; - t.extrapolate(100); - SUMOReal p = t.nearest_offset_to_point2D(counterPos); - if (p >= 0) { - counterPos = t.positionAtOffset2D(p); - } - if (g[-1].distanceTo(counterPos) < SUMO_const_laneWidth * (SUMOReal) counterLanes) { - g.replaceAt((int)g.size() - 1, counterPos); - } else { - g.push_back_noDoublePos(counterPos); - } - if (decenter) { - Line l(g[-2], g[-1]); - SUMOReal factor = laneDiff % 2 != 0 ? SUMO_const_halfLaneAndOffset : SUMO_const_laneWidthAndOffset; - l.move2side(-factor);//SUMO_const_laneWidthAndOffset); - g.replaceAt((int)g.size() - 1, l.p2()); - } -} - - -void -NBNodeShapeComputer::replaceFirstChecking(PositionVector& g, bool decenter, - PositionVector counter, - size_t counterLanes, SUMOReal counterDist, - int laneDiff) { - counter.extrapolate(100); - Position counterPos = counter.positionAtOffset2D(counterDist); - PositionVector t = g; - t.extrapolate(100); - SUMOReal p = t.nearest_offset_to_point2D(counterPos); - if (p >= 0) { - counterPos = t.positionAtOffset2D(p); - } - if (g[0].distanceTo(counterPos) < SUMO_const_laneWidth * (SUMOReal) counterLanes) { - g.replaceAt(0, counterPos); - } else { - g.push_front_noDoublePos(counterPos); - } - if (decenter) { - Line l(g[0], g[1]); - SUMOReal factor = laneDiff % 2 != 0 ? SUMO_const_halfLaneAndOffset : SUMO_const_laneWidthAndOffset; - l.move2side(-factor); - g.replaceAt(0, l.p1()); - } -} - - - PositionVector -NBNodeShapeComputer::computeContinuationNodeShape(bool simpleContinuation) { +NBNodeShapeComputer::computeNodeShapeDefault(bool simpleContinuation) { // if we have less than two edges, we can not compute the node's shape this way if (myNode.myAllEdges.size() < 2) { return PositionVector(); } + // magic values + const SUMOReal radius = (myNode.getRadius() == NBNode::UNSPECIFIED_RADIUS ? NBNode::DEFAULT_RADIUS : myNode.getRadius()); + const int cornerDetail = OptionsCont::getOptions().getInt("junctions.corner-detail"); + // initialise EdgeVector::const_iterator i; // edges located in the value-vector have the same direction as the key edge - std::map same; + std::map > same; // the counter-clockwise boundary of the edge regarding possible same-direction edges - std::map geomsCCW; + GeomsMap geomsCCW; // the clockwise boundary of the edge regarding possible same-direction edges - std::map geomsCW; + GeomsMap geomsCW; // store relationships std::map ccwBoundary; std::map cwBoundary; @@ -219,63 +169,34 @@ if (newAll.size() < 2) { return PositionVector(); } - // combine all geoms - std::map myExtended; + + // All geoms are outoing from myNode. + // for every direction in newAll we compute the offset at which the + // intersection ends and the edge starts. This value is saved in 'distances' + // If the geometries need to be extended to get an intersection, this is + // recorded in 'myExtended' std::map distances; + std::map myExtended; + for (i = newAll.begin(); i != newAll.end(); ++i) { EdgeVector::const_iterator cwi = i; - cwi++; - if (cwi == newAll.end()) { - cwi = newAll.begin(); - } EdgeVector::const_iterator ccwi = i; - if (ccwi == newAll.begin()) { - ccwi = newAll.end() - 1; - } else { - ccwi--; - } - + SUMOReal ccad; + SUMOReal cad; + initNeighbors(newAll, i, geomsCW, geomsCCW, cwi, ccwi, cad, ccad); assert(geomsCCW.find(*i) != geomsCCW.end()); assert(geomsCW.find(*ccwi) != geomsCW.end()); assert(geomsCW.find(*cwi) != geomsCW.end()); - SUMOReal angleI = geomsCCW[*i].lineAt(0).atan2PositiveAngle(); - SUMOReal angleCCW = geomsCW[*ccwi].lineAt(0).atan2PositiveAngle(); - SUMOReal angleCW = geomsCW[*cwi].lineAt(0).atan2PositiveAngle(); - SUMOReal ccad; - SUMOReal cad; - SUMOReal twoPI = (SUMOReal)(2 * M_PI); - if (angleI > angleCCW) { - ccad = angleI - angleCCW; - } else { - ccad = twoPI - angleCCW + angleI; - } - - if (angleI > angleCW) { - cad = twoPI - angleI + angleCW; - } else { - cad = angleCW - angleI; - } - if (ccad < 0) { - ccad += twoPI; - } - if (ccad > twoPI) { - ccad -= twoPI; - } - if (cad < 0) { - cad += twoPI; - } - if (cad > twoPI) { - cad -= twoPI; - } - if (simpleContinuation && ccad < DEG2RAD(45.)) { - ccad += twoPI; - } - if (simpleContinuation && cad < DEG2RAD(45.)) { - cad += twoPI; - } - - if (fabs(ccad - cad) < (SUMOReal) 0.1 && *cwi == *ccwi) { + // there are only 2 directions and they are almost parallel + if (*cwi == *ccwi && + ( + // no change in lane numbers, even low angles still give a good intersection + (simpleContinuation && fabs(ccad - cad) < (SUMOReal) 0.1) + // lane numbers change, a direct intersection could be far away from the node position + // so we use a larger threshold + || (!simpleContinuation && fabs(ccad - cad) < DEG2RAD(22.5))) + ) { // compute the mean position between both edges ends ... Position p; if (myExtended.find(*ccwi) != myExtended.end()) { @@ -304,323 +225,161 @@ } (*i)->setGeometry(g); // and rebuild previous information - geomsCCW[*i] = (*i)->getCCWBoundaryLine(myNode, SUMO_const_halfLaneWidth); + geomsCCW[*i] = (*i)->getCCWBoundaryLine(myNode); geomsCCW[*i].extrapolate(100); - geomsCW[*i] = (*i)->getCWBoundaryLine(myNode, SUMO_const_halfLaneWidth); + geomsCW[*i] = (*i)->getCWBoundaryLine(myNode); geomsCW[*i].extrapolate(100); // the distance is now = zero (the point we have appended) distances[*i] = 100; myExtended[*i] = true; } else { if (!simpleContinuation) { - // let us put some geometry stuff into it - dist = (SUMOReal) 1.5 + dist; + // since there are only two (almost parallel) directions, the + // concept of a turning radius does not quite fit. Instead we need + // to enlarge the intersection to accomodate the change in + // the number of lanes + // @todo: make this independently configurable + dist += radius; } distances[*i] = dist; } } else { - if (ccad < cad) { - if (!simpleContinuation) { - if (geomsCCW[*i].intersects(geomsCW[*ccwi])) { - distances[*i] = (SUMOReal) 1.5 + geomsCCW[*i].intersectsAtLengths2D(geomsCW[*ccwi])[0]; - if (*cwi != *ccwi && geomsCW[*i].intersects(geomsCCW[*cwi])) { - SUMOReal a1 = distances[*i]; - SUMOReal a2 = (SUMOReal) 1.5 + geomsCW[*i].intersectsAtLengths2D(geomsCCW[*cwi])[0]; - if (ccad > DEG2RAD(90. + 45.) && cad > DEG2RAD(90. + 45.)) { - SUMOReal mmin = MIN2(distances[*cwi], distances[*ccwi]); - if (mmin > 100) { - distances[*i] = (SUMOReal) 5. + (SUMOReal) 100. - (SUMOReal)(mmin - 100); //100 + 1.5; - } - } else if (a2 > a1 + POSITION_EPS && a2 - a1 < (SUMOReal) 10) { - distances[*i] = a2; + // the angles are different enough to compute the intersection of + // the outer boundaries directly (or there are more than 2 directions). The "nearer" neighbar causes the furthest distance + const bool ccwCloser = ccad < cad; + // the border facing the closer neighbor + const PositionVector& currGeom = ccwCloser ? geomsCCW[*i] : geomsCW[*i]; + // the border facing the far neighbor + const PositionVector& currGeom2 = ccwCloser ? geomsCW[*i] : geomsCCW[*i]; + // the border of the closer neighbor + const PositionVector& neighGeom = ccwCloser ? geomsCW[*ccwi] : geomsCCW[*cwi]; + // the border of the far neighbor + const PositionVector& neighGeom2 = ccwCloser ? geomsCCW[*cwi] : geomsCW[*ccwi]; + if (!simpleContinuation) { + if (currGeom.intersects(neighGeom)) { + distances[*i] = radius + closestIntersection(currGeom, neighGeom, 100); + if (*cwi != *ccwi && currGeom2.intersects(neighGeom2)) { + const SUMOReal farAngleDist = ccwCloser ? cad : ccad; + SUMOReal a1 = distances[*i]; + SUMOReal a2 = radius + closestIntersection(currGeom2, neighGeom2, 100); + if (ccad > DEG2RAD(90. + 45.) && cad > DEG2RAD(90. + 45.)) { + SUMOReal mmin = MIN2(distances[*cwi], distances[*ccwi]); + if (mmin > 100) { + distances[*i] = (SUMOReal) 5. + (SUMOReal) 100. - (SUMOReal)(mmin - 100); //100 + 1.5; } - } - } else { - if (*cwi != *ccwi && geomsCW[*i].intersects(geomsCCW[*cwi])) { - distances[*i] = (SUMOReal) 1.5 + geomsCW[*i].intersectsAtLengths2D(geomsCCW[*cwi])[0]; - } else { - distances[*i] = (SUMOReal)(100. + 1.5); + } else if (fabs(a2 - a1) < 10 || farAngleDist < DEG2RAD(135)) { + distances[*i] = MAX2(a1, a2); } } } else { - if (geomsCCW[*i].intersects(geomsCW[*ccwi])) { - distances[*i] = geomsCCW[*i].intersectsAtLengths2D(geomsCW[*ccwi])[0]; + if (*cwi != *ccwi && currGeom2.intersects(neighGeom2)) { + distances[*i] = radius + currGeom2.intersectsAtLengths2D(neighGeom2)[0]; } else { - distances[*i] = (SUMOReal) 100.; + distances[*i] = 100 + radius; } } } else { - if (!simpleContinuation) { - if (geomsCW[*i].intersects(geomsCCW[*cwi])) { - distances[*i] = (SUMOReal)(1.5 + geomsCW[*i].intersectsAtLengths2D(geomsCCW[*cwi])[0]); - if (*cwi != *ccwi && geomsCCW[*i].intersects(geomsCW[*ccwi])) { - SUMOReal a1 = distances[*i]; - SUMOReal a2 = (SUMOReal)(1.5 + geomsCCW[*i].intersectsAtLengths2D(geomsCW[*ccwi])[0]); - if (ccad > DEG2RAD(90. + 45.) && cad > DEG2RAD(90. + 45.)) { - SUMOReal mmin = MIN2(distances[*cwi], distances[*ccwi]); - if (mmin > 100) { - distances[*i] = (SUMOReal) 5. + (SUMOReal) 100. - (SUMOReal)(mmin - 100); //100 + 1.5; - } - } else if (a2 > a1 + POSITION_EPS && a2 - a1 < (SUMOReal) 10) { - distances[*i] = a2; - } - } - } else { - if (*cwi != *ccwi && geomsCCW[*i].intersects(geomsCW[*ccwi])) { - distances[*i] = (SUMOReal) 1.5 + geomsCCW[*i].intersectsAtLengths2D(geomsCW[*ccwi])[0]; - } else { - distances[*i] = (SUMOReal)(100. + 1.5); - } - } + if (currGeom.intersects(neighGeom)) { + distances[*i] = currGeom.intersectsAtLengths2D(neighGeom)[0]; } else { - if (geomsCW[*i].intersects(geomsCCW[*cwi])) { - distances[*i] = geomsCW[*i].intersectsAtLengths2D(geomsCCW[*cwi])[0]; - } else { - distances[*i] = (SUMOReal) 100; - } + distances[*i] = (SUMOReal) 100.; } } } } for (i = newAll.begin(); i != newAll.end(); ++i) { - if (distances.find(*i) != distances.end()) { - continue; - } - EdgeVector::const_iterator cwi = i; - cwi++; - if (cwi == newAll.end()) { - cwi = newAll.begin(); - } - EdgeVector::const_iterator ccwi = i; - if (ccwi == newAll.begin()) { - ccwi = newAll.end() - 1; - } else { - ccwi--; - } - - assert(geomsCW.find(*ccwi) != geomsCW.end()); - assert(geomsCW.find(*cwi) != geomsCW.end()); - Position p1 = distances.find(*cwi) != distances.end() && distances[*cwi] != -1 - ? geomsCCW[*cwi].positionAtOffset2D(distances[*cwi]) - : geomsCCW[*cwi].positionAtOffset2D((SUMOReal) - .1); - Position p2 = distances.find(*ccwi) != distances.end() && distances[*ccwi] != -1 - ? geomsCW[*ccwi].positionAtOffset2D(distances[*ccwi]) - : geomsCW[*ccwi].positionAtOffset2D((SUMOReal) - .1); - Line l(p1, p2); - l.extrapolateBy(1000); - SUMOReal angleI = geomsCCW[*i].lineAt(0).atan2PositiveAngle(); - SUMOReal angleCCW = geomsCW[*ccwi].lineAt(0).atan2PositiveAngle(); - SUMOReal angleCW = geomsCW[*cwi].lineAt(0).atan2PositiveAngle(); - SUMOReal ccad; - SUMOReal cad; - SUMOReal twoPI = (SUMOReal)(2 * M_PI); - if (angleI > angleCCW) { - ccad = angleI - angleCCW; - } else { - ccad = twoPI - angleCCW + angleI; - } - - if (angleI > angleCW) { - cad = twoPI - angleI + angleCW; - } else { - cad = angleCW - angleI; - } - - if (ccad < 0) { - ccad += twoPI; - } - if (ccad > twoPI) { - ccad -= twoPI; - } - if (cad < 0) { - cad += twoPI; - } - if (cad > twoPI) { - cad -= twoPI; - } - SUMOReal offset = 0; - int laneDiff = (*i)->getNumLanes() - (*ccwi)->getNumLanes(); - if (*ccwi != *cwi) { - laneDiff -= (*cwi)->getNumLanes(); - } - laneDiff = 0; - if (myNode.hasIncoming(*i) && (*ccwi)->getNumLanes() % 2 == 1) { - laneDiff = 1; - } - if (myNode.hasOutgoing(*i) && (*cwi)->getNumLanes() % 2 == 1) { - laneDiff = 1; - } - - PositionVector g = (*i)->getGeometry(); - PositionVector counter; - if (myNode.hasIncoming(*i)) { - if (myNode.hasOutgoing(*ccwi) && myNode.hasOutgoing(*cwi)) { - if (distances.find(*cwi) == distances.end()) { - return PositionVector(); - } - replaceLastChecking(g, (*i)->getLaneSpreadFunction() == LANESPREAD_CENTER, - (*cwi)->getGeometry(), (*cwi)->getNumLanes(), distances[*cwi], - laneDiff); - } else { - if (distances.find(*ccwi) == distances.end()) { - return PositionVector(); - } - counter = (*ccwi)->getGeometry(); - if (myNode.hasIncoming(*ccwi)) { - counter = counter.reverse(); - } - replaceLastChecking(g, (*i)->getLaneSpreadFunction() == LANESPREAD_CENTER, - counter, (*ccwi)->getNumLanes(), distances[*ccwi], - laneDiff); - } - } else { - if (myNode.hasIncoming(*ccwi) && myNode.hasIncoming(*cwi)) { - if (distances.find(*ccwi) == distances.end()) { - return PositionVector(); - } - replaceFirstChecking(g, (*i)->getLaneSpreadFunction() == LANESPREAD_CENTER, - (*ccwi)->getGeometry().reverse(), (*ccwi)->getNumLanes(), distances[*ccwi], - laneDiff); - } else { - if (distances.find(*cwi) == distances.end()) { - return PositionVector(); - } - counter = (*cwi)->getGeometry(); - if (myNode.hasIncoming(*cwi)) { - counter = counter.reverse(); - } - replaceFirstChecking(g, (*i)->getLaneSpreadFunction() == LANESPREAD_CENTER, - counter, (*cwi)->getNumLanes(), distances[*cwi], - laneDiff); - } - } - (*i)->setGeometry(g); - - if (cwBoundary[*i] != *i) { - PositionVector g = cwBoundary[*i]->getGeometry(); - PositionVector counter = (*cwi)->getGeometry(); - if (myNode.hasIncoming(*cwi)) { - counter = counter.reverse(); - } - if (myNode.hasIncoming(cwBoundary[*i])) { - if (distances.find(*cwi) == distances.end()) { - return PositionVector(); - } - replaceLastChecking(g, (*i)->getLaneSpreadFunction() == LANESPREAD_CENTER, - counter, (*cwi)->getNumLanes(), distances[*cwi], - laneDiff); - } else { - if (distances.find(*cwi) == distances.end()) { - return PositionVector(); - } - replaceFirstChecking(g, (*i)->getLaneSpreadFunction() == LANESPREAD_CENTER, - counter, (*cwi)->getNumLanes(), distances[*cwi], - laneDiff); - } - cwBoundary[*i]->setGeometry(g); - myExtended[cwBoundary[*i]] = true; - geomsCW[*i] = cwBoundary[*i]->getCWBoundaryLine(myNode, SUMO_const_halfLaneWidth); - } else { - geomsCW[*i] = (*i)->getCWBoundaryLine(myNode, SUMO_const_halfLaneWidth); - - } - - geomsCW[*i].extrapolate(100); - - if (ccwBoundary[*i] != *i) { - PositionVector g = ccwBoundary[*i]->getGeometry(); - PositionVector counter = (*ccwi)->getGeometry(); - if (myNode.hasIncoming(*ccwi)) { - counter = counter.reverse(); - } - if (myNode.hasIncoming(ccwBoundary[*i])) { - if (distances.find(*ccwi) == distances.end()) { - return PositionVector(); - } - replaceLastChecking(g, (*i)->getLaneSpreadFunction() == LANESPREAD_CENTER, - counter, (*ccwi)->getNumLanes(), distances[*ccwi], - laneDiff); - } else { - if (distances.find(*cwi) == distances.end()) { - return PositionVector(); - } - replaceFirstChecking(g, (*i)->getLaneSpreadFunction() == LANESPREAD_CENTER, - counter, (*cwi)->getNumLanes(), distances[*cwi], - laneDiff); - } - ccwBoundary[*i]->setGeometry(g); - myExtended[ccwBoundary[*i]] = true; - geomsCCW[*i] = ccwBoundary[*i]->getCCWBoundaryLine(myNode, SUMO_const_halfLaneWidth); - } else { - geomsCCW[*i] = (*i)->getCCWBoundaryLine(myNode, SUMO_const_halfLaneWidth); - - } - geomsCCW[*i].extrapolate(100); - - computeSameEnd(geomsCW[*i], geomsCCW[*i]); - - // and rebuild previous information - if (((*cwi)->getNumLanes() + (*ccwi)->getNumLanes()) > (*i)->getNumLanes()) { - offset = 5; - } - if (ccwBoundary[*i] != cwBoundary[*i]) { - offset = 5; - } - - myExtended[*i] = true; - distances[*i] = 100 + offset; + if (distances.find(*i) == distances.end()) { + assert(false); + distances[*i] = 100; + } } // build PositionVector ret; for (i = newAll.begin(); i != newAll.end(); ++i) { - PositionVector l = geomsCCW[*i]; - SUMOReal len = l.length(); + const PositionVector& ccwBound = geomsCCW[*i]; + SUMOReal len = ccwBound.length(); SUMOReal offset = distances[*i]; if (offset == -1) { offset = (SUMOReal) - .1; } Position p; if (len >= offset) { - p = l.positionAtOffset2D(offset); + p = ccwBound.positionAtOffset2D(offset); } else { - p = l.positionAtOffset2D(len); + p = ccwBound.positionAtOffset2D(len); } p.set(p.x(), p.y(), myNode.getPosition().z()); + if (i != newAll.begin()) { + ret.append(getSmoothCorner(geomsCW[*(i - 1)].reverse(), ccwBound, ret[-1], p, cornerDetail)); + } ret.push_back_noDoublePos(p); // - l = geomsCW[*i]; - len = l.length(); + const PositionVector& cwBound = geomsCW[*i]; + len = cwBound.length(); if (len >= offset) { - p = l.positionAtOffset2D(offset); + p = cwBound.positionAtOffset2D(offset); } else { - p = l.positionAtOffset2D(len); + p = cwBound.positionAtOffset2D(len); } p.set(p.x(), p.y(), myNode.getPosition().z()); ret.push_back_noDoublePos(p); } + // final curve segment + ret.append(getSmoothCorner(geomsCW[*(newAll.end() - 1)], geomsCCW[*newAll.begin()], ret[-1], ret[0], cornerDetail)); return ret; } +SUMOReal +NBNodeShapeComputer::closestIntersection(const PositionVector& geom1, const PositionVector& geom2, SUMOReal offset) { + std::vector intersections = geom1.intersectsAtLengths2D(geom2); + SUMOReal result = intersections[0]; + for (std::vector::iterator it = intersections.begin() + 1; it != intersections.end(); ++it) { + if (fabs(*it - offset) < fabs(result - offset)) { + result = *it; + } + } + return result; +} + + +PositionVector +NBNodeShapeComputer::getSmoothCorner(PositionVector begShape, PositionVector endShape, + const Position& begPoint, const Position& endPoint, int cornerDetail) { + PositionVector ret; + if (cornerDetail > 0) { + begShape = begShape.reverse(); + begShape[-1] = begPoint; + endShape[0] = endPoint; + PositionVector curve = myNode.computeSmoothShape(begShape, endShape, cornerDetail + 2, false, 25, 25); + if (curve.size() > 2) { + curve.eraseAt(0); + curve.eraseAt(-1); + ret = curve; + } + } + return ret; +} void -NBNodeShapeComputer::joinSameDirectionEdges(std::map& same, - std::map& geomsCCW, - std::map& geomsCW) { +NBNodeShapeComputer::joinSameDirectionEdges(std::map >& same, + GeomsMap& geomsCCW, + GeomsMap& geomsCW) { EdgeVector::const_iterator i, j; + // compute boundary lines and extend it by 100m for (i = myNode.myAllEdges.begin(); i != myNode.myAllEdges.end() - 1; i++) { // store current edge's boundary as current ccw/cw boundary try { - geomsCCW[*i] = (*i)->getCCWBoundaryLine(myNode, SUMO_const_halfLaneWidth); + geomsCCW[*i] = (*i)->getCCWBoundaryLine(myNode); } catch (InvalidArgument& e) { WRITE_WARNING(std::string("While computing intersection geometry: ") + std::string(e.what())); geomsCCW[*i] = (*i)->getGeometry(); } try { - geomsCW[*i] = (*i)->getCWBoundaryLine(myNode, SUMO_const_halfLaneWidth); + geomsCW[*i] = (*i)->getCWBoundaryLine(myNode); } catch (InvalidArgument& e) { WRITE_WARNING(std::string("While computing intersection geometry: ") + std::string(e.what())); geomsCW[*i] = (*i)->getGeometry(); @@ -628,68 +387,142 @@ // extend the boundary by extroplating it by 100m PositionVector g1 = myNode.hasIncoming(*i) - ? (*i)->getCCWBoundaryLine(myNode, SUMO_const_halfLaneWidth) - : (*i)->getCWBoundaryLine(myNode, SUMO_const_halfLaneWidth); + ? (*i)->getCCWBoundaryLine(myNode) + : (*i)->getCWBoundaryLine(myNode); Line l1 = g1.lineAt(0); Line tmp = geomsCCW[*i].lineAt(0); - tmp.extrapolateBy(100); + tmp.extrapolateBy2D(100); geomsCCW[*i].replaceAt(0, tmp.p1()); tmp = geomsCW[*i].lineAt(0); - tmp.extrapolateBy(100); + tmp.extrapolateBy2D(100); geomsCW[*i].replaceAt(0, tmp.p1()); // for (j = i + 1; j != myNode.myAllEdges.end(); j++) { - geomsCCW[*j] = (*j)->getCCWBoundaryLine(myNode, SUMO_const_halfLaneWidth); - geomsCW[*j] = (*j)->getCWBoundaryLine(myNode, SUMO_const_halfLaneWidth); + geomsCCW[*j] = (*j)->getCCWBoundaryLine(myNode); + geomsCW[*j] = (*j)->getCWBoundaryLine(myNode); PositionVector g2 = myNode.hasIncoming(*j) - ? (*j)->getCCWBoundaryLine(myNode, SUMO_const_halfLaneWidth) - : (*j)->getCWBoundaryLine(myNode, SUMO_const_halfLaneWidth); + ? (*j)->getCCWBoundaryLine(myNode) + : (*j)->getCWBoundaryLine(myNode); Line l2 = g2.lineAt(0); tmp = geomsCCW[*j].lineAt(0); - tmp.extrapolateBy(100); + tmp.extrapolateBy2D(100); geomsCCW[*j].replaceAt(0, tmp.p1()); tmp = geomsCW[*j].lineAt(0); - tmp.extrapolateBy(100); + tmp.extrapolateBy2D(100); geomsCW[*j].replaceAt(0, tmp.p1()); - if (fabs(l1.atan2DegreeAngle() - l2.atan2DegreeAngle()) < 20) { - if (same.find(*i) == same.end()) { - same[*i] = EdgeVector(); - } - if (same.find(*j) == same.end()) { - same[*j] = EdgeVector(); - } - if (find(same[*i].begin(), same[*i].end(), *j) == same[*i].end()) { - same[*i].push_back(*j); + } + } + // compute same (edges where an intersection doesn't work well + // (always check an edge and its cw neightbor) + // distance to look ahead for a misleading angle + const SUMOReal angleChangeLookahead = 35; + EdgeSet foundOpposite; + for (i = myNode.myAllEdges.begin(); i != myNode.myAllEdges.end() - 1; i++) { + EdgeVector::const_iterator j = i + 1; + if (j == myNode.myAllEdges.end()) { + j = myNode.myAllEdges.begin(); + } + const bool incoming = (*i)->getToNode() == &myNode; + const bool incoming2 = (*j)->getToNode() == &myNode; + const Position positionAtNode = (*i)->getGeometry()[incoming ? -1 : 0]; + const Position positionAtNode2 = (*j)->getGeometry()[incoming2 ? -1 : 0]; + PositionVector g1 = incoming ? (*i)->getCCWBoundaryLine(myNode) : (*i)->getCWBoundaryLine(myNode); + PositionVector g2 = incoming ? (*j)->getCCWBoundaryLine(myNode) : (*j)->getCWBoundaryLine(myNode); + Line l1 = g1.lineAt(0); + Line l2 = g2.lineAt(0); + const SUMOReal angle1further = (g1.size() > 2 && l1.length2D() < angleChangeLookahead ? + g1.lineAt(1).atan2DegreeAngle() : l1.atan2DegreeAngle()); + const SUMOReal angle2further = (g2.size() > 2 && l2.length2D() < angleChangeLookahead ? + g2.lineAt(1).atan2DegreeAngle() : l2.atan2DegreeAngle()); + const SUMOReal angleDiff = NBHelpers::relAngle(l1.atan2DegreeAngle(), l2.atan2DegreeAngle()); + const SUMOReal angleDiffFurther = NBHelpers::relAngle(angle1further, angle2further); + const bool ambiguousGeometry = ((angleDiff > 0 && angleDiffFurther < 0) || (angleDiff < 0 && angleDiffFurther > 0)); + const bool differentDirs = (incoming != incoming2); + //if (ambiguousGeometry) { + // @todo: this warning would be helpful in many cases. However, if angle and angleFurther jump between 179 and -179 it is misleading + // WRITE_WARNING("Ambigous angles at node '" + myNode.getID() + "' for edges '" + (*i)->getID() + "' and '" + (*j)->getID() + "'."); + //} + if (fabs(angleDiff) < 20) { + const bool isOpposite = differentDirs && foundOpposite.count(*i) == 0; + if (isOpposite) { + foundOpposite.insert(*i); + foundOpposite.insert(*j); + } + if (isOpposite || ambiguousGeometry || badIntersection(*i, *j, geomsCW[*i], geomsCCW[*j], 100)) { + // maintain equivalence relation for all members of the equivalence class + for (std::set::iterator k = same[*i].begin(); k != same[*i].end(); ++k) { + if (*j != *k) { + same[*k].insert(*j); + same[*j].insert(*k); + } } - if (find(same[*j].begin(), same[*j].end(), *i) == same[*j].end()) { - same[*j].push_back(*i); + for (std::set::iterator k = same[*j].begin(); k != same[*j].end(); ++k) { + if (*i != *k) { + same[*k].insert(*i); + same[*i].insert(*k); + } } + same[*i].insert(*j); + same[*j].insert(*i); } } } } +bool +NBNodeShapeComputer::badIntersection(const NBEdge* e1, const NBEdge* e2, + const PositionVector& e1cw, const PositionVector& e2ccw, + SUMOReal distance) { + // check whether the two edges are on top of each other. In that case they should be joined + // also, if they never touch along their common length + const SUMOReal commonLength = MIN3(distance, e1->getGeometry().length(), e2->getGeometry().length()); + PositionVector geom1 = e1->getGeometry(); + PositionVector geom2 = e2->getGeometry(); + // shift to make geom the centerline of the edge regardless of spreadtype + if (e1->getLaneSpreadFunction() == LANESPREAD_RIGHT) { + geom1.move2side(e1->getTotalWidth() / 2); + } + if (e2->getLaneSpreadFunction() == LANESPREAD_RIGHT) { + geom2.move2side(e2->getTotalWidth() / 2); + } + // always let geometry start at myNode + if (e1->getToNode() == &myNode) { + geom1 = geom1.reverse(); + } + if (e2->getToNode() == &myNode) { + geom2 = geom2.reverse(); + } + geom1 = geom1.getSubpart2D(0, commonLength); + geom2 = geom2.getSubpart2D(0, commonLength); + std::vector distances = geom1.distances(geom2, true); + const SUMOReal minDistanceThreshold = (e1->getTotalWidth() + e2->getTotalWidth()) / 2 + POSITION_EPS; + const SUMOReal minDist = VectorHelper::minValue(distances); + const SUMOReal maxDist = VectorHelper::maxValue(distances); + const bool onTop = maxDist - POSITION_EPS < minDistanceThreshold; + const bool curvingTowards = geom1[0].distanceTo2D(geom2[0]) > minDistanceThreshold && minDist < minDistanceThreshold; + const bool intersects = e1cw.intersects(e2ccw); + return onTop || curvingTowards || !intersects; +} + + EdgeVector NBNodeShapeComputer::computeUniqueDirectionList( - const std::map& same, - std::map& geomsCCW, - std::map& geomsCW, + std::map >& same, + GeomsMap& geomsCCW, + GeomsMap& geomsCW, std::map& ccwBoundary, std::map& cwBoundary) { EdgeVector newAll = myNode.myAllEdges; - EdgeVector::const_iterator j; + std::set::const_iterator j; EdgeVector::iterator i2; std::map::iterator k; bool changed = true; while (changed) { changed = false; for (i2 = newAll.begin(); !changed && i2 != newAll.end();) { - EdgeVector other; - if (same.find(*i2) != same.end()) { - other = same.find(*i2)->second; - } + std::set other = same[*i2]; for (j = other.begin(); j != other.end(); ++j) { EdgeVector::iterator k = find(newAll.begin(), newAll.end(), *j); if (k != newAll.end()) { @@ -719,20 +552,73 @@ } +void +NBNodeShapeComputer::initNeighbors(const EdgeVector& edges, const EdgeVector::const_iterator& current, + GeomsMap& geomsCW, + GeomsMap& geomsCCW, + EdgeVector::const_iterator& cwi, + EdgeVector::const_iterator& ccwi, + SUMOReal& cad, + SUMOReal& ccad) { + const SUMOReal twoPI = (SUMOReal)(2 * M_PI); + cwi = current; + cwi++; + if (cwi == edges.end()) { + std::advance(cwi, -((int)edges.size())); // set to edges.begin(); + } + ccwi = current; + if (ccwi == edges.begin()) { + std::advance(ccwi, edges.size() - 1); // set to edges.end() - 1; + } else { + ccwi--; + } + + const SUMOReal angleCurCCW = geomsCCW[*current].lineAt(0).atan2PositiveAngle(); + const SUMOReal angleCurCW = geomsCW[*current].lineAt(0).atan2PositiveAngle(); + const SUMOReal angleCCW = geomsCW[*ccwi].lineAt(0).atan2PositiveAngle(); + const SUMOReal angleCW = geomsCCW[*cwi].lineAt(0).atan2PositiveAngle(); + if (angleCurCCW > angleCCW) { + ccad = angleCurCCW - angleCCW; + } else { + ccad = twoPI - (angleCCW - angleCurCCW); + } + + if (angleCurCW > angleCW) { + cad = twoPI - (angleCurCW - angleCW); + } else { + cad = angleCW - angleCurCW; + } + + if (ccad < 0) { + ccad += twoPI; + } + if (ccad > twoPI) { + ccad -= twoPI; + } + if (cad < 0) { + cad += twoPI; + } + if (cad > twoPI) { + cad -= twoPI; + } +} + + + PositionVector -NBNodeShapeComputer::computeNodeShapeByCrosses() { +NBNodeShapeComputer::computeNodeShapeSmall() { PositionVector ret; EdgeVector::const_iterator i; for (i = myNode.myAllEdges.begin(); i != myNode.myAllEdges.end(); i++) { // compute crossing with normal - Line edgebound1 = (*i)->getCCWBoundaryLine(myNode, SUMO_const_halfLaneWidth).lineAt(0); - Line edgebound2 = (*i)->getCWBoundaryLine(myNode, SUMO_const_halfLaneWidth).lineAt(0); + Line edgebound1 = (*i)->getCCWBoundaryLine(myNode).lineAt(0); + Line edgebound2 = (*i)->getCWBoundaryLine(myNode).lineAt(0); Line cross(edgebound1); cross.rotateAtP1(M_PI / 2.); cross.add(myNode.getPosition() - cross.p1()); - cross.extrapolateBy(500); - edgebound1.extrapolateBy(500); - edgebound2.extrapolateBy(500); + cross.extrapolateBy2D(500); + edgebound1.extrapolateBy2D(500); + edgebound2.extrapolateBy2D(500); if (cross.intersects(edgebound1)) { Position np = cross.intersectsAt(edgebound1); np.set(np.x(), np.y(), myNode.getPosition().z()); diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBNodeShapeComputer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNodeShapeComputer.h --- sumo-0.21.0+dfsg/src/netbuild/NBNodeShapeComputer.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBNodeShapeComputer.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2004-01-12 -/// @version $Id: NBNodeShapeComputer.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBNodeShapeComputer.h 18169 2015-03-27 13:40:16Z behrisch $ /// // This class computes shapes of junctions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -61,7 +61,14 @@ PositionVector compute(bool leftHand); private: - PositionVector computeContinuationNodeShape(bool simpleContinuation); + typedef std::map GeomsMap; + + /** @brief Computes the node geometry + * Edges with the same direction are grouped. + * Then the node geometry is built from intersection between the borders + * of adjacent edge groups + */ + PositionVector computeNodeShapeDefault(bool simpleContinuation); /** @brief Computes the node geometry using normals * @@ -70,19 +77,13 @@ * the normals of participating edges' geometry boundaries (cw/ccw) * at the node's height (the length of the edge the edge would cross the node * point). + * + * @note This usually gives a very small node shape, appropriate for + * dead-ends or turn-around-only situations */ - PositionVector computeNodeShapeByCrosses(); - - - void replaceLastChecking(PositionVector& g, bool decenter, - PositionVector counter, size_t counterLanes, SUMOReal counterDist, - int laneDiff); + PositionVector computeNodeShapeSmall(); - void replaceFirstChecking(PositionVector& g, bool decenter, - PositionVector counter, size_t counterLanes, SUMOReal counterDist, - int laneDiff); - /** @brief Joins edges and computes ccw/cw boundaries * * This method goes through all edges and stores each edge's ccw and cw @@ -92,9 +93,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, + GeomsMap& geomsCCW, + GeomsMap& geomsCW); /** @brief Joins edges and computes ccw/cw boundaries * @@ -104,12 +105,47 @@ * ccwBoundary/cwBoundary. */ EdgeVector computeUniqueDirectionList( - const std::map& same, - std::map& geomsCCW, - std::map& geomsCW, + std::map >& same, + GeomsMap& geomsCCW, + GeomsMap& geomsCW, std::map& ccwBoundary, std::map& cwBoundary); + /** @brief Compute smoothed corner shape + * @param[in] begShape + * @param[in] endShape + * @param[in] begPoint + * @param[in] endPoint + * @param[in] cornerDetail + * @return shape to be appended between begPoint and endPoint + */ + PositionVector getSmoothCorner(PositionVector begShape, PositionVector endShape, + const Position& begPoint, const Position& endPoint, int cornerDetail); + + /** @brief Initialize neighbors and angles + * @param[in] edges The list of edges sorted in clockwise direction + * @param[in] current An iterator to the current edge + * @param[in] geomsCW geometry map + * @param[in] geomsCCW geometry map + * @param[out] cwi An iterator to the clockwise neighbor + * @param[out] ccwi An iterator to the counter-clockwise neighbor + * @param[out] cad The angle difference to the clockwise neighbor + * @param[out] ccad The angle difference to the counter-clockwise neighbor + */ + static void initNeighbors(const EdgeVector& edges, const EdgeVector::const_iterator& current, + GeomsMap& geomsCW, + GeomsMap& geomsCCW, + EdgeVector::const_iterator& cwi, + EdgeVector::const_iterator& ccwi, + SUMOReal& cad, + SUMOReal& ccad); + + /// @return whether trying to intersect these edges would probably fail + bool badIntersection(const NBEdge* e1, const NBEdge* e2, + const PositionVector& e1cw, const PositionVector& e2ccw, SUMOReal distance); + + /// @brief return the intersection point closest to the given offset + SUMOReal closestIntersection(const PositionVector& geom1, const PositionVector& geom2, SUMOReal offset); private: /// The node to compute the geometry for diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBOwnTLDef.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBOwnTLDef.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBOwnTLDef.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBOwnTLDef.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 29.05.2005 -/// @version $Id: NBOwnTLDef.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBOwnTLDef.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // A traffic light logics which must be computed (only nodes/edges are given) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -169,7 +169,7 @@ used.push_back(*incoming.begin()); // the first will definitely be used // get the ones with the same priority int prio = getToPrio(*used.begin()); - for (EdgeVector::iterator i = incoming.begin() + 1; i != incoming.end() && prio != getToPrio(*i); ++i) { + for (EdgeVector::iterator i = incoming.begin() + 1; i != incoming.end() && prio == getToPrio(*i); ++i) { used.push_back(*i); } // if there only lower priorised, use these, too @@ -182,15 +182,21 @@ return ret; } - NBTrafficLightLogic* NBOwnTLDef::myCompute(const NBEdgeCont&, unsigned int brakingTimeSeconds) { + return computeLogicAndConts(brakingTimeSeconds); +} + +NBTrafficLightLogic* +NBOwnTLDef::computeLogicAndConts(unsigned int brakingTimeSeconds, bool onlyConts) { + myNeedsContRelation.clear(); const SUMOTime brakingTime = TIME2STEPS(brakingTimeSeconds); const SUMOTime leftTurnTime = TIME2STEPS(6); // make configurable // build complete lists first const EdgeVector& incoming = getIncomingEdges(); EdgeVector fromEdges, toEdges; - std::vector isLeftMoverV, isTurnaround; + std::vector isTurnaround; + std::vector fromLanes; unsigned int noLanesAll = 0; unsigned int noLinksAll = 0; for (unsigned int i1 = 0; i1 < incoming.size(); i1++) { @@ -208,19 +214,11 @@ assert(i3 < approached.size()); NBEdge* toEdge = approached[i3].toEdge; fromEdges.push_back(fromEdge); - //myFromLanes.push_back(i2); + fromLanes.push_back((int)i2); toEdges.push_back(toEdge); if (toEdge != 0) { - isLeftMoverV.push_back( - isLeftMover(fromEdge, toEdge) - || - fromEdge->isTurningDirectionAt(fromEdge->getToNode(), toEdge)); - - isTurnaround.push_back( - fromEdge->isTurningDirectionAt( - fromEdge->getToNode(), toEdge)); + isTurnaround.push_back(fromEdge->isTurningDirectionAt(toEdge)); } else { - isLeftMoverV.push_back(true); isTurnaround.push_back(true); } } @@ -230,8 +228,10 @@ std::vector crossings; for (std::vector::iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) { const std::vector& c = (*i)->getCrossings(); - // set tl indices for crossings - (*i)->setCrossingTLIndices(noLinksAll); + if (!onlyConts) { + // set tl indices for crossings + (*i)->setCrossingTLIndices(noLinksAll); + } copy(c.begin(), c.end(), std::back_inserter(crossings)); noLinksAll += (unsigned int)c.size(); } @@ -243,8 +243,16 @@ while (toProc.size() > 0) { std::pair chosen; if (incoming.size() == 2) { - chosen = std::pair(toProc[0], static_cast(0)); - toProc.erase(toProc.begin()); + // if there are only 2 incoming edges we need to decide whether they are a crossing or a "continuation" + // @node: this heuristic could be extended to also check the number of outgoing edges + SUMOReal angle = fabs(NBHelpers::relAngle(toProc[0]->getAngleAtNode(toProc[0]->getToNode()), toProc[1]->getAngleAtNode(toProc[1]->getToNode()))); + // angle would be 180 for straight opposing incoming edges + if (angle < 135) { + chosen = std::pair(toProc[0], static_cast(0)); + toProc.erase(toProc.begin()); + } else { + chosen = getBestPair(toProc); + } } else { chosen = getBestPair(toProc); } @@ -282,25 +290,34 @@ isForbidden = true; } } - if (!isForbidden) { + if (!isForbidden && !hasCrossing(fromEdges[i1], toEdges[i1], crossings)) { state[i1] = 'G'; } } // correct behaviour for those that have to wait (mainly left-mover) bool haveForbiddenLeftMover = false; + std::vector rightTurnConflicts(pos, false); for (unsigned int i1 = 0; i1 < pos; ++i1) { if (state[i1] != 'G') { continue; } for (unsigned int i2 = 0; i2 < pos; ++i2) { - if ((state[i2] == 'G' || state[i2] == 'g') && forbids(fromEdges[i2], toEdges[i2], fromEdges[i1], toEdges[i1], true)) { - state[i1] = 'g'; - if (!isTurnaround[i1]) { - haveForbiddenLeftMover = true; + if ((state[i2] == 'G' || state[i2] == 'g')) { + if (fromEdges[i2]->getToNode()->rightTurnConflict( + fromEdges[i1], toEdges[i1], fromLanes[i1], fromEdges[i2], toEdges[i2], fromLanes[i2])) { + rightTurnConflicts[i1] = true; + } + if (forbids(fromEdges[i2], toEdges[i2], fromEdges[i1], toEdges[i1], true) || rightTurnConflicts[i1]) { + state[i1] = 'g'; + myNeedsContRelation.insert(StreamPair(fromEdges[i1], toEdges[i1], fromEdges[i2], toEdges[i2])); + if (!isTurnaround[i1]) { + haveForbiddenLeftMover = true; + } } } } } + const std::string vehicleState = state; // backup state before pedestrian modifications state = addPedestrianPhases(logic, greenTime, state, crossings, fromEdges, toEdges); // pedestrians have 'r' from here on for (unsigned int i1 = pos; i1 < pos + crossings.size(); ++i1) { @@ -313,7 +330,7 @@ if (state[i1] != 'G' && state[i1] != 'g') { continue; } - if ((state[i1] >= 'a' && state[i1] <= 'z') && haveForbiddenLeftMover) { + if ((vehicleState[i1] >= 'a' && vehicleState[i1] <= 'z') && haveForbiddenLeftMover && !rightTurnConflicts[i1]) { continue; } state[i1] = 'y'; @@ -350,6 +367,8 @@ } } const SUMOTime totalDuration = logic->getDuration(); + // this computation only makes sense for single nodes + myNeedsContRelationReady = (myControlledNodes.size() == 1); if (totalDuration > 0) { if (totalDuration > 3 * (greenTime + 2 * brakingTime + leftTurnTime)) { WRITE_WARNING("The traffic light '" + getID() + "' has a high cycle time of " + time2string(totalDuration) + "."); @@ -363,6 +382,26 @@ } +bool +NBOwnTLDef::hasCrossing(const NBEdge* from, const NBEdge* to, const std::vector& crossings) { + assert(from != 0); + assert(to != 0); + for (std::vector::const_iterator it = crossings.begin(); it != crossings.end(); it++) { + const NBNode::Crossing& cross = *it; + // only check connections at this crossings node + if (from->getToNode() == cross.node) { + for (EdgeVector::const_iterator it_e = cross.edges.begin(); it_e != cross.edges.end(); ++it_e) { + const NBEdge* edge = *it_e; + if (edge == from || edge == to) { + return true; + } + } + } + } + return false; +} + + std::string NBOwnTLDef::addPedestrianPhases(NBTrafficLightLogic* logic, SUMOTime greenTime, std::string state, const std::vector& crossings, const EdgeVector& fromEdges, const EdgeVector& toEdges) { @@ -481,5 +520,31 @@ NBEdge* /*by*/, int /*byLane*/) {} +void +NBOwnTLDef::initNeedsContRelation() const { + if (!myNeedsContRelationReady) { + assert(myControlledNodes.size() > 0); + // there are basically 2 cases for controlling multiple nodes + // a) a complex (unjoined) intersection. Here, internal junctions should + // not be needed since real nodes are used instead + // b) two far-away junctions which shall be coordinated + // This is likely to mess up the bestPair computation for each + // individual node and thus generate incorrect needsCont data + // + // Therefore we compute needsCont for individual nodes which doesn't + // matter for a) and is better for b) + myNeedsContRelation.clear(); + for (std::vector::const_iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) { + NBNode* n = *i; + NBOwnTLDef dummy("dummy", n, 0, TLTYPE_STATIC); + dummy.setParticipantsInformation(); + dummy.computeLogicAndConts(0, true); + myNeedsContRelation.insert(dummy.myNeedsContRelation.begin(), dummy.myNeedsContRelation.end()); + n->removeTrafficLight(&dummy); + } + myNeedsContRelationReady = true; + } + +} /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBOwnTLDef.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBOwnTLDef.h --- sumo-0.21.0+dfsg/src/netbuild/NBOwnTLDef.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBOwnTLDef.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Sascha Krieg /// @date Tue, 29.05.2005 -/// @version $Id: NBOwnTLDef.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBOwnTLDef.h 18155 2015-03-26 09:57:55Z namdre $ /// // A traffic light logics which must be computed (only nodes/edges are given) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -128,6 +128,16 @@ static std::string patchStateForCrossings(const std::string& state, const std::vector& crossings, const EdgeVector& fromEdges, const EdgeVector& toEdges); + /** @brief helper function for myCompute + * @param[in] brakingTime Duration a vehicle needs for braking in front of the tls + * @param[in] onlyConts whether the method is only called to compute myNeedsContRelation + * @return The computed logic + */ + NBTrafficLightLogic* computeLogicAndConts(unsigned int brakingTimeSeconds, bool onlyConts = false); + + /* initialize myNeedsContRelation and set myNeedsContRelationReady to true */ + void initNeedsContRelation() const; + protected: /// @name Protected methods from NBTrafficLightDefinition-interface /// @{ @@ -208,6 +218,10 @@ std::pair getBestPair(EdgeVector& incoming); + /// @brief compute whether the given connection is crossed by pedestrians + static bool hasCrossing(const NBEdge* from, const NBEdge* to, const std::vector& crossings); + + /** @class edge_by_incoming_priority_sorter * @brief Sorts edges by their priority within the node they end at */ @@ -225,11 +239,11 @@ } }; + private: /// @brief Whether left-mover should not have an additional phase bool myHaveSinglePhase; - }; diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBRequest.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBRequest.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBRequest.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBRequest.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Tue, 20 Nov 2001 -/// @version $Id: NBRequest.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBRequest.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // This class computes the logic of a junction /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -45,8 +45,6 @@ #include #include "NBEdge.h" #include "NBContHelper.h" -#include "NBTrafficLightLogic.h" -#include "NBTrafficLightLogicCont.h" #include "NBNode.h" #include "NBRequest.h" @@ -237,11 +235,11 @@ } // check if one of the links is a turn; this link is always not priorised // true for right-before-left and priority - if (from1->isTurningDirectionAt(myJunction, to1)) { + if (from1->isTurningDirectionAt(to1)) { myForbids[idx2][idx1] = true; return; } - if (from2->isTurningDirectionAt(myJunction, to2)) { + if (from2->isTurningDirectionAt(to2)) { myForbids[idx1][idx2] = true; return; } @@ -637,8 +635,8 @@ } const SUMOReal prohibitorAngle = NBHelpers::relAngle( prohibitorFrom->getAngleAtNode(prohibitorFrom->getToNode()), to->getAngleAtNode(to->getFromNode())); - const bool rightOfProhibitor = prohibitorFrom->isTurningDirectionAt(prohibitorFrom->getToNode(), to) - || (angle > prohibitorAngle && !from->isTurningDirectionAt(from->getToNode(), to)); + const bool rightOfProhibitor = prohibitorFrom->isTurningDirectionAt(to) + || (angle > prohibitorAngle && !from->isTurningDirectionAt(to)); return rightOfProhibitor ? toLane >= prohibitorToLane : toLane <= prohibitorToLane; } @@ -649,7 +647,8 @@ if (from != prohibitorFrom) { return false; } - if (from->isTurningDirectionAt(from->getToNode(), to)) { + if (from->isTurningDirectionAt(to) + || prohibitorFrom->isTurningDirectionAt(prohibitorTo)) { // XXX should warn if there are any non-turning connections left of this return false; } @@ -659,6 +658,10 @@ return false; } // conflict if to is between prohibitorTo and from when going clockwise + if (to->getStartAngle() == prohibitorTo->getStartAngle()) { + // reduce rounding errors + return false; + } const SUMOReal toAngleAtNode = fmod(to->getStartAngle() + 180, (SUMOReal)360.0); const SUMOReal prohibitorToAngleAtNode = fmod(prohibitorTo->getStartAngle() + 180, (SUMOReal)360.0); return (lefthand != (GeomHelper::getCWAngleDiff(from->getEndAngle(), toAngleAtNode) < @@ -698,7 +701,7 @@ bool -NBRequest::mustBrake(const NBEdge* const from, const NBEdge* const to) const { +NBRequest::mustBrake(const NBEdge* const from, const NBEdge* const to, int fromLane, bool includePedCrossings) const { // vehicles which do not have a following lane must always decelerate to the end if (to == 0) { return true; @@ -718,9 +721,23 @@ } } // maybe we need to brake for a pedestrian crossing - for (std::vector::const_reverse_iterator i = myCrossings.rbegin(); i != myCrossings.rend(); i++) { - if (mustBrakeForCrossing(from, to, *i)) { - return true; + if (includePedCrossings) { + for (std::vector::const_reverse_iterator i = myCrossings.rbegin(); i != myCrossings.rend(); i++) { + if (mustBrakeForCrossing(from, to, *i)) { + return true; + } + } + } + // maybe we need to brake due to a right-turn conflict with straight-going + // bicycles + LinkDirection dir = myJunction->getDirection(from, to); + if (dir == LINKDIR_RIGHT || dir == LINKDIR_PARTRIGHT) { + const std::vector& cons = from->getConnections(); + for (std::vector::const_iterator i = cons.begin(); i != cons.end(); i++) { + if (rightTurnConflict(from, to, fromLane, + from, (*i).toEdge, (*i).fromLane)) { + return true; + } } } return false; diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBRequest.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBRequest.h --- sumo-0.21.0+dfsg/src/netbuild/NBRequest.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBRequest.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NBRequest.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBRequest.h 18096 2015-03-17 09:50:59Z behrisch $ /// // This class computes the logic of a junction /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -101,9 +101,11 @@ /** @brief Returns the information whether the described flow must let any other flow pass * @param[in] from The connection's start edge * @param[in] to The connection's end edge + * @param[in] fromLane The connection starting lane + * @param[in] includePedCrossings Whether braking due to a pedestrian crossing counts * @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, int fromLane, bool includePedCrossings) const; /** @brief Returns the information whether the described flow must brake for the given crossing * @param[in] from The connection's start edge @@ -143,6 +145,10 @@ /// prints the request friend std::ostream& operator<<(std::ostream& os, const NBRequest& r); + /** @brief return whether the given laneToLane connection is a right turn which must yield to a bicycle crossings + */ + bool rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane, const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane) const; + /// reports warnings if any occured static void reportWarnings(); @@ -223,10 +229,6 @@ */ bool laneConflict(const NBEdge* from, const NBEdge* to, int toLane, const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorToLane) const; - /** @brief return whether the given laneToLane connection is a right turn which must yield to pedestrian or bicycle crossings - */ - bool rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane, const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane) const; - /// @brief return to total number of edge-to-edge connections of this request-logic inline size_t numLinks() const; diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBSign.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBSign.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBSign.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBSign.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Nov 2012 -/// @version $Id: NBSign.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBSign.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A class representing a street sign /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBSign.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBSign.h --- sumo-0.21.0+dfsg/src/netbuild/NBSign.h 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBSign.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Nov 2012 -/// @version $Id: NBSign.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NBSign.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A class representing a street sign /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBTrafficLightDefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTrafficLightDefinition.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBTrafficLightDefinition.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTrafficLightDefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBTrafficLightDefinition.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBTrafficLightDefinition.cpp 18155 2015-03-26 09:57:55Z namdre $ /// // The base class for traffic light logic definitions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,6 +41,7 @@ #include #include "NBLinkPossibilityMatrix.h" #include "NBTrafficLightLogic.h" +#include "NBOwnTLDef.h" #include "NBContHelper.h" #ifdef CHECK_MEMORY_LEAKS @@ -61,7 +62,8 @@ Named(id), myControlledNodes(junctions), mySubID(programID), myOffset(offset), - myType(type) { + myType(type), + myNeedsContRelationReady(false) { std::vector::iterator i = myControlledNodes.begin(); while (i != myControlledNodes.end()) { for (std::vector::iterator j = i + 1; j != myControlledNodes.end();) { @@ -85,9 +87,9 @@ Named(id), mySubID(programID), myOffset(offset), - myType(type) { + myType(type), + myNeedsContRelationReady(false) { addNode(junction); - junction->addTrafficLight(this); } @@ -96,7 +98,9 @@ Named(id), mySubID(programID), myOffset(offset), - myType(type) {} + myType(type), + myNeedsContRelationReady(false) +{} NBTrafficLightDefinition::~NBTrafficLightDefinition() {} @@ -180,22 +184,6 @@ bool -NBTrafficLightDefinition::isLeftMover(const NBEdge* const from, const NBEdge* const to) const { - // the destination edge may be unused - if (to == 0) { - return false; - } - // get the node which is holding this connection - std::vector::const_iterator i = - find_if(myControlledNodes.begin(), myControlledNodes.end(), - NBContHelper::node_with_incoming_finder(from)); - assert(i != myControlledNodes.end()); - NBNode* node = *i; - return node->isLeftMover(from, to); -} - - -bool NBTrafficLightDefinition::mustBrake(const NBEdge* const from, const NBEdge* const to) const { std::vector::const_iterator i = find_if(myControlledNodes.begin(), myControlledNodes.end(), @@ -205,7 +193,7 @@ if (!node->hasOutgoing(to)) { return true; // !!! } - return node->mustBrake(from, to, -1); + return node->mustBrake(from, to, -1, true); } @@ -392,5 +380,30 @@ } } + +bool +NBTrafficLightDefinition::needsCont(const NBEdge* fromE, const NBEdge* toE, const NBEdge* otherFromE, const NBEdge* otherToE) const { + if (!myNeedsContRelationReady) { + initNeedsContRelation(); + assert(myNeedsContRelationReady); + } + return std::find(myNeedsContRelation.begin(), myNeedsContRelation.end(), + StreamPair(fromE, toE, otherFromE, otherToE)) != myNeedsContRelation.end(); +} + + +void +NBTrafficLightDefinition::initNeedsContRelation() const { + if (!amInvalid()) { + NBOwnTLDef dummy("dummy", myControlledNodes, 0, TLTYPE_STATIC); + dummy.initNeedsContRelation(); + myNeedsContRelation = dummy.myNeedsContRelation; + for (std::vector::const_iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) { + (*i)->removeTrafficLight(&dummy); + } + } + myNeedsContRelationReady = true; +} + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBTrafficLightDefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTrafficLightDefinition.h --- sumo-0.21.0+dfsg/src/netbuild/NBTrafficLightDefinition.h 2014-05-07 22:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTrafficLightDefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBTrafficLightDefinition.h 16314 2014-05-07 09:58:14Z namdre $ +/// @version $Id: NBTrafficLightDefinition.h 18155 2015-03-26 09:57:55Z namdre $ /// // The base class for traffic light logic definitions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -282,14 +282,6 @@ UNUSED_PARAMETER(offset); } - /** @brief returns the information whether the given link is a left-mover - * @param[in] from The connection's start edge - * @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; - - /** @brief Returns the list of incoming edges (must be build first) * @return The edges which are incoming into the tls */ @@ -331,6 +323,16 @@ return myType; } + /* @brief computes whether the given stream may have green minor while the + * other stream has green major in the same phase + */ + bool needsCont(const NBEdge* fromE, const NBEdge* toE, const NBEdge* otherFromE, const NBEdge* otherToE) const; + + /* initialize myNeedsContRelation and set myNeedsContRelationReady to true + * This information is a byproduct of NBOwnTLDef::myCompute. All other + * subclasses instantiate a private instance of NBOwnTLDef to answer this query */ + virtual void initNeedsContRelation() const; + protected: /** @brief Computes the traffic light logic finally in dependence to the type * @param[in] ec The edge container @@ -349,7 +351,7 @@ /** @brief Build the list of participating edges */ - void collectEdges(); + virtual void collectEdges(); /** @brief Computes the time vehicles may need to brake @@ -366,7 +368,6 @@ /// @brief helper method for use in NBOwnTLDef and NBLoadedSUMOTLDef void collectAllLinks(); - protected: /// @brief The container with participating nodes std::vector myControlledNodes; @@ -392,6 +393,41 @@ /// @brief The algorithm type for the traffic light TrafficLightType myType; + /// @brief data structure for caching needsCont information + struct StreamPair { + StreamPair(const NBEdge* _from1, const NBEdge* _to1, const NBEdge* _from2, const NBEdge* _to2): + from1(_from1), + to1(_to1), + from2(_from2), + to2(_to2) {} + + bool operator==(const StreamPair& o) const { + return (from1 == o.from1 && to1 == o.to1 + && from2 == o.from2 && to2 == o.to2); + } + + bool operator<(const StreamPair& o) const { + if (from1 != o.from1) { + return from1 < o.from1; + } + if (to1 != o.to1) { + return to1 < o.to1; + } + if (from2 != o.from2) { + return from2 < o.from2; + } + return to2 < o.to2; + } + + const NBEdge* from1; + const NBEdge* to1; + const NBEdge* from2; + const NBEdge* to2; + }; + typedef std::set NeedsContRelation; + mutable NeedsContRelation myNeedsContRelation; + mutable bool myNeedsContRelationReady; + }; diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBTrafficLightLogicCont.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTrafficLightLogicCont.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBTrafficLightLogicCont.cpp 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTrafficLightLogicCont.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBTrafficLightLogicCont.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBTrafficLightLogicCont.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A container for traffic light definitions and built programs /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -39,7 +39,9 @@ #include #include "NBTrafficLightLogic.h" #include "NBTrafficLightLogicCont.h" +#include "NBOwnTLDef.h" #include "NBEdgeCont.h" +#include "NBNodeCont.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -272,7 +274,7 @@ void -NBTrafficLightLogicCont::setTLControllingInformation(const NBEdgeCont& ec) { +NBTrafficLightLogicCont::setTLControllingInformation(const NBEdgeCont& ec, const NBNodeCont& nc) { Definitions definitions = getDefinitions(); // set the information about all participants, first for (Definitions::iterator it = definitions.begin(); it != definitions.end(); it++) { @@ -284,6 +286,16 @@ for (Definitions::iterator it = definitions.begin(); it != definitions.end(); it++) { (*it)->setTLControllingInformation(ec); } + // handle rail signals which are not instantiated as normal definitions + for (std::map::const_iterator it = nc.begin(); it != nc.end(); it ++) { + NBNode* n = it->second; + if (n->getType() == NODETYPE_RAIL_SIGNAL) { + NBOwnTLDef dummy(n->getID(), n, 0, TLTYPE_STATIC); + dummy.setParticipantsInformation(); + dummy.setTLControllingInformation(ec); + n->removeTrafficLight(&dummy); + } + } } diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBTrafficLightLogicCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTrafficLightLogicCont.h --- sumo-0.21.0+dfsg/src/netbuild/NBTrafficLightLogicCont.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTrafficLightLogicCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBTrafficLightLogicCont.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBTrafficLightLogicCont.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A container for traffic light definitions and built programs /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -214,7 +214,7 @@ * @see NBTrafficLightDefinition::setParticipantsInformation * @see NBTrafficLightDefinition::setTLControllingInformation */ - void setTLControllingInformation(const NBEdgeCont& ec); + void setTLControllingInformation(const NBEdgeCont& ec, const NBNodeCont& nc); private: diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBTrafficLightLogic.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTrafficLightLogic.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBTrafficLightLogic.cpp 2014-06-04 22:02:32.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTrafficLightLogic.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBTrafficLightLogic.cpp 16510 2014-06-04 07:00:26Z namdre $ +/// @version $Id: NBTrafficLightLogic.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A SUMO-compliant built logic for a traffic light /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -56,13 +56,14 @@ const char NBTrafficLightLogic::allowedStatesInitializer[] = {LINKSTATE_TL_GREEN_MAJOR, LINKSTATE_TL_GREEN_MINOR, LINKSTATE_TL_RED, + LINKSTATE_TL_REDYELLOW, LINKSTATE_TL_YELLOW_MAJOR, LINKSTATE_TL_YELLOW_MINOR, LINKSTATE_TL_OFF_BLINKING, LINKSTATE_TL_OFF_NOSIGNAL }; -const std::string NBTrafficLightLogic::ALLOWED_STATES(NBTrafficLightLogic::allowedStatesInitializer, 7); +const std::string NBTrafficLightLogic::ALLOWED_STATES(NBTrafficLightLogic::allowedStatesInitializer, 8); // =========================================================================== // member method definitions diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBTrafficLightLogic.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTrafficLightLogic.h --- sumo-0.21.0+dfsg/src/netbuild/NBTrafficLightLogic.h 2014-02-22 23:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTrafficLightLogic.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NBTrafficLightLogic.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NBTrafficLightLogic.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A SUMO-compliant built logic for a traffic light /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBTypeCont.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTypeCont.cpp --- sumo-0.21.0+dfsg/src/netbuild/NBTypeCont.cpp 2014-05-05 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTypeCont.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Tue, 20 Nov 2001 -/// @version $Id: NBTypeCont.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: NBTypeCont.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A storage for the available types of an edge /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netbuild/NBTypeCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTypeCont.h --- sumo-0.21.0+dfsg/src/netbuild/NBTypeCont.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netbuild/NBTypeCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Tue, 20 Nov 2001 -/// @version $Id: NBTypeCont.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NBTypeCont.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A storage for available types of edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netconvert_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netconvert_main.cpp --- sumo-0.21.0+dfsg/src/netconvert_main.cpp 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netconvert_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: netconvert_main.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: netconvert_main.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Main for NETCONVERT /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -104,7 +104,7 @@ OptionsCont& oc = OptionsCont::getOptions(); // give some application descriptions oc.setApplicationDescription("Road network importer / builder for the road traffic simulation SUMO."); - oc.setApplicationName("netconvert", "SUMO netconvert Version " + (std::string)VERSION_STRING); + oc.setApplicationName("netconvert", "SUMO netconvert Version " + getBuildName(VERSION_STRING)); int ret = 0; try { XMLSubSys::init(); diff -Nru sumo-0.21.0+dfsg/src/netgen/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/Makefile.am --- sumo-0.21.0+dfsg/src/netgen/Makefile.am 2013-09-27 22:02:24.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -2,10 +2,6 @@ MEM_LIBS = ../foreign/nvwa/libnvwa.a endif -if INTERNAL -INTERNAL_LIBS = ../internal/libinternal.a -endif - bin_PROGRAMS = netgenerate netgenerate_SOURCES = netgen_main.cpp NGEdge.cpp NGEdge.h NGFrame.cpp NGFrame.h \ @@ -23,5 +19,4 @@ ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) \ -l$(LIB_XERCES) \ -$(INTERNAL_LIBS) \ $(XERCES_LDFLAGS) $(GDAL_LDFLAGS) $(PROJ_LDFLAGS) diff -Nru sumo-0.21.0+dfsg/src/netgen/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/Makefile.in --- sumo-0.21.0+dfsg/src/netgen/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -103,8 +103,8 @@ ../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) $(INTERNAL_LIBS) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(MEM_LIBS) $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -225,6 +225,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -235,7 +237,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -330,7 +331,6 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @CHECK_MEMORY_LEAKS_TRUE@MEM_LIBS = ../foreign/nvwa/libnvwa.a -@INTERNAL_TRUE@INTERNAL_LIBS = ../internal/libinternal.a 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 @@ -346,7 +346,6 @@ ../foreign/tcpip/libtcpip.a \ $(MEM_LIBS) \ -l$(LIB_XERCES) \ -$(INTERNAL_LIBS) \ $(XERCES_LDFLAGS) $(GDAL_LDFLAGS) $(PROJ_LDFLAGS) all: all-am diff -Nru sumo-0.21.0+dfsg/src/netgen/netgen_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/netgen_main.cpp --- sumo-0.21.0+dfsg/src/netgen/netgen_main.cpp 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/netgen_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: netgen_main.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: netgen_main.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Main for NETGENERATE /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -205,7 +205,7 @@ OptionsCont& oc = OptionsCont::getOptions(); // give some application descriptions oc.setApplicationDescription("Road network generator for the microscopic road traffic simulation SUMO."); - oc.setApplicationName("netgenerate", "SUMO netgenerate Version " + (std::string)VERSION_STRING); + oc.setApplicationName("netgenerate", "SUMO netgenerate Version " + getBuildName(VERSION_STRING)); int ret = 0; try { // initialise the application system (messaging, xml, options) diff -Nru sumo-0.21.0+dfsg/src/netgen/NGEdge.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGEdge.cpp --- sumo-0.21.0+dfsg/src/netgen/NGEdge.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGEdge.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mar, 2003 -/// @version $Id: NGEdge.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NGEdge.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A netgen-representation of an edge /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netgen/NGEdge.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGEdge.h --- sumo-0.21.0+dfsg/src/netgen/NGEdge.h 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGEdge.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGEdge.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NGEdge.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A netgen-representation of an edge /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netgen/NGFrame.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGFrame.cpp --- sumo-0.21.0+dfsg/src/netgen/NGFrame.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGFrame.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 06.05.2011 -/// @version $Id: NGFrame.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NGFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for netgen /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -219,6 +219,8 @@ type != toString(NODETYPE_PRIORITY) && type != toString(NODETYPE_PRIORITY_STOP) && type != toString(NODETYPE_ALLWAY_STOP) && + type != toString(NODETYPE_NOJUNCTION) && + type != toString(NODETYPE_RAIL_SIGNAL) && type != toString(NODETYPE_RIGHT_BEFORE_LEFT)) { WRITE_ERROR("Only the following junction types are known: " + toString(NODETYPE_TRAFFIC_LIGHT) + ", " + @@ -226,6 +228,8 @@ toString(NODETYPE_PRIORITY) + ", " + toString(NODETYPE_PRIORITY_STOP) + ", " + toString(NODETYPE_ALLWAY_STOP) + ", " + + toString(NODETYPE_NOJUNCTION) + ", " + + toString(NODETYPE_RAIL_SIGNAL) + ", " + toString(NODETYPE_RIGHT_BEFORE_LEFT)); ok = false; } diff -Nru sumo-0.21.0+dfsg/src/netgen/NGFrame.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGFrame.h --- sumo-0.21.0+dfsg/src/netgen/NGFrame.h 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGFrame.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NGFrame.h /// @author Daniel Krajzewicz /// @date 06.05.2011 -/// @version $Id: NGFrame.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NGFrame.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for netgen /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netgen/NGNet.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGNet.cpp --- sumo-0.21.0+dfsg/src/netgen/NGNet.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGNet.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mar, 2003 -/// @version $Id: NGNet.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NGNet.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The class storing the generated network /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netgen/NGNet.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGNet.h --- sumo-0.21.0+dfsg/src/netgen/NGNet.h 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGNet.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGNet.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NGNet.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The class storing the generated network /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netgen/NGNode.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGNode.cpp --- sumo-0.21.0+dfsg/src/netgen/NGNode.cpp 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGNode.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGNode.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NGNode.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A netgen-representation of a node /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netgen/NGNode.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGNode.h --- sumo-0.21.0+dfsg/src/netgen/NGNode.h 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGNode.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGNode.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NGNode.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A netgen-representation of a node /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netgen/NGRandomNetBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGRandomNetBuilder.cpp --- sumo-0.21.0+dfsg/src/netgen/NGRandomNetBuilder.cpp 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGRandomNetBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGRandomNetBuilder.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NGRandomNetBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Additional structures for building random nets /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netgen/NGRandomNetBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGRandomNetBuilder.h --- sumo-0.21.0+dfsg/src/netgen/NGRandomNetBuilder.h 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netgen/NGRandomNetBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mar, 2003 -/// @version $Id: NGRandomNetBuilder.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NGRandomNetBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Additional structures for building random nets /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/Makefile.in --- sumo-0.21.0+dfsg/src/netimport/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -271,6 +271,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -281,7 +283,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/netimport/NIFrame.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIFrame.cpp --- sumo-0.21.0+dfsg/src/netimport/NIFrame.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIFrame.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIFrame.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for netimport /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -130,10 +130,11 @@ oc.addSynonyme("itsumo-files", "itsumo"); oc.addDescription("itsumo-files", "Input", "Read ITSUMO-net from FILE"); -#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_INTERNAL + + oc.doRegister("heightmap.geotiff", new Option_FileName()); + oc.addDescription("heightmap.geotiff", "Input", "Read heightmap from GeoTIFF"); // register basic processing options oc.doRegister("ignore-errors", new Option_Bool(false)); @@ -290,6 +291,11 @@ if (oc.isSet("dlr-navteq-prefix") && oc.isDefault("proj.scale")) { oc.set("proj.scale", toString(NIImporter_DlrNavteq::GEO_SCALE)); } +#else + if ((oc.isSet("osm-files") || oc.isSet("dlr-navteq-prefix") || oc.isSet("shapefile-prefix")) && !oc.getBool("simple-projection")) { + WRITE_ERROR("Cannot import network data without PROJ-Library. Please install packages proj before building sumo"); + ok = false; + } #endif if (oc.isSet("sumo-net-file")) { if (oc.isWriteable("no-turnarounds")) { diff -Nru sumo-0.21.0+dfsg/src/netimport/NIFrame.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIFrame.h --- sumo-0.21.0+dfsg/src/netimport/NIFrame.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIFrame.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIFrame.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIFrame.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for netimport /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_ArcView.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_ArcView.cpp --- sumo-0.21.0+dfsg/src/netimport/NIImporter_ArcView.cpp 2014-04-29 22:02:42.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_ArcView.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Thimor Bohn /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIImporter_ArcView.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: NIImporter_ArcView.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in ArcView-shape format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_ArcView.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_ArcView.h --- sumo-0.21.0+dfsg/src/netimport/NIImporter_ArcView.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_ArcView.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: NIImporter_ArcView.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NIImporter_ArcView.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in ArcView-shape format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_DlrNavteq.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_DlrNavteq.cpp --- sumo-0.21.0+dfsg/src/netimport/NIImporter_DlrNavteq.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_DlrNavteq.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_DlrNavteq.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIImporter_DlrNavteq.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in Elmar's format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_DlrNavteq.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_DlrNavteq.h --- sumo-0.21.0+dfsg/src/netimport/NIImporter_DlrNavteq.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_DlrNavteq.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_DlrNavteq.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NIImporter_DlrNavteq.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in Elmar's format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_ITSUMO.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_ITSUMO.cpp --- sumo-0.21.0+dfsg/src/netimport/NIImporter_ITSUMO.cpp 2014-04-29 22:02:42.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_ITSUMO.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2011-09-16 -/// @version $Id: NIImporter_ITSUMO.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: NIImporter_ITSUMO.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in ITSUMO format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_ITSUMO.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_ITSUMO.h --- sumo-0.21.0+dfsg/src/netimport/NIImporter_ITSUMO.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_ITSUMO.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIImporter_ITSUMO.h /// @author Daniel Krajzewicz /// @date 2011-09-16 -/// @version $Id: NIImporter_ITSUMO.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIImporter_ITSUMO.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in ITSUMO format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_MATSim.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_MATSim.cpp --- sumo-0.21.0+dfsg/src/netimport/NIImporter_MATSim.cpp 2014-04-29 22:02:42.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_MATSim.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 26.04.2011 -/// @version $Id: NIImporter_MATSim.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: NIImporter_MATSim.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in MATSim format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_MATSim.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_MATSim.h --- sumo-0.21.0+dfsg/src/netimport/NIImporter_MATSim.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_MATSim.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Tue, 26.04.2011 -/// @version $Id: NIImporter_MATSim.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIImporter_MATSim.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in MATSim format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_OpenDrive.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_OpenDrive.cpp --- sumo-0.21.0+dfsg/src/netimport/NIImporter_OpenDrive.cpp 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_OpenDrive.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_OpenDrive.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: NIImporter_OpenDrive.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in openDrive format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -90,8 +90,8 @@ { "junction", NIImporter_OpenDrive::OPENDRIVE_TAG_JUNCTION }, { "connection", NIImporter_OpenDrive::OPENDRIVE_TAG_CONNECTION }, { "laneLink", NIImporter_OpenDrive::OPENDRIVE_TAG_LANELINK }, - { "width", NIImporter_OpenDrive::OPENDRIVE_TAG_WIDTH }, - { "speed", NIImporter_OpenDrive::OPENDRIVE_TAG_SPEED }, + { "width", NIImporter_OpenDrive::OPENDRIVE_TAG_WIDTH }, + { "speed", NIImporter_OpenDrive::OPENDRIVE_TAG_SPEED }, { "", NIImporter_OpenDrive::OPENDRIVE_TAG_NOTHING } }; @@ -123,8 +123,8 @@ { "dynamic", NIImporter_OpenDrive::OPENDRIVE_ATTR_DYNAMIC }, { "incomingRoad", NIImporter_OpenDrive::OPENDRIVE_ATTR_INCOMINGROAD }, { "connectingRoad", NIImporter_OpenDrive::OPENDRIVE_ATTR_CONNECTINGROAD }, - { "from", NIImporter_OpenDrive::OPENDRIVE_ATTR_FROM }, - { "to", NIImporter_OpenDrive::OPENDRIVE_ATTR_TO }, + { "from", NIImporter_OpenDrive::OPENDRIVE_ATTR_FROM }, + { "to", NIImporter_OpenDrive::OPENDRIVE_ATTR_TO }, { "max", NIImporter_OpenDrive::OPENDRIVE_ATTR_MAX }, { "sOffset", NIImporter_OpenDrive::OPENDRIVE_ATTR_SOFFSET }, { "name", NIImporter_OpenDrive::OPENDRIVE_ATTR_NAME }, @@ -1086,14 +1086,14 @@ } if (from != UNSET_CONNECTION && to != UNSET_CONNECTION) { if (ret.find(from) != ret.end()) { -// WRITE_WARNING("double connection"); +// WRITE_WARNING("double connection"); } if (dir == OPENDRIVE_TAG_LEFT) { std::swap(from, to); } ret[from] = to; } else { -// WRITE_WARNING("missing connection"); +// WRITE_WARNING("missing connection"); } } return ret; diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_OpenDrive.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_OpenDrive.h --- sumo-0.21.0+dfsg/src/netimport/NIImporter_OpenDrive.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_OpenDrive.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_OpenDrive.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIImporter_OpenDrive.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in openDrive format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_OpenStreetMap.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_OpenStreetMap.cpp --- sumo-0.21.0+dfsg/src/netimport/NIImporter_OpenStreetMap.cpp 2014-05-08 22:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_OpenStreetMap.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_OpenStreetMap.cpp 16330 2014-05-08 14:53:54Z namdre $ +/// @version $Id: NIImporter_OpenStreetMap.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Importer for networks stored in OpenStreetMap format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -137,7 +137,7 @@ // for highways NBTypeCont& tc = nb.getTypeCont(); SUMOReal const WIDTH = NBEdge::UNSPECIFIED_WIDTH; - tc.insert("highway.motorway", 3, (SUMOReal)(160. / 3.6), 13, WIDTH, SVC_IGNORING, true); + tc.insert("highway.motorway", 2, (SUMOReal)(160. / 3.6), 13, WIDTH, SVC_IGNORING, true); tc.insert("highway.motorway_link", 1, (SUMOReal)(80. / 3.6), 12, WIDTH, SVC_IGNORING, true); 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); @@ -411,22 +411,32 @@ SUMOReal sidewalkWidth = NBEdge::UNSPECIFIED_WIDTH; bool defaultIsOneWay = false; SVCPermissions permissions = 0; + bool discard = true; for (std::vector::iterator it = types.begin(); it != types.end(); it++) { - numLanes = MAX2(numLanes, tc.getNumLanes(*it)); - maxSpeed = MAX2(maxSpeed, tc.getSpeed(*it)); - prio = MAX2(prio, tc.getPriority(*it)); - defaultIsOneWay &= tc.getIsOneWay(*it); - permissions |= tc.getPermissions(*it); - width = MAX2(width, tc.getWidth(*it)); - sidewalkWidth = MAX2(sidewalkWidth, tc.getSidewalkWidth(*it)); + if (!tc.getShallBeDiscarded(*it)) { + numLanes = MAX2(numLanes, tc.getNumLanes(*it)); + maxSpeed = MAX2(maxSpeed, tc.getSpeed(*it)); + prio = MAX2(prio, tc.getPriority(*it)); + defaultIsOneWay &= tc.getIsOneWay(*it); + permissions |= tc.getPermissions(*it); + width = MAX2(width, tc.getWidth(*it)); + sidewalkWidth = MAX2(sidewalkWidth, tc.getSidewalkWidth(*it)); + discard = false; + } } if (width != NBEdge::UNSPECIFIED_WIDTH) { width = MAX2(width, SUMO_const_laneWidth); } - WRITE_MESSAGE("Adding new type \"" + type + "\" (first occurence for edge \"" + id + "\")."); - tc.insert(newType, numLanes, maxSpeed, prio, permissions, width, defaultIsOneWay, sidewalkWidth); - myKnownCompoundTypes[type] = newType; - type = newType; + if (discard) { + WRITE_WARNING("Discarding compound type \"" + newType + "\" (first occurence for edge \"" + id + "\")."); + myUnusableTypes.insert(newType); + return newIndex; + } else { + WRITE_MESSAGE("Adding new type \"" + type + "\" (first occurence for edge \"" + id + "\")."); + tc.insert(newType, numLanes, maxSpeed, prio, permissions, width, defaultIsOneWay, sidewalkWidth); + myKnownCompoundTypes[type] = newType; + type = newType; + } } } } @@ -603,15 +613,18 @@ } bool ok = true; std::string key = attrs.get(SUMO_ATTR_K, toString(myLastNodeID).c_str(), ok, false); - std::string value = attrs.get(SUMO_ATTR_V, toString(myLastNodeID).c_str(), ok, false); - if (key == "highway" && value.find("traffic_signal") != std::string::npos) { - myToFill[myLastNodeID]->tlsControlled = true; - } else if (myImportElevation && key == "ele") { - try { - myToFill[myLastNodeID]->ele = TplConvert::_2SUMOReal(value.c_str()); - } catch (...) { - WRITE_WARNING("Value of key '" + key + "' is not numeric ('" + value + "') in node '" + - toString(myLastNodeID) + "'."); + // we check whether the key is relevant (and we really need to transcode the value) to avoid hitting #1636 + if (key == "highway" || key == "ele") { + std::string value = attrs.get(SUMO_ATTR_V, toString(myLastNodeID).c_str(), ok, false); + if (key == "highway" && value.find("traffic_signal") != std::string::npos) { + myToFill[myLastNodeID]->tlsControlled = true; + } else if (myImportElevation && key == "ele") { + try { + myToFill[myLastNodeID]->ele = TplConvert::_2SUMOReal(value.c_str()); + } catch (...) { + WRITE_WARNING("Value of key '" + key + "' is not numeric ('" + value + "') in node '" + + toString(myLastNodeID) + "'."); + } } } } @@ -696,15 +709,20 @@ } bool ok = true; std::string key = attrs.get(SUMO_ATTR_K, toString(myCurrentEdge->id).c_str(), ok, false); + // we check whether the key is relevant (and we really need to transcode the value) to avoid hitting #1636 + if (!StringUtils::endsWith(key, "way") && !StringUtils::startsWith(key, "lanes") && key != "maxspeed" && key != "junction" && key != "name" && key != "tracks") { + return; + } std::string value = attrs.get(SUMO_ATTR_V, toString(myCurrentEdge->id).c_str(), ok, false); - if (key == "highway" || key == "railway") { + if (key == "highway" || key == "railway" || key == "waterway") { + const std::string singleTypeID = key + "." + value; if (myCurrentEdge->myHighWayType != "") { // osm-ways may be used by more than one mode (eg railway.tram + highway.residential. this is relevant for multimodal traffic) // we create a new type for this kind of situation which must then be resolved in insertEdge() - myCurrentEdge->myHighWayType = myCurrentEdge->myHighWayType + compoundTypeSeparator + key + "." + value; + myCurrentEdge->myHighWayType = myCurrentEdge->myHighWayType + compoundTypeSeparator + singleTypeID; } else { - myCurrentEdge->myHighWayType = key + "." + value; + myCurrentEdge->myHighWayType = singleTypeID; } myCurrentEdge->myCurrentIsRoad = true; } else if (key == "lanes") { @@ -874,21 +892,25 @@ if (element == SUMO_TAG_TAG) { bool ok = true; std::string key = attrs.get(SUMO_ATTR_K, toString(myCurrentRelation).c_str(), ok, false); - std::string value = attrs.get(SUMO_ATTR_V, toString(myCurrentRelation).c_str(), ok, false); - - if (key == "type" && value == "restriction") { - myIsRestriction = true; - return; - } - if (key == "restriction") { - if (value.substr(0, 5) == "only_") { - myRestrictionType = RESTRICTION_ONLY; - } else if (value.substr(0, 3) == "no_") { - myRestrictionType = RESTRICTION_NO; - } else { - WRITE_WARNING("Found unknown restriction type '" + value + "' in relation '" + toString(myCurrentRelation) + "'"); + // we check whether the key is relevant (and we really need to transcode the value) to avoid hitting #1636 + if (key == "type" || key == "restriction") { + std::string value = attrs.get(SUMO_ATTR_V, toString(myCurrentRelation).c_str(), ok, false); + if (key == "type" && value == "restriction") { + myIsRestriction = true; + return; + } + if (key == "restriction") { + // @note: the 'right/left/straight' part is ignored since the information is + // redundantly encoded in the 'from', 'to' and 'via' members + if (value.substr(0, 5) == "only_") { + myRestrictionType = RESTRICTION_ONLY; + } else if (value.substr(0, 3) == "no_") { + myRestrictionType = RESTRICTION_NO; + } else { + WRITE_WARNING("Found unknown restriction type '" + value + "' in relation '" + toString(myCurrentRelation) + "'"); + } + return; } - return; } } } diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_OpenStreetMap.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_OpenStreetMap.h --- sumo-0.21.0+dfsg/src/netimport/NIImporter_OpenStreetMap.h 2014-06-02 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_OpenStreetMap.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_OpenStreetMap.h 16447 2014-06-02 09:02:56Z behrisch $ +/// @version $Id: NIImporter_OpenStreetMap.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in OpenStreetMap format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -95,6 +95,11 @@ bool tlsControlled; /// @brief the NBNode that was instantiated NBNode* node; + + private: + /// invalidated assignment operator + NIOSMNode& operator=(const NIOSMNode& s); + }; @@ -107,7 +112,7 @@ myCurrentIsRoad(false) {} /// @brief The edge's id - SUMOLong id; + const SUMOLong id; /// @brief The edge's street name std::string streetName; /// @brief number of lanes, or -1 if unknown @@ -124,6 +129,11 @@ std::vector myCurrentNodes; /// @brief Information whether this is a road bool myCurrentIsRoad; + + private: + /// invalidated assignment operator + Edge& operator=(const Edge& s); + }; diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_RobocupRescue.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_RobocupRescue.cpp --- sumo-0.21.0+dfsg/src/netimport/NIImporter_RobocupRescue.cpp 2014-04-29 22:02:42.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_RobocupRescue.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_RobocupRescue.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: NIImporter_RobocupRescue.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in robocup rescue league format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_RobocupRescue.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_RobocupRescue.h --- sumo-0.21.0+dfsg/src/netimport/NIImporter_RobocupRescue.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_RobocupRescue.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_RobocupRescue.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIImporter_RobocupRescue.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in robocup rescue league format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_SUMO.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_SUMO.cpp --- sumo-0.21.0+dfsg/src/netimport/NIImporter_SUMO.cpp 2014-05-07 22:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_SUMO.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_SUMO.cpp 16304 2014-05-07 07:09:29Z namdre $ +/// @version $Id: NIImporter_SUMO.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in SUMO format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -50,6 +50,7 @@ #include #include #include "NILoader.h" +#include "NIXMLEdgesHandler.h" #include "NIImporter_SUMO.h" #ifdef CHECK_MEMORY_LEAKS @@ -186,7 +187,7 @@ true, c.mayDefinitelyPass); // maybe we have a tls-controlled connection - if (c.tlID != "") { + if (c.tlID != "" && myRailSignals.count(c.tlID) == 0) { const std::map& programs = myTLLCont.getPrograms(c.tlID); if (programs.size() > 0) { std::map::const_iterator it; @@ -245,11 +246,30 @@ EdgeVector edges; for (std::vector::const_iterator it_e = crossing.crossingEdges.begin(); it_e != crossing.crossingEdges.end(); ++it_e) { NBEdge* edge = myNetBuilder.getEdgeCont().retrieve(*it_e); - assert(edge != 0); - edges.push_back(edge); + // edge might have been removed due to options + if (edge != 0) { + edges.push_back(edge); + } + } + if (edges.size() > 0) { + node->addCrossing(edges, crossing.width, crossing.priority); + } + } + } + // add roundabouts + for (std::vector >::const_iterator it = myRoundabouts.begin(); it != myRoundabouts.end(); ++it) { + EdgeSet roundabout; + for (std::vector::const_iterator it_r = it->begin(); it_r != it->end(); ++it_r) { + NBEdge* edge = myNetBuilder.getEdgeCont().retrieve(*it_r); + if (edge == 0) { + if (!myNetBuilder.getEdgeCont().wasIgnored(*it_r)) { + WRITE_ERROR("Unknown edge '" + (*it_r) + "' in roundabout"); + } + } else { + roundabout.insert(edge); } - node->addCrossing(edges, crossing.width, crossing.priority); } + myNetBuilder.getEdgeCont().addRoundabout(roundabout); } } @@ -301,7 +321,7 @@ addProhibition(attrs); break; case SUMO_TAG_ROUNDABOUT: - myNetBuilder.haveSeenRoundabouts(); + addRoundabout(attrs); break; default: break; @@ -416,6 +436,10 @@ WRITE_ERROR("Found lane '" + id + "' not within edge element"); return; } + if (attrs.getOpt(SUMO_ATTR_CUSTOMSHAPE, 0, ok, false)) { + const std::string nodeID = NBNode::getNodeIDFromInternalLane(id); + myCustomShapeMaps[nodeID][id] = attrs.get(SUMO_ATTR_SHAPE, id.c_str(), ok); + } myCurrentLane = new LaneAttrs; if (myCurrentEdge->func == EDGEFUNC_CROSSING) { // save the width and the lane id of the crossing but don't do anything else @@ -453,6 +477,8 @@ NIImporter_SUMO::addJunction(const SUMOSAXAttributes& attrs) { // get the id, report an error if not given or empty... myCurrentJunction.node = 0; + myCurrentJunction.intLanes.clear(); + myCurrentJunction.response.clear(); bool ok = true; std::string id = attrs.get(SUMO_ATTR_ID, 0, ok); if (!ok) { @@ -481,6 +507,23 @@ } myCurrentJunction.node = node; SUMOSAXAttributes::parseStringVector(attrs.get(SUMO_ATTR_INTLANES, 0, ok, false), myCurrentJunction.intLanes); + // set optional radius + if (attrs.hasAttribute(SUMO_ATTR_RADIUS)) { + node->setRadius(attrs.get(SUMO_ATTR_RADIUS, id.c_str(), ok)); + } + // handle custom shape + if (attrs.getOpt(SUMO_ATTR_CUSTOMSHAPE, 0, ok, false)) { + node->setCustomShape(attrs.get(SUMO_ATTR_SHAPE, id.c_str(), ok)); + } + if (myCustomShapeMaps.count(id) > 0) { + NBNode::CustomShapeMap customShapes = myCustomShapeMaps[id]; + for (NBNode::CustomShapeMap::const_iterator it = customShapes.begin(); it != customShapes.end(); ++it) { + node->setCustomLaneShape(it->first, it->second); + } + } + if (type == NODETYPE_RAIL_SIGNAL) { + myRailSignals.insert(id); + } } @@ -718,4 +761,16 @@ ok = false; } } + + +void +NIImporter_SUMO::addRoundabout(const SUMOSAXAttributes& attrs) { + if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { + myRoundabouts.push_back(attrs.getStringVector(SUMO_ATTR_EDGES)); + } else { + WRITE_ERROR("Empty edges in roundabout."); + } +} + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_SUMO.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_SUMO.h --- sumo-0.21.0+dfsg/src/netimport/NIImporter_SUMO.h 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_SUMO.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 14.04.2008 -/// @version $Id: NIImporter_SUMO.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: NIImporter_SUMO.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in SUMO format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -164,6 +164,11 @@ */ void addProhibition(const SUMOSAXAttributes& attrs); + /** @brief Parses a roundabout and stores it in myEdgeCont. + * @param[in] attrs The attributes to get the roundabouts values from + */ + void addRoundabout(const SUMOSAXAttributes& attrs); + //@} @@ -272,7 +277,6 @@ std::vector response; }; - /// @brief Loaded edge definitions std::map myEdges; @@ -309,6 +313,15 @@ /// @brief whether the loaded network contains internal lanes bool myHaveSeenInternalEdge; + /// @brief loaded roundabout edges + std::vector > myRoundabouts; + + /// @brief customLaneShape (cannot be added to the NBNode when parsed since the node doesn't yet exist + std::map myCustomShapeMaps; + + /// @brief list of node id with rail signals (no NBTrafficLightDefinition exists) + std::set myRailSignals; + /** @brief Parses lane index from lane ID an retrieve lane from EdgeAttrs * @param[in] edge The EdgeAttrs* which should contain the lane * @param[in] lane_id The ID of the lane diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_VISUM.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_VISUM.cpp --- sumo-0.21.0+dfsg/src/netimport/NIImporter_VISUM.cpp 2014-06-04 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_VISUM.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Fri, 19 Jul 2002 -/// @version $Id: NIImporter_VISUM.cpp 16516 2014-06-04 10:41:11Z namdre $ +/// @version $Id: NIImporter_VISUM.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A VISUM network importer /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIImporter_VISUM.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_VISUM.h --- sumo-0.21.0+dfsg/src/netimport/NIImporter_VISUM.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIImporter_VISUM.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 19 Jul 2002 -/// @version $Id: NIImporter_VISUM.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIImporter_VISUM.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A VISUM network importer /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NILoader.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NILoader.cpp --- sumo-0.21.0+dfsg/src/netimport/NILoader.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NILoader.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NILoader.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NILoader.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Perfoms network import /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -64,10 +64,7 @@ #include "NILoader.h" #include #include - -#ifdef HAVE_INTERNAL -#include -#endif +#include #ifdef CHECK_MEMORY_LEAKS #include @@ -91,9 +88,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_INTERNAL - HeightMapper::loadIfSet(oc); -#endif + NBHeightMapper::loadIfSet(oc); // try to load using different methods NIImporter_SUMO::loadNetwork(oc, myNetBuilder); NIImporter_RobocupRescue::loadNetwork(oc, myNetBuilder); @@ -161,7 +156,7 @@ WRITE_WARNING("Deprecated vehicle class(es) '" + toString(deprecatedVehicleClassesSeen) + "' in input edge files."); } // load the connections - loadXMLType(new NIXMLConnectionsHandler(myNetBuilder.getEdgeCont(), myNetBuilder.getTLLogicCont()), + loadXMLType(new NIXMLConnectionsHandler(myNetBuilder.getEdgeCont(), myNetBuilder.getNodeCont(), myNetBuilder.getTLLogicCont()), oc.getStringVector("connection-files"), "connections"); // load traffic lights (needs to come last, references loaded edges and connections) loadXMLType(new NIXMLTrafficLightsHandler( diff -Nru sumo-0.21.0+dfsg/src/netimport/NILoader.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NILoader.h --- sumo-0.21.0+dfsg/src/netimport/NILoader.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NILoader.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NILoader.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NILoader.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Perfoms network import /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NINavTeqHelper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NINavTeqHelper.cpp --- sumo-0.21.0+dfsg/src/netimport/NINavTeqHelper.cpp 2014-04-11 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NINavTeqHelper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Jul 2006 -/// @version $Id: NINavTeqHelper.cpp 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: NINavTeqHelper.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Some parser methods shared around several formats containing NavTeq-Nets /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NINavTeqHelper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NINavTeqHelper.h --- sumo-0.21.0+dfsg/src/netimport/NINavTeqHelper.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NINavTeqHelper.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Jul 2006 -/// @version $Id: NINavTeqHelper.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NINavTeqHelper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some parser methods shared around several formats containing NavTeq-Nets /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIVisumTL.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIVisumTL.cpp --- sumo-0.21.0+dfsg/src/netimport/NIVisumTL.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIVisumTL.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thr, 08 May 2003 -/// @version $Id: NIVisumTL.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NIVisumTL.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Intermediate class for storing visum traffic lights during their import /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIVisumTL.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIVisumTL.h --- sumo-0.21.0+dfsg/src/netimport/NIVisumTL.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIVisumTL.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVisumTL.h /// @author Daniel Krajzewicz /// @date Wed, 07 May 2003 -/// @version $Id: NIVisumTL.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVisumTL.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Intermediate class for storing visum traffic lights during their import /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIXMLConnectionsHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLConnectionsHandler.cpp --- sumo-0.21.0+dfsg/src/netimport/NIXMLConnectionsHandler.cpp 2014-06-05 22:02:18.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLConnectionsHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Thu, 17 Oct 2002 -/// @version $Id: NIXMLConnectionsHandler.cpp 16530 2014-06-05 09:13:58Z namdre $ +/// @version $Id: NIXMLConnectionsHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for edge connections stored in XML /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -40,6 +40,7 @@ #include "NIXMLConnectionsHandler.h" #include #include +#include #include #include #include @@ -59,9 +60,10 @@ // =========================================================================== // method definitions // =========================================================================== -NIXMLConnectionsHandler::NIXMLConnectionsHandler(NBEdgeCont& ec, NBTrafficLightLogicCont& tlc) : +NIXMLConnectionsHandler::NIXMLConnectionsHandler(NBEdgeCont& ec, NBNodeCont& nc, NBTrafficLightLogicCont& tlc) : SUMOSAXHandler("xml-connection-description"), myEdgeCont(ec), + myNodeCont(nc), myTLLogicCont(tlc), myHaveWarnedAboutDeprecatedLanes(false), myErrorMsgHandler(OptionsCont::getOptions().getBool("ignore-errors.connections") ? @@ -164,6 +166,9 @@ if (element == SUMO_TAG_CROSSING) { addCrossing(attrs); } + if (element == SUMO_TAG_CUSTOMSHAPE) { + addCustomShape(attrs); + } } @@ -237,16 +242,13 @@ } if (!from->addLane2LaneConnection(fromLane, to, toLane, NBEdge::L2L_USER, true, mayDefinitelyPass)) { NBEdge* nFrom = from; - do { - if (nFrom->getToNode()->getOutgoingEdges().size() != 1) { - break; - } + while (nFrom->getToNode()->getOutgoingEdges().size() == 1) { NBEdge* t = nFrom->getToNode()->getOutgoingEdges()[0]; if (t->getID().substr(0, t->getID().find('/')) != nFrom->getID().substr(0, nFrom->getID().find('/'))) { break; } nFrom = t; - } while (true); + } if (nFrom == 0 || !nFrom->addLane2LaneConnection(fromLane, to, toLane, NBEdge::L2L_USER, false, mayDefinitelyPass)) { if (OptionsCont::getOptions().getBool("show-errors.connections-first-try")) { WRITE_WARNING("Could not set loaded connection from '" + from->getLaneID(fromLane) + "' to '" + to->getLaneID(toLane) + "'."); @@ -361,6 +363,24 @@ } +void +NIXMLConnectionsHandler::addCustomShape(const SUMOSAXAttributes& attrs) { + bool ok = true; + const std::string id = attrs.get(SUMO_ATTR_ID, 0, ok); + const PositionVector shape = attrs.get(SUMO_ATTR_SHAPE, id.c_str(), ok); + if (!ok) { + return; + } + const std::string nodeID = NBNode::getNodeIDFromInternalLane(id); + NBNode* node = myNodeCont.retrieve(nodeID); + if (node == 0) { + WRITE_ERROR("Node '" + nodeID + "' in customShape is not known."); + return; + } + node->setCustomLaneShape(id, shape); +} + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/netimport/NIXMLConnectionsHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLConnectionsHandler.h --- sumo-0.21.0+dfsg/src/netimport/NIXMLConnectionsHandler.h 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLConnectionsHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLConnectionsHandler.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: NIXMLConnectionsHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for edge connections stored in XML /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,6 +41,7 @@ // =========================================================================== class NBEdge; class NBEdgeCont; +class NBNodeCont; class NBTrafficLightLogicCont; class MsgHandler; @@ -60,7 +61,7 @@ /** @brief Constructor * @param[in] ec The edge container which includes the edges to change connections of */ - NIXMLConnectionsHandler(NBEdgeCont& ec, NBTrafficLightLogicCont& tlc); + NIXMLConnectionsHandler(NBEdgeCont& ec, NBNodeCont& nc, NBTrafficLightLogicCont& tlc); /// @brief Destructor @@ -137,10 +138,18 @@ */ void addCrossing(const SUMOSAXAttributes& attrs); + /** @brief Parses a customShape and updates the referenced node + * @param[in] attrs The attributes to get the customShapes's values from + */ + void addCustomShape(const SUMOSAXAttributes& attrs); + private: /// @brief The edge container to fill NBEdgeCont& myEdgeCont; + /// @brief The edge container to fill + NBNodeCont& myNodeCont; + /** @brief The traffic lights container to add built tls to (when * invalidating tls) */ NBTrafficLightLogicCont& myTLLogicCont; diff -Nru sumo-0.21.0+dfsg/src/netimport/NIXMLEdgesHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLEdgesHandler.cpp --- sumo-0.21.0+dfsg/src/netimport/NIXMLEdgesHandler.cpp 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLEdgesHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Walter Bamberger /// @author Laura Bieker /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLEdgesHandler.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: NIXMLEdgesHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for network edges stored in XML /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -105,6 +105,9 @@ case SUMO_TAG_DELETE: deleteEdge(attrs); break; + case SUMO_TAG_ROUNDABOUT: + addRoundabout(attrs); + break; default: break; } @@ -126,18 +129,27 @@ myCurrentEdge = myEdgeCont.retrieve(myCurrentID); // check deprecated (unused) attributes // use default values, first - myCurrentSpeed = myTypeCont.getSpeed(""); myCurrentPriority = myTypeCont.getPriority(""); myCurrentLaneNo = myTypeCont.getNumLanes(""); - myPermissions = myTypeCont.getPermissions(""); - myCurrentWidth = myTypeCont.getWidth(""); myCurrentEndOffset = NBEdge::UNSPECIFIED_OFFSET; + if (myCurrentEdge != 0) { + // update existing edge. only update lane-specific settings when explicitly requested + myCurrentSpeed = NBEdge::UNSPECIFIED_SPEED; + myPermissions = SVC_UNSPECIFIED; + myCurrentWidth = NBEdge::UNSPECIFIED_WIDTH; + } else { + // this is a completely new edge. get the type specific defaults + myCurrentSpeed = myTypeCont.getSpeed(""); + myPermissions = myTypeCont.getPermissions(""); + myCurrentWidth = myTypeCont.getWidth(""); + } myCurrentType = ""; myShape = PositionVector(); myLanesSpread = LANESPREAD_RIGHT; myLength = NBEdge::UNSPECIFIED_LOADED_LENGTH; myCurrentStreetName = ""; myReinitKeepEdgeShape = false; + mySidewalkWidth = NBEdge::UNSPECIFIED_WIDTH; // check whether a type's values shall be used if (attrs.hasAttribute(SUMO_ATTR_TYPE)) { myCurrentType = attrs.get(SUMO_ATTR_TYPE, myCurrentID.c_str(), ok); @@ -153,6 +165,7 @@ myCurrentLaneNo = myTypeCont.getNumLanes(myCurrentType); myPermissions = myTypeCont.getPermissions(myCurrentType); myCurrentWidth = myTypeCont.getWidth(myCurrentType); + mySidewalkWidth = myTypeCont.getSidewalkWidth(myCurrentType); } // use values from the edge to overwrite if existing, then if (myCurrentEdge != 0) { @@ -166,17 +179,13 @@ myCurrentEdge = 0; return; } - myCurrentSpeed = myCurrentEdge->getSpeed(); myCurrentPriority = myCurrentEdge->getPriority(); myCurrentLaneNo = myCurrentEdge->getNumLanes(); myCurrentType = myCurrentEdge->getTypeID(); - myPermissions = myCurrentEdge->getPermissions(); if (!myCurrentEdge->hasDefaultGeometry()) { myShape = myCurrentEdge->getGeometry(); myReinitKeepEdgeShape = true; } - myCurrentWidth = myCurrentEdge->getLaneWidth(); - myCurrentEndOffset = myCurrentEdge->getEndOffset(); myLanesSpread = myCurrentEdge->getLaneSpreadFunction(); if (myCurrentEdge->hasLoadedLength()) { myLength = myCurrentEdge->getLoadedLength(); @@ -188,7 +197,7 @@ if (attrs.hasAttribute(SUMO_ATTR_SPEED)) { myCurrentSpeed = attrs.get(SUMO_ATTR_SPEED, myCurrentID.c_str(), ok); } - if (myOptions.getBool("speed-in-kmh")) { + if (myOptions.getBool("speed-in-kmh") && myCurrentSpeed != NBEdge::UNSPECIFIED_SPEED) { myCurrentSpeed = myCurrentSpeed / (SUMOReal) 3.6; } // try to get the number of lanes @@ -203,7 +212,7 @@ if (attrs.hasAttribute(SUMO_ATTR_WIDTH)) { myCurrentWidth = attrs.get(SUMO_ATTR_WIDTH, myCurrentID.c_str(), ok); } - // try to get the width + // try to get the offset of the stop line from the intersection if (attrs.hasAttribute(SUMO_ATTR_ENDOFFSET)) { myCurrentEndOffset = attrs.get(SUMO_ATTR_ENDOFFSET, myCurrentID.c_str(), ok); } @@ -233,6 +242,8 @@ myLanesSpread = tryGetLaneSpread(attrs); // try to get the length myLength = attrs.getOpt(SUMO_ATTR_LENGTH, myCurrentID.c_str(), ok, myLength); + // tro to get the sidewalkWidth + mySidewalkWidth = attrs.getOpt(SUMO_ATTR_SIDEWALKWIDTH, myCurrentID.c_str(), ok, mySidewalkWidth); // insert the parsed edge into the edges map if (!ok) { return; @@ -258,10 +269,8 @@ } } myCurrentEdge->setLoadedLength(myLength); - myCurrentEdge->setPermissions(myPermissions); - if (myTypeCont.getSidewalkWidth(myCurrentType) != NBEdge::UNSPECIFIED_WIDTH) { - // lane specifications may override this - myCurrentEdge->addSidewalk(myTypeCont.getSidewalkWidth(myCurrentType)); + if (myPermissions != SVC_UNSPECIFIED) { + myCurrentEdge->setPermissions(myPermissions); } } @@ -317,7 +326,9 @@ void NIXMLEdgesHandler::addSplit(const SUMOSAXAttributes& attrs) { if (myCurrentEdge == 0) { - WRITE_WARNING("Ignoring 'split' because it cannot be assigned to an edge"); + if (!OptionsCont::getOptions().isInStringVector("remove-edges.explicit", myCurrentID)) { + WRITE_WARNING("Ignoring 'split' because it cannot be assigned to an edge"); + } return; } bool ok = true; @@ -334,12 +345,6 @@ return; } e.nameid = (int)e.pos; - if (myCurrentEdge == 0) { - if (!OptionsCont::getOptions().isInStringVector("remove-edges.explicit", myCurrentID)) { - WRITE_ERROR("Additional lane information could not be set - the edge with id '" + myCurrentID + "' is not known."); - } - return; - } if (e.pos < 0) { e.pos += myCurrentEdge->getGeometry().length(); } @@ -360,6 +365,13 @@ e.lanes.push_back((int) l); } } + e.speed = attrs.getOpt(SUMO_ATTR_SPEED, 0, ok, myCurrentEdge->getSpeed()); + if (attrs.hasAttribute(SUMO_ATTR_SPEED) && myOptions.getBool("speed-in-kmh")) { + e.speed /= (SUMOReal) 3.6; + } + if (!ok) { + return; + } mySplits.push_back(e); } } @@ -461,6 +473,10 @@ void NIXMLEdgesHandler::myEndElement(int element) { if (element == SUMO_TAG_EDGE && myCurrentEdge != 0) { + // add sidewalk, wait until lanes are loaded to avoid building if it already exists + if (mySidewalkWidth != NBEdge::UNSPECIFIED_WIDTH) { + myCurrentEdge->addSidewalk(mySidewalkWidth); + } if (!myIsUpdate) { try { if (!myEdgeCont.insert(myCurrentEdge)) { @@ -485,16 +501,20 @@ sort((*i).lanes.begin(), (*i).lanes.end()); noLanesMax = MAX2(noLanesMax, (unsigned int)(*i).lanes.size()); } - // invalidate traffic light definitions loaded from a SUMO network - // XXX it would be preferable to reconstruct the phase definitions heuristically - e->getToNode()->invalidateTLS(myTLLogicCont); - e->invalidateConnections(true); - // split the edge std::vector currLanes; for (unsigned int l = 0; l < e->getNumLanes(); ++l) { currLanes.push_back(l); } + if (e->getNumLanes() != mySplits.back().lanes.size()) { + // invalidate traffic light definitions loaded from a SUMO network + // XXX it would be preferable to reconstruct the phase definitions heuristically + e->getToNode()->invalidateTLS(myTLLogicCont); + // if the number of lanes changes the connections should be + // recomputed + e->invalidateConnections(true); + } + std::string edgeid = e->getID(); SUMOReal seen = 0; for (i = mySplits.begin(); i != mySplits.end(); ++i) { @@ -508,7 +528,7 @@ std::string nid = myCurrentID + "." + toString(exp.nameid); std::string pid = e->getID(); myEdgeCont.splitAt(myDistrictCont, e, exp.pos - seen, rn, - pid, nid, e->getNumLanes(), (unsigned int) exp.lanes.size()); + pid, nid, e->getNumLanes(), (unsigned int) exp.lanes.size(), exp.speed); seen = exp.pos; std::vector newLanes = exp.lanes; NBEdge* pe = myEdgeCont.retrieve(pid); @@ -559,10 +579,16 @@ } // patch lane offsets e = myEdgeCont.retrieve(edgeid); - i = mySplits.begin(); - if ((*i).pos != 0) { - e = e->getToNode()->getOutgoingEdges()[0]; + if (mySplits.front().pos != 0) { + // add a dummy split at the beginning to ensure correct offset + Split start; + start.pos = 0; + for (int lane = 0; lane < (int)e->getNumLanes(); ++lane) { + start.lanes.push_back(lane); + } + mySplits.insert(mySplits.begin(), start); } + i = mySplits.begin(); for (; i != mySplits.end(); ++i) { unsigned int maxLeft = (*i).lanes.back(); SUMOReal offset = 0; @@ -590,5 +616,29 @@ } } + +void +NIXMLEdgesHandler::addRoundabout(const SUMOSAXAttributes& attrs) { + if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { + std::vector edgeIDs = attrs.getStringVector(SUMO_ATTR_EDGES); + EdgeSet roundabout; + for (std::vector::iterator it = edgeIDs.begin(); it != edgeIDs.end(); ++it) { + NBEdge* edge = myEdgeCont.retrieve(*it); + if (edge == 0) { + if (!myEdgeCont.wasIgnored(*it)) { + WRITE_ERROR("Unknown edge '" + (*it) + "' in roundabout"); + } + } else { + roundabout.insert(edge); + } + } + myEdgeCont.addRoundabout(roundabout); + } else { + WRITE_ERROR("Empty edges in roundabout."); + } +} + + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/netimport/NIXMLEdgesHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLEdgesHandler.h --- sumo-0.21.0+dfsg/src/netimport/NIXMLEdgesHandler.h 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLEdgesHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLEdgesHandler.h 16286 2014-05-05 07:14:06Z namdre $ +/// @version $Id: NIXMLEdgesHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for network edges stored in XML /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -86,7 +86,6 @@ /// @brief Destructor ~NIXMLEdgesHandler(); - protected: /// @name inherited from GenericSAXHandler //@{ @@ -188,6 +187,9 @@ /// @brief Whether the edge shape shall be kept at reinitilization bool myReinitKeepEdgeShape; + /// @brief The width of the sidewalk that shall be added to the current edge + SUMOReal mySidewalkWidth; + /// @} @@ -220,13 +222,15 @@ NBEdge* myCurrentEdge; /** @struct Split - * @brief A structure which describes changes of lane number along the road + * @brief A structure which describes changes of lane number or speed along the road */ struct Split { - /// @brief The lanes until this change + /// @brief The lanes after this change std::vector lanes; /// @brief The position of this change SUMOReal pos; + /// @brief The speed after this change + SUMOReal speed; /// @brief A numerical id int nameid; /// @brief A 2D-position (for the node to insert at this place) @@ -306,6 +310,12 @@ */ void addSplit(const SUMOSAXAttributes& attrs); + /** @brief Parses a roundabout and stores it in myEdgeCont. + * @param[in] attrs The attributes to get the roundabouts values from + */ + void addRoundabout(const SUMOSAXAttributes& attrs); + + private: /** @brief invalid copy constructor */ NIXMLEdgesHandler(const NIXMLEdgesHandler& s); diff -Nru sumo-0.21.0+dfsg/src/netimport/NIXMLNodesHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLNodesHandler.cpp --- sumo-0.21.0+dfsg/src/netimport/NIXMLNodesHandler.cpp 2014-05-22 22:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLNodesHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLNodesHandler.cpp 16414 2014-05-22 14:12:38Z namdre $ +/// @version $Id: NIXMLNodesHandler.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Importer for network nodes stored in XML /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -118,6 +118,8 @@ myPosition = node->getPosition(); xOk = yOk = true; needConversion = false; + } else { + myPosition.set(0, 0, 0); // better to reset than to reuse the previous (z)-value } if (attrs.hasAttribute(SUMO_ATTR_X)) { myPosition.set(attrs.get(SUMO_ATTR_X, myID.c_str(), ok), myPosition.y()); @@ -189,6 +191,10 @@ } node->setCustomShape(shape); } + // set optional radius + if (attrs.hasAttribute(SUMO_ATTR_RADIUS)) { + node->setRadius(attrs.get(SUMO_ATTR_RADIUS, myID.c_str(), ok)); + } } diff -Nru sumo-0.21.0+dfsg/src/netimport/NIXMLNodesHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLNodesHandler.h --- sumo-0.21.0+dfsg/src/netimport/NIXMLNodesHandler.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLNodesHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLNodesHandler.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIXMLNodesHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for network nodes stored in XML /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIXMLTrafficLightsHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLTrafficLightsHandler.cpp --- sumo-0.21.0+dfsg/src/netimport/NIXMLTrafficLightsHandler.cpp 2014-04-24 22:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLTrafficLightsHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2011-10-05 -/// @version $Id: NIXMLTrafficLightsHandler.cpp 16238 2014-04-24 09:03:46Z namdre $ +/// @version $Id: NIXMLTrafficLightsHandler.cpp 18169 2015-03-27 13:40:16Z behrisch $ /// // Importer for traffic lights stored in XML /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -109,10 +109,6 @@ if (!myCurrentTL) { WRITE_ERROR("Unmatched closing tag for tlLogic."); } else { - if (!myTLLCont.insert(myCurrentTL)) { - WRITE_MESSAGE("Updating program '" + myCurrentTL->getProgramID() + - "' for traffic light '" + myCurrentTL->getID() + "'"); - } myCurrentTL = 0; } break; @@ -146,37 +142,64 @@ // simply retrieve the loaded definitions and update them // 2) the tll.xml is loaded to define new traffic lights // nod.xml will have triggered building of NBOwnTLDef. Replace it with NBLoadedSUMOTLDef + // 3) the tll.xml is loaded to define new programs for a defined traffic light + // there should be a definition with the same id but different programID + const std::map& programs = myTLLCont.getPrograms(id); + if (programs.size() == 0) { + WRITE_ERROR("Cannot load traffic light program for unknown id '" + id + "', programID '" + programID + "'."); + return 0; + } + const std::string existingProgram = programs.begin()->first; // arbitrary for our purpose NBLoadedSUMOTLDef* loadedDef = dynamic_cast(myTLLCont.getDefinition(id, programID)); if (loadedDef == 0) { - // case 2 - NBTrafficLightDefinition* newDef = dynamic_cast(myTLLCont.getDefinition( - id, NBTrafficLightDefinition::DefaultProgramID)); - if (newDef == 0) { - // the default program may have already been replaced with a loaded program - newDef = dynamic_cast(myTLLCont.getDefinition( - id, NBTrafficLightDefinition::DefaultProgramID)); + NBLoadedSUMOTLDef* oldDef = dynamic_cast(myTLLCont.getDefinition(id, existingProgram)); + if (oldDef == 0) { + // case 2 + NBTrafficLightDefinition* newDef = dynamic_cast(myTLLCont.getDefinition( + id, NBTrafficLightDefinition::DefaultProgramID)); if (newDef == 0) { - WRITE_ERROR("Cannot load traffic light program for unknown id '" + id + "', programID '" + programID + "'."); - return 0; + // the default program may have already been replaced with a loaded program + newDef = dynamic_cast(myTLLCont.getDefinition( + id, NBTrafficLightDefinition::DefaultProgramID)); + if (newDef == 0) { + WRITE_ERROR("Cannot load traffic light program for unknown id '" + id + "', programID '" + programID + "'."); + return 0; + } } - } - assert(newDef != 0); - loadedDef = new NBLoadedSUMOTLDef(id, programID, offset, type); - // copy nodes and controlled inner edges - std::vector nodes = newDef->getNodes(); - for (std::vector::iterator it = nodes.begin(); it != nodes.end(); it++) { - loadedDef->addNode(*it); - } - loadedDef->addControlledInnerEdges(newDef->getControlledInnerEdges()); - if (programID == NBTrafficLightDefinition::DefaultProgramID) { - // replace default Program + assert(newDef != 0); + loadedDef = new NBLoadedSUMOTLDef(id, programID, offset, type); + // copy nodes and controlled inner edges std::vector nodes = newDef->getNodes(); for (std::vector::iterator it = nodes.begin(); it != nodes.end(); it++) { - (*it)->removeTrafficLight(newDef); + loadedDef->addNode(*it); } - myTLLCont.removeProgram(id, NBTrafficLightDefinition::DefaultProgramID); + loadedDef->addControlledInnerEdges(newDef->getControlledInnerEdges()); + if (programID == NBTrafficLightDefinition::DefaultProgramID) { + // replace default Program + std::vector nodes = newDef->getNodes(); + for (std::vector::iterator it = nodes.begin(); it != nodes.end(); it++) { + (*it)->removeTrafficLight(newDef); + } + myTLLCont.removeProgram(id, NBTrafficLightDefinition::DefaultProgramID); + } + myTLLCont.insert(loadedDef); + } else { + // case 3 + NBTrafficLightLogic* oldLogic = oldDef->getLogic(); + NBTrafficLightLogic* newLogic = new NBTrafficLightLogic(id, programID, + oldLogic->getNumLinks(), offset, type); + loadedDef = new NBLoadedSUMOTLDef(oldDef, newLogic); + // copy nodes + std::vector nodes = oldDef->getNodes(); + for (std::vector::iterator it = nodes.begin(); it != nodes.end(); it++) { + loadedDef->addNode(*it); + } + myTLLCont.insert(loadedDef); } - myTLLCont.insert(loadedDef); + } else { + // case 1 + loadedDef->setOffset(offset); + loadedDef->setType(type); } if (ok) { myResetPhases = true; diff -Nru sumo-0.21.0+dfsg/src/netimport/NIXMLTrafficLightsHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLTrafficLightsHandler.h --- sumo-0.21.0+dfsg/src/netimport/NIXMLTrafficLightsHandler.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLTrafficLightsHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIXMLTrafficLightsHandler.h /// @author Jakob Erdmann /// @date 2011-10-05 -/// @version $Id: NIXMLTrafficLightsHandler.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIXMLTrafficLightsHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for traffic lights stored in XML /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIXMLTypesHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLTypesHandler.cpp --- sumo-0.21.0+dfsg/src/netimport/NIXMLTypesHandler.cpp 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLTypesHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLTypesHandler.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: NIXMLTypesHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for edge type information stored in XML /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/NIXMLTypesHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLTypesHandler.h --- sumo-0.21.0+dfsg/src/netimport/NIXMLTypesHandler.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/NIXMLTypesHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NIXMLTypesHandler.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIXMLTypesHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for edge type information stored in XML /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/Makefile.in --- sumo-0.21.0+dfsg/src/netimport/vissim/Makefile.in 2014-06-11 22:03:56.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -262,6 +262,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -272,7 +274,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/NIImporter_Vissim.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/NIImporter_Vissim.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/NIImporter_Vissim.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/NIImporter_Vissim.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIImporter_Vissim.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIImporter_Vissim.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/NIImporter_Vissim.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/NIImporter_Vissim.h --- sumo-0.21.0+dfsg/src/netimport/vissim/NIImporter_Vissim.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/NIImporter_Vissim.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIImporter_Vissim.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIImporter_Vissim.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Importer for networks stored in Vissim format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/NIVissimElements.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/NIVissimElements.h --- sumo-0.21.0+dfsg/src/netimport/vissim/NIVissimElements.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/NIVissimElements.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimElements.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimElements.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimElements.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/Makefile.in --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -235,6 +235,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -245,7 +247,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimAbstractEdge.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimAbstractEdge.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimAbstractEdge.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimAbstractEdge.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimBoundedClusterObject.cpp /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimBoundedClusterObject.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimBoundedClusterObject.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimBoundedClusterObject.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimBoundedClusterObject.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimBoundedClusterObject.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimClosedLaneDef.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NIVissimClosedLaneDef.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -37,9 +37,8 @@ #endif // CHECK_MEMORY_LEAKS -NIVissimClosedLaneDef::NIVissimClosedLaneDef(int lane, - const std::vector& assignedVehicles) - : myLaneNo(lane), myAssignedVehicles(assignedVehicles) {} +NIVissimClosedLaneDef::NIVissimClosedLaneDef(const std::vector& assignedVehicles) + : myAssignedVehicles(assignedVehicles) {} NIVissimClosedLaneDef::~NIVissimClosedLaneDef() {} diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimClosedLaneDef.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NIVissimClosedLaneDef.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,10 +41,9 @@ */ class NIVissimClosedLaneDef { public: - NIVissimClosedLaneDef(int lane, const std::vector& assignedVehicles); + NIVissimClosedLaneDef(const std::vector& assignedVehicles); ~NIVissimClosedLaneDef(); private: - int myLaneNo; std::vector myAssignedVehicles; }; diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimClosedLanesVector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimClosedLanesVector.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimClosedLanesVector.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimClosedLanesVector.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimClosedLanesVector.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimClosedLanesVector.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimClosedLanesVector.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimClosures.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimClosures.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimClosures.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimClosures.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimClosures.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NIVissimClosures.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimClosures.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimClosures.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimClosures.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimClosures.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimClosures.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NIVissimClosures.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimConnectionCluster.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimConnectionCluster.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimConnectionCluster.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimConnectionCluster.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimConnection.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimConnection.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimConnection.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimConnection.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: NIVissimConnection.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimConnection.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -70,15 +70,10 @@ NIVissimConnection::NIVissimConnection(int id, const std::string& name, const NIVissimExtendedEdgePoint& from_def, const NIVissimExtendedEdgePoint& to_def, - const PositionVector& geom, Direction direction, - SUMOReal dxnothalt, SUMOReal dxeinordnen, - SUMOReal zuschlag1, SUMOReal zuschlag2, SUMOReal /*seglength*/, + const PositionVector& geom, const std::vector& assignedVehicles, const NIVissimClosedLanesVector& clv) : NIVissimAbstractEdge(id, geom), myName(name), myFromDef(from_def), myToDef(to_def), - myDirection(direction), - myDXNothalt(dxnothalt), myDXEinordnen(dxeinordnen), - myZuschlag1(zuschlag1), myZuschlag2(zuschlag2), myAssignedVehicles(assignedVehicles), myClosedLanes(clv) {} @@ -91,32 +86,6 @@ bool -NIVissimConnection::dictionary(int id, const std::string& name, - const NIVissimExtendedEdgePoint& from_def, - const NIVissimExtendedEdgePoint& to_def, - const PositionVector& geom, - Direction direction, - SUMOReal dxnothalt, SUMOReal dxeinordnen, - SUMOReal zuschlag1, SUMOReal zuschlag2, - SUMOReal seglength, - const std::vector& assignedVehicles, - const NIVissimClosedLanesVector& clv) { - NIVissimConnection* o = new NIVissimConnection(id, name, from_def, to_def, - geom, direction, dxnothalt, dxeinordnen, zuschlag1, zuschlag2, - seglength, assignedVehicles, clv); - if (!dictionary(id, o)) { - delete o; - return false; - } - if (myMaxID < id) { - myMaxID = id; - } - return true; -} - - - -bool NIVissimConnection::dictionary(int id, NIVissimConnection* o) { DictType::iterator i = myDict.find(id); if (i == myDict.end()) { diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimConnection.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimConnection.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimConnection.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimConnection.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimConnection.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimConnection.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -54,18 +54,16 @@ : public NIVissimBoundedClusterObject, public NIVissimAbstractEdge { public: - enum Direction { + /* enum Direction { NIVC_DIR_RIGHT, NIVC_DIR_LEFT, NIVC_DIR_ALL - }; + }; */ NIVissimConnection(int id, const std::string& name, const NIVissimExtendedEdgePoint& from_def, const NIVissimExtendedEdgePoint& to_def, const PositionVector& geom, - Direction direction, SUMOReal dxnothalt, SUMOReal dxeinordnen, - SUMOReal zuschlag1, SUMOReal zuschlag2, SUMOReal seglength, const std::vector& assignedVehicles, const NIVissimClosedLanesVector& clv); virtual ~NIVissimConnection(); @@ -100,14 +98,6 @@ - static bool dictionary(int id, const std::string& name, - const NIVissimExtendedEdgePoint& from_def, - const NIVissimExtendedEdgePoint& to_def, - const PositionVector& geom, - Direction direction, SUMOReal dxnothalt, SUMOReal dxeinordnen, - SUMOReal zuschlag1, SUMOReal zuschlag2, SUMOReal seglength, - const std::vector& assignedVehicles, - const NIVissimClosedLanesVector& clv); static bool dictionary(int id, NIVissimConnection* o); static NIVissimConnection* dictionary(int id); static std::vector getWithin(const AbstractPoly& poly); @@ -120,9 +110,6 @@ private: std::string myName; NIVissimExtendedEdgePoint myFromDef, myToDef; - Direction myDirection; - SUMOReal myDXNothalt, myDXEinordnen; - SUMOReal myZuschlag1, myZuschlag2; std::vector myAssignedVehicles; NIVissimClosedLanesVector myClosedLanes; private: diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimDistrictConnection.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimDistrictConnection.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date End of 2002 -/// @version $Id: NIVissimDistrictConnection.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimDistrictConnection.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An edge imported from Vissim together for a container for /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp 2014-06-05 22:02:18.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimDisturbance.cpp 16530 2014-06-05 09:13:58Z namdre $ +/// @version $Id: NIVissimDisturbance.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -68,11 +68,8 @@ NIVissimDisturbance::NIVissimDisturbance(int id, const std::string& name, const NIVissimExtendedEdgePoint& edge, - const NIVissimExtendedEdgePoint& by, - SUMOReal timegap, SUMOReal waygap, - SUMOReal vmax) - : myID(id), myNode(-1), myName(name), myEdge(edge), myDisturbance(by), - myTimeGap(timegap), myWayGap(waygap), myVMax(vmax) {} + const NIVissimExtendedEdgePoint& by) + : myID(id), myNode(-1), myName(name), myEdge(edge), myDisturbance(by) {} NIVissimDisturbance::~NIVissimDisturbance() {} @@ -80,15 +77,12 @@ bool -NIVissimDisturbance::dictionary(int id, - const std::string& name, +NIVissimDisturbance::dictionary(const std::string& name, const NIVissimExtendedEdgePoint& edge, - const NIVissimExtendedEdgePoint& by, - SUMOReal timegap, SUMOReal waygap, SUMOReal vmax) { - UNUSED_PARAMETER(id); + const NIVissimExtendedEdgePoint& by) { int nid = myRunningID++; NIVissimDisturbance* o = - new NIVissimDisturbance(nid, name, edge, by, timegap, waygap, vmax); + new NIVissimDisturbance(nid, name, edge, by); if (!dictionary(nid, o)) { delete o; } diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimDisturbance.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimDisturbance.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimDisturbance.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimDisturbance.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimDisturbance.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NIVissimDisturbance.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -52,8 +52,7 @@ public: NIVissimDisturbance(int id, const std::string& name, const NIVissimExtendedEdgePoint& edge, - const NIVissimExtendedEdgePoint& by, - SUMOReal timegap, SUMOReal waygap, SUMOReal vmax); + const NIVissimExtendedEdgePoint& by); virtual ~NIVissimDisturbance(); void computeBounding(); bool addToNode(NBNode* node, NBDistrictCont& dc, @@ -67,10 +66,9 @@ NBConnection getConnection(NBNode* node, int aedgeid); public: - static bool dictionary(int id, const std::string& name, + static bool dictionary(const std::string& name, const NIVissimExtendedEdgePoint& edge, - const NIVissimExtendedEdgePoint& by, - SUMOReal timegap, SUMOReal waygap, SUMOReal vmax); + const NIVissimExtendedEdgePoint& by); static bool dictionary(int id, NIVissimDisturbance* o); static NIVissimDisturbance* dictionary(int id); static std::vector getWithin(const AbstractPoly& poly); @@ -84,7 +82,6 @@ std::string myName; NIVissimExtendedEdgePoint myEdge; NIVissimExtendedEdgePoint myDisturbance; - SUMOReal myTimeGap, myWayGap, myVMax; typedef std::map DictType; static DictType myDict; diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimEdge.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimEdge.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimEdge.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimEdge.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimEdge.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimEdge.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A temporary storage for edges imported from Vissim /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimEdge.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimEdge.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimEdge.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimEdge.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date End of 2002 -/// @version $Id: NIVissimEdge.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimEdge.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A temporary storage for edges imported from Vissim /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimEdgePosMap.cpp /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimEdgePosMap.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimEdgePosMap.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimEdgePosMap.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimEdgePosMap.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimEdgePosMap.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimExtendedEdgePoint.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimExtendedEdgePoint.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimExtendedEdgePoint.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimExtendedEdgePoint.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePointVector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePointVector.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePointVector.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePointVector.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimExtendedEdgePointVector.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimExtendedEdgePointVector.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimExtendedEdgePointVector.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimNodeCluster.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimNodeCluster.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeCluster.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeCluster.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeCluster.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeCluster.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimNodeCluster.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimNodeCluster.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeDef.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeDef.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeDef.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeDef.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimNodeDef.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NIVissimNodeDef.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -115,7 +115,7 @@ assert(myBoundary!=0&&myBoundary->xmax()>=myBoundary->xmin()); return myBoundary->partialWithin(p, off); } -*/ + void NIVissimNodeDef::dict_assignConnectionsToNodes() { @@ -123,6 +123,7 @@ (*i).second->searchAndSetConnections(); } } +*/ size_t diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimNodeDef_Edges.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimNodeDef_Edges.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -76,6 +76,7 @@ } +/* void NIVissimNodeDef_Edges::searchAndSetConnections() { std::vector connections; @@ -106,7 +107,7 @@ edge->myConnectionClusters.push_back(c); } } - +*/ SUMOReal diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimNodeDef_Edges.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimNodeDef_Edges.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimNodeDef_Edges.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -46,7 +46,7 @@ static bool dictionary(int id, const std::string& name, const NIVissimNodeParticipatingEdgeVector& edges); // virtual void computeBounding(); - virtual void searchAndSetConnections(); +// virtual void searchAndSetConnections(); virtual SUMOReal getEdgePosition(int edgeid) const; /** diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeDef.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeDef.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeDef.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeDef.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimNodeDef.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NIVissimNodeDef.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -45,7 +45,7 @@ int buildNodeCluster(); // virtual void computeBounding() = 0; // bool partialWithin(const AbstractPoly &p, SUMOReal off=0.0) const; - virtual void searchAndSetConnections() = 0; +// virtual void searchAndSetConnections() = 0; virtual SUMOReal getEdgePosition(int edgeid) const = 0; public: @@ -53,7 +53,7 @@ static NIVissimNodeDef* dictionary(int id); // static std::vector getWithin(const AbstractPoly &p, SUMOReal off=0.0); // static void buildNodeClusters(); - static void dict_assignConnectionsToNodes(); +// static void dict_assignConnectionsToNodes(); static size_t dictSize(); static void clearDict(); static int getMaxID(); diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimNodeDef_Poly.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimNodeDef_Poly.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -90,7 +90,6 @@ Position(myBoundary->xmin(), myBoundary->ymin()), Position(myBoundary->xmax(), myBoundary->ymax())); } -*/ void @@ -119,7 +118,7 @@ edge->myConnectionClusters.push_back(c); } } - +*/ /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimNodeDef_Poly.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimNodeDef_Poly.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -47,7 +47,7 @@ const PositionVector& poly); // virtual void computeBounding(); // SUMOReal getEdgePosition(int edgeid) const; - void searchAndSetConnections(SUMOReal offset); +// void searchAndSetConnections(SUMOReal offset); private: PositionVector myPoly; diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimNodeParticipatingEdge.cpp /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimNodeParticipatingEdge.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimNodeParticipatingEdge.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimNodeParticipatingEdge.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimNodeParticipatingEdge.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdgeVector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdgeVector.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdgeVector.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdgeVector.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimNodeParticipatingEdgeVector.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimNodeParticipatingEdgeVector.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimNodeParticipatingEdgeVector.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimSource.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimSource.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimSource.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimSource.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSource.cpp /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimSource.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSource.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -40,12 +40,8 @@ NIVissimSource::DictType NIVissimSource::myDict; NIVissimSource::NIVissimSource(const std::string& id, const std::string& name, - const std::string& edgeid, SUMOReal q, - bool exact, int vehicle_combination, - SUMOReal beg, SUMOReal end) - : myID(id), myName(name), myEdgeID(edgeid), myQ(q), myExact(exact), - myVehicleCombination(vehicle_combination), - myTimeBeg(beg), myTimeEnd(end) {} + const std::string& edgeid) + : myID(id), myName(name), myEdgeID(edgeid) {} NIVissimSource::~NIVissimSource() {} @@ -53,10 +49,8 @@ bool NIVissimSource::dictionary(const std::string& id, const std::string& name, - const std::string& edgeid, SUMOReal q, bool exact, - int vehicle_combination, SUMOReal beg, SUMOReal end) { - NIVissimSource* o = new NIVissimSource(id, name, edgeid, q, exact, - vehicle_combination, beg, end); + const std::string& edgeid) { + NIVissimSource* o = new NIVissimSource(id, name, edgeid); if (!dictionary(id, o)) { delete o; return false; diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimSource.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimSource.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimSource.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimSource.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSource.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimSource.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSource.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -43,12 +43,10 @@ class NIVissimSource { public: NIVissimSource(const std::string& id, const std::string& name, - const std::string& edgeid, SUMOReal q, bool exact, - int vehicle_combination, SUMOReal beg, SUMOReal end); + const std::string& edgeid); ~NIVissimSource(); static bool dictionary(const std::string& id, const std::string& name, - const std::string& edgeid, SUMOReal q, bool exact, - int vehicle_combination, SUMOReal beg, SUMOReal end); + const std::string& edgeid); static bool dictionary(const std::string& id, NIVissimSource* o); static NIVissimSource* dictionary(const std::string& id); static void clearDict(); @@ -56,11 +54,6 @@ std::string myID; std::string myName; std::string myEdgeID; - SUMOReal myQ; - bool myExact; - int myVehicleCombination; - SUMOReal myTimeBeg; - SUMOReal myTimeEnd; private: typedef std::map DictType; diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimTL.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimTL.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimTL.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimTL.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimTL.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimTL.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -62,14 +62,14 @@ // =========================================================================== // method definitions // =========================================================================== -NIVissimTL::NIVissimTLSignal::NIVissimTLSignal(int lsaid, int id, +NIVissimTL::NIVissimTLSignal::NIVissimTLSignal(int id, const std::string& name, const std::vector& groupids, int edgeid, int laneno, SUMOReal position, const std::vector& vehicleTypes) - : myLSA(lsaid), myID(id), myName(name), myGroupIDs(groupids), + : myID(id), myName(name), myGroupIDs(groupids), myEdgeID(edgeid), myLane(laneno), myPosition(position), myVehicleTypes(vehicleTypes) {} @@ -210,11 +210,11 @@ NIVissimTL::GroupDictType NIVissimTL::NIVissimTLSignalGroup::myDict; NIVissimTL::NIVissimTLSignalGroup::NIVissimTLSignalGroup( - int lsaid, int id, + int id, const std::string& name, bool isGreenBegin, const std::vector& times, SUMOTime tredyellow, SUMOTime tyellow) - : myLSA(lsaid), myID(id), myName(name), myTimes(times), + : myID(id), myName(name), myTimes(times), myFirstIsRed(!isGreenBegin), myTRedYellow(tredyellow), myTYellow(tyellow) {} @@ -383,12 +383,12 @@ size_t no_groups = 0; for (DictType::iterator i = myDict.begin(); i != myDict.end(); i++) { NIVissimTL* tl = (*i).second; - /* if(tl->myType!="festzeit") { - cout << " Warning: The traffic light '" << tl->myID - << "' could not be assigned to a node." << endl; - ref++; - continue; - }*/ + /* if(tl->myType!="festzeit") { + cout << " Warning: The traffic light '" << tl->myID + << "' could not be assigned to a node." << endl; + ref++; + continue; + }*/ std::string id = toString(tl->myID); TrafficLightType type = ((tl->getType() == "festzeit" || tl->getType() == "festzeit_fake") ? TLTYPE_STATIC : TLTYPE_ACTUATED); diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimTL.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimTL.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimTL.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimTL.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimTL.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimTL.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -40,16 +40,20 @@ #include -class NBTrafficLightLogicCont; - - - // =========================================================================== // class declarations // =========================================================================== +class NBTrafficLightLogicCont; class NBLoadedTLDef; class NBEdgeCont; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class NIVissimTL + */ class NIVissimTL { public: NIVissimTL(int id, const std::string& type, const std::string& name, @@ -82,7 +86,7 @@ */ class NIVissimTLSignal { public: - NIVissimTLSignal(int lsaid, int id, const std::string& name, + NIVissimTLSignal(int id, const std::string& name, const std::vector& groupids, int edgeid, int laneno, SUMOReal position, const std::vector& assignedVehicleTypes); ~NIVissimTLSignal(); @@ -97,7 +101,6 @@ static SSignalDictType getSignalsFor(int tlid); protected: - int myLSA; int myID; std::string myName; std::vector myGroupIDs; @@ -110,7 +113,7 @@ class NIVissimTLSignalGroup { public: - NIVissimTLSignalGroup(int lsaid, int id, const std::string& name, + NIVissimTLSignalGroup(int id, const std::string& name, bool isGreenBegin, const std::vector& times, SUMOTime tredyellow, SUMOTime tyellow); ~NIVissimTLSignalGroup(); @@ -122,7 +125,6 @@ static SGroupDictType getGroupsFor(int tlid); private: - int myLSA; int myID; std::string myName; std::vector myTimes; diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimTrafficDescription.cpp /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimTrafficDescription.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimTrafficDescription.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -49,9 +49,9 @@ // member method definitions // =========================================================================== NIVissimTrafficDescription::NIVissimTrafficDescription( - int id, const std::string& name, + const std::string& name, const NIVissimVehicleClassVector& vehicleTypes) - : myID(id), myName(name), myVehicleTypes(vehicleTypes) {} + : myName(name), myVehicleTypes(vehicleTypes) {} NIVissimTrafficDescription::~NIVissimTrafficDescription() { @@ -66,7 +66,7 @@ NIVissimTrafficDescription::dictionary(int id, const std::string& name, const NIVissimVehicleClassVector& vehicleTypes) { - NIVissimTrafficDescription* o = new NIVissimTrafficDescription(id, name, vehicleTypes); + NIVissimTrafficDescription* o = new NIVissimTrafficDescription(name, vehicleTypes); if (!dictionary(id, o)) { delete o; return false; diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimTrafficDescription.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimTrafficDescription.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimTrafficDescription.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -43,7 +43,7 @@ */ class NIVissimTrafficDescription { public: - NIVissimTrafficDescription(int id, const std::string& name, + NIVissimTrafficDescription(const std::string& name, const NIVissimVehicleClassVector& vehicleTypes); ~NIVissimTrafficDescription(); static bool dictionary(int id, const std::string& name, @@ -54,7 +54,6 @@ static SUMOReal meanSpeed(int id); SUMOReal meanSpeed() const; private: - int myID; std::string myName; NIVissimVehicleClassVector myVehicleTypes; private: diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehicleClass.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehicleClass.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehicleClass.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehicleClass.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimVehicleClass.cpp /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimVehicleClass.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimVehicleClass.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,10 +35,8 @@ #include #endif // CHECK_MEMORY_LEAKS -NIVissimVehicleClass::NIVissimVehicleClass(int type, - SUMOReal percentage, - int vwish) - : myType(type), myPercentage(percentage), myVWish(vwish) {} +NIVissimVehicleClass::NIVissimVehicleClass(int vwish) + : myVWish(vwish) {} NIVissimVehicleClass::~NIVissimVehicleClass() {} diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehicleClass.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehicleClass.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehicleClass.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehicleClass.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimVehicleClass.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimVehicleClass.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimVehicleClass.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -39,12 +39,10 @@ */ class NIVissimVehicleClass { public: - NIVissimVehicleClass(int type, SUMOReal percentage, int vwish); + NIVissimVehicleClass(int vwish); ~NIVissimVehicleClass(); int getSpeed() const; private: - int myType; - SUMOReal myPercentage; int myVWish; }; diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehicleClassVector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehicleClassVector.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehicleClassVector.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehicleClassVector.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimVehicleClassVector.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimVehicleClassVector.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimVehicleClassVector.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehicleType.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehicleType.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehicleType.cpp 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehicleType.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimVehicleType.cpp /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimVehicleType.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimVehicleType.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -37,11 +37,10 @@ NIVissimVehicleType::DictType NIVissimVehicleType::myDict; -NIVissimVehicleType::NIVissimVehicleType(int id, - const std::string& name, const std::string& category, SUMOReal length, - const RGBColor& color, SUMOReal amax, SUMOReal dmax) - : myID(id), myName(name), myCategory(category), myLength(length), - myColor(color), myAMax(amax), myDMax(dmax) {} +NIVissimVehicleType::NIVissimVehicleType(const std::string& name, + const std::string& category, const RGBColor& color) + : myName(name), myCategory(category), + myColor(color) {} NIVissimVehicleType::~NIVissimVehicleType() {} @@ -49,11 +48,9 @@ bool -NIVissimVehicleType::dictionary(int id, - const std::string& name, const std::string& category, SUMOReal length, - const RGBColor& color, SUMOReal amax, SUMOReal dmax) { - NIVissimVehicleType* o = new NIVissimVehicleType(id, name, category, - length, color, amax, dmax); +NIVissimVehicleType::dictionary(int id, const std::string& name, const std::string& category, + const RGBColor& color) { + NIVissimVehicleType* o = new NIVissimVehicleType(name, category, color); if (!dictionary(id, o)) { delete o; return false; diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehicleType.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehicleType.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehicleType.h 2014-02-22 23:02:16.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehicleType.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimVehicleType.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimVehicleType.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimVehicleType.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -43,24 +43,19 @@ */ class NIVissimVehicleType { public: - NIVissimVehicleType(int id, const std::string& name, - const std::string& category, SUMOReal length, const RGBColor& color, - SUMOReal amax, SUMOReal dmax); + NIVissimVehicleType(const std::string& name, + const std::string& category, const RGBColor& color); ~NIVissimVehicleType(); static bool dictionary(int id, const std::string& name, - const std::string& category, SUMOReal length, const RGBColor& color, - SUMOReal amax, SUMOReal dmax); + const std::string& category, const RGBColor& color); static bool dictionary(int id, NIVissimVehicleType* o); static NIVissimVehicleType* dictionary(int id); static void clearDict(); private: - int myID; std::string myName; std::string myCategory; - SUMOReal myLength; RGBColor myColor; - SUMOReal myAMax, myDMax; private: typedef std::map DictType; static DictType myDict; diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NIVissimVehTypeClass.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NIVissimVehTypeClass.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.h --- sumo-0.21.0+dfsg/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Michael Behrisch /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: NIVissimVehTypeClass.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NIVissimVehTypeClass.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/Makefile.in --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -275,6 +275,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -285,7 +287,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 21 Mar 2003 -/// @version $Id: NIVissimSingleTypeParser_Auswertungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Auswertungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Auswertungsdefinition.h /// @author Daniel Krajzewicz /// @date Fri, 21 Mar 2003 -/// @version $Id: NIVissimSingleTypeParser_Auswertungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Auswertungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Detektordefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Detektordefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Detektordefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Detektordefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Detektordefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_DynUml.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_DynUml.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_DynUml.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_DynUml.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_DynUml.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Einheitendefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Einheitendefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Einheitendefinition.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Einheitendefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Einheitendefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Emission.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Emission.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Emission.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Emission.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Emission.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Fahrtverlaufdateien.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Fahrtverlaufdateien.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Fahrtverlaufdateien.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Fahrverhaltendefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Fahrverhaltendefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Fahrverhaltendefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Fahrzeugklassendefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Fahrzeugklassendefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Fahrzeugklassendefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -112,8 +112,7 @@ while (tag != "DATAEND") { tag = readEndSecure(from, "verlustzeit"); } - return NIVissimVehicleType::dictionary(id, name, - category, length, color, amax, dmax); + return NIVissimVehicleType::dictionary(id, name, category, color); } diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Fahrzeugtypdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Fahrzeugtypdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Fahrzeugtypdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 21 Mar 2003 -/// @version $Id: NIVissimSingleTypeParser_Fensterdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Fensterdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Fensterdefinition.h /// @author Daniel Krajzewicz /// @date Fri, 21 Mar 2003 -/// @version $Id: NIVissimSingleTypeParser_Fensterdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Fensterdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Gelbverhaltendefinition.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Gelbverhaltendefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Gelbverhaltendefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Haltestellendefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Haltestellendefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Haltestellendefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Haltestellendefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Haltestellendefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Kantensperrung.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Kantensperrung.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Kantensperrung.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Kantensperrung.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Kantensperrung.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 6 Mar 2003 -/// @version $Id: NIVissimSingleTypeParser_Kennungszeile.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Kennungszeile.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Kennungszeile.h /// @author Daniel Krajzewicz /// @date Thu, 6 Mar 2003 -/// @version $Id: NIVissimSingleTypeParser_Kennungszeile.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Kennungszeile.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Knotendefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Knotendefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Knotendefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Knotendefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Knotendefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Laengenverteilungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Laengenverteilungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Laengenverteilungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Liniendefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Liniendefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Liniendefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Liniendefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Liniendefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Linksverkehr.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Linksverkehr.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Linksverkehr.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Linksverkehr.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Linksverkehr.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_LSAKopplungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_LSAKopplungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_LSAKopplungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Messungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Messungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Messungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Messungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Messungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Netzobjektdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Netzobjektdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Netzobjektdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Netzobjektdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Netzobjektdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Parkplatzdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Parkplatzdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Parkplatzdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Parkplatzdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Parkplatzdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -99,8 +99,7 @@ if (tag == "vmax") { from >> vmax; } - ok = NIVissimDisturbance::dictionary(-1, "", edge, by, - timegap, waygap, vmax); + ok = NIVissimDisturbance::dictionary("", edge, by); if (tag != "DATAEND") { tag = readEndSecure(from); } @@ -145,8 +144,7 @@ from >> vmax; } - ok = NIVissimDisturbance::dictionary(id, name, edge, by, - timegap, waygap, vmax); + ok = NIVissimDisturbance::dictionary(name, edge, by); if (tag != "DATAEND") { tag = readEndSecure(from); } diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Rautedefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Rautedefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Rautedefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Rautedefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Richtungspfeildefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Richtungspfeildefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Richtungspfeildefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Richtungspfeildefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Richtungspfeildefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Routenentscheidungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Routenentscheidungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Routenentscheidungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Signalgeberdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Signalgeberdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -101,7 +101,7 @@ from >> laneno; from >> tag; - int position; + SUMOReal position; from >> position; // while (tag != "fahrzeugklassen") { @@ -111,8 +111,8 @@ // NIVissimTL::dictionary(lsaid); // !!! check whether someting is really done here NIVissimTL::NIVissimTLSignal* signal = - new NIVissimTL::NIVissimTLSignal(lsaid, id, name, groupids, edgeid, - laneno, (SUMOReal) position, assignedVehicleTypes); + new NIVissimTL::NIVissimTLSignal(id, name, groupids, edgeid, + laneno, position, assignedVehicleTypes); if (!NIVissimTL::NIVissimTLSignal::dictionary(lsaid, id, signal)) { throw 1; // !!! } diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Signalgeberdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Signalgeberdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Signalgeberdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Signalgruppendefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Signalgruppendefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -141,7 +141,7 @@ from >> tyellow; NIVissimTL::NIVissimTLSignalGroup* group = new NIVissimTL::NIVissimTLSignalGroup( - lsaid, id, name, isGreenBegin, times, (SUMOTime) tredyellow, (SUMOTime) tyellow); + id, name, isGreenBegin, times, (SUMOTime) tredyellow, (SUMOTime) tyellow); if (!NIVissimTL::NIVissimTLSignalGroup::dictionary(lsaid, id, group)) { throw 1; // !!! } diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Signalgruppendefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Signalgruppendefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Signalgruppendefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Simdauer.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Simdauer.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Simdauer.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Simdauer.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Simdauer.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_SimRate.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_SimRate.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_SimRate.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_SimRate.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_SimRate.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Startuhrzeit.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Startuhrzeit.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Startuhrzeit.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Startuhrzeit.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Startuhrzeit.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Startzufallszahl.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Startzufallszahl.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Startzufallszahl.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Startzufallszahl.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Startzufallszahl.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Stauparameterdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Stauparameterdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Stauparameterdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Stauparameterdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Stauparameterdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Stauzaehlerdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Stauzaehlerdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Stauzaehlerdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Stopschilddefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Stopschilddefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Stopschilddefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Stopschilddefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Stopschilddefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Streckendefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Streckendefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -116,7 +116,7 @@ } else if (tag == "spur") { // get the lane number int laneNo; - from >> laneNo; // type-checking is missing! + from >> laneNo; // unused and type-checking is missing! // get the list of assigned car classes std::vector assignedVehicles; tag = myRead(from); @@ -127,7 +127,7 @@ tag = readEndSecure(from); } // build and add the definition - NIVissimClosedLaneDef* cld = new NIVissimClosedLaneDef(laneNo, assignedVehicles); + NIVissimClosedLaneDef* cld = new NIVissimClosedLaneDef(assignedVehicles); clv.push_back(cld); } else { tag = readEndSecure(from); diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Streckendefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Streckendefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Streckendefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 6 Mar 2003 -/// @version $Id: NIVissimSingleTypeParser_Streckentypdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Streckentypdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Streckentypdefinition.h /// @author Daniel Krajzewicz /// @date Thu, 6 Mar 2003 -/// @version $Id: NIVissimSingleTypeParser_Streckentypdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Streckentypdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_TEAPACDefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_TEAPACDefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_TEAPACDefinition.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_TEAPACDefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_TEAPACDefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Verbindungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Verbindungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -94,14 +94,14 @@ zuschlag1 = zuschlag2 = 0; SUMOReal seglength = 0; tag = myRead(from); - NIVissimConnection::Direction direction = NIVissimConnection::NIVC_DIR_ALL; +// NIVissimConnection::Direction direction = NIVissimConnection::NIVC_DIR_ALL; while (tag != "fahrzeugklassen" && tag != "sperrung" && tag != "auswertung" && tag != "DATAEND") { if (tag == "rechts") { - direction = NIVissimConnection::NIVC_DIR_RIGHT; +// direction = NIVissimConnection::NIVC_DIR_RIGHT; } else if (tag == "links") { - direction = NIVissimConnection::NIVC_DIR_LEFT; +// direction = NIVissimConnection::NIVC_DIR_LEFT; } else if (tag == "alle") { - direction = NIVissimConnection::NIVC_DIR_ALL; +// direction = NIVissimConnection::NIVC_DIR_ALL; } else if (tag == "dxnothalt") { from >> dxnothalt; // type-checking is missing! } else if (tag == "dxeinordnen") { @@ -145,7 +145,7 @@ // get the lane number // from >> tag; int laneNo; - from >> laneNo; // type-checking is missing! + from >> laneNo; // unused and type-checking is missing! // get the list of assigned car classes std::vector assignedVehicles; tag = myRead(from); @@ -158,13 +158,12 @@ tag = readEndSecure(from); } // build and add the definition - NIVissimClosedLaneDef* cld = new NIVissimClosedLaneDef(laneNo, assignedVehicles); + NIVissimClosedLaneDef* cld = new NIVissimClosedLaneDef(assignedVehicles); clv.push_back(cld); } } while (tag != "DATAEND"); } NIVissimConnection* c = new NIVissimConnection(id, name, from_def, to_def, geom, - direction, dxnothalt, dxeinordnen, zuschlag1, zuschlag2, seglength, assignedVehicles, clv); if (!NIVissimConnection::dictionary(id, c)) { diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Verbindungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Verbindungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Verbindungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -77,7 +77,7 @@ int vwish; from >> tag; from >> vwish; - assignedTypes.push_back(new NIVissimVehicleClass(type, percentage, vwish)); + assignedTypes.push_back(new NIVissimVehicleClass(vwish)); tag = readEndSecure(from, "Fahrzeugtyp"); } // diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser__XKurvedefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser__XKurvedefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser__XKurvedefinition.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser__XKurvedefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser__XKurvedefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser__XVerteilungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser__XVerteilungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser__XVerteilungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser__XVerteilungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser__XVerteilungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Zeitschrittfaktor.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Zeitschrittfaktor.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Zeitschrittfaktor.h /// @author Daniel Krajzewicz /// @date Wed, 30 Apr 2003 -/// @version $Id: NIVissimSingleTypeParser_Zeitschrittfaktor.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Zeitschrittfaktor.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Zuflussdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Zuflussdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -65,14 +65,13 @@ } } // read q - bool exact = false; - SUMOReal q; + // bool exact = false; tag = myRead(from); if (tag == "exakt") { - exact = true; + // exact = true; tag = myRead(from); } - q = TplConvert::_2SUMOReal(tag.c_str()); + // SUMOReal q = TplConvert::_2SUMOReal(tag.c_str()); // read the vehicle types from >> tag; int vehicle_combination; @@ -88,8 +87,7 @@ from >> tag; from >> end; } - return NIVissimSource::dictionary(id, name, edgeid, q, exact, vehicle_combination, - beg, end); + return NIVissimSource::dictionary(id, name, edgeid); } diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Zuflussdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Zuflussdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Zuflussdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.h --- sumo-0.21.0+dfsg/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.h 2014-02-22 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NIVissimSingleTypeParser_Zusammensetzungsdefinition.h /// @author Daniel Krajzewicz /// @date Wed, 18 Dec 2002 -/// @version $Id: NIVissimSingleTypeParser_Zusammensetzungsdefinition.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NIVissimSingleTypeParser_Zusammensetzungsdefinition.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netload/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/Makefile.in --- sumo-0.21.0+dfsg/src/netload/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -224,6 +224,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -234,7 +236,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/netload/NLBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLBuilder.cpp --- sumo-0.21.0+dfsg/src/netload/NLBuilder.cpp 2014-04-29 22:02:43.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: NLBuilder.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: NLBuilder.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // The main interface for loading a microsim /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -162,7 +162,7 @@ // the measure to use, then EdgeFloatTimeLineRetriever_EdgeEffort eRetriever(myNet); std::string measure = myOptions.getString("weight-attribute"); - if (measure != "traveltime") { + if (!myOptions.isDefault("weight-attribute")) { if (measure == "CO" || measure == "CO2" || measure == "HC" || measure == "PMx" || measure == "NOx" || measure == "fuel") { measure += "_perVeh"; } @@ -192,6 +192,11 @@ if (!load("additional-files")) { return false; } + // load shapes with separate handler + NLShapeHandler sh("", myNet.getShapeContainer()); + if (!ShapeHandler::loadFiles(myOptions.getStringVector("additional-files"), sh)) { + return false; + } } WRITE_MESSAGE("Loading done."); return true; @@ -227,7 +232,8 @@ stateDumpFiles.push_back(prefix + "_" + time2string(*i) + ".sbx"); } } - myNet.closeBuilding(edges, junctions, routeLoaders, tlc, stateDumpTimes, stateDumpFiles); + myNet.closeBuilding(edges, junctions, routeLoaders, tlc, stateDumpTimes, stateDumpFiles, + myXMLHandler.haveSeenInternalEdge()); } catch (IOError& e) { delete edges; delete junctions; diff -Nru sumo-0.21.0+dfsg/src/netload/NLBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLBuilder.h --- sumo-0.21.0+dfsg/src/netload/NLBuilder.h 2014-02-25 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: NLBuilder.h 15727 2014-02-25 08:09:54Z behrisch $ +/// @version $Id: NLBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The main interface for loading a microsim /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netload/NLDetectorBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLDetectorBuilder.cpp --- sumo-0.21.0+dfsg/src/netload/NLDetectorBuilder.cpp 2014-04-11 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLDetectorBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Christian Roessel /// @author Jakob Erdmann /// @date Mon, 15 Apr 2002 -/// @version $Id: NLDetectorBuilder.cpp 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: NLDetectorBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Builds detectors for microsim /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netload/NLDetectorBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLDetectorBuilder.h --- sumo-0.21.0+dfsg/src/netload/NLDetectorBuilder.h 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLDetectorBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Christian Roessel /// @author Michael Behrisch /// @date Mon, 15 Apr 2002 -/// @version $Id: NLDetectorBuilder.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NLDetectorBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Builds detectors for microsim /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netload/NLDiscreteEventBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLDiscreteEventBuilder.cpp --- sumo-0.21.0+dfsg/src/netload/NLDiscreteEventBuilder.cpp 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLDiscreteEventBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sep, 2003 -/// @version $Id: NLDiscreteEventBuilder.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NLDiscreteEventBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // } /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netload/NLDiscreteEventBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLDiscreteEventBuilder.h --- sumo-0.21.0+dfsg/src/netload/NLDiscreteEventBuilder.h 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLDiscreteEventBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sep, 2003 -/// @version $Id: NLDiscreteEventBuilder.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NLDiscreteEventBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netload/NLEdgeControlBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLEdgeControlBuilder.cpp --- sumo-0.21.0+dfsg/src/netload/NLEdgeControlBuilder.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLEdgeControlBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: NLEdgeControlBuilder.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NLEdgeControlBuilder.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Interface for building edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -73,8 +74,9 @@ NLEdgeControlBuilder::beginEdgeParsing( const std::string& id, const MSEdge::EdgeBasicFunction function, const std::string& streetName, - const std::string& edgeType) { - myActiveEdge = buildEdge(id, function, streetName, edgeType); + const std::string& edgeType, + int priority) { + myActiveEdge = buildEdge(id, function, streetName, edgeType, priority); if (MSEdge::dictionary(id) != 0) { throw InvalidArgument("Another edge with the id '" + id + "' exists."); } @@ -106,7 +108,7 @@ MSEdgeControl* NLEdgeControlBuilder::build() { - for (EdgeCont::iterator i1 = myEdges.begin(); i1 != myEdges.end(); i1++) { + for (MSEdgeVector::iterator i1 = myEdges.begin(); i1 != myEdges.end(); i1++) { (*i1)->closeBuilding(); #ifdef HAVE_INTERNAL if (MSGlobals::gUseMesoSim) { @@ -116,12 +118,13 @@ } // mark internal edges belonging to a roundabout (after all edges are build) if (MSGlobals::gUsingInternalLanes) { - for (EdgeCont::iterator i1 = myEdges.begin(); i1 != myEdges.end(); i1++) { + for (MSEdgeVector::iterator i1 = myEdges.begin(); i1 != myEdges.end(); i1++) { MSEdge* edge = *i1; if (edge->isInternal()) { - assert(edge->getNoFollowing() == 1); - assert(edge->getIncomingEdges().size() == 1); - if (edge->getFollower(0)->isRoundabout() || edge->getIncomingEdges()[0]->isRoundabout()) { + if (edge->getNumSuccessors() != 1 || edge->getIncomingEdges().size() != 1) { + throw ProcessError("Internal edge '" + edge->getID() + "' is not properly connected (probably a manually modified net.xml)."); + } + if (edge->getSuccessors()[0]->isRoundabout() || edge->getIncomingEdges()[0]->isRoundabout()) { edge->markAsRoundabout(); } } @@ -136,8 +139,9 @@ MSEdge* -NLEdgeControlBuilder::buildEdge(const std::string& id, const MSEdge::EdgeBasicFunction function, const std::string& streetName, const std::string& edgeType) { - return new MSEdge(id, myCurrentNumericalEdgeID++, function, streetName, edgeType); +NLEdgeControlBuilder::buildEdge(const std::string& id, const MSEdge::EdgeBasicFunction function, + const std::string& streetName, const std::string& edgeType, const int priority) { + return new MSEdge(id, myCurrentNumericalEdgeID++, function, streetName, edgeType, priority); } diff -Nru sumo-0.21.0+dfsg/src/netload/NLEdgeControlBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLEdgeControlBuilder.h --- sumo-0.21.0+dfsg/src/netload/NLEdgeControlBuilder.h 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLEdgeControlBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: NLEdgeControlBuilder.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: NLEdgeControlBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Interface for building edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -62,9 +62,6 @@ * @todo Assignment of lanes is not really well. Should be reworked after shapes are given as params. */ class NLEdgeControlBuilder { -public: - /// @brief definition of the used storage for edges - typedef std::vector EdgeCont; public: /// @brief Constructor @@ -88,7 +85,7 @@ * @exception InvalidArgument If an edge with the same name was already built */ void beginEdgeParsing(const std::string& id, const MSEdge::EdgeBasicFunction function, - const std::string& streetName, const std::string& edgeType); + const std::string& streetName, const std::string& edgeType, int priority); /** @brief Adds a lane to the current edge; @@ -128,7 +125,8 @@ * @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 MSEdge::EdgeBasicFunction function, const std::string& streetName = "", const std::string& edgeType = ""); + virtual MSEdge* buildEdge(const std::string& id, const MSEdge::EdgeBasicFunction function, + const std::string& streetName, const std::string& edgeType, const int priority); protected: @@ -139,7 +137,7 @@ unsigned int myCurrentNumericalEdgeID; /// @brief Temporary, internal storage for built edges - EdgeCont myEdges; + MSEdgeVector myEdges; /// @brief pointer to the currently chosen edge MSEdge* myActiveEdge; diff -Nru sumo-0.21.0+dfsg/src/netload/NLHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLHandler.cpp --- sumo-0.21.0+dfsg/src/netload/NLHandler.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Michael Behrisch /// @author Felix Brack /// @date Mon, 9 Jul 2001 -/// @version $Id: NLHandler.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NLHandler.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // The XML-Handler for network loading /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #include @@ -70,16 +69,18 @@ NLDetectorBuilder& detBuilder, NLTriggerBuilder& triggerBuilder, NLEdgeControlBuilder& edgeBuilder, - NLJunctionControlBuilder& junctionBuilder) - : MSRouteHandler(file, true), - myNet(net), myActionBuilder(net), - myCurrentIsInternalToSkip(false), - myDetectorBuilder(detBuilder), myTriggerBuilder(triggerBuilder), - myEdgeControlBuilder(edgeBuilder), myJunctionControlBuilder(junctionBuilder), - myAmInTLLogicMode(false), myCurrentIsBroken(false), - myHaveWarnedAboutDeprecatedLanes(false), - myLastParameterised(0), - myHaveSeenInternalEdge(false) {} + NLJunctionControlBuilder& junctionBuilder) : + MSRouteHandler(file, true), + myNet(net), myActionBuilder(net), + myCurrentIsInternalToSkip(false), + myDetectorBuilder(detBuilder), myTriggerBuilder(triggerBuilder), + myEdgeControlBuilder(edgeBuilder), myJunctionControlBuilder(junctionBuilder), + myAmInTLLogicMode(false), myCurrentIsBroken(false), + myHaveWarnedAboutDeprecatedLanes(false), + myLastParameterised(0), + myHaveSeenInternalEdge(false), + myNetIsLoaded(false) +{} NLHandler::~NLHandler() {} @@ -96,12 +97,6 @@ case SUMO_TAG_LANE: addLane(attrs); break; - case SUMO_TAG_POLY: - addPoly(attrs); - break; - case SUMO_TAG_POI: - addPOI(attrs); - break; case SUMO_TAG_JUNCTION: openJunction(attrs); initJunctionLogic(attrs); @@ -160,6 +155,9 @@ case SUMO_TAG_BUS_STOP: myTriggerBuilder.parseAndBuildBusStop(myNet, attrs); break; + case SUMO_TAG_CONTAINER_STOP: + myTriggerBuilder.parseAndBuildContainerStop(myNet, attrs); + break; case SUMO_TAG_VTYPEPROBE: addVTypeProbeDetector(attrs); break; @@ -238,7 +236,6 @@ endE3Detector(); break; case SUMO_TAG_NET: - myJunctionControlBuilder.postLoadInitialization(); // build junction graph for (JunctionGraph::iterator it = myJunctionGraph.begin(); it != myJunctionGraph.end(); ++it) { MSEdge* edge = MSEdge::dictionary(it->first); @@ -250,6 +247,9 @@ to->addIncoming(edge); } } + //initialise traffic lights + myJunctionControlBuilder.postLoadInitialization(); + myNetIsLoaded = true; break; default: break; @@ -274,10 +274,12 @@ return; } // omit internal edges if not wished - if (!MSGlobals::gUsingInternalLanes && id[0] == ':') { + if (id[0] == ':') { myHaveSeenInternalEdge = true; - myCurrentIsInternalToSkip = true; - return; + if (!MSGlobals::gUsingInternalLanes) { + myCurrentIsInternalToSkip = true; + return; + } } if (attrs.hasAttribute(SUMO_ATTR_FROM)) { myJunctionGraph[id] = std::make_pair( @@ -318,16 +320,18 @@ break; } // get the street name - std::string streetName = attrs.getOpt(SUMO_ATTR_NAME, id.c_str(), ok, ""); - // get the edge type - std::string edgeType = attrs.getOpt(SUMO_ATTR_TYPE, id.c_str(), ok, ""); + const std::string streetName = attrs.getOpt(SUMO_ATTR_NAME, id.c_str(), ok, ""); + // get the edge type (only for visualization) + const std::string edgeType = attrs.getOpt(SUMO_ATTR_TYPE, id.c_str(), ok, ""); + // get the edge priority (only for visualization) + const int priority = attrs.getOpt(SUMO_ATTR_PRIORITY, id.c_str(), ok, -1); // default taken from netbuild/NBFrame option 'default.priority' if (!ok) { myCurrentIsBroken = true; return; } // try { - myEdgeControlBuilder.beginEdgeParsing(id, funcEnum, streetName, edgeType); + myEdgeControlBuilder.beginEdgeParsing(id, funcEnum, streetName, edgeType, priority); } catch (InvalidArgument& e) { WRITE_ERROR(e.what()); myCurrentIsBroken = true; @@ -364,24 +368,21 @@ myCurrentIsBroken = true; return; } - SUMOReal maxSpeed = attrs.get(SUMO_ATTR_SPEED, id.c_str(), ok); - SUMOReal length = attrs.get(SUMO_ATTR_LENGTH, id.c_str(), ok); - std::string allow; - try { - bool dummy; - allow = attrs.getOpt(SUMO_ATTR_ALLOW, id.c_str(), dummy, "", false); - } catch (EmptyData e) { - // !!! deprecated - } - std::string disallow = attrs.getOpt(SUMO_ATTR_DISALLOW, id.c_str(), ok, ""); - SUMOReal width = attrs.getOpt(SUMO_ATTR_WIDTH, id.c_str(), ok, SUMO_const_laneWidth); - PositionVector shape = attrs.get(SUMO_ATTR_SHAPE, id.c_str(), ok); + const SUMOReal maxSpeed = attrs.get(SUMO_ATTR_SPEED, id.c_str(), ok); + const SUMOReal length = attrs.get(SUMO_ATTR_LENGTH, id.c_str(), ok); + const std::string allow = attrs.getOpt(SUMO_ATTR_ALLOW, id.c_str(), ok, "", false); + const std::string disallow = attrs.getOpt(SUMO_ATTR_DISALLOW, id.c_str(), ok, ""); + const SUMOReal width = attrs.getOpt(SUMO_ATTR_WIDTH, id.c_str(), ok, SUMO_const_laneWidth); + const PositionVector shape = attrs.get(SUMO_ATTR_SHAPE, id.c_str(), ok); if (shape.size() < 2) { WRITE_ERROR("Shape of lane '" + id + "' is broken.\n Can not build according edge."); myCurrentIsBroken = true; return; } - SVCPermissions permissions = parseVehicleClasses(allow, disallow); + const SVCPermissions permissions = parseVehicleClasses(allow, disallow); + if (permissions != SVCAll) { + myNet.setRestrictionFound(); + } myCurrentIsBroken |= !ok; if (!myCurrentIsBroken) { try { @@ -555,94 +556,6 @@ } - - - - - -void -NLHandler::addPOI(const SUMOSAXAttributes& attrs) { - bool ok = true; - const SUMOReal INVALID_POSITION(-1000000); - std::string id = attrs.get(SUMO_ATTR_ID, 0, ok); - SUMOReal x = attrs.getOpt(SUMO_ATTR_X, id.c_str(), ok, INVALID_POSITION); - SUMOReal y = attrs.getOpt(SUMO_ATTR_Y, id.c_str(), ok, INVALID_POSITION); - SUMOReal lon = attrs.getOpt(SUMO_ATTR_LON, id.c_str(), ok, INVALID_POSITION); - SUMOReal lat = attrs.getOpt(SUMO_ATTR_LAT, id.c_str(), ok, INVALID_POSITION); - SUMOReal lanePos = attrs.getOpt(SUMO_ATTR_POSITION, id.c_str(), ok, INVALID_POSITION); - SUMOReal layer = attrs.getOpt(SUMO_ATTR_LAYER, id.c_str(), ok, (SUMOReal)GLO_POI); - std::string type = attrs.getOpt(SUMO_ATTR_TYPE, id.c_str(), ok, ""); - std::string laneID = attrs.getOpt(SUMO_ATTR_LANE, id.c_str(), ok, ""); - RGBColor color = attrs.hasAttribute(SUMO_ATTR_COLOR) ? attrs.get(SUMO_ATTR_COLOR, id.c_str(), ok) : RGBColor::RED; - SUMOReal angle = attrs.getOpt(SUMO_ATTR_ANGLE, id.c_str(), ok, Shape::DEFAULT_ANGLE); - std::string imgFile = attrs.getOpt(SUMO_ATTR_IMGFILE, id.c_str(), ok, Shape::DEFAULT_IMG_FILE); - if (imgFile != "" && !FileHelpers::isAbsolute(imgFile)) { - imgFile = FileHelpers::getConfigurationRelative(getFileName(), imgFile); - } - SUMOReal width = attrs.getOpt(SUMO_ATTR_WIDTH, id.c_str(), ok, Shape::DEFAULT_IMG_WIDTH); - SUMOReal height = attrs.getOpt(SUMO_ATTR_HEIGHT, id.c_str(), ok, Shape::DEFAULT_IMG_HEIGHT); - if (!ok) { - return; - } - Position pos(x, y); - if (x == INVALID_POSITION || y == INVALID_POSITION) { - // try computing x,y from lane,pos - if (laneID != "") { - MSLane* lane = MSLane::dictionary(laneID); - if (lane == 0) { - WRITE_ERROR("Lane '" + laneID + "' to place poi '" + id + "' on is not known."); - return; - } - if (lanePos < 0) { - lanePos = lane->getLength() + lanePos; - } - pos = lane->geometryPositionAtOffset(lanePos); - } else { - // try computing x,y from lon,lat - if (lat == INVALID_POSITION || lon == INVALID_POSITION) { - WRITE_ERROR("Either (x,y), (lon,lat) or (lane,pos) must be specified for poi '" + id + "'."); - return; - } else if (!GeoConvHelper::getFinal().usingGeoProjection()) { - WRITE_ERROR("(lon, lat) is specified for poi '" + id + "' but no geo-conversion is specified for the network."); - return; - } - pos.set(lon, lat); - GeoConvHelper::getFinal().x2cartesian_const(pos); - } - } - if (!myNet.getShapeContainer().addPOI(id, type, color, layer, angle, imgFile, pos, width, height)) { - WRITE_ERROR("PoI '" + id + "' already exists."); - } -} - - -void -NLHandler::addPoly(const SUMOSAXAttributes& attrs) { - bool ok = true; - std::string id = attrs.get(SUMO_ATTR_ID, 0, ok); - // get the id, report an error if not given or empty... - if (!ok) { - return; - } - SUMOReal layer = attrs.getOpt(SUMO_ATTR_LAYER, id.c_str(), ok, Shape::DEFAULT_LAYER); - bool fill = attrs.getOpt(SUMO_ATTR_FILL, id.c_str(), ok, false); - std::string type = attrs.getOpt(SUMO_ATTR_TYPE, id.c_str(), ok, Shape::DEFAULT_TYPE); - std::string colorStr = attrs.get(SUMO_ATTR_COLOR, id.c_str(), ok); - RGBColor color = attrs.get(SUMO_ATTR_COLOR, id.c_str(), ok); - PositionVector shape = attrs.get(SUMO_ATTR_SHAPE, id.c_str(), ok); - SUMOReal angle = attrs.getOpt(SUMO_ATTR_ANGLE, id.c_str(), ok, Shape::DEFAULT_ANGLE); - std::string imgFile = attrs.getOpt(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, type, color, layer, angle, imgFile, shape, fill)) { - WRITE_WARNING("Skipping redefinition of polygon '" + id + "'."); - } - } -} - - void NLHandler::addRequest(const SUMOSAXAttributes& attrs) { if (myCurrentIsBroken) { @@ -718,7 +631,9 @@ // try to get the phase duration SUMOTime duration = attrs.getSUMOTimeReporting(SUMO_ATTR_DURATION, myJunctionControlBuilder.getActiveKey().c_str(), ok); if (duration == 0) { - WRITE_ERROR("Duration of tls-logic '" + myJunctionControlBuilder.getActiveKey() + "/" + myJunctionControlBuilder.getActiveSubKey() + "' is zero."); + WRITE_ERROR("Duration of phase " + toString(myJunctionControlBuilder.getNumberOfLoadedPhases()) + + " for tlLogic '" + myJunctionControlBuilder.getActiveKey() + + "' program '" + myJunctionControlBuilder.getActiveSubKey() + "' is zero."); return; } // if the traffic light is an actuated traffic light, try to get @@ -1010,7 +925,8 @@ tlLinkIdx = attrs.get(SUMO_ATTR_TLLINKINDEX, 0, ok); // make sure that the index is in range MSTrafficLightLogic* logic = myJunctionControlBuilder.getTLLogic(tlID).getActive(); - if (tlLinkIdx < 0 || tlLinkIdx >= (int)logic->getCurrentPhaseDef().getState().size()) { + if ((tlLinkIdx < 0 || tlLinkIdx >= (int)logic->getCurrentPhaseDef().getState().size()) + && logic->getLogicType() != "railSignal") { WRITE_ERROR("Invalid " + toString(SUMO_ATTR_TLLINKINDEX) + " '" + toString(tlLinkIdx) + "' in connection controlled by '" + tlID + "'"); return; @@ -1088,6 +1004,10 @@ // ---------------------------------- void NLHandler::setLocation(const SUMOSAXAttributes& attrs) { + if (myNetIsLoaded) { + //WRITE_WARNING("POIs and Polygons should be loaded using option --po-files") + return; + } bool ok = true; PositionVector s = attrs.get(SUMO_ATTR_NET_OFFSET, 0, ok); Boundary convBoundary = attrs.get(SUMO_ATTR_CONV_BOUNDARY, 0, ok); @@ -1114,13 +1034,13 @@ return; } try { - MSEdge* sink = myEdgeControlBuilder.buildEdge(myCurrentDistrictID + "-sink", MSEdge::EDGEFUNCTION_DISTRICT); + MSEdge* sink = myEdgeControlBuilder.buildEdge(myCurrentDistrictID + "-sink", MSEdge::EDGEFUNCTION_DISTRICT, "", "", -1); if (!MSEdge::dictionary(myCurrentDistrictID + "-sink", sink)) { delete sink; throw InvalidArgument("Another edge with the id '" + myCurrentDistrictID + "-sink' exists."); } sink->initialize(new std::vector()); - MSEdge* source = myEdgeControlBuilder.buildEdge(myCurrentDistrictID + "-source", MSEdge::EDGEFUNCTION_DISTRICT); + MSEdge* source = myEdgeControlBuilder.buildEdge(myCurrentDistrictID + "-source", MSEdge::EDGEFUNCTION_DISTRICT, "", "", -1); if (!MSEdge::dictionary(myCurrentDistrictID + "-source", source)) { delete source; throw InvalidArgument("Another edge with the id '" + myCurrentDistrictID + "-source' exists."); @@ -1134,8 +1054,8 @@ if (edge == 0) { throw InvalidArgument("The edge '" + *i + "' within district '" + myCurrentDistrictID + "' is not known."); } - source->addFollower(edge); - edge->addFollower(sink); + source->addSuccessor(edge); + edge->addSuccessor(sink); } } if (attrs.hasAttribute(SUMO_ATTR_SHAPE)) { @@ -1165,9 +1085,9 @@ if (succ != 0) { // connect edge if (isSource) { - MSEdge::dictionary(myCurrentDistrictID + "-source")->addFollower(succ); + MSEdge::dictionary(myCurrentDistrictID + "-source")->addSuccessor(succ); } else { - succ->addFollower(MSEdge::dictionary(myCurrentDistrictID + "-sink")); + succ->addSuccessor(MSEdge::dictionary(myCurrentDistrictID + "-sink")); } } else { WRITE_ERROR("At district '" + myCurrentDistrictID + "': succeeding edge '" + id + "' does not exist."); @@ -1218,4 +1138,16 @@ } +Position +NLShapeHandler::getLanePos(const std::string& poiID, const std::string& laneID, SUMOReal lanePos) { + MSLane* lane = MSLane::dictionary(laneID); + if (lane == 0) { + WRITE_ERROR("Lane '" + laneID + "' to place poi '" + poiID + "' on is not known."); + return Position::INVALID; + } + if (lanePos < 0) { + lanePos = lane->getLength() + lanePos; + } + return lane->geometryPositionAtOffset(lanePos); +} /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/netload/NLHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLHandler.h --- sumo-0.21.0+dfsg/src/netload/NLHandler.h 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Clemens Honomichl /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: NLHandler.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: NLHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The XML-Handler for network loading /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,26 @@ // =========================================================================== // class definitions // =========================================================================== + + +/** + * @class NLShapeHandler + * @brief The XML-Handler for shapes loading network loading + * + * This subclasses ShapeHandler with MSLane specific function + */ +class NLShapeHandler : public ShapeHandler { +public: + NLShapeHandler(const std::string& file, ShapeContainer& sc) : + ShapeHandler(file, sc) {} + + /// @brief Destructor + virtual ~NLShapeHandler() {} + + Position getLanePos(const std::string& poiID, const std::string& laneID, SUMOReal lanePos); +}; + + /** * @class NLHandler * @brief The XML-Handler for network loading @@ -309,6 +330,9 @@ /// @brief whether the loaded network contains internal lanes bool myHaveSeenInternalEdge; + /// @brief whether the location element was already loadee + bool myNetIsLoaded; + /// @brief temporary data for building the junction graph after network parsing is finished typedef std::map > JunctionGraph; JunctionGraph myJunctionGraph; @@ -323,6 +347,8 @@ }; + + #endif /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/netload/NLJunctionControlBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLJunctionControlBuilder.cpp --- sumo-0.21.0+dfsg/src/netload/NLJunctionControlBuilder.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLJunctionControlBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: NLJunctionControlBuilder.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NLJunctionControlBuilder.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Builder of microsim-junctions and tls /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -43,9 +43,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -135,6 +135,14 @@ } #endif break; + case NODETYPE_RAIL_SIGNAL: + myOffset = 0; + myActiveKey = myActiveID; + myActiveProgram = "0"; + myLogicType = TLTYPE_RAIL; + closeTrafficLightLogic(); + junction = buildLogicJunction(); + break; default: throw InvalidArgument("False junction logic type."); } @@ -156,7 +164,7 @@ MSJunction* NLJunctionControlBuilder::buildNoLogicJunction() { - return new MSNoLogicJunction(myActiveID, myPosition, myShape, myActiveIncomingLanes + return new MSNoLogicJunction(myActiveID, myType, myPosition, myShape, myActiveIncomingLanes #ifdef HAVE_INTERNAL_LANES , myActiveInternalLanes #endif @@ -168,7 +176,7 @@ NLJunctionControlBuilder::buildLogicJunction() { MSJunctionLogic* jtype = getJunctionLogicSecure(); // build the junction - return new MSRightOfWayJunction(myActiveID, myPosition, myShape, myActiveIncomingLanes, + return new MSRightOfWayJunction(myActiveID, myType, myPosition, myShape, myActiveIncomingLanes, #ifdef HAVE_INTERNAL_LANES myActiveInternalLanes, #endif @@ -180,7 +188,7 @@ MSJunction* NLJunctionControlBuilder::buildInternalJunction() { // build the junction - return new MSInternalJunction(myActiveID, myPosition, myShape, myActiveIncomingLanes, + return new MSInternalJunction(myActiveID, myType, myPosition, myShape, myActiveIncomingLanes, myActiveInternalLanes); } #endif @@ -214,29 +222,30 @@ } return; } - if (myAbsDuration == 0) { - throw InvalidArgument("TLS program '" + myActiveProgram + "' for TLS '" + myActiveKey + "' has a duration of 0."); - } - // compute the initial step and first switch time of the tls-logic - // a positive offset delays all phases by x (advance by absDuration - x) while a negative offset advances all phases by x seconds - // @note The implementation of % for negative values is implementation defined in ISO1998 - SUMOTime offset; // the time to run the traffic light in advance - if (myOffset >= 0) { - offset = (myNet.getCurrentTimeStep() + myAbsDuration - (myOffset % myAbsDuration)) % myAbsDuration; - } else { - offset = (myNet.getCurrentTimeStep() + ((-myOffset) % myAbsDuration)) % myAbsDuration; - } - unsigned int step = 0; SUMOTime firstEventOffset = 0; + unsigned int step = 0; MSSimpleTrafficLightLogic::Phases::const_iterator i = myActivePhases.begin(); - while (offset >= (*i)->duration) { - step++; - offset -= (*i)->duration; - ++i; + if (myLogicType != TLTYPE_RAIL) { + if (myAbsDuration == 0) { + throw InvalidArgument("TLS program '" + myActiveProgram + "' for TLS '" + myActiveKey + "' has a duration of 0."); + } + // compute the initial step and first switch time of the tls-logic + // a positive offset delays all phases by x (advance by absDuration - x) while a negative offset advances all phases by x seconds + // @note The implementation of % for negative values is implementation defined in ISO1998 + SUMOTime offset; // the time to run the traffic light in advance + if (myOffset >= 0) { + offset = (myNet.getCurrentTimeStep() + myAbsDuration - (myOffset % myAbsDuration)) % myAbsDuration; + } else { + offset = (myNet.getCurrentTimeStep() + ((-myOffset) % myAbsDuration)) % myAbsDuration; + } + while (offset >= (*i)->duration) { + step++; + offset -= (*i)->duration; + ++i; + } + firstEventOffset = (*i)->duration - offset + myNet.getCurrentTimeStep(); } - firstEventOffset = (*i)->duration - offset + myNet.getCurrentTimeStep(); - // if (myActiveProgram == "") { myActiveProgram = "default"; } @@ -244,15 +253,11 @@ // build the tls-logic in dependance to its type switch (myLogicType) { case TLTYPE_ACTUATED: + // @note it is unclear how to apply the given offset in the context + // of variable-length phases tlLogic = new MSActuatedTrafficLightLogic(getTLLogicControlToUse(), myActiveKey, myActiveProgram, - myActivePhases, step, firstEventOffset, - myAdditionalParameter); - break; - case TLTYPE_AGENT: - tlLogic = new MSAgentbasedTrafficLightLogic(getTLLogicControlToUse(), - myActiveKey, myActiveProgram, - myActivePhases, step, firstEventOffset, + myActivePhases, step, (*i)->minDuration + myNet.getCurrentTimeStep(), myAdditionalParameter); break; case TLTYPE_STATIC: @@ -262,6 +267,11 @@ myActivePhases, step, firstEventOffset, myAdditionalParameter); break; + case TLTYPE_RAIL: + tlLogic = new MSRailSignal(getTLLogicControlToUse(), + myActiveKey, myActiveProgram, + myAdditionalParameter); + break; } myActivePhases.clear(); if (tlLogic != 0) { diff -Nru sumo-0.21.0+dfsg/src/netload/NLJunctionControlBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLJunctionControlBuilder.h --- sumo-0.21.0+dfsg/src/netload/NLJunctionControlBuilder.h 2014-05-05 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLJunctionControlBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: NLJunctionControlBuilder.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: NLJunctionControlBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Builder of microsim-junctions and tls /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -265,6 +266,11 @@ /// @brief try to retrieve junction by id MSJunction* retrieve(const std::string id); + /// @brief return the number of phases loaded so far (for error reporting) + size_t getNumberOfLoadedPhases() const { + return myActivePhases.size(); + } + protected: /** @brief Returns the current junction logic diff -Nru sumo-0.21.0+dfsg/src/netload/NLTriggerBuilder.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLTriggerBuilder.cpp --- sumo-0.21.0+dfsg/src/netload/NLTriggerBuilder.cpp 2014-02-22 23:02:25.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLTriggerBuilder.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Thu, 17 Oct 2002 -/// @version $Id: NLTriggerBuilder.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NLTriggerBuilder.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Builds trigger objects for microsim /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,7 @@ #include "NLHandler.h" #include "NLTriggerBuilder.h" #include +#include #ifdef HAVE_INTERNAL @@ -106,9 +108,9 @@ } if (end >= string2time(OptionsCont::getOptions().getString("begin"))) { Command* cb = new WrappingCommand< MSEdge >(e, &MSEdge::incVaporization); - MSNet::getInstance()->getBeginOfTimestepEvents().addEvent(cb, begin, MSEventControl::ADAPT_AFTER_EXECUTION); + MSNet::getInstance()->getBeginOfTimestepEvents()->addEvent(cb, begin, MSEventControl::ADAPT_AFTER_EXECUTION); Command* ce = new WrappingCommand< MSEdge >(e, &MSEdge::decVaporization); - MSNet::getInstance()->getBeginOfTimestepEvents().addEvent(ce, end, MSEventControl::ADAPT_AFTER_EXECUTION); + MSNet::getInstance()->getBeginOfTimestepEvents()->addEvent(ce, end, MSEventControl::ADAPT_AFTER_EXECUTION); } } @@ -178,6 +180,29 @@ buildBusStop(net, id, lines, lane, frompos, topos); } +void +NLTriggerBuilder::parseAndBuildContainerStop(MSNet& net, const SUMOSAXAttributes& attrs) { + bool ok = true; + // get the id, throw if not given or empty... + std::string id = attrs.get(SUMO_ATTR_ID, 0, ok); + if (!ok) { + throw ProcessError(); + } + // get the lane + MSLane* lane = getLane(attrs, "containerStop", id); + // get the positions + SUMOReal frompos = attrs.getOpt(SUMO_ATTR_STARTPOS, id.c_str(), ok, 0); + SUMOReal topos = attrs.getOpt(SUMO_ATTR_ENDPOS, id.c_str(), ok, lane->getLength()); + const bool friendlyPos = attrs.getOpt(SUMO_ATTR_FRIENDLY_POS, id.c_str(), ok, false); + if (!ok || !myHandler->checkStopPos(frompos, topos, lane->getLength(), POSITION_EPS, friendlyPos)) { + throw InvalidArgument("Invalid position for container stop '" + id + "'."); + } + // get the lines + std::vector lines; + SUMOSAXAttributes::parseStringVector(attrs.getOpt(SUMO_ATTR_LINES, id.c_str(), ok, "", false), lines); + // build the container stop + buildContainerStop(net, id, lines, lane, frompos, topos); +} void NLTriggerBuilder::parseAndBuildCalibrator(MSNet& net, const SUMOSAXAttributes& attrs, @@ -230,7 +255,7 @@ if (!ok) { throw InvalidArgument("The edge to use within MSTriggeredRerouter '" + id + "' is not known."); } - std::vector edges; + MSEdgeVector edges; std::vector edgeIDs; SUMOSAXAttributes::parseStringVector(objectid, edgeIDs); for (std::vector::iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) { @@ -249,8 +274,11 @@ throw InvalidArgument("Could not parse MSTriggeredRerouter '" + id + "'."); } MSTriggeredRerouter* trigger = buildRerouter(net, id, edges, prob, file, off); + // read in the trigger description if (file == "") { trigger->registerParent(SUMO_TAG_REROUTER, myHandler); + } else if (!XMLSubSys::runParser(*trigger, file)) { + throw ProcessError(); } } @@ -283,14 +311,14 @@ MSEdge* edge, SUMOReal pos, const std::string& file, const std::string& outfile, - const SUMOTime freq, MSRouteProbe* probe) { + const SUMOTime freq, const MSRouteProbe* probe) { return new MSCalibrator(id, edge, pos, file, outfile, freq, edge->getLength(), probe); } MSTriggeredRerouter* NLTriggerBuilder::buildRerouter(MSNet&, const std::string& id, - std::vector& edges, + MSEdgeVector& edges, SUMOReal prob, const std::string& file, bool off) { return new MSTriggeredRerouter(id, edges, prob, file, off); } @@ -307,6 +335,18 @@ } } + +void +NLTriggerBuilder::buildContainerStop(MSNet& net, const std::string& id, + const std::vector& lines, + MSLane* lane, SUMOReal frompos, SUMOReal topos) { + MSContainerStop* stop = new MSContainerStop(id, lines, *lane, frompos, topos); + if (!net.addContainerStop(stop)) { + delete stop; + throw InvalidArgument("Could not build container stop '" + id + "'; probably declared twice."); + } +} + diff -Nru sumo-0.21.0+dfsg/src/netload/NLTriggerBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLTriggerBuilder.h --- sumo-0.21.0+dfsg/src/netload/NLTriggerBuilder.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netload/NLTriggerBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Thu, 17 Oct 2002 -/// @version $Id: NLTriggerBuilder.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NLTriggerBuilder.h 18096 2015-03-17 09:50:59Z behrisch $ /// // Builds trigger objects for microsim /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -141,6 +141,15 @@ void parseAndBuildBusStop(MSNet& net, const SUMOSAXAttributes& attrs); + /** @brief Parses his values and builds a container stop + * + * @param[in] net The network the container stop belongs to + * @param[in] attrs SAX-attributes which define the trigger + * @exception InvalidArgument If a parameter (lane/position) is not valid + */ + void parseAndBuildContainerStop(MSNet& net, const SUMOSAXAttributes& attrs); + + /** @brief Parses his values and builds a mesoscopic or microscopic calibrator * * @param[in] net The network the calibrator belongs to @@ -197,6 +206,23 @@ MSLane* lane, SUMOReal frompos, SUMOReal topos); + /** @brief Builds a container stop + * + * Simply calls the MSContainerStop constructor. + * + * @param[in] net The net the container stop belongs to + * @param[in] id The id of the container stop + * @param[in] lines Names of the lines that halt on this container stop + * @param[in] lane The lane the container stop is placed on + * @param[in] frompos Begin position of the container stop on the lane + * @param[in] topos End position of the container stop on the lane + * @exception InvalidArgument If the container stop can not be added to the net (is duplicate) + */ + virtual void buildContainerStop(MSNet& net, + const std::string& id, const std::vector& lines, + MSLane* lane, SUMOReal frompos, SUMOReal topos); + + /** @brief builds a microscopic calibrator * * Simply calls the MSCalibrator constructor. @@ -211,7 +237,7 @@ virtual MSCalibrator* buildCalibrator(MSNet& net, const std::string& id, MSEdge* edge, SUMOReal pos, const std::string& file, const std::string& outfile, - const SUMOTime freq, MSRouteProbe* probe); + const SUMOTime freq, const MSRouteProbe* probe); #ifdef HAVE_INTERNAL /** @brief builds a mesoscopic calibrator * @@ -242,7 +268,7 @@ * @param[in] file The file to read the reroute definitions from */ virtual MSTriggeredRerouter* buildRerouter(MSNet& net, - const std::string& id, std::vector& edges, + const std::string& id, MSEdgeVector& edges, SUMOReal prob, const std::string& file, bool off); //@} diff -Nru sumo-0.21.0+dfsg/src/netwrite/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/Makefile.in --- sumo-0.21.0+dfsg/src/netwrite/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -223,6 +223,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -233,7 +235,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWFrame.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWFrame.cpp --- sumo-0.21.0+dfsg/src/netwrite/NWFrame.cpp 2014-04-11 22:02:32.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWFrame.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NWFrame.cpp 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: NWFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for netwrite /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -83,9 +83,6 @@ } #endif // HAVE_PROJ - oc.doRegister("map-output", 'M', new Option_FileName()); - oc.addDescription("map-output", "Output", "Writes joined edges information to FILE"); - oc.doRegister("amitran-output", new Option_FileName()); oc.addDescription("amitran-output", "Output", "The generated net will be written to FILE using Amitran format"); @@ -139,12 +136,6 @@ 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")) { - OutputDevice& mdevice = OutputDevice::getDevice(oc.getString("map-output")); - mdevice << nb.getJoinedEdgesMap(); - mdevice.close(); - } } diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWFrame.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWFrame.h --- sumo-0.21.0+dfsg/src/netwrite/NWFrame.h 2014-02-22 23:02:35.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWFrame.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: NWFrame.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NWFrame.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for netwrite /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWWriter_Amitran.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_Amitran.cpp --- sumo-0.21.0+dfsg/src/netwrite/NWWriter_Amitran.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_Amitran.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NWWriter_Amitran.cpp /// @author Michael Behrisch /// @date 13.03.2014 -/// @version $Id: NWWriter_Amitran.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NWWriter_Amitran.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Exporter writing networks using the Amitran format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -57,17 +57,18 @@ if (!oc.isSet("amitran-output")) { return; } + NBEdgeCont& ec = nb.getEdgeCont(); OutputDevice& device = OutputDevice::getDevice(oc.getString("amitran-output")); device << "\n"; - device << "\n"; + device << "\n"; // write nodes int index = 0; NBNodeCont& nc = nb.getNodeCont(); std::set singleRoundaboutNodes; std::set multiRoundaboutNodes; - const std::vector& roundabouts = nb.getRoundabouts(); - for (std::vector::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) { - for (EdgeVector::const_iterator j = (*i).begin(); j != (*i).end(); ++j) { + const std::set& roundabouts = ec.getRoundabouts(); + for (std::set::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) { + for (EdgeSet::const_iterator j = (*i).begin(); j != (*i).end(); ++j) { if ((*j)->getNumLanes() > 1) { multiRoundaboutNodes.insert((*j)->getFromNode()); } else { @@ -104,6 +105,9 @@ case NODETYPE_ALLWAY_STOP: device << "\" type=\"allwayStop"; break; + case NODETYPE_RAIL_SIGNAL: + device << "\" type=\"railSignal"; + break; case NODETYPE_DEAD_END: case NODETYPE_DEAD_END_DEPRECATED: device << "\" type=\"deadEnd"; @@ -118,7 +122,6 @@ } // write edges index = 0; - NBEdgeCont& ec = nb.getEdgeCont(); for (std::map::const_iterator i = ec.begin(); i != ec.end(); ++i) { device << " second->getFromNode()] diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWWriter_Amitran.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_Amitran.h --- sumo-0.21.0+dfsg/src/netwrite/NWWriter_Amitran.h 2014-04-11 22:02:32.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_Amitran.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NWWriter_Amitran.h /// @author Michael Behrisch /// @date 13.03.2014 -/// @version $Id: NWWriter_Amitran.h 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: NWWriter_Amitran.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Exporter writing networks using the Amitran format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWWriter_DlrNavteq.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_DlrNavteq.cpp --- sumo-0.21.0+dfsg/src/netwrite/NWWriter_DlrNavteq.cpp 2014-04-11 22:02:32.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_DlrNavteq.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 26.10.2012 -/// @version $Id: NWWriter_DlrNavteq.cpp 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: NWWriter_DlrNavteq.cpp 18102 2015-03-18 11:55:16Z behrisch $ /// // Exporter writing networks using DlrNavteq (Elmar) format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -141,6 +141,7 @@ void NWWriter_DlrNavteq::writeLinksUnsplitted(const OptionsCont& oc, NBEdgeCont& ec) { + std::map nameIDs; OutputDevice& device = OutputDevice::getDevice(oc.getString("dlr-navteq-output") + "_links_unsplitted.txt"); writeHeader(device, oc); // write format specifier @@ -150,6 +151,14 @@ NBEdge* e = (*i).second; const int kph = speedInKph(e->getSpeed()); const std::string& betweenNodeID = (e->getGeometry().size() > 2) ? e->getID() : UNDEFINED; + std::string nameID = UNDEFINED; + if (oc.getBool("output.street-names")) { + const std::string& name = i->second->getStreetName(); + if (name != "" && nameIDs.count(name) == 0) { + nameID = toString(nameIDs.size()); + nameIDs[name] = nameID; + } + } device << e->getID() << "\t" << e->getFromNode()->getID() << "\t" << e->getToNode()->getID() << "\t" @@ -163,7 +172,7 @@ << getNavteqLaneCode(e->getNumLanes()) << "\t" << getSpeedCategoryUpperBound(kph) << "\t" << kph << "\t" - << UNDEFINED << "\t" // NAME_ID1_REGIONAL XXX + << nameID << "\t" // NAME_ID1_REGIONAL XXX << UNDEFINED << "\t" // NAME_ID2_LOCAL XXX << UNDEFINED << "\t" // housenumbers_right << UNDEFINED << "\t" // housenumbers_left @@ -177,6 +186,15 @@ << "0\t" // connection (between nodes always in order) << "\n"; } + if (oc.getBool("output.street-names")) { + OutputDevice& namesDevice = OutputDevice::getDevice(oc.getString("dlr-navteq-output") + "_names.txt"); + writeHeader(namesDevice, oc); + // write format specifier + namesDevice << "# NAME_ID\tName\n" << nameIDs.size() << "\n"; + for (std::map::const_iterator i = nameIDs.begin(); i != nameIDs.end(); ++i) { + namesDevice << i->second << "\t" << i->first << "\n"; + } + } } diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWWriter_DlrNavteq.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_DlrNavteq.h --- sumo-0.21.0+dfsg/src/netwrite/NWWriter_DlrNavteq.h 2014-04-11 22:02:32.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_DlrNavteq.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 26.10.2012 -/// @version $Id: NWWriter_DlrNavteq.h 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: NWWriter_DlrNavteq.h 18102 2015-03-18 11:55:16Z behrisch $ /// // Exporter writing networks using DlrNavteq (Elmar) format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -80,7 +80,6 @@ /** @brief Writes the links_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 writeLinksUnsplitted(const OptionsCont& oc, NBEdgeCont& ec); diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWWriter_MATSim.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_MATSim.cpp --- sumo-0.21.0+dfsg/src/netwrite/NWWriter_MATSim.cpp 2014-02-22 23:02:35.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_MATSim.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 04.05.2011 -/// @version $Id: NWWriter_MATSim.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NWWriter_MATSim.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Exporter writing networks using the MATSim format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWWriter_MATSim.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_MATSim.h --- sumo-0.21.0+dfsg/src/netwrite/NWWriter_MATSim.h 2014-02-22 23:02:35.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_MATSim.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 04.05.2011 -/// @version $Id: NWWriter_MATSim.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NWWriter_MATSim.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Exporter writing networks using the MATSim format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWWriter_OpenDrive.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_OpenDrive.cpp --- sumo-0.21.0+dfsg/src/netwrite/NWWriter_OpenDrive.cpp 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_OpenDrive.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Tue, 04.05.2011 -/// @version $Id: NWWriter_OpenDrive.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NWWriter_OpenDrive.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Exporter writing networks using the openDRIVE format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWWriter_OpenDrive.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_OpenDrive.h --- sumo-0.21.0+dfsg/src/netwrite/NWWriter_OpenDrive.h 2014-02-22 23:02:35.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_OpenDrive.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file NWWriter_OpenDrive.h /// @author Daniel Krajzewicz /// @date Tue, 04.05.2011 -/// @version $Id: NWWriter_OpenDrive.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NWWriter_OpenDrive.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Exporter writing networks using the openDRIVE format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWWriter_SUMO.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_SUMO.cpp --- sumo-0.21.0+dfsg/src/netwrite/NWWriter_SUMO.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_SUMO.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 04.05.2011 -/// @version $Id: NWWriter_SUMO.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: NWWriter_SUMO.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Exporter writing networks using the SUMO format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -67,7 +67,7 @@ return; } OutputDevice& device = OutputDevice::getDevice(oc.getString("output-file")); - device.writeXMLHeader("net", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/net_file.xsd\""); // street names may contain non-ascii chars + device.writeXMLHeader("net", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/net_file.xsd\""); // street names may contain non-ascii chars device.lf(); // get involved container const NBNodeCont& nc = nb.getNodeCont(); @@ -75,7 +75,7 @@ const NBDistrictCont& dc = nb.getDistrictCont(); // write network offsets and projection - writeLocation(device); + GeoConvHelper::writeLocation(device); // write inner lanes bool origNames = oc.getBool("output.original-names"); @@ -104,9 +104,9 @@ const bool checkLaneFoesAll = oc.getBool("check-lane-foes.all"); const bool checkLaneFoesRoundabout = !checkLaneFoesAll && oc.getBool("check-lane-foes.roundabout"); if (checkLaneFoesRoundabout) { - const std::vector& roundabouts = nb.getRoundabouts(); - for (std::vector::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) { - for (EdgeVector::const_iterator j = (*i).begin(); j != (*i).end(); ++j) { + const std::set& roundabouts = ec.getRoundabouts(); + for (std::set::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) { + for (EdgeSet::const_iterator j = (*i).begin(); j != (*i).end(); ++j) { roundaboutNodes.insert((*j)->getToNode()); } } @@ -195,25 +195,7 @@ } // write roundabout information - const std::vector& roundabouts = nb.getRoundabouts(); - // make output deterministic - std::vector > edgeIDs; - for (std::vector::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) { - std::vector tEdgeIDs; - for (EdgeVector::const_iterator j = (*i).begin(); j != (*i).end(); ++j) { - tEdgeIDs.push_back((*j)->getID()); - } - std::sort(tEdgeIDs.begin(), tEdgeIDs.end()); - edgeIDs.push_back(tEdgeIDs); - } - std::sort(edgeIDs.begin(), edgeIDs.end()); - // write - for (std::vector >::const_iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) { - writeRoundabout(device, *i, ec); - } - if (roundabouts.size() != 0) { - device.lf(); - } + writeRoundabouts(device, ec.getRoundabouts(), ec); // write the districts for (std::map::const_iterator i = dc.begin(); i != dc.end(); i++) { @@ -271,7 +253,7 @@ writeLane(into, internalEdgeID, (*k).getInternalLaneID(), (*k).vmax, successor.permissions, successor.preferred, NBEdge::UNSPECIFIED_OFFSET, successor.width, (*k).shape, (*k).origID, - length, (*k).internalLaneIndex, origNames); + length, (*k).internalLaneIndex, origNames, &n); haveVia = haveVia || (*k).haveVia; } ret = true; @@ -293,7 +275,7 @@ writeLane(into, (*k).viaID, (*k).viaID + "_0", (*k).viaVmax, SVCAll, SVCAll, NBEdge::UNSPECIFIED_OFFSET, successor.width, (*k).viaShape, (*k).origID, MAX2((*k).viaShape.length(), POSITION_EPS), // microsim needs positive length - 0, origNames); + 0, origNames, &n); into.closeTag(); } } @@ -307,7 +289,7 @@ into.writeAttr(SUMO_ATTR_FUNCTION, EDGEFUNC_CROSSING); into.writeAttr(SUMO_ATTR_CROSSING_EDGES, (*it).edges); writeLane(into, (*it).id, (*it).id + "_0", 1, SVC_PEDESTRIAN, 0, - NBEdge::UNSPECIFIED_OFFSET, (*it).width, (*it).shape, "", (*it).shape.length(), 0, false); + NBEdge::UNSPECIFIED_OFFSET, (*it).width, (*it).shape, "", (*it).shape.length(), 0, false, &n); into.closeTag(); } // write pedestrian walking areas @@ -318,7 +300,7 @@ into.writeAttr(SUMO_ATTR_ID, wa.id); into.writeAttr(SUMO_ATTR_FUNCTION, EDGEFUNC_WALKINGAREA); writeLane(into, wa.id, wa.id + "_0", 1, SVC_PEDESTRIAN, 0, - NBEdge::UNSPECIFIED_OFFSET, wa.width, wa.shape, "", wa.length, 0, false); + NBEdge::UNSPECIFIED_OFFSET, wa.width, wa.shape, "", wa.length, 0, false, &n); into.closeTag(); } return ret; @@ -379,8 +361,9 @@ void NWWriter_SUMO::writeLane(OutputDevice& into, const std::string& eID, const std::string& lID, SUMOReal speed, SVCPermissions permissions, SVCPermissions preferred, - SUMOReal endOffset, SUMOReal width, const PositionVector& shape, - const std::string& origID, SUMOReal length, unsigned int index, bool origNames) { + SUMOReal endOffset, SUMOReal width, PositionVector shape, + const std::string& origID, SUMOReal length, unsigned int index, bool origNames, + const NBNode* node) { // 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 @@ -405,6 +388,14 @@ if (width != NBEdge::UNSPECIFIED_WIDTH) { into.writeAttr(SUMO_ATTR_WIDTH, width); } + if (node != 0) { + const NBNode::CustomShapeMap& cs = node->getCustomLaneShapes(); + NBNode::CustomShapeMap::const_iterator it = cs.find(lID); + if (it != cs.end()) { + shape = it->second; + into.writeAttr(SUMO_ATTR_CUSTOMSHAPE, true); + } + } into.writeAttr(SUMO_ATTR_SHAPE, endOffset > 0 ? shape.getSubpart(0, shape.length() - endOffset) : shape); if (origNames && origID != "") { @@ -464,12 +455,22 @@ } } } - for (std::vector::const_iterator it = crossings.begin(); it != crossings.end(); it++) { - intLanes += ' ' + (*it).id + "_0"; + if (n.getType() != NODETYPE_DEAD_END && n.getType() != NODETYPE_NOJUNCTION) { + for (std::vector::const_iterator it = crossings.begin(); it != crossings.end(); it++) { + intLanes += ' ' + (*it).id + "_0"; + } } into.writeAttr(SUMO_ATTR_INTLANES, intLanes); // close writing into.writeAttr(SUMO_ATTR_SHAPE, n.getShape()); + // write optional radius + if (n.getRadius() != NBNode::UNSPECIFIED_RADIUS) { + into.writeAttr(SUMO_ATTR_RADIUS, n.getRadius()); + } + // specify whether a custom shape was used + if (n.hasCustomShape()) { + into.writeAttr(SUMO_ATTR_CUSTOMSHAPE, true); + } if (n.getType() == NODETYPE_DEAD_END) { into.closeTag(); } else { @@ -556,7 +557,7 @@ into.writeAttr(SUMO_ATTR_DIR, toString(dir)); // write the state information const LinkState linkState = from.getToNode()->getLinkState( - &from, c.toEdge, c.toLane, c.mayDefinitelyPass, c.tlID); + &from, c.toEdge, c.fromLane, c.mayDefinitelyPass, c.tlID); into.writeAttr(SUMO_ATTR_STATE, linkState); } } @@ -608,17 +609,55 @@ void +NWWriter_SUMO::writeRoundabouts(OutputDevice& into, const std::set& roundabouts, + const NBEdgeCont& ec) { + // make output deterministic + std::vector > edgeIDs; + for (std::set::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) { + std::vector tEdgeIDs; + for (EdgeSet::const_iterator j = (*i).begin(); j != (*i).end(); ++j) { + tEdgeIDs.push_back((*j)->getID()); + } + std::sort(tEdgeIDs.begin(), tEdgeIDs.end()); + edgeIDs.push_back(tEdgeIDs); + } + std::sort(edgeIDs.begin(), edgeIDs.end()); + // write + for (std::vector >::const_iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) { + writeRoundabout(into, *i, ec); + } + if (roundabouts.size() != 0) { + into.lf(); + } +} + + +void NWWriter_SUMO::writeRoundabout(OutputDevice& into, const std::vector& edgeIDs, const NBEdgeCont& ec) { + std::vector validEdgeIDs; + std::vector invalidEdgeIDs; std::vector nodeIDs; for (std::vector::const_iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) { - nodeIDs.push_back(ec.retrieve(*i)->getToNode()->getID()); + const NBEdge* edge = ec.retrieve(*i); + if (edge != 0) { + nodeIDs.push_back(edge->getToNode()->getID()); + validEdgeIDs.push_back(edge->getID()); + } else { + invalidEdgeIDs.push_back(*i); + } } std::sort(nodeIDs.begin(), nodeIDs.end()); - into.openTag(SUMO_TAG_ROUNDABOUT); - into.writeAttr(SUMO_ATTR_NODES, joinToString(nodeIDs, " ")); - into.writeAttr(SUMO_ATTR_EDGES, joinToString(edgeIDs, " ")); - into.closeTag(); + if (validEdgeIDs.size() > 0) { + into.openTag(SUMO_TAG_ROUNDABOUT); + into.writeAttr(SUMO_ATTR_NODES, joinToString(nodeIDs, " ")); + into.writeAttr(SUMO_ATTR_EDGES, joinToString(validEdgeIDs, " ")); + into.closeTag(); + if (invalidEdgeIDs.size() > 0) { + WRITE_WARNING("Writing incomplete roundabout. Edges: '" + + joinToString(invalidEdgeIDs, " ") + "' no longer exist'"); + } + } } @@ -719,25 +758,6 @@ } -void -NWWriter_SUMO::writeLocation(OutputDevice& into) { - const GeoConvHelper& geoConvHelper = GeoConvHelper::getFinal(); - into.openTag(SUMO_TAG_LOCATION); - into.writeAttr(SUMO_ATTR_NET_OFFSET, geoConvHelper.getOffsetBase()); - 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(); - into.lf(); -} - - void NWWriter_SUMO::writePermissions(OutputDevice& into, SVCPermissions permissions) { if (permissions == SVCAll) { diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWWriter_SUMO.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_SUMO.h --- sumo-0.21.0+dfsg/src/netwrite/NWWriter_SUMO.h 2014-05-05 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_SUMO.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 04.05.2011 -/// @version $Id: NWWriter_SUMO.h 16286 2014-05-05 07:14:06Z namdre $ +/// @version $Id: NWWriter_SUMO.h 18096 2015-03-17 09:50:59Z behrisch $ /// // Exporter writing networks using the SUMO format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -93,15 +93,20 @@ /// @brief writes the traffic light logics to the given device static void writeTrafficLights(OutputDevice& into, const NBTrafficLightLogicCont& tllCont); - /// @brief writes the location element - static void writeLocation(OutputDevice& into); - /// @brief writes allowed disallowed attributes if needed; static void writePermissions(OutputDevice& into, SVCPermissions permissions); /// @brief writes allowed disallowed attributes if needed; static void writePreferences(OutputDevice& into, SVCPermissions preferred); + /** @brief Writes roundabouts + * @param[in] into The device to write the edge into + * @param[in] roundaboutes The roundabouts to write + * @param[in] ec The edge control to retrieve named edges from + */ + static void writeRoundabouts(OutputDevice& into, const std::set& roundabouts, + const NBEdgeCont& ec); + protected: /// @name Methods for writing network parts /// @{ @@ -132,11 +137,13 @@ * @param[in] length Lane's length * @param[in] index The index of the lane within the edge * @param[in] origNames Whether original names shall be written as parameter + * @param[in] node The node to check for custom shape data */ static void writeLane(OutputDevice& into, const std::string& eID, const std::string& lID, SUMOReal speed, SVCPermissions permissions, SVCPermissions preferred, - SUMOReal endOffset, SUMOReal width, const PositionVector& shape, - const std::string& origID, SUMOReal length, unsigned int index, bool origNames); + SUMOReal endOffset, SUMOReal width, PositionVector shape, + const std::string& origID, SUMOReal length, unsigned int index, bool origNames, + const NBNode* node = 0); /** @brief Writes a junction (& r, - const NBEdgeCont& ec); - - /** @brief Writes a district * @param[in] into The device to write the edge into * @param[in] d The district */ static void writeDistrict(OutputDevice& into, const NBDistrict& d); - private: /** @brief Writes a single internal connection * @param[in] from The id of the from-edge @@ -194,6 +191,16 @@ /// @brief the attribute value for a prohibition static std::string prohibitionConnection(const NBConnection& c); + + /** @brief Writes a roundabout + * @param[in] into The device to write the edge into + * @param[in] r The roundabout to write + * @param[in] ec The edge control to retrieve named edges from + */ + static void writeRoundabout(OutputDevice& into, const std::vector& r, + const NBEdgeCont& ec); + + }; diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWWriter_XML.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_XML.cpp --- sumo-0.21.0+dfsg/src/netwrite/NWWriter_XML.cpp 2014-05-22 22:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_XML.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 11.05.2011 -/// @version $Id: NWWriter_XML.cpp 16414 2014-05-22 14:12:38Z namdre $ +/// @version $Id: NWWriter_XML.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Exporter writing networks using XML (native input) format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -85,11 +85,11 @@ const bool geoAccuracy = useGeo || gch.usingInverseGeoProjection(); OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".nod.xml"); - device.writeXMLHeader("nodes", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/nodes_file.xsd\""); + device.writeXMLHeader("nodes", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/nodes_file.xsd\""); // write network offsets and projection to allow reconstruction of original coordinates if (!useGeo) { - NWWriter_SUMO::writeLocation(device); + GeoConvHelper::writeLocation(device); } // write nodes @@ -134,6 +134,9 @@ if (n->hasCustomShape()) { device.writeAttr(SUMO_ATTR_SHAPE, n->getShape()); } + if (n->getRadius() != NBNode::UNSPECIFIED_RADIUS) { + device.writeAttr(SUMO_ATTR_RADIUS, n->getRadius()); + } device.closeTag(); } device.close(); @@ -147,9 +150,9 @@ const bool geoAccuracy = useGeo || gch.usingInverseGeoProjection(); OutputDevice& edevice = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".edg.xml"); - edevice.writeXMLHeader("edges", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/edges_file.xsd\""); + edevice.writeXMLHeader("edges", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/edges_file.xsd\""); OutputDevice& cdevice = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".con.xml"); - cdevice.writeXMLHeader("connections", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/connections_file.xsd\""); + cdevice.writeXMLHeader("connections", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/connections_file.xsd\""); bool noNames = !oc.getBool("output.street-names"); for (std::map::const_iterator i = ec.begin(); i != ec.end(); ++i) { // write the edge itself to the edges-files @@ -235,6 +238,11 @@ cdevice << "\n"; } } + // write roundabout information to the edges-files + if (ec.getRoundabouts().size() > 0) { + edevice.lf(); + NWWriter_SUMO::writeRoundabouts(edevice, ec.getRoundabouts(), ec); + } // write loaded prohibitions to the connections-file for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { @@ -254,6 +262,17 @@ cdevice.closeTag(); } } + // write customShapes to the connection-file + for (std::map::const_iterator it_node = nc.begin(); it_node != nc.end(); ++it_node) { + NBNode::CustomShapeMap customShapes = (*it_node).second->getCustomLaneShapes(); + for (NBNode::CustomShapeMap::const_iterator it = customShapes.begin(); it != customShapes.end(); ++it) { + cdevice.openTag(SUMO_TAG_CUSTOMSHAPE); + cdevice.writeAttr(SUMO_ATTR_ID, (*it).first); + cdevice.writeAttr(SUMO_ATTR_SHAPE, (*it).second); + cdevice.closeTag(); + } + } + edevice.close(); cdevice.close(); } @@ -262,7 +281,7 @@ void NWWriter_XML::writeTrafficLights(const OptionsCont& oc, NBTrafficLightLogicCont& tc, NBEdgeCont& ec) { OutputDevice& device = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".tll.xml"); - device.writeXMLHeader("tlLogics", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/tllogic_file.xsd\""); + device.writeXMLHeader("tlLogics", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/tllogic_file.xsd\""); NWWriter_SUMO::writeTrafficLights(device, tc); // we also need to remember the associations between tlLogics and connections // since the information in con.xml is insufficient @@ -283,7 +302,7 @@ void NWWriter_XML::writeJoinedJunctions(const OptionsCont& oc, NBNodeCont& nc) { OutputDevice& device = OutputDevice::getDevice(oc.getString("junctions.join-output")); - device.writeXMLHeader("nodes", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/nodes_file.xsd\""); + device.writeXMLHeader("nodes", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/nodes_file.xsd\""); const std::vector >& clusters = nc.getJoinedClusters(); for (std::vector >::const_iterator it = clusters.begin(); it != clusters.end(); it++) { assert((*it).size() > 0); @@ -305,7 +324,7 @@ void NWWriter_XML::writeStreetSigns(const OptionsCont& oc, NBEdgeCont& ec) { OutputDevice& device = OutputDevice::getDevice(oc.getString("street-sign-output")); - device.writeXMLHeader("pois", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/poi_file.xsd\""); + device.writeXMLHeader("pois", NWFrame::MAJOR_VERSION + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/additional_file.xsd\""); for (std::map::const_iterator i = ec.begin(); i != ec.end(); ++i) { NBEdge* e = (*i).second; const std::vector& signs = e->getSigns(); diff -Nru sumo-0.21.0+dfsg/src/netwrite/NWWriter_XML.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_XML.h --- sumo-0.21.0+dfsg/src/netwrite/NWWriter_XML.h 2014-02-22 23:02:35.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/netwrite/NWWriter_XML.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 11.05.2011 -/// @version $Id: NWWriter_XML.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NWWriter_XML.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Exporter writing networks using XML (native input) format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -89,8 +89,7 @@ /** @brief Writes the edges and connections 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 + * @param[in] nb The network build from which to read data */ static void writeEdgesAndConnections(const OptionsCont& oc, NBNodeCont& nc, NBEdgeCont& ec); diff -Nru sumo-0.21.0+dfsg/src/od/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/Makefile.am --- sumo-0.21.0+dfsg/src/od/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,7 @@ +noinst_LIBRARIES = libod.a + +libod_a_SOURCES = ODDistrict.cpp ODDistrict.h \ +ODDistrictCont.cpp ODDistrictCont.h \ +ODAmitranHandler.cpp ODAmitranHandler.h \ +ODDistrictHandler.cpp ODDistrictHandler.h \ +ODCell.h ODMatrix.h ODMatrix.cpp diff -Nru sumo-0.21.0+dfsg/src/od/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/Makefile.in --- sumo-0.21.0+dfsg/src/od/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,625 @@ +# Makefile.in generated by automake 1.13.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +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/od +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +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 +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libod_a_AR = $(AR) $(ARFLAGS) +libod_a_LIBADD = +am_libod_a_OBJECTS = ODDistrict.$(OBJEXT) ODDistrictCont.$(OBJEXT) \ + ODAmitranHandler.$(OBJEXT) ODDistrictHandler.$(OBJEXT) \ + ODMatrix.$(OBJEXT) +libod_a_OBJECTS = $(am_libod_a_OBJECTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +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) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libod_a_SOURCES) +DIST_SOURCES = $(libod_a_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +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@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +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_CONFIG = @FOX_CONFIG@ +FOX_LDFLAGS = @FOX_LDFLAGS@ +GDAL_CONFIG = @GDAL_CONFIG@ +GDAL_LDFLAGS = @GDAL_LDFLAGS@ +GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ +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_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 = libod.a +libod_a_SOURCES = ODDistrict.cpp ODDistrict.h \ +ODDistrictCont.cpp ODDistrictCont.h \ +ODAmitranHandler.cpp ODAmitranHandler.h \ +ODDistrictHandler.cpp ODDistrictHandler.h \ +ODCell.h ODMatrix.h ODMatrix.cpp + +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/od/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/od/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) + +libod.a: $(libod_a_OBJECTS) $(libod_a_DEPENDENCIES) $(EXTRA_libod_a_DEPENDENCIES) + $(AM_V_at)-rm -f libod.a + $(AM_V_AR)$(libod_a_AR) libod.a $(libod_a_OBJECTS) $(libod_a_LIBADD) + $(AM_V_at)$(RANLIB) libod.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODAmitranHandler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODDistrict.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODDistrictCont.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODDistrictHandler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODMatrix.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + 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-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + 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" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +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 TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \ + ctags-am 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 tags-am 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.21.0+dfsg/src/od/ODAmitranHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODAmitranHandler.cpp --- sumo-0.21.0+dfsg/src/od/ODAmitranHandler.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODAmitranHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,75 @@ +/****************************************************************************/ +/// @file ODAmitranHandler.cpp +/// @author Michael Behrisch +/// @date 27.03.2014 +/// @version $Id: ODAmitranHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// An XML-Handler for Amitran OD matrices +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "ODMatrix.h" +#include "ODAmitranHandler.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +ODAmitranHandler::ODAmitranHandler(ODMatrix& matrix, const std::string& file) + : SUMOSAXHandler(file), myMatrix(matrix) {} + + +ODAmitranHandler::~ODAmitranHandler() {} + + +void +ODAmitranHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { + bool ok = true; + switch (element) { + case SUMO_TAG_ACTORCONFIG: + myVehicleType = attrs.get(SUMO_ATTR_ID, 0, ok); + break; + case SUMO_TAG_TIMESLICE: + myBegin = attrs.get(SUMO_ATTR_STARTTIME, myVehicleType.c_str(), ok); + myEnd = myBegin + attrs.get(SUMO_ATTR_DURATION, myVehicleType.c_str(), ok); + if (myBegin >= myEnd) { + WRITE_ERROR("Invalid duration for timeSlice starting " + toString(myBegin) + "."); + } + break; + case SUMO_TAG_OD_PAIR: + myMatrix.add(attrs.get(SUMO_ATTR_AMOUNT, myVehicleType.c_str(), ok), + myBegin, myEnd, attrs.get(SUMO_ATTR_ORIGIN, myVehicleType.c_str(), ok), + attrs.get(SUMO_ATTR_DESTINATION, myVehicleType.c_str(), ok), myVehicleType); + break; + default: + break; + } +} + + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/od/ODAmitranHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODAmitranHandler.h --- sumo-0.21.0+dfsg/src/od/ODAmitranHandler.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODAmitranHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,108 @@ +/****************************************************************************/ +/// @file ODAmitranHandler.h +/// @author Michael Behrisch +/// @date 27.03.2014 +/// @version $Id: ODAmitranHandler.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// An XML-Handler for Amitran OD matrices +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 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 ODAmitranHandler_h +#define ODAmitranHandler_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class ODMatrix; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ODAmitranHandler + * @brief An XML-Handler for districts + * + * This SUMOSAXHandler parses OD matrices in the Amitran format. + */ +class ODAmitranHandler : public SUMOSAXHandler { +public: + /** @brief Constructor + * + * Saves the given matrix in order to fill it. + * @param[in] cont The matrix to fill + * @param[in] file The file that will be processed + */ + ODAmitranHandler(ODMatrix& matrix, const std::string& file); + + + /// @brief Destructor + ~ODAmitranHandler(); + + +protected: + /// @name inherited from GenericSAXHandler + //@{ + + /** @brief Called when an opening-tag occurs + * + * Processes district elements via openDistrict, their sinks (via + * addSink) and sources (via addSource). + * + * @param[in] element The enum of the currently opened element + * @param[in] attrs Attributes of the currently opened element + * @exception ProcessError If an error within the parsed file occurs + * @see GenericSAXHandler::myStartElement + */ + void myStartElement(int element, + const SUMOSAXAttributes& attrs); + //@} + + +private: + /// The matrix to add demand to + ODMatrix& myMatrix; + + std::string myVehicleType; + + SUMOTime myBegin; + SUMOTime myEnd; +private: + /// @brief invalidated copy constructor + ODAmitranHandler(const ODAmitranHandler& s); + + /// @brief invalidated assignment operator + ODAmitranHandler& operator=(const ODAmitranHandler& s); + + +}; + + +#endif + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/od/ODCell.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODCell.h --- sumo-0.21.0+dfsg/src/od/ODCell.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODCell.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,83 @@ +/****************************************************************************/ +/// @file ODCell.h +/// @author Peter Mieth +/// @author Daniel Krajzewicz +/// @author Yun-Pang Floetteroed +/// @date Sept 2002 +/// @version $Id: ODCell.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A single O/D-matrix cell +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 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 ODCell_h +#define ODCell_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + + +// =========================================================================== +// class declarations +// =========================================================================== +class RORoute; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @struct ODCell + * @brief A single O/D-matrix cell + * + * A single cell within an O/D-matrix. Contains the information about the origin + * and destination via string-ids of the district, the begin and the end time + * for which this cell is valid, the id of the vehicle type to use, and the + * amount of vehicles to insert during the described interval. + * + * @todo Check whether the vehicle type is used and makes sense herein + */ +struct ODCell { + /// @brief The number of vehicles + SUMOReal vehicleNumber; + + /// @brief The begin time this cell describes + SUMOTime begin; + + /// @brief The end time this cell describes + SUMOTime end; + + /// @brief Name of the origin district + std::string origin; + + /// @brief Name of the destination district + std::string destination; + + /// @brief Name of the vehicle type + std::string vehicleType; + + /// @brief the list of paths / routes + std::vector pathsVector; // path_id, string of edges? +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/od/ODDistrictCont.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODDistrictCont.cpp --- sumo-0.21.0+dfsg/src/od/ODDistrictCont.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODDistrictCont.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,113 @@ +/****************************************************************************/ +/// @file ODDistrictCont.cpp +/// @author Daniel Krajzewicz +/// @author Michael Behrisch +/// @author Yun-Pang Floetteroed +/// @date Sept 2002 +/// @version $Id: ODDistrictCont.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A container for districts +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 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 "ODDistrict.h" +#include "ODDistrictHandler.h" +#include "ODDistrictCont.h" + + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +ODDistrictCont::ODDistrictCont() {} + + +ODDistrictCont::~ODDistrictCont() {} + + +std::string +ODDistrictCont::getRandomSourceFromDistrict(const std::string& name) const { + ODDistrict* district = get(name); + if (district == 0) { + throw InvalidArgument("There is no district '" + name + "'."); + } + return district->getRandomSource(); +} + + +std::string +ODDistrictCont::getRandomSinkFromDistrict(const std::string& name) const { + ODDistrict* district = get(name); + if (district == 0) { + throw InvalidArgument("There is no district '" + name + "'."); + } + return district->getRandomSink(); +} + + +void +ODDistrictCont::loadDistricts(std::string districtfile) { + if (!FileHelpers::isReadable(districtfile)) { + throw ProcessError("Could not access network file '" + districtfile + "' to load."); + } + PROGRESS_BEGIN_MESSAGE("Loading districts from '" + districtfile + "'"); + // build the xml-parser and handler + ODDistrictHandler handler(*this, districtfile); + if (!XMLSubSys::runParser(handler, districtfile, true)) { + PROGRESS_FAILED_MESSAGE(); + } else { + PROGRESS_DONE_MESSAGE(); + } +} + + +void +ODDistrictCont::makeDistricts(const std::map, std::vector > >& districts) { + for (std::map, std::vector > >::const_iterator it = districts.begin(); it != districts.end(); ++it) { + ODDistrict* current = new ODDistrict(it->first); + const std::vector& sources = it->second.first; + for (std::vector::const_iterator i = sources.begin(); i != sources.end(); ++i) { + current->addSource(*i, 1.); + } + const std::vector& sinks = it->second.second; + for (std::vector::const_iterator i = sinks.begin(); i != sinks.end(); ++i) { + current->addSink(*i, 1.); + } + add(current->getID(), current); + } +} + + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/od/ODDistrictCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODDistrictCont.h --- sumo-0.21.0+dfsg/src/od/ODDistrictCont.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODDistrictCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,112 @@ +/****************************************************************************/ +/// @file ODDistrictCont.h +/// @author Daniel Krajzewicz +/// @author Yun-Pang Floetteroed +/// @author Michael Behrisch +/// @date Sept 2002 +/// @version $Id: ODDistrictCont.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A container for districts +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 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 ODDistrictCont_h +#define ODDistrictCont_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include "ODDistrict.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ODDistrictCont + * @brief A container for districts + * + * Besides the inherited methods for adding/removing districts, this container + * allows to retrieve a random source or sink from a named district. + */ +class ODDistrictCont : public NamedObjectCont { +public: + /// Constructor + ODDistrictCont(); + + + /// Destructor + ~ODDistrictCont(); + + + /** @brief Returns the id of a random source from the named district + * + * At first, the named district is retrieved. If this fails, an + * InvalidArgument-exception is thrown. Otherwise, a source (edge) + * is chosen randomly from this district using this district's + * getRandomSource-method which throws an OutOfBoundsException-exception + * if this district does not contain a source. + * + * @param[in] name The id of the district to get a random source from + * @return The id of a randomly chosen source + * @exception InvalidArgument If the named district is not known + * @exception OutOfBoundsException If the named district has no sources + * @see ODDistrict::getRandomSource + */ + std::string getRandomSourceFromDistrict(const std::string& name) const; + + + /** @brief Returns the id of a random sink from the named district + * + * At first, the named district is retrieved. If this fails, an + * InvalidArgument-exception is thrown. Otherwise, a sink (edge) + * is chosen randomly from this district using this district's + * getRandomSink-method which throws an OutOfBoundsException-exception + * if this district does not contain a sink. + * + * @param[in] name The id of the district to get a random sink from + * @return The id of a randomly chosen sink + * @exception InvalidArgument If the named district is not known + * @exception OutOfBoundsException If the named district has no sinks + * @see ODDistrict::getRandomSink + */ + std::string getRandomSinkFromDistrict(const std::string& name) const; + + /// @brief load districts from FILE + void loadDistricts(std::string districtfile); + + /// @brief create districts from description + void makeDistricts(const std::map, std::vector > >& districts); + +private: + /// @brief invalidated copy constructor + ODDistrictCont(const ODDistrictCont& s); + + /// @brief invalidated assignment operator + ODDistrictCont& operator=(const ODDistrictCont& s); + + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/od/ODDistrict.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODDistrict.cpp --- sumo-0.21.0+dfsg/src/od/ODDistrict.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODDistrict.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,95 @@ +/****************************************************************************/ +/// @file ODDistrict.cpp +/// @author Daniel Krajzewicz +/// @author Michael Behrisch +/// @author Yun-Pang Floetteroed +/// @date Sept 2002 +/// @version $Id: ODDistrict.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A district (origin/destination) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 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 "ODDistrict.h" + + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +ODDistrict::ODDistrict(const std::string& id) + : Named(id) {} + + +ODDistrict::~ODDistrict() {} + + +void +ODDistrict::addSource(const std::string& id, SUMOReal weight) { + mySources.add(weight, id); +} + + +void +ODDistrict::addSink(const std::string& id, SUMOReal weight) { + mySinks.add(weight, id); +} + + +std::string +ODDistrict::getRandomSource() const { + return mySources.get(); +} + + +std::string +ODDistrict::getRandomSink() const { + return mySinks.get(); +} + + +unsigned int +ODDistrict::sinkNumber() const { + return (unsigned int) mySinks.getVals().size(); +} + + +unsigned int +ODDistrict::sourceNumber() const { + return (unsigned int) mySources.getVals().size(); +} + + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/od/ODDistrict.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODDistrict.h --- sumo-0.21.0+dfsg/src/od/ODDistrict.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODDistrict.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,155 @@ +/****************************************************************************/ +/// @file ODDistrict.h +/// @author Daniel Krajzewicz +/// @author Michael Behrisch +/// @date Sept 2002 +/// @version $Id: ODDistrict.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A district (origin/destination) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 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 ODDistrict_h +#define ODDistrict_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ODDistrict + * @brief A district (origin/destination) + * + * Class representing a district which has some ingoing and outgoing connections + * to the road network which may be weighted. + */ +class ODDistrict : public Named { +public: + /** @brief Constructor + * + * @param[in] id The id of the district + */ + ODDistrict(const std::string& id); + + + /// @brief Destructor + ~ODDistrict(); + + + /** @brief Adds a source connection + * + * A source is an edge where vehicles leave the district from to reach + * the network. The weight is used when a random source shall be + * chosen. + * + * BTW, it is possible to add a source twice. In this case it will occure + * twice within the distribution so that the behaviour is as adding + * both given probabilities. + * + * @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); + + + /** @brief Adds a sink connection + * + * A sink connection is an edge which is used by vehicles to leave the + * network and reach the district. The weight is used when a random + * sink shall be chosen. + * + * BTW, it is possible to add a sink twice. In this case it will occure + * twice within the distribution so that the behaviour is as adding + * both given probabilities. + * + * @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); + + + /** @brief Returns the id of a source to use + * + * If the list of this district's sources is empty, an OutOfBoundsException + * -exception is thrown. + * + * @return One of this district's sources chosen randomly regarding their weights + * @exception OutOfBoundsException If this district has no sources + */ + std::string getRandomSource() const; + + + /** @brief Returns the id of a sink to use + * + * If the list of this district's sinks is empty, an OutOfBoundsException + * -exception is thrown. + * + * @return One of this district's sinks chosen randomly regarding their weights + * @exception OutOfBoundsException If this district has no sinks + */ + std::string getRandomSink() const; + + + /** @brief Returns the number of sinks + * + * @return The number of known sinks + */ + unsigned int sinkNumber() const; + + + /** @brief Returns the number of sources + * + * @return The number of known sources + */ + unsigned int sourceNumber() const; + + +private: + /// @brief Container of weighted sources + RandomDistributor mySources; + + /// @brief Container of weighted sinks + RandomDistributor mySinks; + + +private: + /// @brief invalidated copy constructor + ODDistrict(const ODDistrict& s); + + /// @brief invalidated assignment operator + ODDistrict& operator=(const ODDistrict& s); + + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/od/ODDistrictHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODDistrictHandler.cpp --- sumo-0.21.0+dfsg/src/od/ODDistrictHandler.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODDistrictHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,162 @@ +/****************************************************************************/ +/// @file ODDistrictHandler.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date Sept 2002 +/// @version $Id: ODDistrictHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// An XML-Handler for districts +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "ODDistrict.h" +#include "ODDistrictCont.h" +#include "ODDistrictHandler.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +ODDistrictHandler::ODDistrictHandler(ODDistrictCont& cont, + const std::string& file) + : SUMOSAXHandler(file), myContainer(cont), myCurrentDistrict(0) {} + + +ODDistrictHandler::~ODDistrictHandler() {} + + +void +ODDistrictHandler::myStartElement(int element, + const SUMOSAXAttributes& attrs) { + switch (element) { + case SUMO_TAG_TAZ: + openDistrict(attrs); + break; + case SUMO_TAG_TAZSOURCE: + addSource(attrs); + break; + case SUMO_TAG_TAZSINK: + addSink(attrs); + break; + default: + break; + } +} + + +void +ODDistrictHandler::myEndElement(int element) { + if (element == SUMO_TAG_TAZ) { + closeDistrict(); + } +} + + +void +ODDistrictHandler::openDistrict(const SUMOSAXAttributes& attrs) { + myCurrentDistrict = 0; + // get the id, report an error if not given or empty... + bool ok = true; + std::string id = attrs.get(SUMO_ATTR_ID, 0, ok); + if (!ok) { + return; + } + myCurrentDistrict = new ODDistrict(id); + if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { + std::vector desc = attrs.getStringVector(SUMO_ATTR_EDGES); + for (std::vector::const_iterator i = desc.begin(); i != desc.end(); ++i) { + myCurrentDistrict->addSource(*i, 1.); + myCurrentDistrict->addSink(*i, 1.); + } + } +} + + +void +ODDistrictHandler::addSource(const SUMOSAXAttributes& attrs) { + std::pair vals = parseTAZ(attrs); + if (vals.second >= 0) { + myCurrentDistrict->addSource(vals.first, vals.second); + } +} + + +void +ODDistrictHandler::addSink(const SUMOSAXAttributes& attrs) { + std::pair vals = parseTAZ(attrs); + if (vals.second >= 0) { + myCurrentDistrict->addSink(vals.first, vals.second); + } +} + + + +std::pair +ODDistrictHandler::parseTAZ(const SUMOSAXAttributes& attrs) { + // check the current district first + if (myCurrentDistrict == 0) { + return std::pair("", -1); + } + // get the id, report an error if not given or empty... + bool ok = true; + std::string id = attrs.get(SUMO_ATTR_ID, 0, ok); + if (!ok) { + return std::pair("", -1); + } + // get the weight + SUMOReal weight = attrs.get(SUMO_ATTR_WEIGHT, id.c_str(), ok); + if (ok) { + if (weight < 0) { + WRITE_ERROR("'probability' must be positive (in definition of " + attrs.getObjectType() + " '" + id + "')."); + } else { + return std::pair(id, weight); + } + } + return std::pair("", -1); +} + + +void +ODDistrictHandler::closeDistrict() { + if (myCurrentDistrict != 0) { + myContainer.add(myCurrentDistrict->getID(), myCurrentDistrict); + } +} + + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/od/ODDistrictHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODDistrictHandler.h --- sumo-0.21.0+dfsg/src/od/ODDistrictHandler.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODDistrictHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,187 @@ +/****************************************************************************/ +/// @file ODDistrictHandler.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date Sept 2002 +/// @version $Id: ODDistrictHandler.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// An XML-Handler for districts +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 ODDistrictHandler_h +#define ODDistrictHandler_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class ODDistrict; +class ODDistrictCont; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ODDistrictHandler + * @brief An XML-Handler for districts + * + * This SUMOSAXHandler parses districts and their sinks and sources from + * and stores them into a the district container given at initialisation. + */ +class ODDistrictHandler : public SUMOSAXHandler { +public: + /** @brief Constructor + * + * Saves the given district containe in order to fill it. + * @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); + + + /// @brief Destructor + ~ODDistrictHandler(); + + +protected: + /// @name inherited from GenericSAXHandler + //@{ + + /** @brief Called when an opening-tag occurs + * + * Processes district elements via openDistrict, their sinks (via + * addSink) and sources (via addSource). + * + * @param[in] element The enum of the currently opened element + * @param[in] attrs Attributes of the currently opened element + * @exception ProcessError If an error within the parsed file occurs + * @see GenericSAXHandler::myStartElement + */ + void myStartElement(int element, + const SUMOSAXAttributes& attrs); + + + /** @brief Called when a closing tag occurs + * + * Processes district elements via closeDistrict. + * + * @param[in] element ID of the currently opened element + * @exception ProcessError If an error within the parsed file occurs + */ + void myEndElement(int element); + //@} + + +private: + /** @brief Begins the parsing of a district + * + * Tries to retrieve the id of a district, adds a message to the + * error handler if this fails. Otherwise builds a new district + * with this id at myCurrentDistrict. + * + * @param[in] attrs Attributes of the currently opened element + */ + void openDistrict(const SUMOSAXAttributes& attrs); + + + /** @brief Adds a read source to the current district + * + * Tries to get the id and the weight of the currently parsed source + * from the attributes using getValues. If the retrieval could be + * done without errors (weight>=0), the so retrieved weighted source + * is added to myCurrentDistrict using addSource. (getValues checks + * whether myCurrentDistrict is valid) + * + * @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); + + + /** @brief Adds a read sink to the current district + * + * Tries to get the id and the weight of the currently parsed sink + * from the attributes using getValues. If the retrieval could be + * done without errors (weight>=0), the so retrieved weighted sink + * is added to myCurrentDistrict using addSink. (getValues checks + * whether myCurrentDistrict is valid) + * + * @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); + + + /** @brief Closes the processing of the current district + * + * Adds myCurrentDistrict to myContainer. + */ + void closeDistrict(); + + + /** @brief Returns the id and weight for a taz/tazSink/tazSource + * + * Checks whether myCurrentDistrict (the currently processed + * district) is !=0; in this case, both the id and the weight + * are parsed. If one of them is missing or the weight is not numerical, + * an error is generated and reported to MsgHandler. The "type"-parameter + * is used in order to inform the user whether a source or a sink was + * processed. In the case of an error, the returned weight is -1. + * + * If no error occurs, the correct id and weight are returned. + * + * @param[in] attrs Attributes of the currently opened element + * @param[in] type The type of the currntly processed connection (sink/source) + * @return The id and the weight of a taz + */ + std::pair parseTAZ(const SUMOSAXAttributes& attrs); + +private: + /// The container to add read districts to + ODDistrictCont& myContainer; + + /// The currently parsed district + ODDistrict* myCurrentDistrict; + + +private: + /// @brief invalidated copy constructor + ODDistrictHandler(const ODDistrictHandler& s); + + /// @brief invalidated assignment operator + ODDistrictHandler& operator=(const ODDistrictHandler& s); + + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/od/ODMatrix.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODMatrix.cpp --- sumo-0.21.0+dfsg/src/od/ODMatrix.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODMatrix.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,551 @@ +/****************************************************************************/ +/// @file ODMatrix.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @author Yun-Pang Floetteroed +/// @date 05 Apr. 2006 +/// @version $Id: ODMatrix.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// An O/D (origin/destination) matrix +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 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 "ODAmitranHandler.h" +#include "ODMatrix.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +ODMatrix::ODMatrix(const ODDistrictCont& dc) + : myDistricts(dc), myNoLoaded(0), myNoWritten(0), myNoDiscarded(0) {} + + +ODMatrix::~ODMatrix() { + for (std::vector::iterator i = myContainer.begin(); i != myContainer.end(); ++i) { + delete *i; + } + myContainer.clear(); +} + + +void +ODMatrix::add(SUMOReal vehicleNumber, SUMOTime begin, + SUMOTime end, const std::string& origin, const std::string& destination, + const std::string& vehicleType) { + myNoLoaded += vehicleNumber; + if (myDistricts.get(origin) == 0 && myDistricts.get(destination) == 0) { + WRITE_WARNING("Missing origin '" + origin + "' and destination '" + destination + "' (" + toString(vehicleNumber) + " vehicles)."); + } else if (myDistricts.get(origin) == 0 && vehicleNumber > 0) { + WRITE_ERROR("Missing origin '" + origin + "' (" + toString(vehicleNumber) + " vehicles)."); + myNoDiscarded += vehicleNumber; + } else if (myDistricts.get(destination) == 0 && vehicleNumber > 0) { + WRITE_ERROR("Missing destination '" + destination + "' (" + toString(vehicleNumber) + " vehicles)."); + myNoDiscarded += vehicleNumber; + } else { + if (myDistricts.get(origin)->sourceNumber() == 0) { + WRITE_ERROR("District '" + origin + "' has no source."); + myNoDiscarded += vehicleNumber; + } else if (myDistricts.get(destination)->sinkNumber() == 0) { + WRITE_ERROR("District '" + destination + "' has no sink."); + myNoDiscarded += vehicleNumber; + } else { + ODCell* cell = new ODCell(); + cell->begin = begin; + cell->end = end; + cell->origin = origin; + cell->destination = destination; + cell->vehicleType = vehicleType; + cell->vehicleNumber = vehicleNumber; + myContainer.push_back(cell); + } + } +} + + +SUMOReal +ODMatrix::computeDeparts(ODCell* cell, + 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 + if (RandHelper::rand() < cell->vehicleNumber - (SUMOReal)vehicles2insert) { + vehicles2insert++; + } + if (vehicles2insert == 0) { + return cell->vehicleNumber; + } + + 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 = (SUMOTime)(offset + cell->begin + ((SUMOReal)(cell->end - cell->begin) * (SUMOReal) i / (SUMOReal) vehicles2insert)); + } else { + veh.depart = (SUMOTime)RandHelper::rand(cell->begin, cell->end); + } + + veh.from = myDistricts.getRandomSourceFromDistrict(cell->origin); + veh.to = myDistricts.getRandomSinkFromDistrict(cell->destination); + veh.cell = cell; + into.push_back(veh); + } + return cell->vehicleNumber - vehicles2insert; +} + + +void +ODMatrix::writeDefaultAttrs(OutputDevice& dev, const bool noVtype, + const ODCell* const cell) { + const OptionsCont& oc = OptionsCont::getOptions(); + if (!noVtype && cell->vehicleType != "") { + dev.writeAttr(SUMO_ATTR_TYPE, cell->vehicleType); + } + dev.writeAttr(SUMO_ATTR_FROM_TAZ, cell->origin).writeAttr(SUMO_ATTR_TO_TAZ, cell->destination); + if (oc.isSet("departlane") && oc.getString("departlane") != "default") { + dev.writeAttr(SUMO_ATTR_DEPARTLANE, oc.getString("departlane")); + } + if (oc.isSet("departpos")) { + dev.writeAttr(SUMO_ATTR_DEPARTPOS, oc.getString("departpos")); + } + if (oc.isSet("departspeed") && oc.getString("departspeed") != "default") { + dev.writeAttr(SUMO_ATTR_DEPARTSPEED, oc.getString("departspeed")); + } + if (oc.isSet("arrivallane")) { + dev.writeAttr(SUMO_ATTR_ARRIVALLANE, oc.getString("arrivallane")); + } + if (oc.isSet("arrivalpos")) { + dev.writeAttr(SUMO_ATTR_ARRIVALPOS, oc.getString("arrivalpos")); + } + if (oc.isSet("arrivalspeed")) { + dev.writeAttr(SUMO_ATTR_ARRIVALSPEED, oc.getString("arrivalspeed")); + } +} + + +void +ODMatrix::write(SUMOTime begin, const SUMOTime end, + OutputDevice& dev, const bool uniform, const bool noVtype, + const std::string& prefix, const bool stepLog) { + if (myContainer.size() == 0) { + return; + } + std::map, SUMOReal> fractionLeft; + size_t vehName = 0; + sort(myContainer.begin(), myContainer.end(), cell_by_begin_sorter()); + // recheck begin time + 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;) { + 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; + while (next != myContainer.end() && (*next)->begin <= t && (*next)->end > t) { + std::pair odID = std::make_pair((*next)->origin, (*next)->destination); + // check whether the current cell must be extended by the last fraction + if (fractionLeft.find(odID) != fractionLeft.end()) { + (*next)->vehicleNumber += fractionLeft[odID]; + fractionLeft[odID] = 0; + } + // get the new departures (into tmp) + const size_t oldSize = vehicles.size(); + const SUMOReal fraction = computeDeparts(*next, vehName, vehicles, uniform, prefix); + if (oldSize != vehicles.size()) { + changed = true; + } + if (fraction != 0) { + fractionLeft[odID] = fraction; + } + ++next; + } + if (changed) { + sort(vehicles.begin(), vehicles.end(), descending_departure_comperator()); + } + for (std::vector::reverse_iterator i = vehicles.rbegin(); i != vehicles.rend() && (*i).depart == t; ++i) { + myNoWritten++; + dev.openTag(SUMO_TAG_TRIP).writeAttr(SUMO_ATTR_ID, (*i).id).writeAttr(SUMO_ATTR_DEPART, time2string(t)); + dev.writeAttr(SUMO_ATTR_FROM, (*i).from).writeAttr(SUMO_ATTR_TO, (*i).to); + writeDefaultAttrs(dev, noVtype, i->cell); + dev.closeTag(); + } + 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; + } + } +} + + +void +ODMatrix::writeFlows(const SUMOTime begin, const SUMOTime end, + OutputDevice& dev, bool noVtype, + const std::string& prefix) { + if (myContainer.size() == 0) { + return; + } + size_t flowName = 0; + sort(myContainer.begin(), myContainer.end(), cell_by_begin_sorter()); + // recheck begin time + for (std::vector::const_iterator i = myContainer.begin(); i != myContainer.end(); ++i) { + const ODCell* const c = *i; + if (c->end > begin && c->begin < end) { + dev.openTag(SUMO_TAG_FLOW).writeAttr(SUMO_ATTR_ID, prefix + toString(flowName++)); + dev.writeAttr(SUMO_ATTR_BEGIN, time2string(c->begin)); + dev.writeAttr(SUMO_ATTR_END, time2string(c->end)).writeAttr(SUMO_ATTR_NUMBER, int(c->vehicleNumber)); + writeDefaultAttrs(dev, noVtype, *i); + dev.closeTag(); + } + } +} + + +std::string +ODMatrix::getNextNonCommentLine(LineReader& lr) { + std::string line; + do { + line = lr.readLine(); + if (line[0] != '*') { + return StringUtils::prune(line); + } + } while (lr.good() && lr.hasMore()); + throw ProcessError(); +} + + +SUMOTime +ODMatrix::parseSingleTime(const std::string& time) { + if (time.find('.') == std::string::npos) { + throw OutOfBoundsException(); + } + std::string hours = time.substr(0, time.find('.')); + std::string minutes = time.substr(time.find('.') + 1); + return TIME2STEPS(TplConvert::_2int(hours.c_str()) * 3600 + TplConvert::_2int(minutes.c_str()) * 60); +} + + +std::pair +ODMatrix::readTime(LineReader& lr) { + std::string line = getNextNonCommentLine(lr); + try { + StringTokenizer st(line, StringTokenizer::WHITECHARS); + SUMOTime begin = parseSingleTime(st.next()); + SUMOTime end = parseSingleTime(st.next()); + if (begin >= end) { + throw ProcessError("Begin time is larger than end time."); + } + return std::make_pair(begin, end); + } catch (OutOfBoundsException&) { + throw ProcessError("Broken period definition '" + line + "'."); + } catch (NumberFormatException&) { + throw ProcessError("Broken period definition '" + line + "'."); + } +} + +SUMOReal +ODMatrix::readFactor(LineReader& lr, SUMOReal scale) { + std::string line = getNextNonCommentLine(lr); + SUMOReal factor = -1; + try { + factor = TplConvert::_2SUMOReal(line.c_str()) * scale; + } catch (NumberFormatException&) { + throw ProcessError("Broken factor: '" + line + "'."); + } + return factor; +} + +void +ODMatrix::readV(LineReader& lr, SUMOReal scale, + std::string vehType, bool matrixHasVehType) { + PROGRESS_BEGIN_MESSAGE("Reading matrix '" + lr.getFileName() + "' stored as VMR"); + // parse first defs + std::string line; + if (matrixHasVehType) { + line = getNextNonCommentLine(lr); + if (vehType == "") { + vehType = StringUtils::prune(line); + } + } + + // parse time + std::pair times = readTime(lr); + SUMOTime begin = times.first; + SUMOTime end = times.second; + + // factor + SUMOReal factor = readFactor(lr, scale); + + // districts + line = getNextNonCommentLine(lr); + int districtNo = TplConvert::_2int(StringUtils::prune(line).c_str()); + // parse district names (normally ints) + std::vector names; + do { + line = getNextNonCommentLine(lr); + StringTokenizer st2(line, StringTokenizer::WHITECHARS); + while (st2.hasNext()) { + names.push_back(st2.next()); + } + } while ((int) names.size() != districtNo); + + // parse the cells + for (std::vector::iterator si = names.begin(); si != names.end(); ++si) { + std::vector::iterator di = names.begin(); + // + do { + line = getNextNonCommentLine(lr); + if (line.length() == 0) { + continue; + } + try { + StringTokenizer st2(line, StringTokenizer::WHITECHARS); + while (st2.hasNext()) { + assert(di != names.end()); + SUMOReal vehNumber = TplConvert::_2SUMOReal(st2.next().c_str()) * factor; + if (vehNumber != 0) { + add(vehNumber, begin, end, *si, *di, vehType); + } + if (di == names.end()) { + throw ProcessError("More entries than districts found."); + } + ++di; + } + } catch (NumberFormatException&) { + throw ProcessError("Not numeric vehicle number in line '" + line + "'."); + } + if (!lr.hasMore()) { + break; + } + } while (di != names.end()); + } + PROGRESS_DONE_MESSAGE(); +} + + +void +ODMatrix::readO(LineReader& lr, SUMOReal scale, + std::string vehType, bool matrixHasVehType) { + PROGRESS_BEGIN_MESSAGE("Reading matrix '" + lr.getFileName() + "' stored as OR"); + // parse first defs + std::string line; + if (matrixHasVehType) { + line = getNextNonCommentLine(lr); + int type = TplConvert::_2int(StringUtils::prune(line).c_str()); + if (vehType == "") { + vehType = toString(type); + } + } + + // parse time + std::pair times = readTime(lr); + SUMOTime begin = times.first; + SUMOTime end = times.second; + + // factor + SUMOReal factor = readFactor(lr, scale); + + // parse the cells + while (lr.hasMore()) { + line = getNextNonCommentLine(lr); + if (line.length() == 0) { + continue; + } + StringTokenizer st2(line, StringTokenizer::WHITECHARS); + if (st2.size() == 0) { + continue; + } + try { + std::string sourceD = st2.next(); + std::string destD = st2.next(); + SUMOReal vehNumber = TplConvert::_2SUMOReal(st2.next().c_str()) * factor; + if (vehNumber != 0) { + add(vehNumber, begin, end, sourceD, destD, vehType); + } + } catch (OutOfBoundsException&) { + throw ProcessError("Missing at least one information in line '" + line + "'."); + } catch (NumberFormatException&) { + throw ProcessError("Not numeric vehicle number in line '" + line + "'."); + } + } + PROGRESS_DONE_MESSAGE(); +} + + + +SUMOReal +ODMatrix::getNoLoaded() const { + return myNoLoaded; +} + + +SUMOReal +ODMatrix::getNoWritten() const { + return myNoWritten; +} + + +SUMOReal +ODMatrix::getNoDiscarded() const { + return myNoDiscarded; +} + + +void +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 = TIME2STEPS(ps.getAreaBegin(i)); + ncell->end = TIME2STEPS(ps.getAreaEnd(i)); + ncell->origin = cell->origin; + ncell->destination = cell->destination; + ncell->vehicleType = cell->vehicleType; + ncell->vehicleNumber = cell->vehicleNumber * ps.getAreaPerc(i); + newCells.push_back(ncell); + } +} + + +void +ODMatrix::applyCurve(const Distribution_Points& ps) { + std::vector oldCells = myContainer; + myContainer.clear(); + 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; + } +} + +void +ODMatrix::loadMatrix(OptionsCont& oc) { + std::vector files = oc.getStringVector("od-matrix-files"); + for (std::vector::iterator i = files.begin(); i != files.end(); ++i) { + LineReader lr(*i); + if (!lr.good()) { + throw ProcessError("Could not open '" + (*i) + "'."); + } + std::string type = lr.readLine(); + // get the type only + if (type.find(';') != std::string::npos) { + type = type.substr(0, type.find(';')); + } + // parse type-dependant + if (type.length() > 1 && type[1] == 'V') { + // process ptv's 'V'-matrices + if (type.find('N') != std::string::npos) { + throw ProcessError("'" + *i + "' does not contain the needed information about the time described."); + } + readV(lr, oc.getFloat("scale"), oc.getString("vtype"), type.find('M') != std::string::npos); + } else if (type.length() > 1 && type[1] == 'O') { + // process ptv's 'O'-matrices + if (type.find('N') != std::string::npos) { + throw ProcessError("'" + *i + "' does not contain the needed information about the time described."); + } + readO(lr, oc.getFloat("scale"), oc.getString("vtype"), type.find('M') != std::string::npos); + } else { + throw ProcessError("'" + *i + "' uses an unknown matrix type '" + type + "'."); + } + } + std::vector amitranFiles = oc.getStringVector("od-amitran-files"); + for (std::vector::iterator i = amitranFiles.begin(); i != amitranFiles.end(); ++i) { + if (!FileHelpers::isReadable(*i)) { + throw ProcessError("Could not access matrix file '" + *i + "' to load."); + } + PROGRESS_BEGIN_MESSAGE("Loading matrix in Amitran format from '" + *i + "'"); + ODAmitranHandler handler(*this, *i); + if (!XMLSubSys::runParser(handler, *i)) { + PROGRESS_FAILED_MESSAGE(); + } else { + PROGRESS_DONE_MESSAGE(); + } + } +} + + +Distribution_Points +ODMatrix::parseTimeLine(const std::vector& def, bool timelineDayInHours) { + bool interpolating = !timelineDayInHours; + PositionVector points; + SUMOReal prob = 0; + if (timelineDayInHours) { + if (def.size() != 24) { + 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()); + points.push_back(Position((SUMOReal)(chour * 3600), prob)); + } + points.push_back(Position((SUMOReal)(24 * 3600), prob)); + } else { + size_t i = 0; + while (i < def.size()) { + StringTokenizer st2(def[i++], ":"); + 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()); + points.push_back(Position((SUMOReal) time, prob)); + } + } + return Distribution_Points("N/A", points, interpolating); +} + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/od/ODMatrix.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODMatrix.h --- sumo-0.21.0+dfsg/src/od/ODMatrix.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od/ODMatrix.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,406 @@ +/****************************************************************************/ +/// @file ODMatrix.h +/// @author Daniel Krajzewicz +/// @author Michael Behrisch +/// @author Yun-Pang Floetteroed +/// @date 05. Apr. 2006 +/// @version $Id: ODMatrix.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// An O/D (origin/destination) matrix +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 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 ODMatrix_h +#define ODMatrix_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ODCell.h" +#include "ODDistrictCont.h" +#include +#include +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ODMatrix + * @brief An O/D (origin/destination) matrix + * + * This class is the internal representation of a loaded O/D-matrix. Beside + * being the storage for ODCells, the matrix also contains information about + * the numbers of loaded, discarded, and written vehicles. + * + * The matrix has a reference to the container of districts stored. This allows + * to validate added cell descriptions in means that using existing origins/ + * destinations only is assured. + * + * In addition of being a storage, the matrix is also responsible for writing + * the results and contains methods for splitting the entries over time. + */ +class ODMatrix { +public: + /** @brief Constructor + * + * @param[in] dc The district container to obtain referenced districts from + */ + ODMatrix(const ODDistrictCont& dc); + + + /// Destructor + ~ODMatrix(); + + + /** @brief Builds a single cell from the given values, verifying them + * + * At first, the number of loaded vehicles (myNoLoaded) is incremented + * by vehicleNumber. + * + * It is checked whether both the origin and the destination exist within + * the assigned district container (myDistricts). If one of them is missing, + * an error is generated, if both, a warning, because in the later case + * the described flow may lay completely beside the processed area. In both + * cases the given number of vehicles (vehicleNumber) is added to myNoDiscarded. + * + * If the origin/destination districts are known, a cell is built using the + * given values. This cell is added to the list of known cells (myContainer). + * + * @param[in] vehicleNumber The number of vehicles to store within the cell + * @param[in] begin The begin of the interval the cell is valid for + * @param[in] end The end of the interval the cell is valid for + * @param[in] origin The origin district to use for the cell's flows + * @param[in] destination The destination district to use for the cell's flows + * @param[in] vehicleType The vehicle type to use for the cell's flows + */ + void add(SUMOReal vehicleNumber, SUMOTime begin, + SUMOTime end, const std::string& origin, const std::string& destination, + const std::string& vehicleType); + + /** @brief Helper function for flow and trip output writing the depart + * and arrival attributes + * + * @param[in] dev The stream to write the generated vehicle trips to + * @param[in] noVtype Whether vtype information shall not be written + * @param[in] cell The OD cell containing the vtype + */ + void writeDefaultAttrs(OutputDevice& dev, const bool noVtype, + const ODCell* const cell); + + /** @brief Writes the vehicles stored in the matrix assigning the sources and sinks + * + * The cells stored in myContainer are sorted, first. Then, for each time + * step to generate vehicles for, it is checked whether the topmost cell + * is valid for this time step. If so, vehicles are generated from this + * cell's description using "computeDeparts" and stored in an internal vector. + * The pointer is moved and the check is repeated until the current cell + * is not valid for the current time or no further cells exist. + * + * Then, for the current time step, the internal list of vehicles is sorted and + * all vehicles that start within this time step are written. + * + * The left fraction of vehicles to insert is saved for each O/D-dependency + * over time and the number of vehicles to generate is increased as soon + * as this value is larger than 1, decrementing it. + * + * @param[in] begin The begin time to generate vehicles for + * @param[in] end The end time to generate vehicles for + * @param[in] dev The stream to write the generated vehicle trips to + * @param[in] uniform Information whether departure times shallbe uniformly spread or random + * @param[in] noVtype Whether vtype information shall not be written + * @param[in] prefix A prefix for the vehicle names + * @param[in] stepLog Whether processed time shall be written + */ + void write(SUMOTime begin, const SUMOTime end, + OutputDevice& dev, const bool uniform, const bool noVtype, + const std::string& prefix, const bool stepLog); + + + /** @brief Writes the flows stored in the matrix + * + * @param[in] begin The begin time to generate vehicles for + * @param[in] end The end time to generate vehicles for + * @param[in] dev The stream to write the generated vehicle trips to + * @param[in] noVtype Whether vtype information shall not be written + * @param[in] prefix A prefix for the flow names + */ + void writeFlows(const SUMOTime begin, const SUMOTime end, + OutputDevice& dev, const bool noVtype, + const std::string& prefix); + + + /** @brief Returns the number of loaded vehicles + * + * Returns the value of myNoLoaded + * + * @return The number of loaded vehicles + */ + SUMOReal getNoLoaded() const; + + + /** @brief Returns the number of written vehicles + * + * Returns the value of myNoWritten + * + * @return The number of written vehicles + */ + SUMOReal getNoWritten() const; + + + /** @brief Returns the number of discarded vehicles + * + * Returns the value of myNoDiscarded + * + * @return The number of discarded vehicles + */ + SUMOReal getNoDiscarded() const; + + + /** @brief Splits the stored cells dividing them on the given time line + * @todo Describe + */ + void applyCurve(const Distribution_Points& ps); + + + /** @brief read a VISUM-matrix with the O Format + * @todo Describe + */ + void readO(LineReader& lr, SUMOReal scale, + std::string vehType, bool matrixHasVehType); + + /** @brief read a VISUM-matrix with the V Format + * @todo Describe + */ + void readV(LineReader& lr, SUMOReal scale, + std::string vehType, bool matrixHasVehType); + + /** @brief read a VISUM-matrix with the V Format + * @todo Describe + */ + void loadMatrix(OptionsCont& oc); + + /** @brief split the given timeline + * @todo Describe + */ + Distribution_Points parseTimeLine(const std::vector& def, bool timelineDayInHours); + + const std::vector& getCells() { + return myContainer; + } + +protected: + /** + * @struct ODVehicle + * @brief An internal representation of a single vehicle + */ + struct ODVehicle { + /// @brief The id of the vehicle + std::string id; + /// @brief The departure time of the vehicle + SUMOTime depart; + /// @brief The cell of the ODMatrix which generated the vehicle + ODCell* cell; + /// @brief The edge the vehicles shall start at + std::string from; + /// @brief The edge the vehicles shall end at + std::string to; + + }; + + + /** @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 + * integer value of the vehicleNumber information from the given cell. + * In the case vehicleNumber has a fraction, an additional vehicle + * may be added in the case a chosen random number is lower than this fraction. + * + * If uniform is true, the departure times of the generated vehicles + * are spread uniformly, otherwise the departure time are chosen randomly from + * the interval. + * + * The vehicle names are generated by putting the value of vehName after the + * given prefix. The value of vehName is incremented with each generated vehicle. + * + * The number of left vehicles (the fraction if no additional vehicle was + * generated) is returned. + * + * @param[in] cell The cell to use + * @param[in,out] vehName An incremented index of the generated vehicle + * @param[out] into The storage to put generated vehicles into + * @param[in] uniform Information whether departure times shallbe uniformly spread or random + * @param[in] prefix A prefix for the vehicle names + * @return The number of left vehicles to insert + */ + SUMOReal computeDeparts(ODCell* cell, + 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 + * storing the results in the given container + * + * For the given cell, a list of clones is generated. The number of these + * is equal to the number of "areas" within the given distribution + * description (time line in this case) and each clone's vehicleNumber + * is equal to the given cell's vehicle number multiplied with the area's + * probability. The clones are stored in the given cell vector. + * + * @see Distribution_Points + * @param[in] ps The time line to apply + * @param[in] cell The cell to split + * @param[out] newCells The storage to put generated cells into + * @todo describe better!!! + */ + void applyCurve(const Distribution_Points& ps, ODCell* cell, + std::vector& newCells); + + +private: + /** @used in the functions readV and readO + * @todo Describe + */ + std::string getNextNonCommentLine(LineReader& lr); + + /** @used in the functions readV and readO + * @todo Describe + */ + SUMOTime parseSingleTime(const std::string& time); + + /** @used in the functions readV and readO + * @todo Describe + */ + std::pair readTime(LineReader& lr); + + /** @used in the functions readV and readO + * @todo Describe + */ + SUMOReal readFactor(LineReader& lr, SUMOReal scale); + + +protected: + /// @brief The loaded cells + std::vector myContainer; + + /// @brief The districts to retrieve sources/sinks from + const ODDistrictCont& myDistricts; + + /// @brief Number of loaded vehicles + SUMOReal myNoLoaded; + + /// @brief Number of written vehicles + SUMOReal myNoWritten; + + /// @brief Number of discarded vehicles + SUMOReal myNoDiscarded; + + + /** + * @class cell_by_begin_sorter + * @brief Used for sorting the cells by the begin time they describe + */ + class cell_by_begin_sorter { + public: + /// @brief constructor + explicit cell_by_begin_sorter() { } + + + /** @brief Comparing operator + * + * Compares two cells by the begin of the time they describe. The sort is stabilized + * (with secondary sort keys being origin and destination) to get comparable results + * with different platforms / compilers. + * + * @param[in] p1 First cell to compare + * @param[in] p2 Second cell to compare + * @return Whether the begin time of the first cell is lower than the one of the second + */ + int operator()(ODCell* p1, ODCell* p2) const { + if (p1->begin == p2->begin) { + if (p1->origin == p2->origin) { + return p1->destination < p2->destination; + } + return p1->origin < p2->origin; + } + return p1->begin < p2->begin; + } + + }; + + + /** + * @class descending_departure_comperator + * @brief Used for sorting vehicles by their departure (latest first) + * + * A reverse operator to what may be expected is used in order to allow + * prunning the sorted vector from its tail. + */ + class descending_departure_comperator { + public: + /// @brief constructor + descending_departure_comperator() { } + + + /** @brief Comparing operator + * + * Compares two vehicles by their departure time + * + * @param[in] p1 First vehicle to compare + * @param[in] p2 Second vehicle to compare + * @return Whether the departure time of the first vehicle is larger than the one of the second + */ + bool operator()(const ODVehicle& p1, const ODVehicle& p2) const { + if (p1.depart == p2.depart) { + return p1.id > p2.id; + } + return p1.depart > p2.depart; + } + + }; + +private: + /** @brief invalid copy constructor */ + ODMatrix(const ODMatrix& s); + + /** @brief invalid assignment operator */ + ODMatrix& operator=(const ODMatrix& s); + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/od2trips/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/Makefile.am --- sumo-0.21.0+dfsg/src/od2trips/Makefile.am 2014-04-11 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -XERCES_LIBS = -l$(LIB_XERCES) - -if CHECK_MEMORY_LEAKS -MEM_LIBS = ../foreign/nvwa/libnvwa.a -endif - -COMMON_LIBS = ../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) \ -$(XERCES_LIBS) - -bin_PROGRAMS = od2trips - -od2trips_SOURCES = od2trips_main.cpp \ -ODDistrict.cpp ODDistrict.h \ -ODDistrictCont.cpp ODDistrictCont.h \ -ODAmitranHandler.cpp ODAmitranHandler.h \ -ODDistrictHandler.cpp ODDistrictHandler.h \ -ODCell.h ODMatrix.h ODMatrix.cpp - -od2trips_LDFLAGS = $(XERCES_LDFLAGS) - -od2trips_LDADD = ../utils/options/liboptions.a \ -../utils/distribution/libdistribution.a \ -../utils/common/libcommon.a \ -../utils/geom/libgeom.a \ -$(COMMON_LIBS) diff -Nru sumo-0.21.0+dfsg/src/od2trips/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/Makefile.in --- sumo-0.21.0+dfsg/src/od2trips/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/Makefile.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,697 +0,0 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 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@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -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@ -bin_PROGRAMS = od2trips$(EXEEXT) -subdir = src/od2trips -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/depcomp -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 = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -am_od2trips_OBJECTS = od2trips_main.$(OBJEXT) ODDistrict.$(OBJEXT) \ - ODDistrictCont.$(OBJEXT) ODAmitranHandler.$(OBJEXT) \ - ODDistrictHandler.$(OBJEXT) ODMatrix.$(OBJEXT) -od2trips_OBJECTS = $(am_od2trips_OBJECTS) -am__DEPENDENCIES_1 = -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) -od2trips_DEPENDENCIES = ../utils/options/liboptions.a \ - ../utils/distribution/libdistribution.a \ - ../utils/common/libcommon.a ../utils/geom/libgeom.a \ - $(am__DEPENDENCIES_2) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -od2trips_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(od2trips_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -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) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -AM_V_CXX = $(am__v_CXX_@AM_V@) -am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) -am__v_CXX_0 = @echo " CXX " $@; -am__v_CXX_1 = -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ - $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) -am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) -am__v_CXXLD_0 = @echo " CXXLD " $@; -am__v_CXXLD_1 = -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(od2trips_SOURCES) -DIST_SOURCES = $(od2trips_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -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@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -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_CONFIG = @FOX_CONFIG@ -FOX_LDFLAGS = @FOX_LDFLAGS@ -GDAL_CONFIG = @GDAL_CONFIG@ -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_GTEST = @LIB_GTEST@ -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 = -l$(LIB_XERCES) -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@ -@CHECK_MEMORY_LEAKS_TRUE@MEM_LIBS = ../foreign/nvwa/libnvwa.a -COMMON_LIBS = ../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) \ -$(XERCES_LIBS) - -od2trips_SOURCES = od2trips_main.cpp \ -ODDistrict.cpp ODDistrict.h \ -ODDistrictCont.cpp ODDistrictCont.h \ -ODAmitranHandler.cpp ODAmitranHandler.h \ -ODDistrictHandler.cpp ODDistrictHandler.h \ -ODCell.h ODMatrix.h ODMatrix.cpp - -od2trips_LDFLAGS = $(XERCES_LDFLAGS) -od2trips_LDADD = ../utils/options/liboptions.a \ -../utils/distribution/libdistribution.a \ -../utils/common/libcommon.a \ -../utils/geom/libgeom.a \ -$(COMMON_LIBS) - -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/od2trips/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/od2trips/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): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -od2trips$(EXEEXT): $(od2trips_OBJECTS) $(od2trips_DEPENDENCIES) $(EXTRA_od2trips_DEPENDENCIES) - @rm -f od2trips$(EXEEXT) - $(AM_V_CXXLD)$(od2trips_LINK) $(od2trips_OBJECTS) $(od2trips_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODAmitranHandler.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODDistrict.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODDistrictCont.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODDistrictHandler.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ODMatrix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/od2trips_main.Po@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - 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-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - 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" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -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 $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -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: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -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-binPROGRAMS clean-generic clean-libtool 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-binPROGRAMS - -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: uninstall-binPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ - clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ - ctags ctags-am distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - 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 tags-am uninstall uninstall-am uninstall-binPROGRAMS - - -# 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.21.0+dfsg/src/od2trips/od2trips_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/od2trips_main.cpp --- sumo-0.21.0+dfsg/src/od2trips/od2trips_main.cpp 2014-04-11 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/od2trips_main.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,324 +0,0 @@ -/****************************************************************************/ -/// @file od2trips_main.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @author Laura Bieker -/// @author Yun-Pang Floetteroed -/// @date Thu, 12 September 2002 -/// @version $Id: od2trips_main.cpp 16170 2014-04-11 10:04:38Z behrisch $ -/// -// Main for OD2TRIPS -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 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 - -#ifdef HAVE_VERSION_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// functions -// =========================================================================== -void -fillOptions() { - OptionsCont& oc = OptionsCont::getOptions(); - oc.addCallExample("-c ", "run with configuration file"); - - // insert options sub-topics - SystemFrame::addConfigurationOptions(oc); // fill this subtopic, too - oc.addOptionSubTopic("Input"); - oc.addOptionSubTopic("Output"); - oc.addOptionSubTopic("Time"); - oc.addOptionSubTopic("Processing"); - oc.addOptionSubTopic("Defaults"); - SystemFrame::addReportOptions(oc); // fill this subtopic, too - - - // register the file input options - oc.doRegister("net-file", 'n', new Option_FileName()); - oc.addSynonyme("net-file", "net"); - oc.addDescription("net-file", "Input", "Loads network (districts) from FILE"); - - oc.doRegister("od-matrix-files", 'd', new Option_FileName()); - oc.addSynonyme("od-matrix-files", "od-files"); - oc.addSynonyme("od-matrix-files", "od"); - oc.addDescription("od-matrix-files", "Input", "Loads O/D-files from FILE(s)"); - - oc.doRegister("od-amitran-files", new Option_FileName()); - oc.addSynonyme("od-amitran-files", "amitran-files"); - oc.addSynonyme("od-amitran-files", "amitran"); - oc.addDescription("od-amitran-files", "Input", "Loads O/D-matrix in Amitran format from FILE(s)"); - - - // register the file output options - oc.doRegister("output-file", 'o', new Option_FileName()); - oc.addSynonyme("output-file", "output", true); - oc.addDescription("output-file", "Output", "Writes trip definitions into FILE"); - - oc.doRegister("flow-output", new Option_FileName()); - oc.addDescription("flow-output", "Output", "Writes flow definitions into FILE"); - - oc.doRegister("ignore-vehicle-type", new Option_Bool(false)); - oc.addSynonyme("ignore-vehicle-type", "no-vtype", true); - oc.addDescription("ignore-vehicle-type", "Output", "Does not save vtype information"); - - - // 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"); - - oc.doRegister("end", 'e', new Option_String(SUMOTIME_MAXSTRING, "TIME")); - oc.addDescription("end", "Time", "Defines the end time; Later trips will be discarded; Defaults to the maximum time that SUMO can represent"); - - - // register the data processing options - oc.doRegister("scale", 's', new Option_Float(1)); - oc.addDescription("scale", "Processing", "Scales the loaded flows by FLOAT"); - - oc.doRegister("spread.uniform", new Option_Bool(false)); - oc.addDescription("spread.uniform", "Processing", "Spreads trips uniformly over each time period"); - - oc.doRegister("vtype", new Option_String("")); - oc.addDescription("vtype", "Processing", "Defines the name of the vehicle type to use"); - - oc.doRegister("prefix", new Option_String("")); - oc.addDescription("prefix", "Processing", "Defines the prefix for vehicle names"); - - oc.doRegister("timeline", new Option_String()); - oc.addDescription("timeline", "Processing", "Uses STR as a timeline definition"); - - oc.doRegister("timeline.day-in-hours", new Option_Bool(false)); - oc.addDescription("timeline.day-in-hours", "Processing", "Uses STR as a 24h-timeline definition"); - - oc.doRegister("ignore-errors", new Option_Bool(false)); // !!! describe, document - oc.addSynonyme("ignore-errors", "dismiss-loading-errors", true); - oc.addDescription("ignore-errors", "Processing", "Continue on broken input"); - - oc.doRegister("no-step-log", new Option_Bool(false)); - oc.addDescription("no-step-log", "Processing", "Disable console output of current time step"); - - - // register defaults options - oc.doRegister("departlane", new Option_String("free")); - oc.addDescription("departlane", "Defaults", "Assigns a default depart lane"); - - oc.doRegister("departpos", new Option_String()); - oc.addDescription("departpos", "Defaults", "Assigns a default depart position"); - - oc.doRegister("departspeed", new Option_String("max")); - oc.addDescription("departspeed", "Defaults", "Assigns a default depart speed"); - - oc.doRegister("arrivallane", new Option_String()); - oc.addDescription("arrivallane", "Defaults", "Assigns a default arrival lane"); - - oc.doRegister("arrivalpos", new Option_String()); - oc.addDescription("arrivalpos", "Defaults", "Assigns a default arrival position"); - - oc.doRegister("arrivalspeed", new Option_String()); - oc.addDescription("arrivalspeed", "Defaults", "Assigns a default arrival speed"); - - // add rand options - RandHelper::insertRandOptions(); -} - -bool -checkOptions() { - OptionsCont& oc = OptionsCont::getOptions(); - bool ok = true; - if (!oc.isSet("net-file")) { - WRITE_ERROR("No net input file (-n) specified."); - ok = false; - } - if (!oc.isSet("od-matrix-files") && !oc.isSet("od-amitran-files")) { - WRITE_ERROR("No input specified."); - ok = false; - } - if (!oc.isSet("output-file")) { - WRITE_ERROR("No trip table output file (-o) specified."); - ok = false; - } - // - 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; -} - - - - -/* ------------------------------------------------------------------------- - * main - * ----------------------------------------------------------------------- */ -int -main(int argc, char** argv) { - OptionsCont& oc = OptionsCont::getOptions(); - // give some application descriptions - oc.setApplicationDescription("Importer of O/D-matrices for the road traffic simulation SUMO."); - oc.setApplicationName("od2trips", "SUMO od2trips Version " + (std::string)VERSION_STRING); - int ret = 0; - try { - // initialise subsystems - XMLSubSys::init(); - fillOptions(); - OptionsIO::getOptions(true, argc, argv); - if (oc.processMetaOptions(argc < 2)) { - SystemFrame::close(); - return 0; - } - XMLSubSys::setValidation(oc.getString("xml-validation"), oc.getString("xml-validation.net")); - MsgHandler::initOutputOptions(); - if (!checkOptions()) { - throw ProcessError(); - } - RandHelper::initRandGlobal(); - // load the districts - // check whether the user gave a net filename - if (!oc.isSet("net-file")) { - throw ProcessError("You must supply a network or districts file ('-n')."); - } - // get the file name and set it - ODDistrictCont districts; - districts.loadDistricts(oc.getString("net-file")); - if (districts.size() == 0) { - throw ProcessError("No districts loaded."); - } - // load the matrix - ODMatrix matrix(districts); - matrix.loadMatrix(oc); - if (matrix.getNoLoaded() == 0) { - throw ProcessError("No vehicles loaded."); - } - if (MsgHandler::getErrorInstance()->wasInformed() && !oc.getBool("ignore-errors")) { - throw ProcessError("Loading failed."); - } - WRITE_MESSAGE(toString(matrix.getNoLoaded()) + " vehicles loaded."); - // apply a curve if wished - if (oc.isSet("timeline")) { - matrix.applyCurve(matrix.parseTimeLine(oc.getStringVector("timeline"), oc.getBool("timeline.day-in-hours"))); - } - // write - bool haveOutput = false; - if (OutputDevice::createDeviceByOption("output-file", "routes", "routes_file.xsd")) { - matrix.write(string2time(oc.getString("begin")), string2time(oc.getString("end")), - OutputDevice::getDeviceByOption("output-file"), - oc.getBool("spread.uniform"), oc.getBool("ignore-vehicle-type"), - oc.getString("prefix"), !oc.getBool("no-step-log")); - haveOutput = true; - } - if (OutputDevice::createDeviceByOption("flow-output", "routes", "routes_file.xsd")) { - matrix.writeFlows(string2time(oc.getString("begin")), string2time(oc.getString("end")), - OutputDevice::getDeviceByOption("flow-output"), - oc.getBool("ignore-vehicle-type"), oc.getString("prefix")); - haveOutput = true; - } - if (!haveOutput) { - throw ProcessError("No output file given."); - } - WRITE_MESSAGE(toString(matrix.getNoDiscarded()) + " vehicles discarded."); - WRITE_MESSAGE(toString(matrix.getNoWritten()) + " vehicles written."); - } 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(); - if (ret == 0) { - std::cout << "Success." << std::endl; - } - return ret; -} - - - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/od2trips/ODAmitranHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODAmitranHandler.cpp --- sumo-0.21.0+dfsg/src/od2trips/ODAmitranHandler.cpp 2014-04-11 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODAmitranHandler.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/****************************************************************************/ -/// @file ODAmitranHandler.cpp -/// @author Michael Behrisch -/// @date 27.03.2014 -/// @version $Id: ODAmitranHandler.cpp 16170 2014-04-11 10:04:38Z behrisch $ -/// -// An XML-Handler for Amitran OD matrices -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 "ODMatrix.h" -#include "ODAmitranHandler.h" - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// method definitions -// =========================================================================== -ODAmitranHandler::ODAmitranHandler(ODMatrix& matrix, const std::string& file) - : SUMOSAXHandler(file), myMatrix(matrix) {} - - -ODAmitranHandler::~ODAmitranHandler() {} - - -void -ODAmitranHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { - bool ok = true; - switch (element) { - case SUMO_TAG_ACTORCONFIG: - myVehicleType = attrs.get(SUMO_ATTR_ID, 0, ok); - break; - case SUMO_TAG_TIMESLICE: - myBegin = attrs.get(SUMO_ATTR_STARTTIME, myVehicleType.c_str(), ok); - myEnd = myBegin + attrs.get(SUMO_ATTR_DURATION, myVehicleType.c_str(), ok); - if (myBegin >= myEnd) { - WRITE_ERROR("Invalid duration for timeSlice starting " + toString(myBegin) + "."); - } - break; - case SUMO_TAG_OD_PAIR: - myMatrix.add(attrs.get(SUMO_ATTR_AMOUNT, myVehicleType.c_str(), ok), - myBegin, myEnd, attrs.get(SUMO_ATTR_ORIGIN, myVehicleType.c_str(), ok), - attrs.get(SUMO_ATTR_DESTINATION, myVehicleType.c_str(), ok), myVehicleType); - break; - default: - break; - } -} - - -/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/od2trips/ODAmitranHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODAmitranHandler.h --- sumo-0.21.0+dfsg/src/od2trips/ODAmitranHandler.h 2014-04-11 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODAmitranHandler.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ -/****************************************************************************/ -/// @file ODAmitranHandler.h -/// @author Michael Behrisch -/// @date 27.03.2014 -/// @version $Id: ODAmitranHandler.h 16170 2014-04-11 10:04:38Z behrisch $ -/// -// An XML-Handler for Amitran OD matrices -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 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 ODAmitranHandler_h -#define ODAmitranHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class ODMatrix; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class ODAmitranHandler - * @brief An XML-Handler for districts - * - * This SUMOSAXHandler parses OD matrices in the Amitran format. - */ -class ODAmitranHandler : public SUMOSAXHandler { -public: - /** @brief Constructor - * - * Saves the given matrix in order to fill it. - * @param[in] cont The matrix to fill - * @param[in] file The file that will be processed - */ - ODAmitranHandler(ODMatrix& matrix, const std::string& file); - - - /// @brief Destructor - ~ODAmitranHandler(); - - -protected: - /// @name inherited from GenericSAXHandler - //@{ - - /** @brief Called when an opening-tag occurs - * - * Processes district elements via openDistrict, their sinks (via - * addSink) and sources (via addSource). - * - * @param[in] element The enum of the currently opened element - * @param[in] attrs Attributes of the currently opened element - * @exception ProcessError If an error within the parsed file occurs - * @see GenericSAXHandler::myStartElement - */ - void myStartElement(int element, - const SUMOSAXAttributes& attrs); - //@} - - -private: - /// The matrix to add demand to - ODMatrix& myMatrix; - - std::string myVehicleType; - - SUMOTime myBegin; - SUMOTime myEnd; -private: - /// @brief invalidated copy constructor - ODAmitranHandler(const ODAmitranHandler& s); - - /// @brief invalidated assignment operator - ODAmitranHandler& operator=(const ODAmitranHandler& s); - - -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/od2trips/ODCell.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODCell.h --- sumo-0.21.0+dfsg/src/od2trips/ODCell.h 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODCell.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -/****************************************************************************/ -/// @file ODCell.h -/// @author Peter Mieth -/// @author Daniel Krajzewicz -/// @author Yun-Pang Floetteroed -/// @date Sept 2002 -/// @version $Id: ODCell.h 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// A single O/D-matrix cell -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 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 ODCell_h -#define ODCell_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - - -// =========================================================================== -// class declarations -// =========================================================================== -class RORoute; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @struct ODCell - * @brief A single O/D-matrix cell - * - * A single cell within an O/D-matrix. Contains the information about the origin - * and destination via string-ids of the district, the begin and the end time - * for which this cell is valid, the id of the vehicle type to use, and the - * amount of vehicles to insert during the described interval. - * - * @todo Check whether the vehicle type is used and makes sense herein - */ -struct ODCell { - /// @brief The number of vehicles - SUMOReal vehicleNumber; - - /// @brief The begin time this cell describes - SUMOTime begin; - - /// @brief The end time this cell describes - SUMOTime end; - - /// @brief Name of the origin district - std::string origin; - - /// @brief Name of the destination district - std::string destination; - - /// @brief Name of the vehicle type - std::string vehicleType; - - /// @brief the list of paths / routes - std::vector pathsVector; // path_id, string of edges? -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/od2trips/ODDistrictCont.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODDistrictCont.cpp --- sumo-0.21.0+dfsg/src/od2trips/ODDistrictCont.cpp 2014-04-29 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODDistrictCont.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -/****************************************************************************/ -/// @file ODDistrictCont.cpp -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @author Yun-Pang Floetteroed -/// @date Sept 2002 -/// @version $Id: ODDistrictCont.cpp 16275 2014-04-29 11:43:40Z behrisch $ -/// -// A container for districts -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 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 "ODDistrict.h" -#include "ODDistrictCont.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef CHECK_MEMORY_LEAKS -#include -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// method definitions -// =========================================================================== -ODDistrictCont::ODDistrictCont() {} - - -ODDistrictCont::~ODDistrictCont() {} - - -std::string -ODDistrictCont::getRandomSourceFromDistrict(const std::string& name) const { - ODDistrict* district = get(name); - if (district == 0) { - throw InvalidArgument("There is no district '" + name + "'."); - } - return district->getRandomSource(); -} - - -std::string -ODDistrictCont::getRandomSinkFromDistrict(const std::string& name) const { - ODDistrict* district = get(name); - if (district == 0) { - throw InvalidArgument("There is no district '" + name + "'."); - } - return district->getRandomSink(); -} - -void -ODDistrictCont::loadDistricts(std::string districtfile) { - if (!FileHelpers::isReadable(districtfile)) { - throw ProcessError("Could not access network file '" + districtfile + "' to load."); - } - PROGRESS_BEGIN_MESSAGE("Loading districts from '" + districtfile + "'"); - // build the xml-parser and handler - ODDistrictHandler handler(*this, districtfile); - if (!XMLSubSys::runParser(handler, districtfile, true)) { - PROGRESS_FAILED_MESSAGE(); - } else { - PROGRESS_DONE_MESSAGE(); - } -} - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/od2trips/ODDistrictCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODDistrictCont.h --- sumo-0.21.0+dfsg/src/od2trips/ODDistrictCont.h 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODDistrictCont.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,109 +0,0 @@ -/****************************************************************************/ -/// @file ODDistrictCont.h -/// @author Daniel Krajzewicz -/// @author Yun-Pang Floetteroed -/// @author Michael Behrisch -/// @date Sept 2002 -/// @version $Id: ODDistrictCont.h 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// A container for districts -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 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 ODDistrictCont_h -#define ODDistrictCont_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include "ODDistrict.h" -#include - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class ODDistrictCont - * @brief A container for districts - * - * Besides the inherited methods for adding/removing districts, this container - * allows to retrieve a random source or sink from a named district. - */ -class ODDistrictCont : public NamedObjectCont { -public: - /// Constructor - ODDistrictCont(); - - - /// Destructor - ~ODDistrictCont(); - - - /** @brief Returns the id of a random source from the named district - * - * At first, the named district is retrieved. If this fails, an - * InvalidArgument-exception is thrown. Otherwise, a source (edge) - * is chosen randomly from this district using this district's - * getRandomSource-method which throws an OutOfBoundsException-exception - * if this district does not contain a source. - * - * @param[in] name The id of the district to get a random source from - * @return The id of a randomly chosen source - * @exception InvalidArgument If the named district is not known - * @exception OutOfBoundsException If the named district has no sources - * @see ODDistrict::getRandomSource - */ - std::string getRandomSourceFromDistrict(const std::string& name) const; - - - /** @brief Returns the id of a random sink from the named district - * - * At first, the named district is retrieved. If this fails, an - * InvalidArgument-exception is thrown. Otherwise, a sink (edge) - * is chosen randomly from this district using this district's - * getRandomSink-method which throws an OutOfBoundsException-exception - * if this district does not contain a sink. - * - * @param[in] name The id of the district to get a random sink from - * @return The id of a randomly chosen sink - * @exception InvalidArgument If the named district is not known - * @exception OutOfBoundsException If the named district has no sinks - * @see ODDistrict::getRandomSink - */ - std::string getRandomSinkFromDistrict(const std::string& name) const; - - // @brief load districts from FILE - void loadDistricts(std::string districtfile); - -private: - /// @brief invalidated copy constructor - ODDistrictCont(const ODDistrictCont& s); - - /// @brief invalidated assignment operator - ODDistrictCont& operator=(const ODDistrictCont& s); - - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/od2trips/ODDistrict.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODDistrict.cpp --- sumo-0.21.0+dfsg/src/od2trips/ODDistrict.cpp 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODDistrict.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,95 +0,0 @@ -/****************************************************************************/ -/// @file ODDistrict.cpp -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @author Yun-Pang Floetteroed -/// @date Sept 2002 -/// @version $Id: ODDistrict.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// A district (origin/destination) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 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 "ODDistrict.h" - - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// method definitions -// =========================================================================== -ODDistrict::ODDistrict(const std::string& id) - : Named(id) {} - - -ODDistrict::~ODDistrict() {} - - -void -ODDistrict::addSource(const std::string& id, SUMOReal weight) { - mySources.add(weight, id); -} - - -void -ODDistrict::addSink(const std::string& id, SUMOReal weight) { - mySinks.add(weight, id); -} - - -std::string -ODDistrict::getRandomSource() const { - return mySources.get(); -} - - -std::string -ODDistrict::getRandomSink() const { - return mySinks.get(); -} - - -unsigned int -ODDistrict::sinkNumber() const { - return (unsigned int) mySinks.getVals().size(); -} - - -unsigned int -ODDistrict::sourceNumber() const { - return (unsigned int) mySources.getVals().size(); -} - - - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/od2trips/ODDistrict.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODDistrict.h --- sumo-0.21.0+dfsg/src/od2trips/ODDistrict.h 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODDistrict.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,155 +0,0 @@ -/****************************************************************************/ -/// @file ODDistrict.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @date Sept 2002 -/// @version $Id: ODDistrict.h 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// A district (origin/destination) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 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 ODDistrict_h -#define ODDistrict_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class ODDistrict - * @brief A district (origin/destination) - * - * Class representing a district which has some ingoing and outgoing connections - * to the road network which may be weighted. - */ -class ODDistrict : public Named { -public: - /** @brief Constructor - * - * @param[in] id The id of the district - */ - ODDistrict(const std::string& id); - - - /// @brief Destructor - ~ODDistrict(); - - - /** @brief Adds a source connection - * - * A source is an edge where vehicles leave the district from to reach - * the network. The weight is used when a random source shall be - * chosen. - * - * BTW, it is possible to add a source twice. In this case it will occure - * twice within the distribution so that the behaviour is as adding - * both given probabilities. - * - * @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); - - - /** @brief Adds a sink connection - * - * A sink connection is an edge which is used by vehicles to leave the - * network and reach the district. The weight is used when a random - * sink shall be chosen. - * - * BTW, it is possible to add a sink twice. In this case it will occure - * twice within the distribution so that the behaviour is as adding - * both given probabilities. - * - * @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); - - - /** @brief Returns the id of a source to use - * - * If the list of this district's sources is empty, an OutOfBoundsException - * -exception is thrown. - * - * @return One of this district's sources chosen randomly regarding their weights - * @exception OutOfBoundsException If this district has no sources - */ - std::string getRandomSource() const; - - - /** @brief Returns the id of a sink to use - * - * If the list of this district's sinks is empty, an OutOfBoundsException - * -exception is thrown. - * - * @return One of this district's sinks chosen randomly regarding their weights - * @exception OutOfBoundsException If this district has no sinks - */ - std::string getRandomSink() const; - - - /** @brief Returns the number of sinks - * - * @return The number of known sinks - */ - unsigned int sinkNumber() const; - - - /** @brief Returns the number of sources - * - * @return The number of known sources - */ - unsigned int sourceNumber() const; - - -private: - /// @brief Container of weighted sources - RandomDistributor mySources; - - /// @brief Container of weighted sinks - RandomDistributor mySinks; - - -private: - /// @brief invalidated copy constructor - ODDistrict(const ODDistrict& s); - - /// @brief invalidated assignment operator - ODDistrict& operator=(const ODDistrict& s); - - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/od2trips/ODDistrictHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODDistrictHandler.cpp --- sumo-0.21.0+dfsg/src/od2trips/ODDistrictHandler.cpp 2014-02-22 23:02:38.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODDistrictHandler.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ -/****************************************************************************/ -/// @file ODDistrictHandler.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date Sept 2002 -/// @version $Id: ODDistrictHandler.cpp 15692 2014-02-22 09:17:02Z behrisch $ -/// -// An XML-Handler for districts -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 "ODDistrict.h" -#include "ODDistrictCont.h" -#include "ODDistrictHandler.h" - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// method definitions -// =========================================================================== -ODDistrictHandler::ODDistrictHandler(ODDistrictCont& cont, - const std::string& file) - : SUMOSAXHandler(file), myContainer(cont), myCurrentDistrict(0) {} - - -ODDistrictHandler::~ODDistrictHandler() {} - - -void -ODDistrictHandler::myStartElement(int element, - const SUMOSAXAttributes& attrs) { - switch (element) { - case SUMO_TAG_TAZ: - openDistrict(attrs); - break; - case SUMO_TAG_TAZSOURCE: - addSource(attrs); - break; - case SUMO_TAG_TAZSINK: - addSink(attrs); - break; - default: - break; - } -} - - -void -ODDistrictHandler::myEndElement(int element) { - if (element == SUMO_TAG_TAZ) { - closeDistrict(); - } -} - - -void -ODDistrictHandler::openDistrict(const SUMOSAXAttributes& attrs) { - myCurrentDistrict = 0; - // get the id, report an error if not given or empty... - bool ok = true; - std::string id = attrs.get(SUMO_ATTR_ID, 0, ok); - if (!ok) { - return; - } - myCurrentDistrict = new ODDistrict(id); - if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { - std::vector desc = attrs.getStringVector(SUMO_ATTR_EDGES); - for (std::vector::const_iterator i = desc.begin(); i != desc.end(); ++i) { - myCurrentDistrict->addSource(*i, 1.); - myCurrentDistrict->addSink(*i, 1.); - } - } -} - - -void -ODDistrictHandler::addSource(const SUMOSAXAttributes& attrs) { - std::pair vals = parseConnection(attrs); - if (vals.second >= 0) { - myCurrentDistrict->addSource(vals.first, vals.second); - } -} - - -void -ODDistrictHandler::addSink(const SUMOSAXAttributes& attrs) { - std::pair vals = parseConnection(attrs); - if (vals.second >= 0) { - myCurrentDistrict->addSink(vals.first, vals.second); - } -} - - - -std::pair -ODDistrictHandler::parseConnection(const SUMOSAXAttributes& attrs) { - // check the current district first - if (myCurrentDistrict == 0) { - return std::pair("", -1); - } - // get the id, report an error if not given or empty... - bool ok = true; - std::string id = attrs.get(SUMO_ATTR_ID, 0, ok); - if (!ok) { - return std::pair("", -1); - } - // get the weight - SUMOReal weight = attrs.get(SUMO_ATTR_WEIGHT, id.c_str(), ok); - if (ok) { - if (weight < 0) { - WRITE_ERROR("'probability' must be positive (in definition of " + attrs.getObjectType() + " '" + id + "')."); - } else { - return std::pair(id, weight); - } - } - return std::pair("", -1); -} - - -void -ODDistrictHandler::closeDistrict() { - if (myCurrentDistrict != 0) { - myContainer.add(myCurrentDistrict->getID(), myCurrentDistrict); - } -} - - - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/od2trips/ODDistrictHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODDistrictHandler.h --- sumo-0.21.0+dfsg/src/od2trips/ODDistrictHandler.h 2014-02-22 23:02:38.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODDistrictHandler.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,187 +0,0 @@ -/****************************************************************************/ -/// @file ODDistrictHandler.h -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date Sept 2002 -/// @version $Id: ODDistrictHandler.h 15692 2014-02-22 09:17:02Z behrisch $ -/// -// An XML-Handler for districts -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 ODDistrictHandler_h -#define ODDistrictHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class ODDistrict; -class ODDistrictCont; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class ODDistrictHandler - * @brief An XML-Handler for districts - * - * This SUMOSAXHandler parses districts and their sinks and sources from - * and stores them into a the district container given at initialisation. - */ -class ODDistrictHandler : public SUMOSAXHandler { -public: - /** @brief Constructor - * - * Saves the given district containe in order to fill it. - * @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); - - - /// @brief Destructor - ~ODDistrictHandler(); - - -protected: - /// @name inherited from GenericSAXHandler - //@{ - - /** @brief Called when an opening-tag occurs - * - * Processes district elements via openDistrict, their sinks (via - * addSink) and sources (via addSource). - * - * @param[in] element The enum of the currently opened element - * @param[in] attrs Attributes of the currently opened element - * @exception ProcessError If an error within the parsed file occurs - * @see GenericSAXHandler::myStartElement - */ - void myStartElement(int element, - const SUMOSAXAttributes& attrs); - - - /** @brief Called when a closing tag occurs - * - * Processes district elements via closeDistrict. - * - * @param[in] element ID of the currently opened element - * @exception ProcessError If an error within the parsed file occurs - */ - void myEndElement(int element); - //@} - - -private: - /** @brief Begins the parsing of a district - * - * Tries to retrieve the id of a district, adds a message to the - * error handler if this fails. Otherwise builds a new district - * with this id at myCurrentDistrict. - * - * @param[in] attrs Attributes of the currently opened element - */ - void openDistrict(const SUMOSAXAttributes& attrs); - - - /** @brief Adds a read source to the current district - * - * Tries to get the id and the weight of the currently parsed source - * from the attributes using getValues. If the retrieval could be - * done without errors (weight>=0), the so retrieved weighted source - * is added to myCurrentDistrict using addSource. (getValues checks - * whether myCurrentDistrict is valid) - * - * @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); - - - /** @brief Adds a read sink to the current district - * - * Tries to get the id and the weight of the currently parsed sink - * from the attributes using getValues. If the retrieval could be - * done without errors (weight>=0), the so retrieved weighted sink - * is added to myCurrentDistrict using addSink. (getValues checks - * whether myCurrentDistrict is valid) - * - * @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); - - - /** @brief Closes the processing of the current district - * - * Adds myCurrentDistrict to myContainer. - */ - void closeDistrict(); - - - /** @brief Returns the id and weight for a sink/source - * - * Checks whether myCurrentDistrict (the currently processed - * district) is !=0; in this case, both the id and the weight - * are parsed. If one of them is missing or the weight is not numerical, - * an error is generated and reported to MsgHandler. The "type"-parameter - * is used in order to inform the user whether a source or a sink was - * processed. In the case of an error, the returned weight is -1. - * - * If no error occurs, the correct id and weight are returned. - * - * @param[in] attrs Attributes of the currently opened element - * @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); - -private: - /// The container to add read districts to - ODDistrictCont& myContainer; - - /// The currently parsed district - ODDistrict* myCurrentDistrict; - - -private: - /// @brief invalidated copy constructor - ODDistrictHandler(const ODDistrictHandler& s); - - /// @brief invalidated assignment operator - ODDistrictHandler& operator=(const ODDistrictHandler& s); - - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/od2trips/ODMatrix.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODMatrix.cpp --- sumo-0.21.0+dfsg/src/od2trips/ODMatrix.cpp 2014-06-06 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODMatrix.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,551 +0,0 @@ -/****************************************************************************/ -/// @file ODMatrix.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @author Yun-Pang Floetteroed -/// @date 05 Apr. 2006 -/// @version $Id: ODMatrix.cpp 16547 2014-06-06 08:47:38Z behrisch $ -/// -// An O/D (origin/destination) matrix -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 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 "ODAmitranHandler.h" -#include "ODMatrix.h" - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// method definitions -// =========================================================================== -ODMatrix::ODMatrix(const ODDistrictCont& dc) - : myDistricts(dc), myNoLoaded(0), myNoWritten(0), myNoDiscarded(0) {} - - -ODMatrix::~ODMatrix() { - for (std::vector::iterator i = myContainer.begin(); i != myContainer.end(); ++i) { - delete *i; - } - myContainer.clear(); -} - - -void -ODMatrix::add(SUMOReal vehicleNumber, SUMOTime begin, - SUMOTime end, const std::string& origin, const std::string& destination, - const std::string& vehicleType) { - myNoLoaded += vehicleNumber; - if (myDistricts.get(origin) == 0 && myDistricts.get(destination) == 0) { - WRITE_WARNING("Missing origin '" + origin + "' and destination '" + destination + "' (" + toString(vehicleNumber) + " vehicles)."); - } else if (myDistricts.get(origin) == 0 && vehicleNumber > 0) { - WRITE_ERROR("Missing origin '" + origin + "' (" + toString(vehicleNumber) + " vehicles)."); - myNoDiscarded += vehicleNumber; - } else if (myDistricts.get(destination) == 0 && vehicleNumber > 0) { - WRITE_ERROR("Missing destination '" + destination + "' (" + toString(vehicleNumber) + " vehicles)."); - myNoDiscarded += vehicleNumber; - } else { - if (myDistricts.get(origin)->sourceNumber() == 0) { - WRITE_ERROR("District '" + origin + "' has no source."); - myNoDiscarded += vehicleNumber; - } else if (myDistricts.get(destination)->sinkNumber() == 0) { - WRITE_ERROR("District '" + destination + "' has no sink."); - myNoDiscarded += vehicleNumber; - } else { - ODCell* cell = new ODCell(); - cell->begin = begin; - cell->end = end; - cell->origin = origin; - cell->destination = destination; - cell->vehicleType = vehicleType; - cell->vehicleNumber = vehicleNumber; - myContainer.push_back(cell); - } - } -} - - -SUMOReal -ODMatrix::computeDeparts(ODCell* cell, - 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 - if (RandHelper::rand() < cell->vehicleNumber - (SUMOReal)vehicles2insert) { - vehicles2insert++; - } - if (vehicles2insert == 0) { - return cell->vehicleNumber; - } - - 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 = (SUMOTime)(offset + cell->begin + ((SUMOReal)(cell->end - cell->begin) * (SUMOReal) i / (SUMOReal) vehicles2insert)); - } else { - veh.depart = (SUMOTime)RandHelper::rand(cell->begin, cell->end); - } - - veh.from = myDistricts.getRandomSourceFromDistrict(cell->origin); - veh.to = myDistricts.getRandomSinkFromDistrict(cell->destination); - veh.cell = cell; - into.push_back(veh); - } - return cell->vehicleNumber - vehicles2insert; -} - - -void -ODMatrix::writeDefaultAttrs(OutputDevice& dev, const bool noVtype, - const ODCell* const cell) { - const OptionsCont& oc = OptionsCont::getOptions(); - if (!noVtype && cell->vehicleType != "") { - dev.writeAttr(SUMO_ATTR_TYPE, cell->vehicleType); - } - dev.writeAttr(SUMO_ATTR_FROM_TAZ, cell->origin).writeAttr(SUMO_ATTR_TO_TAZ, cell->destination); - if (oc.isSet("departlane") && oc.getString("departlane") != "default") { - dev.writeAttr(SUMO_ATTR_DEPARTLANE, oc.getString("departlane")); - } - if (oc.isSet("departpos")) { - dev.writeAttr(SUMO_ATTR_DEPARTPOS, oc.getString("departpos")); - } - if (oc.isSet("departspeed") && oc.getString("departspeed") != "default") { - dev.writeAttr(SUMO_ATTR_DEPARTSPEED, oc.getString("departspeed")); - } - if (oc.isSet("arrivallane")) { - dev.writeAttr(SUMO_ATTR_ARRIVALLANE, oc.getString("arrivallane")); - } - if (oc.isSet("arrivalpos")) { - dev.writeAttr(SUMO_ATTR_ARRIVALPOS, oc.getString("arrivalpos")); - } - if (oc.isSet("arrivalspeed")) { - dev.writeAttr(SUMO_ATTR_ARRIVALSPEED, oc.getString("arrivalspeed")); - } -} - - -void -ODMatrix::write(SUMOTime begin, const SUMOTime end, - OutputDevice& dev, const bool uniform, const bool noVtype, - const std::string& prefix, const bool stepLog) { - if (myContainer.size() == 0) { - return; - } - std::map, SUMOReal> fractionLeft; - size_t vehName = 0; - sort(myContainer.begin(), myContainer.end(), cell_by_begin_sorter()); - // recheck begin time - 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;) { - 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; - while (next != myContainer.end() && (*next)->begin <= t && (*next)->end > t) { - std::pair odID = std::make_pair((*next)->origin, (*next)->destination); - // check whether the current cell must be extended by the last fraction - if (fractionLeft.find(odID) != fractionLeft.end()) { - (*next)->vehicleNumber += fractionLeft[odID]; - fractionLeft[odID] = 0; - } - // get the new departures (into tmp) - const size_t oldSize = vehicles.size(); - const SUMOReal fraction = computeDeparts(*next, vehName, vehicles, uniform, prefix); - if (oldSize != vehicles.size()) { - changed = true; - } - if (fraction != 0) { - fractionLeft[odID] = fraction; - } - ++next; - } - if (changed) { - sort(vehicles.begin(), vehicles.end(), descending_departure_comperator()); - } - for (std::vector::reverse_iterator i = vehicles.rbegin(); i != vehicles.rend() && (*i).depart == t; ++i) { - myNoWritten++; - dev.openTag(SUMO_TAG_TRIP).writeAttr(SUMO_ATTR_ID, (*i).id).writeAttr(SUMO_ATTR_DEPART, time2string(t)); - dev.writeAttr(SUMO_ATTR_FROM, (*i).from).writeAttr(SUMO_ATTR_TO, (*i).to); - writeDefaultAttrs(dev, noVtype, i->cell); - dev.closeTag(); - } - 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; - } - } -} - - -void -ODMatrix::writeFlows(const SUMOTime begin, const SUMOTime end, - OutputDevice& dev, bool noVtype, - const std::string& prefix) { - if (myContainer.size() == 0) { - return; - } - size_t flowName = 0; - sort(myContainer.begin(), myContainer.end(), cell_by_begin_sorter()); - // recheck begin time - for (std::vector::const_iterator i = myContainer.begin(); i != myContainer.end(); ++i) { - const ODCell* const c = *i; - if (c->end > begin && c->begin < end) { - dev.openTag(SUMO_TAG_FLOW).writeAttr(SUMO_ATTR_ID, prefix + toString(flowName++)); - dev.writeAttr(SUMO_ATTR_BEGIN, time2string(c->begin)); - dev.writeAttr(SUMO_ATTR_END, time2string(c->end)).writeAttr(SUMO_ATTR_NUMBER, int(c->vehicleNumber)); - writeDefaultAttrs(dev, noVtype, *i); - dev.closeTag(); - } - } -} - - -std::string -ODMatrix::getNextNonCommentLine(LineReader& lr) { - std::string line; - do { - line = lr.readLine(); - if (line[0] != '*') { - return StringUtils::prune(line); - } - } while (lr.good() && lr.hasMore()); - throw ProcessError(); -} - - -SUMOTime -ODMatrix::parseSingleTime(const std::string& time) { - if (time.find('.') == std::string::npos) { - throw OutOfBoundsException(); - } - std::string hours = time.substr(0, time.find('.')); - std::string minutes = time.substr(time.find('.') + 1); - return TIME2STEPS(TplConvert::_2int(hours.c_str()) * 3600 + TplConvert::_2int(minutes.c_str()) * 60); -} - - -std::pair -ODMatrix::readTime(LineReader& lr) { - std::string line = getNextNonCommentLine(lr); - try { - StringTokenizer st(line, StringTokenizer::WHITECHARS); - SUMOTime begin = parseSingleTime(st.next()); - SUMOTime end = parseSingleTime(st.next()); - if (begin >= end) { - throw ProcessError("Begin time is larger than end time."); - } - return std::make_pair(begin, end); - } catch (OutOfBoundsException&) { - throw ProcessError("Broken period definition '" + line + "'."); - } catch (NumberFormatException&) { - throw ProcessError("Broken period definition '" + line + "'."); - } -} - -SUMOReal -ODMatrix::readFactor(LineReader& lr, SUMOReal scale) { - std::string line = getNextNonCommentLine(lr); - SUMOReal factor = -1; - try { - factor = TplConvert::_2SUMOReal(line.c_str()) * scale; - } catch (NumberFormatException&) { - throw ProcessError("Broken factor: '" + line + "'."); - } - return factor; -} - -void -ODMatrix::readV(LineReader& lr, SUMOReal scale, - std::string vehType, bool matrixHasVehType) { - PROGRESS_BEGIN_MESSAGE("Reading matrix '" + lr.getFileName() + "' stored as VMR"); - // parse first defs - std::string line; - if (matrixHasVehType) { - line = getNextNonCommentLine(lr); - if (vehType == "") { - vehType = StringUtils::prune(line); - } - } - - // parse time - std::pair times = readTime(lr); - SUMOTime begin = times.first; - SUMOTime end = times.second; - - // factor - SUMOReal factor = readFactor(lr, scale); - - // districts - line = getNextNonCommentLine(lr); - int districtNo = TplConvert::_2int(StringUtils::prune(line).c_str()); - // parse district names (normally ints) - std::vector names; - do { - line = getNextNonCommentLine(lr); - StringTokenizer st2(line, StringTokenizer::WHITECHARS); - while (st2.hasNext()) { - names.push_back(st2.next()); - } - } while ((int) names.size() != districtNo); - - // parse the cells - for (std::vector::iterator si = names.begin(); si != names.end(); ++si) { - std::vector::iterator di = names.begin(); - // - do { - line = getNextNonCommentLine(lr); - if (line.length() == 0) { - continue; - } - try { - StringTokenizer st2(line, StringTokenizer::WHITECHARS); - while (st2.hasNext()) { - assert(di != names.end()); - SUMOReal vehNumber = TplConvert::_2SUMOReal(st2.next().c_str()) * factor; - if (vehNumber != 0) { - add(vehNumber, begin, end, *si, *di, vehType); - } - if (di == names.end()) { - throw ProcessError("More entries than districts found."); - } - ++di; - } - } catch (NumberFormatException&) { - throw ProcessError("Not numeric vehicle number in line '" + line + "'."); - } - if (!lr.hasMore()) { - break; - } - } while (di != names.end()); - } - PROGRESS_DONE_MESSAGE(); -} - - -void -ODMatrix::readO(LineReader& lr, SUMOReal scale, - std::string vehType, bool matrixHasVehType) { - PROGRESS_BEGIN_MESSAGE("Reading matrix '" + lr.getFileName() + "' stored as OR"); - // parse first defs - std::string line; - if (matrixHasVehType) { - line = getNextNonCommentLine(lr); - int type = TplConvert::_2int(StringUtils::prune(line).c_str()); - if (vehType == "") { - vehType = toString(type); - } - } - - // parse time - std::pair times = readTime(lr); - SUMOTime begin = times.first; - SUMOTime end = times.second; - - // factor - SUMOReal factor = readFactor(lr, scale); - - // parse the cells - while (lr.hasMore()) { - line = getNextNonCommentLine(lr); - if (line.length() == 0) { - continue; - } - StringTokenizer st2(line, StringTokenizer::WHITECHARS); - if (st2.size() == 0) { - continue; - } - try { - std::string sourceD = st2.next(); - std::string destD = st2.next(); - SUMOReal vehNumber = TplConvert::_2SUMOReal(st2.next().c_str()) * factor; - if (vehNumber != 0) { - add(vehNumber, begin, end, sourceD, destD, vehType); - } - } catch (OutOfBoundsException&) { - throw ProcessError("Missing at least one information in line '" + line + "'."); - } catch (NumberFormatException&) { - throw ProcessError("Not numeric vehicle number in line '" + line + "'."); - } - } - PROGRESS_DONE_MESSAGE(); -} - - - -SUMOReal -ODMatrix::getNoLoaded() const { - return myNoLoaded; -} - - -SUMOReal -ODMatrix::getNoWritten() const { - return myNoWritten; -} - - -SUMOReal -ODMatrix::getNoDiscarded() const { - return myNoDiscarded; -} - - -void -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 = TIME2STEPS(ps.getAreaBegin(i)); - ncell->end = TIME2STEPS(ps.getAreaEnd(i)); - ncell->origin = cell->origin; - ncell->destination = cell->destination; - ncell->vehicleType = cell->vehicleType; - ncell->vehicleNumber = cell->vehicleNumber * ps.getAreaPerc(i); - newCells.push_back(ncell); - } -} - - -void -ODMatrix::applyCurve(const Distribution_Points& ps) { - std::vector oldCells = myContainer; - myContainer.clear(); - 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; - } -} - -void -ODMatrix::loadMatrix(OptionsCont& oc) { - std::vector files = oc.getStringVector("od-matrix-files"); - for (std::vector::iterator i = files.begin(); i != files.end(); ++i) { - LineReader lr(*i); - if (!lr.good()) { - throw ProcessError("Could not open '" + (*i) + "'."); - } - std::string type = lr.readLine(); - // get the type only - if (type.find(';') != std::string::npos) { - type = type.substr(0, type.find(';')); - } - // parse type-dependant - if (type.length() > 1 && type[1] == 'V') { - // process ptv's 'V'-matrices - if (type.find('N') != std::string::npos) { - throw ProcessError("'" + *i + "' does not contain the needed information about the time described."); - } - readV(lr, oc.getFloat("scale"), oc.getString("vtype"), type.find('M') != std::string::npos); - } else if (type.length() > 1 && type[1] == 'O') { - // process ptv's 'O'-matrices - if (type.find('N') != std::string::npos) { - throw ProcessError("'" + *i + "' does not contain the needed information about the time described."); - } - readO(lr, oc.getFloat("scale"), oc.getString("vtype"), type.find('M') != std::string::npos); - } else { - throw ProcessError("'" + *i + "' uses an unknown matrix type '" + type + "'."); - } - } - std::vector amitranFiles = oc.getStringVector("od-amitran-files"); - for (std::vector::iterator i = amitranFiles.begin(); i != amitranFiles.end(); ++i) { - if (!FileHelpers::isReadable(*i)) { - throw ProcessError("Could not access matrix file '" + *i + "' to load."); - } - PROGRESS_BEGIN_MESSAGE("Loading matrix in Amitran format from '" + *i + "'"); - ODAmitranHandler handler(*this, *i); - if (!XMLSubSys::runParser(handler, *i)) { - PROGRESS_FAILED_MESSAGE(); - } else { - PROGRESS_DONE_MESSAGE(); - } - } -} - - -Distribution_Points -ODMatrix::parseTimeLine(const std::vector& def, bool timelineDayInHours) { - bool interpolating = !timelineDayInHours; - PositionVector points; - SUMOReal prob = 0; - if (timelineDayInHours) { - if (def.size() != 24) { - 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()); - points.push_back(Position((SUMOReal)(chour * 3600), prob)); - } - points.push_back(Position((SUMOReal)(24 * 3600), prob)); - } else { - size_t i = 0; - while (i < def.size()) { - StringTokenizer st2(def[i++], ":"); - 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()); - points.push_back(Position((SUMOReal) time, prob)); - } - } - return Distribution_Points("N/A", points, interpolating); -} - -/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/od2trips/ODMatrix.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODMatrix.h --- sumo-0.21.0+dfsg/src/od2trips/ODMatrix.h 2014-04-11 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips/ODMatrix.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,406 +0,0 @@ -/****************************************************************************/ -/// @file ODMatrix.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @author Yun-Pang Floetteroed -/// @date 05. Apr. 2006 -/// @version $Id: ODMatrix.h 16170 2014-04-11 10:04:38Z behrisch $ -/// -// An O/D (origin/destination) matrix -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 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 ODMatrix_h -#define ODMatrix_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ODCell.h" -#include "ODDistrictCont.h" -#include -#include -#include - -// =========================================================================== -// class declarations -// =========================================================================== -class OutputDevice; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class ODMatrix - * @brief An O/D (origin/destination) matrix - * - * This class is the internal representation of a loaded O/D-matrix. Beside - * being the storage for ODCells, the matrix also contains information about - * the numbers of loaded, discarded, and written vehicles. - * - * The matrix has a reference to the container of districts stored. This allows - * to validate added cell descriptions in means that using existing origins/ - * destinations only is assured. - * - * In addition of being a storage, the matrix is also responsible for writing - * the results and contains methods for splitting the entries over time. - */ -class ODMatrix { -public: - /** @brief Constructor - * - * @param[in] dc The district container to obtain referenced districts from - */ - ODMatrix(const ODDistrictCont& dc); - - - /// Destructor - ~ODMatrix(); - - - /** @brief Builds a single cell from the given values, verifying them - * - * At first, the number of loaded vehicles (myNoLoaded) is incremented - * by vehicleNumber. - * - * It is checked whether both the origin and the destination exist within - * the assigned district container (myDistricts). If one of them is missing, - * an error is generated, if both, a warning, because in the later case - * the described flow may lay completely beside the processed area. In both - * cases the given number of vehicles (vehicleNumber) is added to myNoDiscarded. - * - * If the origin/destination districts are known, a cell is built using the - * given values. This cell is added to the list of known cells (myContainer). - * - * @param[in] vehicleNumber The number of vehicles to store within the cell - * @param[in] begin The begin of the interval the cell is valid for - * @param[in] end The end of the interval the cell is valid for - * @param[in] origin The origin district to use for the cell's flows - * @param[in] destination The destination district to use for the cell's flows - * @param[in] vehicleType The vehicle type to use for the cell's flows - */ - void add(SUMOReal vehicleNumber, SUMOTime begin, - SUMOTime end, const std::string& origin, const std::string& destination, - const std::string& vehicleType); - - /** @brief Helper function for flow and trip output writing the depart - * and arrival attributes - * - * @param[in] dev The stream to write the generated vehicle trips to - * @param[in] noVtype Whether vtype information shall not be written - * @param[in] cell The OD cell containing the vtype - */ - void writeDefaultAttrs(OutputDevice& dev, const bool noVtype, - const ODCell* const cell); - - /** @brief Writes the vehicles stored in the matrix assigning the sources and sinks - * - * The cells stored in myContainer are sorted, first. Then, for each time - * step to generate vehicles for, it is checked whether the topmost cell - * is valid for this time step. If so, vehicles are generated from this - * cell's description using "computeDeparts" and stored in an internal vector. - * The pointer is moved and the check is repeated until the current cell - * is not valid for the current time or no further cells exist. - * - * Then, for the current time step, the internal list of vehicles is sorted and - * all vehicles that start within this time step are written. - * - * The left fraction of vehicles to insert is saved for each O/D-dependency - * over time and the number of vehicles to generate is increased as soon - * as this value is larger than 1, decrementing it. - * - * @param[in] begin The begin time to generate vehicles for - * @param[in] end The end time to generate vehicles for - * @param[in] dev The stream to write the generated vehicle trips to - * @param[in] uniform Information whether departure times shallbe uniformly spread or random - * @param[in] noVtype Whether vtype information shall not be written - * @param[in] prefix A prefix for the vehicle names - * @param[in] stepLog Whether processed time shall be written - */ - void write(SUMOTime begin, const SUMOTime end, - OutputDevice& dev, const bool uniform, const bool noVtype, - const std::string& prefix, const bool stepLog); - - - /** @brief Writes the flows stored in the matrix - * - * @param[in] begin The begin time to generate vehicles for - * @param[in] end The end time to generate vehicles for - * @param[in] dev The stream to write the generated vehicle trips to - * @param[in] noVtype Whether vtype information shall not be written - * @param[in] prefix A prefix for the flow names - */ - void writeFlows(const SUMOTime begin, const SUMOTime end, - OutputDevice& dev, const bool noVtype, - const std::string& prefix); - - - /** @brief Returns the number of loaded vehicles - * - * Returns the value of myNoLoaded - * - * @return The number of loaded vehicles - */ - SUMOReal getNoLoaded() const; - - - /** @brief Returns the number of written vehicles - * - * Returns the value of myNoWritten - * - * @return The number of written vehicles - */ - SUMOReal getNoWritten() const; - - - /** @brief Returns the number of discarded vehicles - * - * Returns the value of myNoDiscarded - * - * @return The number of discarded vehicles - */ - SUMOReal getNoDiscarded() const; - - - /** @brief Splits the stored cells dividing them on the given time line - * @todo Describe - */ - void applyCurve(const Distribution_Points& ps); - - - /** @brief read a VISUM-matrix with the O Format - * @todo Describe - */ - void readO(LineReader& lr, SUMOReal scale, - std::string vehType, bool matrixHasVehType); - - /** @brief read a VISUM-matrix with the V Format - * @todo Describe - */ - void readV(LineReader& lr, SUMOReal scale, - std::string vehType, bool matrixHasVehType); - - /** @brief read a VISUM-matrix with the V Format - * @todo Describe - */ - void loadMatrix(OptionsCont& oc); - - /** @brief split the given timeline - * @todo Describe - */ - Distribution_Points parseTimeLine(const std::vector& def, bool timelineDayInHours); - - const std::vector& getCells() { - return myContainer; - } - -protected: - /** - * @struct ODVehicle - * @brief An internal representation of a single vehicle - */ - struct ODVehicle { - /// @brief The id of the vehicle - std::string id; - /// @brief The departure time of the vehicle - SUMOTime depart; - /// @brief The cell of the ODMatrix which generated the vehicle - ODCell* cell; - /// @brief The edge the vehicles shall start at - std::string from; - /// @brief The edge the vehicles shall end at - std::string to; - - }; - - - /** @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 - * integer value of the vehicleNumber information from the given cell. - * In the case vehicleNumber has a fraction, an additional vehicle - * may be added in the case a chosen random number is lower than this fraction. - * - * If uniform is true, the departure times of the generated vehicles - * are spread uniformly, otherwise the departure time are chosen randomly from - * the interval. - * - * The vehicle names are generated by putting the value of vehName after the - * given prefix. The value of vehName is incremented with each generated vehicle. - * - * The number of left vehicles (the fraction if no additional vehicle was - * generated) is returned. - * - * @param[in] cell The cell to use - * @param[in,out] vehName An incremented index of the generated vehicle - * @param[out] into The storage to put generated vehicles into - * @param[in] uniform Information whether departure times shallbe uniformly spread or random - * @param[in] prefix A prefix for the vehicle names - * @return The number of left vehicles to insert - */ - SUMOReal computeDeparts(ODCell* cell, - 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 - * storing the results in the given container - * - * For the given cell, a list of clones is generated. The number of these - * is equal to the number of "areas" within the given distribution - * description (time line in this case) and each clone's vehicleNumber - * is equal to the given cell's vehicle number multiplied with the area's - * probability. The clones are stored in the given cell vector. - * - * @see Distribution_Points - * @param[in] ps The time line to apply - * @param[in] cell The cell to split - * @param[out] newCells The storage to put generated cells into - * @todo describe better!!! - */ - void applyCurve(const Distribution_Points& ps, ODCell* cell, - std::vector& newCells); - - -private: - /** @used in the functions readV and readO - * @todo Describe - */ - std::string getNextNonCommentLine(LineReader& lr); - - /** @used in the functions readV and readO - * @todo Describe - */ - SUMOTime parseSingleTime(const std::string& time); - - /** @used in the functions readV and readO - * @todo Describe - */ - std::pair readTime(LineReader& lr); - - /** @used in the functions readV and readO - * @todo Describe - */ - SUMOReal readFactor(LineReader& lr, SUMOReal scale); - - -protected: - /// @brief The loaded cells - std::vector myContainer; - - /// @brief The districts to retrieve sources/sinks from - const ODDistrictCont& myDistricts; - - /// @brief Number of loaded vehicles - SUMOReal myNoLoaded; - - /// @brief Number of written vehicles - SUMOReal myNoWritten; - - /// @brief Number of discarded vehicles - SUMOReal myNoDiscarded; - - - /** - * @class cell_by_begin_sorter - * @brief Used for sorting the cells by the begin time they describe - */ - class cell_by_begin_sorter { - public: - /// @brief constructor - explicit cell_by_begin_sorter() { } - - - /** @brief Comparing operator - * - * Compares two cells by the begin of the time they describe. The sort is stabilized - * (with secondary sort keys being origin and destination) to get comparable results - * with different platforms / compilers. - * - * @param[in] p1 First cell to compare - * @param[in] p2 Second cell to compare - * @return Whether the begin time of the first cell is lower than the one of the second - */ - int operator()(ODCell* p1, ODCell* p2) const { - if (p1->begin == p2->begin) { - if (p1->origin == p2->origin) { - return p1->destination < p2->destination; - } - return p1->origin < p2->origin; - } - return p1->begin < p2->begin; - } - - }; - - - /** - * @class descending_departure_comperator - * @brief Used for sorting vehicles by their departure (latest first) - * - * A reverse operator to what may be expected is used in order to allow - * prunning the sorted vector from its tail. - */ - class descending_departure_comperator { - public: - /// @brief constructor - descending_departure_comperator() { } - - - /** @brief Comparing operator - * - * Compares two vehicles by their departure time - * - * @param[in] p1 First vehicle to compare - * @param[in] p2 Second vehicle to compare - * @return Whether the departure time of the first vehicle is larger than the one of the second - */ - bool operator()(const ODVehicle& p1, const ODVehicle& p2) const { - if (p1.depart == p2.depart) { - return p1.id > p2.id; - } - return p1.depart > p2.depart; - } - - }; - -private: - /** @brief invalid copy constructor */ - ODMatrix(const ODMatrix& s); - - /** @brief invalid assignment operator */ - ODMatrix& operator=(const ODMatrix& s); - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/od2trips_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips_main.cpp --- sumo-0.21.0+dfsg/src/od2trips_main.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/od2trips_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,324 @@ +/****************************************************************************/ +/// @file od2trips_main.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @author Laura Bieker +/// @author Yun-Pang Floetteroed +/// @date Thu, 12 September 2002 +/// @version $Id: od2trips_main.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Main for OD2TRIPS +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 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 + +#ifdef HAVE_VERSION_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// functions +// =========================================================================== +void +fillOptions() { + OptionsCont& oc = OptionsCont::getOptions(); + oc.addCallExample("-c ", "run with configuration file"); + + // insert options sub-topics + SystemFrame::addConfigurationOptions(oc); // fill this subtopic, too + oc.addOptionSubTopic("Input"); + oc.addOptionSubTopic("Output"); + oc.addOptionSubTopic("Time"); + oc.addOptionSubTopic("Processing"); + oc.addOptionSubTopic("Defaults"); + SystemFrame::addReportOptions(oc); // fill this subtopic, too + + + // register the file input options + oc.doRegister("net-file", 'n', new Option_FileName()); + oc.addSynonyme("net-file", "net"); + oc.addDescription("net-file", "Input", "Loads network (districts) from FILE"); + + oc.doRegister("od-matrix-files", 'd', new Option_FileName()); + oc.addSynonyme("od-matrix-files", "od-files"); + oc.addSynonyme("od-matrix-files", "od"); + oc.addDescription("od-matrix-files", "Input", "Loads O/D-files from FILE(s)"); + + oc.doRegister("od-amitran-files", new Option_FileName()); + oc.addSynonyme("od-amitran-files", "amitran-files"); + oc.addSynonyme("od-amitran-files", "amitran"); + oc.addDescription("od-amitran-files", "Input", "Loads O/D-matrix in Amitran format from FILE(s)"); + + + // register the file output options + oc.doRegister("output-file", 'o', new Option_FileName()); + oc.addSynonyme("output-file", "output", true); + oc.addDescription("output-file", "Output", "Writes trip definitions into FILE"); + + oc.doRegister("flow-output", new Option_FileName()); + oc.addDescription("flow-output", "Output", "Writes flow definitions into FILE"); + + oc.doRegister("ignore-vehicle-type", new Option_Bool(false)); + oc.addSynonyme("ignore-vehicle-type", "no-vtype", true); + oc.addDescription("ignore-vehicle-type", "Output", "Does not save vtype information"); + + + // 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"); + + oc.doRegister("end", 'e', new Option_String(SUMOTIME_MAXSTRING, "TIME")); + oc.addDescription("end", "Time", "Defines the end time; Later trips will be discarded; Defaults to the maximum time that SUMO can represent"); + + + // register the data processing options + oc.doRegister("scale", 's', new Option_Float(1)); + oc.addDescription("scale", "Processing", "Scales the loaded flows by FLOAT"); + + oc.doRegister("spread.uniform", new Option_Bool(false)); + oc.addDescription("spread.uniform", "Processing", "Spreads trips uniformly over each time period"); + + oc.doRegister("vtype", new Option_String("")); + oc.addDescription("vtype", "Processing", "Defines the name of the vehicle type to use"); + + oc.doRegister("prefix", new Option_String("")); + oc.addDescription("prefix", "Processing", "Defines the prefix for vehicle names"); + + oc.doRegister("timeline", new Option_String()); + oc.addDescription("timeline", "Processing", "Uses STR as a timeline definition"); + + oc.doRegister("timeline.day-in-hours", new Option_Bool(false)); + oc.addDescription("timeline.day-in-hours", "Processing", "Uses STR as a 24h-timeline definition"); + + oc.doRegister("ignore-errors", new Option_Bool(false)); // !!! describe, document + oc.addSynonyme("ignore-errors", "dismiss-loading-errors", true); + oc.addDescription("ignore-errors", "Processing", "Continue on broken input"); + + oc.doRegister("no-step-log", new Option_Bool(false)); + oc.addDescription("no-step-log", "Processing", "Disable console output of current time step"); + + + // register defaults options + oc.doRegister("departlane", new Option_String("free")); + oc.addDescription("departlane", "Defaults", "Assigns a default depart lane"); + + oc.doRegister("departpos", new Option_String()); + oc.addDescription("departpos", "Defaults", "Assigns a default depart position"); + + oc.doRegister("departspeed", new Option_String("max")); + oc.addDescription("departspeed", "Defaults", "Assigns a default depart speed"); + + oc.doRegister("arrivallane", new Option_String()); + oc.addDescription("arrivallane", "Defaults", "Assigns a default arrival lane"); + + oc.doRegister("arrivalpos", new Option_String()); + oc.addDescription("arrivalpos", "Defaults", "Assigns a default arrival position"); + + oc.doRegister("arrivalspeed", new Option_String()); + oc.addDescription("arrivalspeed", "Defaults", "Assigns a default arrival speed"); + + // add rand options + RandHelper::insertRandOptions(); +} + +bool +checkOptions() { + OptionsCont& oc = OptionsCont::getOptions(); + bool ok = true; + if (!oc.isSet("net-file")) { + WRITE_ERROR("No net input file (-n) specified."); + ok = false; + } + if (!oc.isSet("od-matrix-files") && !oc.isSet("od-amitran-files")) { + WRITE_ERROR("No input specified."); + ok = false; + } + if (!oc.isSet("output-file")) { + WRITE_ERROR("No trip table output file (-o) specified."); + ok = false; + } + // + 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; +} + + + + +/* ------------------------------------------------------------------------- + * main + * ----------------------------------------------------------------------- */ +int +main(int argc, char** argv) { + OptionsCont& oc = OptionsCont::getOptions(); + // give some application descriptions + oc.setApplicationDescription("Importer of O/D-matrices for the road traffic simulation SUMO."); + oc.setApplicationName("od2trips", "SUMO od2trips Version " + getBuildName(VERSION_STRING)); + int ret = 0; + try { + // initialise subsystems + XMLSubSys::init(); + fillOptions(); + OptionsIO::getOptions(true, argc, argv); + if (oc.processMetaOptions(argc < 2)) { + SystemFrame::close(); + return 0; + } + XMLSubSys::setValidation(oc.getString("xml-validation"), oc.getString("xml-validation.net")); + MsgHandler::initOutputOptions(); + if (!checkOptions()) { + throw ProcessError(); + } + RandHelper::initRandGlobal(); + // load the districts + // check whether the user gave a net filename + if (!oc.isSet("net-file")) { + throw ProcessError("You must supply a network or districts file ('-n')."); + } + // get the file name and set it + ODDistrictCont districts; + districts.loadDistricts(oc.getString("net-file")); + if (districts.size() == 0) { + throw ProcessError("No districts loaded."); + } + // load the matrix + ODMatrix matrix(districts); + matrix.loadMatrix(oc); + if (matrix.getNoLoaded() == 0) { + throw ProcessError("No vehicles loaded."); + } + if (MsgHandler::getErrorInstance()->wasInformed() && !oc.getBool("ignore-errors")) { + throw ProcessError("Loading failed."); + } + WRITE_MESSAGE(toString(matrix.getNoLoaded()) + " vehicles loaded."); + // apply a curve if wished + if (oc.isSet("timeline")) { + matrix.applyCurve(matrix.parseTimeLine(oc.getStringVector("timeline"), oc.getBool("timeline.day-in-hours"))); + } + // write + bool haveOutput = false; + if (OutputDevice::createDeviceByOption("output-file", "routes", "routes_file.xsd")) { + matrix.write(string2time(oc.getString("begin")), string2time(oc.getString("end")), + OutputDevice::getDeviceByOption("output-file"), + oc.getBool("spread.uniform"), oc.getBool("ignore-vehicle-type"), + oc.getString("prefix"), !oc.getBool("no-step-log")); + haveOutput = true; + } + if (OutputDevice::createDeviceByOption("flow-output", "routes", "routes_file.xsd")) { + matrix.writeFlows(string2time(oc.getString("begin")), string2time(oc.getString("end")), + OutputDevice::getDeviceByOption("flow-output"), + oc.getBool("ignore-vehicle-type"), oc.getString("prefix")); + haveOutput = true; + } + if (!haveOutput) { + throw ProcessError("No output file given."); + } + WRITE_MESSAGE(toString(matrix.getNoDiscarded()) + " vehicles discarded."); + WRITE_MESSAGE(toString(matrix.getNoWritten()) + " vehicles written."); + } 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(); + if (ret == 0) { + std::cout << "Success." << std::endl; + } + return ret; +} + + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/polyconvert/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/Makefile.in --- sumo-0.21.0+dfsg/src/polyconvert/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -230,6 +230,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -240,7 +242,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCLoaderArcView.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderArcView.cpp --- sumo-0.21.0+dfsg/src/polyconvert/PCLoaderArcView.cpp 2014-02-25 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderArcView.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: PCLoaderArcView.cpp 15727 2014-02-25 08:09:54Z behrisch $ +/// @version $Id: PCLoaderArcView.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A reader of pois and polygons from shape files /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCLoaderArcView.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderArcView.h --- sumo-0.21.0+dfsg/src/polyconvert/PCLoaderArcView.h 2014-02-22 23:02:24.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderArcView.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: PCLoaderArcView.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: PCLoaderArcView.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A reader of pois and polygons from shape files /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCLoaderDlrNavteq.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderDlrNavteq.cpp --- sumo-0.21.0+dfsg/src/polyconvert/PCLoaderDlrNavteq.cpp 2014-04-29 22:02:43.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderDlrNavteq.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Christoph Sommer /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCLoaderDlrNavteq.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: PCLoaderDlrNavteq.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A reader of pois and polygons stored in DLR-Navteq (Elmar)-format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCLoaderDlrNavteq.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderDlrNavteq.h --- sumo-0.21.0+dfsg/src/polyconvert/PCLoaderDlrNavteq.h 2014-02-22 23:02:24.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderDlrNavteq.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCLoaderDlrNavteq.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: PCLoaderDlrNavteq.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A reader of pois and polygons stored in DLR-Navteq (Elmar)-format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCLoaderOSM.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderOSM.cpp --- sumo-0.21.0+dfsg/src/polyconvert/PCLoaderOSM.cpp 2014-05-12 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderOSM.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Melanie Knocke /// @date Wed, 19.11.2008 -/// @version $Id: PCLoaderOSM.cpp 16351 2014-05-12 10:09:31Z namdre $ +/// @version $Id: PCLoaderOSM.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A reader of pois and polygons stored in OSM-format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCLoaderOSM.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderOSM.h --- sumo-0.21.0+dfsg/src/polyconvert/PCLoaderOSM.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderOSM.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Melanie Knocke /// @date Wed, 19.11.2008 -/// @version $Id: PCLoaderOSM.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: PCLoaderOSM.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A reader of pois and polygons stored in OSM-format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCLoaderVisum.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderVisum.cpp --- sumo-0.21.0+dfsg/src/polyconvert/PCLoaderVisum.cpp 2014-04-29 22:02:43.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderVisum.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Christoph Sommer /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCLoaderVisum.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: PCLoaderVisum.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A reader of pois and polygons stored in VISUM-format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCLoaderVisum.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderVisum.h --- sumo-0.21.0+dfsg/src/polyconvert/PCLoaderVisum.h 2014-02-22 23:02:24.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderVisum.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCLoaderVisum.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: PCLoaderVisum.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A reader of pois and polygons stored in VISUM-format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCLoaderXML.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderXML.cpp --- sumo-0.21.0+dfsg/src/polyconvert/PCLoaderXML.cpp 2014-04-29 22:02:43.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderXML.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Christoph Sommer /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCLoaderXML.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: PCLoaderXML.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A reader for polygons and pois stored in XML-format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCLoaderXML.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderXML.h --- sumo-0.21.0+dfsg/src/polyconvert/PCLoaderXML.h 2014-02-22 23:02:24.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCLoaderXML.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCLoaderXML.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: PCLoaderXML.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A reader for polygons and pois stored in XML-format /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCNetProjectionLoader.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCNetProjectionLoader.cpp --- sumo-0.21.0+dfsg/src/polyconvert/PCNetProjectionLoader.cpp 2014-04-29 22:02:43.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCNetProjectionLoader.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCNetProjectionLoader.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: PCNetProjectionLoader.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A reader for a SUMO network's projection description /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCNetProjectionLoader.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCNetProjectionLoader.h --- sumo-0.21.0+dfsg/src/polyconvert/PCNetProjectionLoader.h 2014-02-22 23:02:24.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCNetProjectionLoader.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 02.11.2006 -/// @version $Id: PCNetProjectionLoader.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: PCNetProjectionLoader.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A reader for a SUMO network's projection description /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCPolyContainer.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCPolyContainer.cpp --- sumo-0.21.0+dfsg/src/polyconvert/PCPolyContainer.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCPolyContainer.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Melanie Knocke /// @date Mon, 05 Dec 2005 -/// @version $Id: PCPolyContainer.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: PCPolyContainer.cpp 18137 2015-03-24 15:12:38Z behrisch $ /// // A storage for loaded polygons and pois /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -153,35 +154,22 @@ void -PCPolyContainer::save(const std::string& file) { +PCPolyContainer::save(const std::string& file, bool useGeo) { + const GeoConvHelper& gch = GeoConvHelper::getFinal(); + if (useGeo && !gch.usingGeoProjection()) { + WRITE_WARNING("Ignoring option \"proj.plain-geo\" because no geo-conversion has been defined"); + useGeo = false; + } OutputDevice& out = OutputDevice::getDevice(file); - out.writeXMLHeader("additional", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/additional_file.xsd\""); + out.writeXMLHeader("additional", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/additional_file.xsd\""); + if (useGeo) { + out.setPrecision(GEO_OUTPUT_ACCURACY); + } else { + GeoConvHelper::writeLocation(out); + } // write polygons for (PolyCont::iterator i = myPolyCont.begin(); i != myPolyCont.end(); ++i) { - 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()); - } - const std::map& attrs = p->getMap(); - if (attrs.size() != 0) { - for (std::map::const_iterator j = attrs.begin(); j != attrs.end(); ++j) { - out.openTag(SUMO_TAG_PARAM); - out.writeAttr(SUMO_ATTR_KEY, (*j).first); - out.writeAttr(SUMO_ATTR_VALUE, (*j).second); - out.closeTag(); - } - } - out.closeTag(); + i->second->writeXML(out, useGeo); } // write pois for (POICont::iterator i = myPOICont.begin(); i != myPOICont.end(); ++i) { @@ -191,8 +179,15 @@ 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 (useGeo) { + Position pos(*p); + gch.cartesian2geo(pos); + out.writeAttr(SUMO_ATTR_LON, pos.x()); + out.writeAttr(SUMO_ATTR_LAT, pos.y()); + } else { + 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()); } @@ -205,14 +200,11 @@ if (p->getHeight() != Shape::DEFAULT_IMG_HEIGHT) { out.writeAttr(SUMO_ATTR_HEIGHT, p->getHeight()); } - const std::map& attrs = p->getMap(); - if (attrs.size() != 0) { - for (std::map::const_iterator j = attrs.begin(); j != attrs.end(); ++j) { - out.openTag(SUMO_TAG_PARAM); - out.writeAttr(SUMO_ATTR_KEY, (*j).first); - out.writeAttr(SUMO_ATTR_VALUE, (*j).second); - out.closeTag(); - } + for (std::map::const_iterator j = p->getMap().begin(); j != p->getMap().end(); ++j) { + out.openTag(SUMO_TAG_PARAM); + out.writeAttr(SUMO_ATTR_KEY, (*j).first); + out.writeAttr(SUMO_ATTR_VALUE, (*j).second); + out.closeTag(); } out.closeTag(); } diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCPolyContainer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCPolyContainer.h --- sumo-0.21.0+dfsg/src/polyconvert/PCPolyContainer.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCPolyContainer.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 05 Dec 2005 -/// @version $Id: PCPolyContainer.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: PCPolyContainer.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A storage for loaded polygons and pois /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -138,9 +138,10 @@ /** @brief Saves the stored polygons into the given file * @param[in] file The name of the file to write stored objects' definitions into + * @param[in] useGeo Whether to write output in geo-coordinates * @exception IOError If the file could not be opened */ - void save(const std::string& file); + void save(const std::string& file, bool useGeo); /** @brief Retuns a unique id for a given name diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCTypeDefHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCTypeDefHandler.cpp --- sumo-0.21.0+dfsg/src/polyconvert/PCTypeDefHandler.cpp 2014-02-22 23:02:24.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCTypeDefHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: PCTypeDefHandler.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: PCTypeDefHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A handler for loading polygon type maps /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCTypeDefHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCTypeDefHandler.h --- sumo-0.21.0+dfsg/src/polyconvert/PCTypeDefHandler.h 2014-02-22 23:02:24.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCTypeDefHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 16.03.2006 -/// @version $Id: PCTypeDefHandler.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: PCTypeDefHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A handler for loading polygon type maps /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCTypeMap.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCTypeMap.cpp --- sumo-0.21.0+dfsg/src/polyconvert/PCTypeMap.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCTypeMap.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 05 Dec 2005 -/// @version $Id: PCTypeMap.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: PCTypeMap.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A storage for type mappings /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/PCTypeMap.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCTypeMap.h --- sumo-0.21.0+dfsg/src/polyconvert/PCTypeMap.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/PCTypeMap.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 05 Dec 2005 -/// @version $Id: PCTypeMap.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: PCTypeMap.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A storage for type mappings /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/polyconvert/polyconvert_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/polyconvert_main.cpp --- sumo-0.21.0+dfsg/src/polyconvert/polyconvert_main.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/polyconvert/polyconvert_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Melanie Knocke /// @date Mon, 05 Dec 2005 -/// @version $Id: polyconvert_main.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: polyconvert_main.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Main for POLYCONVERT /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -203,6 +203,10 @@ oc.doRegister("discard", new Option_Bool(false)); oc.addDescription("discard", "Building Defaults", "Sets default action to discard"); + + // projection + oc.doRegister("proj.plain-geo", new Option_Bool(false)); + oc.addDescription("proj.plain-geo", "Projection", "Write geo coordinates in output"); } @@ -210,7 +214,7 @@ main(int argc, char** argv) { OptionsCont& oc = OptionsCont::getOptions(); oc.setApplicationDescription("Importer of polygons and POIs for the road traffic simulation SUMO."); - oc.setApplicationName("polyconvert", "SUMO polyconvert Version " + (std::string)VERSION_STRING); + oc.setApplicationName("polyconvert", "SUMO polyconvert Version " + getBuildName(VERSION_STRING)); int ret = 0; try { // initialise subsystems @@ -287,13 +291,14 @@ PCLoaderDlrNavteq::loadIfSet(oc, toFill, tm); // Elmar-files PCLoaderVisum::loadIfSet(oc, toFill, tm); // VISUM PCLoaderArcView::loadIfSet(oc, toFill, tm); // shape-files + GeoConvHelper::computeFinal(); // error processing if (MsgHandler::getErrorInstance()->wasInformed() && oc.getBool("ignore-errors")) { MsgHandler::getErrorInstance()->clear(); } if (!MsgHandler::getErrorInstance()->wasInformed()) { // no? ok, save - toFill.save(oc.getString("output-file")); + toFill.save(oc.getString("output-file"), oc.getBool("proj.plain-geo")); } else { throw ProcessError(); } diff -Nru sumo-0.21.0+dfsg/src/router/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/Makefile.am --- sumo-0.21.0+dfsg/src/router/Makefile.am 2013-05-03 20:25:06.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -1,13 +1,11 @@ noinst_LIBRARIES = librouter.a -librouter_a_SOURCES = ReferencedItem.h \ -ROAbstractEdgeBuilder.h \ -ROCostCalculator.cpp ROCostCalculator.h \ +librouter_a_SOURCES = ROAbstractEdgeBuilder.h \ ROEdge.cpp ROEdge.h \ ROFrame.cpp ROFrame.h ROHelper.cpp ROHelper.h ROLane.h \ ROLoader.cpp ROLoader.h \ RONet.cpp RONet.h RONetHandler.cpp RONetHandler.h \ -RONode.cpp RONode.h \ +RONode.cpp RONode.h RORouteAggregator.h \ RORoute.cpp RORoute.h RORouteDef.cpp RORouteDef.h \ RORouteHandler.cpp RORouteHandler.h \ ROVehicle.cpp ROVehicle.h \ diff -Nru sumo-0.21.0+dfsg/src/router/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/Makefile.in --- sumo-0.21.0+dfsg/src/router/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -98,12 +98,11 @@ am__v_AR_1 = librouter_a_AR = $(AR) $(ARFLAGS) librouter_a_LIBADD = -am_librouter_a_OBJECTS = ROCostCalculator.$(OBJEXT) ROEdge.$(OBJEXT) \ - ROFrame.$(OBJEXT) ROHelper.$(OBJEXT) ROLoader.$(OBJEXT) \ - RONet.$(OBJEXT) RONetHandler.$(OBJEXT) RONode.$(OBJEXT) \ - RORoute.$(OBJEXT) RORouteDef.$(OBJEXT) \ - RORouteHandler.$(OBJEXT) ROVehicle.$(OBJEXT) \ - ROVehicleCont.$(OBJEXT) +am_librouter_a_OBJECTS = ROEdge.$(OBJEXT) ROFrame.$(OBJEXT) \ + ROHelper.$(OBJEXT) ROLoader.$(OBJEXT) RONet.$(OBJEXT) \ + RONetHandler.$(OBJEXT) RONode.$(OBJEXT) RORoute.$(OBJEXT) \ + RORouteDef.$(OBJEXT) RORouteHandler.$(OBJEXT) \ + ROVehicle.$(OBJEXT) ROVehicleCont.$(OBJEXT) librouter_a_OBJECTS = $(am_librouter_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -225,6 +224,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -235,7 +236,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -330,14 +330,12 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = librouter.a -librouter_a_SOURCES = ReferencedItem.h \ -ROAbstractEdgeBuilder.h \ -ROCostCalculator.cpp ROCostCalculator.h \ +librouter_a_SOURCES = ROAbstractEdgeBuilder.h \ ROEdge.cpp ROEdge.h \ ROFrame.cpp ROFrame.h ROHelper.cpp ROHelper.h ROLane.h \ ROLoader.cpp ROLoader.h \ RONet.cpp RONet.h RONetHandler.cpp RONetHandler.h \ -RONode.cpp RONode.h \ +RONode.cpp RONode.h RORouteAggregator.h \ RORoute.cpp RORoute.h RORouteDef.cpp RORouteDef.h \ RORouteHandler.cpp RORouteHandler.h \ ROVehicle.cpp ROVehicle.h \ @@ -392,7 +390,6 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ROCostCalculator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ROEdge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ROFrame.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ROHelper.Po@am__quote@ diff -Nru sumo-0.21.0+dfsg/src/router/ReferencedItem.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ReferencedItem.h --- sumo-0.21.0+dfsg/src/router/ReferencedItem.h 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ReferencedItem.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -/****************************************************************************/ -/// @file ReferencedItem.h -/// @author Daniel Krajzewicz -/// @date Sept 2002 -/// @version $Id: ReferencedItem.h 15692 2014-02-22 09:17:02Z behrisch $ -/// -// Helper base for things that are referenced and have to be saved only once -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 ReferencedItem_h -#define ReferencedItem_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class ReferencedItem - * @brief Helper base for things that are referenced and have to be saved only once - * - * Basic class for structures which are referenced by other classes. The wish - * is to have an information whether an instance of a derived class was already - * saved (together with a referencing class) or shall be saved this time. - */ -class ReferencedItem { -public: - /// @brief Constructor - ReferencedItem() : myWasSaved(false) { } - - - /// @brief Destructor - virtual ~ReferencedItem() { } - - - /** @brief Returns the information whether this item was already saved - * - * @return Whether this item was saved - */ - bool isSaved() const { - return myWasSaved; - } - - - /** @brief Marks the item as saved - */ - void markSaved() { - myWasSaved = true; - } - - -private: - /// @brief Information whether the item was already saved - bool myWasSaved; - - -private: - /// @brief Invalidated copy constructor - ReferencedItem(const ReferencedItem& src); - - /// @brief Invalidated assignment operator - ReferencedItem& operator=(const ReferencedItem& src); - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/router/ROAbstractEdgeBuilder.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROAbstractEdgeBuilder.h --- sumo-0.21.0+dfsg/src/router/ROAbstractEdgeBuilder.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROAbstractEdgeBuilder.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Yun-Pang Floetteroed /// @date Wed, 21 Jan 2004 -/// @version $Id: ROAbstractEdgeBuilder.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: ROAbstractEdgeBuilder.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Interface for building instances of router-edges /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/router/ROCostCalculator.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROCostCalculator.cpp --- sumo-0.21.0+dfsg/src/router/ROCostCalculator.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROCostCalculator.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,251 +0,0 @@ -/****************************************************************************/ -/// @file ROCostCalculator.cpp -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @author Jakob Erdmann -/// @date Sept 2002 -/// @version $Id: ROCostCalculator.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// Calculators for route costs and probabilities -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 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 "ROEdge.h" -#include "RORoute.h" -#include "ROVehicle.h" -#include "ROCostCalculator.h" - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// static member definitions -// =========================================================================== -ROCostCalculator* ROCostCalculator::myInstance = 0; - - -// =========================================================================== -// method definitions -// =========================================================================== -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() {} - - -ROCostCalculator& -ROCostCalculator::getCalculator() { - if (myInstance == 0) { - OptionsCont& oc = OptionsCont::getOptions(); - if (oc.getString("route-choice-method") == "logit") { - myInstance = new ROLogitCalculator(oc.getFloat("logit.beta"), oc.getFloat("logit.gamma"), oc.getFloat("logit.theta")); - } else if (oc.getString("route-choice-method") == "gawron") { - myInstance = new ROGawronCalculator(oc.getFloat("gawron.beta"), oc.getFloat("gawron.a")); - } - } - return *myInstance; -} - - -void -ROCostCalculator::cleanup() { - delete myInstance; - myInstance = 0; -} - - -ROGawronCalculator::ROGawronCalculator(const SUMOReal beta, const SUMOReal a) - : myBeta(beta), myA(a) {} - - -ROGawronCalculator::~ROGawronCalculator() {} - - -void -ROGawronCalculator::setCosts(RORoute* route, const SUMOReal costs, const bool isActive) const { - if (isActive) { - route->setCosts(costs); - } else { - route->setCosts(myBeta * costs + ((SUMOReal) 1.0 - myBeta) * route->getCosts()); - } -} - - -void -ROGawronCalculator::calculateProbabilities(std::vector alternatives, const ROVehicle* const /* veh */, const SUMOTime /* time */) { - 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++) { - RORoute* pS = *j; - // see [Gawron, 1998] (4.2) - const SUMOReal delta = - (pS->getCosts() - pR->getCosts()) / - (pS->getCosts() + pR->getCosts()); - // see [Gawron, 1998] (4.3a, 4.3b) - SUMOReal newPR = gawronF(pR->getProbability(), pS->getProbability(), delta); - SUMOReal newPS = pR->getProbability() + pS->getProbability() - newPR; - if (ISNAN(newPR) || ISNAN(newPS)) { - newPR = pS->getCosts() > pR->getCosts() - ? (SUMOReal) 1. : 0; - newPS = pS->getCosts() > pR->getCosts() - ? 0 : (SUMOReal) 1.; - } - newPR = MIN2((SUMOReal) MAX2(newPR, (SUMOReal) 0), (SUMOReal) 1); - newPS = MIN2((SUMOReal) MAX2(newPS, (SUMOReal) 0), (SUMOReal) 1); - pR->setProbability(newPR); - pS->setProbability(newPS); - } - } -} - - -SUMOReal -ROGawronCalculator::gawronF(const SUMOReal pdr, const SUMOReal pds, const SUMOReal x) const { - if (pdr * gawronG(myA, x) + pds == 0) { - return std::numeric_limits::max(); - } - return (pdr * (pdr + pds) * gawronG(myA, x)) / - (pdr * gawronG(myA, x) + pds); -} - - -SUMOReal -ROGawronCalculator::gawronG(const SUMOReal a, const SUMOReal x) const { - if (((1.0 - (x * x)) == 0)) { - return std::numeric_limits::max(); - } - return (SUMOReal) exp((a * x) / (1.0 - (x * x))); -} - - - - -ROLogitCalculator::ROLogitCalculator(const SUMOReal beta, const SUMOReal gamma, - const SUMOReal theta) - : myBeta(beta), myGamma(gamma), myTheta(theta) {} - - -ROLogitCalculator::~ROLogitCalculator() {} - - -void -ROLogitCalculator::setCosts(RORoute* route, const SUMOReal costs, const bool /* isActive */) const { - route->setCosts(costs); -} - - -void -ROLogitCalculator::calculateProbabilities(std::vector alternatives, const ROVehicle* const veh, const SUMOTime time) { - const SUMOReal theta = myTheta >= 0 ? myTheta : getThetaForCLogit(alternatives); - const SUMOReal beta = myBeta >= 0 ? myBeta : getBetaForCLogit(alternatives); - if (beta > 0) { - // calculate commonalities - 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(); - for (std::vector::const_iterator edge = edgesR.begin(); edge != edgesR.end(); ++edge) { - //@todo we should use costs here - lengthR += (*edge)->getTravelTime(veh, STEPS2TIME(time)); - } - SUMOReal overlapSum = 0; - for (std::vector::const_iterator j = alternatives.begin(); j != alternatives.end(); j++) { - const RORoute* pS = *j; - SUMOReal overlapLength = 0.; - SUMOReal lengthS = 0; - const std::vector& edgesS = pS->getEdgeVector(); - for (std::vector::const_iterator edge = edgesS.begin(); edge != edgesS.end(); ++edge) { - lengthS += (*edge)->getTravelTime(veh, STEPS2TIME(time)); - if (std::find(edgesR.begin(), edgesR.end(), *edge) != edgesR.end()) { - overlapLength += (*edge)->getTravelTime(veh, STEPS2TIME(time)); - } - } - overlapSum += pow(overlapLength / sqrt(lengthR * lengthS), myGamma); - } - myCommonalities[pR] = beta * log(overlapSum); - } - } - for (std::vector::iterator i = alternatives.begin(); i != alternatives.end(); i++) { - RORoute* pR = *i; - SUMOReal weightedSum = 0; - for (std::vector::iterator j = alternatives.begin(); j != alternatives.end(); j++) { - RORoute* pS = *j; - weightedSum += exp(theta * (pR->getCosts() - pS->getCosts() + myCommonalities[pR] - myCommonalities[pS])); - } - pR->setProbability(1. / weightedSum); - } -} - - -SUMOReal -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.; - if (cost < min) { - min = cost; - } - } - return min; -} - - -SUMOReal -ROLogitCalculator::getThetaForCLogit(const std::vector alternatives) const { - // @todo this calculation works for travel times only - SUMOReal sum = 0.; - 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.; - sum += cost; - if (cost < min) { - min = cost; - } - } - 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); - } - const SUMOReal cvCost = sqrt(diff / SUMOReal(alternatives.size())) / meanCost; - // @todo re-evaluate function -// if (cvCost > 0.04) { // Magic numbers from Lohse book - return M_PI / (sqrt(6.) * cvCost * (min + 1.1)) / 3600.; -// } -// return 1./3600.; -} - - -/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/router/ROCostCalculator.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROCostCalculator.h --- sumo-0.21.0+dfsg/src/router/ROCostCalculator.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROCostCalculator.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,186 +0,0 @@ -/****************************************************************************/ -/// @file ROCostCalculator.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @author Jakob Erdmann -/// @date Sept 2002 -/// @version $Id: ROCostCalculator.h 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// Calculators for route costs and probabilities -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 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 ROCostCalculator_h -#define ROCostCalculator_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class RORoute; -class ROVehicle; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class ROCostCalculator - * @brief Abstract base class providing static factory method. - */ -class ROCostCalculator { -public: - static ROCostCalculator& getCalculator(); - - static void cleanup(); - - 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(std::vector alternatives, const ROVehicle* const veh, const SUMOTime time) = 0; - - unsigned int getMaxRouteNumber() const { - return myMaxRouteNumber; - } - - bool keepRoutes() const { - return myKeepRoutes; - } - - bool skipRouteCalculation() const { - return mySkipRouteCalculation; - } - -protected: - /// @brief Constructor - ROCostCalculator(); - - /// @brief Destructor - virtual ~ROCostCalculator(); - -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; - -}; - - -/** - * @class ROGawronCalculator - * @brief Cost calculation with Gawron's method. - */ -class ROGawronCalculator : public ROCostCalculator { -public: - /// Constructor - ROGawronCalculator(const SUMOReal beta, const SUMOReal a); - - /// Destructor - virtual ~ROGawronCalculator(); - - void setCosts(RORoute* route, const SUMOReal costs, const bool isActive = false) const; - - /** @brief calculate the probabilities */ - void calculateProbabilities(std::vector alternatives, const ROVehicle* const veh, const SUMOTime time); - -private: - /** @brief Performs the gawron - f() function - From "Dynamic User Equilibria..." */ - SUMOReal gawronF(const SUMOReal pdr, const SUMOReal pds, const SUMOReal x) const; - - /** @brief Performs the gawron - g() function - From "Dynamic User Equilibria..." */ - SUMOReal gawronG(const SUMOReal a, const SUMOReal x) const; - -private: - /// @brief gawron beta - value - const SUMOReal myBeta; - - /// @brief gawron a - value - const SUMOReal myA; - -private: - /** @brief invalidated assignment operator */ - ROGawronCalculator& operator=(const ROGawronCalculator& s); - -}; - - -/** - * @class ROLogitCalculator - * @brief Cost calculation with c-logit or logit method. - */ -class ROLogitCalculator : public ROCostCalculator { -public: - /// Constructor - ROLogitCalculator(const SUMOReal beta, const SUMOReal gamma, - const SUMOReal theta); - - /// Destructor - virtual ~ROLogitCalculator(); - - void setCosts(RORoute* route, const SUMOReal costs, const bool isActive = false) const; - - /** @brief calculate the probabilities in the logit model */ - void calculateProbabilities(std::vector alternatives, const ROVehicle* const veh, const SUMOTime time); - -private: - /** @brief calculate the scaling factor in the logit model */ - SUMOReal getBetaForCLogit(const std::vector alternatives) const; - - /** @brief calculate the scaling factor in the logit model */ - SUMOReal getThetaForCLogit(const std::vector alternatives) const; - -private: - /// @brief logit beta - value - const SUMOReal myBeta; - - /// @brief logit gamma - value - const SUMOReal myGamma; - - /// @brief logit theta - value - const SUMOReal myTheta; - - /// @brief The route commonality factors for c-logit - std::map myCommonalities; - -private: - /** @brief invalidated assignment operator */ - ROLogitCalculator& operator=(const ROLogitCalculator& s); - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/router/ROEdge.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROEdge.cpp --- sumo-0.21.0+dfsg/src/router/ROEdge.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROEdge.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Melanie Knocke /// @author Yun-Pang Floetteroed /// @date Sept 2002 -/// @version $Id: ROEdge.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: ROEdge.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // A basic edge for routing applications /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,7 +41,7 @@ #include "ROLane.h" #include "ROEdge.h" #include "ROVehicle.h" -#include +#include #include #include @@ -58,7 +58,7 @@ bool ROEdge::myInterpolate = false; bool ROEdge::myHaveTTWarned = false; bool ROEdge::myHaveEWarned = false; -std::vector ROEdge::myEdges; +ROEdgeVector ROEdge::myEdges; // =========================================================================== @@ -100,7 +100,7 @@ void -ROEdge::addFollower(ROEdge* s, std::string) { +ROEdge::addSuccessor(ROEdge* s, std::string) { if (find(myFollowingEdges.begin(), myFollowingEdges.end(), s) == myFollowingEdges.end()) { myFollowingEdges.push_back(s); s->myApproachingEdges.push_back(this); @@ -126,7 +126,7 @@ ROEdge::getEffort(const ROVehicle* const veh, SUMOReal time) const { SUMOReal ret = 0; if (!getStoredEffort(time, ret)) { - return (SUMOReal)(myLength / MIN2(veh->getType()->maxSpeed, mySpeed)); + return myLength / MIN2(veh->getType()->maxSpeed, mySpeed); } return ret; } @@ -163,93 +163,15 @@ } } } - return (SUMOReal)(myLength / MIN2(veh->getType()->maxSpeed, veh->getType()->speedFactor * mySpeed)); + return myLength / MIN2(veh->getType()->maxSpeed, veh->getType()->speedFactor * mySpeed); } SUMOReal -ROEdge::getCOEffort(const ROVehicle* const veh, SUMOReal time) const { +ROEdge::getNoiseEffort(const ROEdge* const edge, const ROVehicle* const veh, SUMOReal time) { SUMOReal ret = 0; - if (!getStoredEffort(time, ret)) { - const SUMOVTypeParameter* const type = veh->getType(); - const SUMOReal vMax = MIN2(type->maxSpeed, mySpeed); - const SUMOReal accel = type->get(SUMO_ATTR_ACCEL, SUMOVTypeParameter::getDefaultAccel(type->vehicleClass)) * type->get(SUMO_ATTR_SIGMA, SUMOVTypeParameter::getDefaultImperfection(type->vehicleClass)) / 2.; - ret = PollutantsInterface::computeDefault(type->emissionClass, PollutantsInterface::CO, vMax, accel, 0, getTravelTime(veh, time)); // @todo: give correct slope - } - return ret; -} - - -SUMOReal -ROEdge::getCO2Effort(const ROVehicle* const veh, SUMOReal time) const { - SUMOReal ret = 0; - if (!getStoredEffort(time, ret)) { - const SUMOVTypeParameter* const type = veh->getType(); - const SUMOReal vMax = MIN2(type->maxSpeed, mySpeed); - const SUMOReal accel = type->get(SUMO_ATTR_ACCEL, SUMOVTypeParameter::getDefaultAccel(type->vehicleClass)) * type->get(SUMO_ATTR_SIGMA, SUMOVTypeParameter::getDefaultImperfection(type->vehicleClass)) / 2.; - ret = PollutantsInterface::computeDefault(type->emissionClass, PollutantsInterface::CO2, vMax, accel, 0, getTravelTime(veh, time)); // @todo: give correct slope - } - return ret; -} - - -SUMOReal -ROEdge::getPMxEffort(const ROVehicle* const veh, SUMOReal time) const { - SUMOReal ret = 0; - if (!getStoredEffort(time, ret)) { - const SUMOVTypeParameter* const type = veh->getType(); - const SUMOReal vMax = MIN2(type->maxSpeed, mySpeed); - const SUMOReal accel = type->get(SUMO_ATTR_ACCEL, SUMOVTypeParameter::getDefaultAccel(type->vehicleClass)) * type->get(SUMO_ATTR_SIGMA, SUMOVTypeParameter::getDefaultImperfection(type->vehicleClass)) / 2.; - ret = PollutantsInterface::computeDefault(type->emissionClass, PollutantsInterface::PM_X, vMax, accel, 0, getTravelTime(veh, time)); // @todo: give correct slope - } - return ret; -} - - -SUMOReal -ROEdge::getHCEffort(const ROVehicle* const veh, SUMOReal time) const { - SUMOReal ret = 0; - if (!getStoredEffort(time, ret)) { - const SUMOVTypeParameter* const type = veh->getType(); - const SUMOReal vMax = MIN2(type->maxSpeed, mySpeed); - const SUMOReal accel = type->get(SUMO_ATTR_ACCEL, SUMOVTypeParameter::getDefaultAccel(type->vehicleClass)) * type->get(SUMO_ATTR_SIGMA, SUMOVTypeParameter::getDefaultImperfection(type->vehicleClass)) / 2.; - ret = PollutantsInterface::computeDefault(type->emissionClass, PollutantsInterface::HC, vMax, accel, 0, getTravelTime(veh, time)); // @todo: give correct slope - } - return ret; -} - - -SUMOReal -ROEdge::getNOxEffort(const ROVehicle* const veh, SUMOReal time) const { - SUMOReal ret = 0; - if (!getStoredEffort(time, ret)) { - const SUMOVTypeParameter* const type = veh->getType(); - const SUMOReal vMax = MIN2(type->maxSpeed, mySpeed); - const SUMOReal accel = type->get(SUMO_ATTR_ACCEL, SUMOVTypeParameter::getDefaultAccel(type->vehicleClass)) * type->get(SUMO_ATTR_SIGMA, SUMOVTypeParameter::getDefaultImperfection(type->vehicleClass)) / 2.; - ret = PollutantsInterface::computeDefault(type->emissionClass, PollutantsInterface::NO_X, vMax, accel, 0, getTravelTime(veh, time)); // @todo: give correct slope - } - return ret; -} - - -SUMOReal -ROEdge::getFuelEffort(const ROVehicle* const veh, SUMOReal time) const { - SUMOReal ret = 0; - if (!getStoredEffort(time, ret)) { - const SUMOVTypeParameter* const type = veh->getType(); - const SUMOReal vMax = MIN2(type->maxSpeed, mySpeed); - const SUMOReal accel = type->get(SUMO_ATTR_ACCEL, SUMOVTypeParameter::getDefaultAccel(type->vehicleClass)) * type->get(SUMO_ATTR_SIGMA, SUMOVTypeParameter::getDefaultImperfection(type->vehicleClass)) / 2.; - ret = PollutantsInterface::computeDefault(type->emissionClass, PollutantsInterface::FUEL, vMax, accel, 0, getTravelTime(veh, time)); // @todo: give correct slope - } - return ret; -} - - -SUMOReal -ROEdge::getNoiseEffort(const ROVehicle* const veh, SUMOReal time) const { - SUMOReal ret = 0; - if (!getStoredEffort(time, ret)) { - const SUMOReal v = MIN2(veh->getType()->maxSpeed, mySpeed); + if (!edge->getStoredEffort(time, ret)) { + const SUMOReal v = MIN2(veh->getType()->maxSpeed, edge->mySpeed); ret = HelpersHarmonoise::computeNoise(veh->getType()->emissionClass, v, 0); } return ret; @@ -282,7 +204,7 @@ unsigned int -ROEdge::getNoFollowing() const { +ROEdge::getNumSuccessors() const { if (getType() == ET_SINK) { return 0; } @@ -291,7 +213,7 @@ unsigned int -ROEdge::getNumApproaching() const { +ROEdge::getNumPredecessors() const { if (getType() == ET_SOURCE) { return 0; } @@ -338,7 +260,7 @@ bool ROEdge::allFollowersProhibit(const ROVehicle* const vehicle) const { - for (std::vector::const_iterator i = myFollowingEdges.begin(); i != myFollowingEdges.end(); ++i) { + for (ROEdgeVector::const_iterator i = myFollowingEdges.begin(); i != myFollowingEdges.end(); ++i) { if (!(*i)->prohibits(vehicle)) { return false; } @@ -354,6 +276,44 @@ } +const ROEdgeVector& +ROEdge::getSuccessors(SUMOVehicleClass vClass) const { + if (vClass == SVC_IGNORING) { + return myFollowingEdges; + } + ClassesSuccesorMap::const_iterator i = myClassesSuccessorMap.find(vClass); + if (i != myClassesSuccessorMap.end()) { + // can use cached value + return i->second; + } else { + // this vClass is requested for the first time. rebuild all succesors + std::set followers; + for (std::vector::const_iterator it = myLanes.begin(); it != myLanes.end(); ++it) { + ROLane* lane = *it; + if ((lane->getPermissions() & vClass) != 0) { + const std::vector& outgoing = lane->getOutgoingLanes(); + for (std::vector::const_iterator it2 = outgoing.begin(); it2 != outgoing.end(); ++it2) { + const ROLane* next = *it2; + if ((next->getPermissions() & vClass) != 0) { + followers.insert(&next->getEdge()); + } + } + } + } + myClassesSuccessorMap[vClass].insert(myClassesSuccessorMap[vClass].begin(), + followers.begin(), followers.end()); + return myClassesSuccessorMap[vClass]; + } + +} + + +bool +ROEdge::isConnectedTo(const ROEdge* const e, const ROVehicle* const vehicle) const { + const SUMOVehicleClass vClass = (vehicle == 0 ? SVC_IGNORING : vehicle->getVClass()); + const ROEdgeVector& followers = getSuccessors(vClass); + return std::find(followers.begin(), followers.end(), e) != followers.end(); +} /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/router/ROEdge.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROEdge.h --- sumo-0.21.0+dfsg/src/router/ROEdge.h 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROEdge.h 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Melanie Knocke /// @author Yun-Pang Floetteroed /// @date Sept 2002 -/// @version $Id: ROEdge.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: ROEdge.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A basic edge for routing applications /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -43,7 +43,8 @@ #include #include #include -#include +#include +#include #include "RONode.h" #include "ROVehicle.h" @@ -52,7 +53,10 @@ // class declarations // =========================================================================== class ROLane; +class ROEdge; +typedef std::vector ROEdgeVector; +typedef std::vector ConstROEdgeVector; // =========================================================================== // class definitions @@ -120,12 +124,11 @@ /** @brief Adds information about a connected edge * - * The edge is added to "myFollowingEdges". + * The edge s is added to "myFollowingEdges" and this edge is added as predecessor to s. * @param[in] s The edge to add * @todo What about vehicle-type aware connections? - * @note: if HAVE_INTERNAL is defined, the backward connections is added as well */ - virtual void addFollower(ROEdge* s, std::string dir = ""); + virtual void addSuccessor(ROEdge* s, std::string dir = ""); /** @brief Sets the type of te edge @@ -224,11 +227,10 @@ /** @brief returns the information whether this edge is directly connected to the given * * @param[in] e The edge which may be connected + * @param[in] vehicle The vehicle for which the connectivity is checked * @return Whether the given edge is a direct successor to this one */ - bool isConnectedTo(const ROEdge* const e) const { - return std::find(myFollowingEdges.begin(), myFollowingEdges.end(), e) != myFollowingEdges.end(); - } + bool isConnectedTo(const ROEdge* const e, const ROVehicle* const vehicle) const; /** @brief Returns whether this edge prohibits the given vehicle to pass it @@ -245,7 +247,7 @@ } - /** @brief Returns whether this edge succeding edges prohibit the given vehicle to pass them + /** @brief Returns whether this edge succeeding edges prohibit the given vehicle to pass them * @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 */ @@ -282,34 +284,39 @@ * * @return The number of edges following this edge */ - unsigned int getNoFollowing() const; + unsigned int getNumSuccessors() const; - /** @brief Returns the edge at the given position from the list of reachable edges - * @param[in] pos The position of the list within the list of following - * @return The following edge, stored at position pos + /** @brief Returns the following edges */ - ROEdge* getFollower(unsigned int pos) const { - return myFollowingEdges[pos]; + const ROEdgeVector& getSuccessors() const { + return myFollowingEdges; } - /** @brief Returns the number of edges this edge is connected to + /** @brief Returns the following edges, restricted by vClass + * @param[in] vClass The vClass for which to restrict the successors + * @return The eligible following edges + */ + const ROEdgeVector& getSuccessors(SUMOVehicleClass vClass) const; + + + /** @brief Returns the number of edges connected to this edge * * If this edge's type is set to "source", 0 is returned, otherwise * the number of edges stored in "myApproachingEdges". * - * @return The number of edges following this edge + * @return The number of edges reaching into this edge */ - unsigned int getNumApproaching() const; + unsigned int getNumPredecessors() const; - /** @brief Returns the edge at the given position from the list of reachable edges - * @param[in] pos The position of the list within the list of approached - * @return The following edge, stored at position pos + /** @brief Returns the edge at the given position from the list of incoming edges + * @param[in] pos The position of the list within the list of incoming + * @return The incoming edge, stored at position pos */ - ROEdge* getApproaching(unsigned int pos) const { - return myApproachingEdges[pos]; + const ROEdgeVector& getPredecessors() const { + return myApproachingEdges; } @@ -325,11 +332,36 @@ /** @brief Returns the travel time for this edge * + * @param[in] veh The vehicle for which the travel time on this edge shall be retrieved + * @param[in] time The time for which the travel time shall be returned [s] + * @return The travel time needed by the given vehicle to pass the edge at the given time + */ + SUMOReal getTravelTime(const ROVehicle* const veh, SUMOReal time) const; + + + /** @brief Returns the effort for the given edge + * + * @param[in] edge The edge for which the effort shall be retrieved * @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 + */ + static inline SUMOReal getEffortStatic(const ROEdge* const edge, const ROVehicle* const veh, SUMOReal time) { + return edge->getEffort(veh, time); + } + + + /** @brief Returns the travel time for the given edge + * + * @param[in] edge The edge for which the travel time shall be retrieved + * @param[in] veh The vehicle for which the travel time on this edge shall be retrieved + * @param[in] time The time for which the travel time shall be returned [s] * @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; + static inline SUMOReal getTravelTimeStatic(const ROEdge* const edge, const ROVehicle* const veh, SUMOReal time) { + return edge->getTravelTime(veh, time); + } /** @brief Returns a lower bound for the travel time on this edge without using any stored timeLine @@ -338,17 +370,24 @@ * @param[in] time The time for which the effort shall be returned [s] */ inline SUMOReal getMinimumTravelTime(const ROVehicle* const veh) const { - return myLength / MIN2(veh->getType()->maxSpeed, SUMOReal(2. * veh->getType()->speedDev + 1.) * veh->getType()->speedFactor * mySpeed); + return myLength / MIN2(veh->getType()->maxSpeed, veh->getChosenSpeedFactor() * mySpeed); + } + + + template + static SUMOReal getEmissionEffort(const ROEdge* const edge, const ROVehicle* const veh, SUMOReal time) { + SUMOReal ret = 0; + if (!edge->getStoredEffort(time, ret)) { + const SUMOVTypeParameter* const type = veh->getType(); + const SUMOReal vMax = MIN2(type->maxSpeed, edge->mySpeed); + const SUMOReal accel = type->get(SUMO_ATTR_ACCEL, SUMOVTypeParameter::getDefaultAccel(type->vehicleClass)) * type->get(SUMO_ATTR_SIGMA, SUMOVTypeParameter::getDefaultImperfection(type->vehicleClass)) / 2.; + ret = PollutantsInterface::computeDefault(type->emissionClass, ET, vMax, accel, 0, edge->getTravelTime(veh, time)); // @todo: give correct slope + } + return ret; } - 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; + static SUMOReal getNoiseEffort(const ROEdge* const edge, const ROVehicle* const veh, SUMOReal time); //@} @@ -450,10 +489,10 @@ static bool myHaveTTWarned; /// @brief List of edges that may be approached from this edge - std::vector myFollowingEdges; + ROEdgeVector myFollowingEdges; /// @brief List of edges that approached this edge - std::vector myApproachingEdges; + ROEdgeVector myApproachingEdges; /// @brief The type of the edge EdgeType myType; @@ -464,12 +503,15 @@ /// @brief The list of allowed vehicle classes combined across lanes SVCPermissions myCombinedPermissions; - static std::vector myEdges; + static ROEdgeVector myEdges; /// @brief the junctions for this edge RONode* myFromJunction; RONode* myToJunction; + /// @brief The successors available for a given vClass + typedef std::map ClassesSuccesorMap; + mutable ClassesSuccesorMap myClassesSuccessorMap; private: /// @brief Invalidated copy constructor diff -Nru sumo-0.21.0+dfsg/src/router/ROFrame.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROFrame.cpp --- sumo-0.21.0+dfsg/src/router/ROFrame.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROFrame.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROFrame.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: ROFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for routing /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -94,8 +94,7 @@ oc.addSynonyme("weight-attribute", "measure", true); oc.addDescription("weight-attribute", "Input", "Name of the xml attribute which gives the edge weight"); - std::string plp = getenv("PHEMLIGHT_PATH") == 0 ? "./PHEMlight/" : std::string(getenv("PHEMLIGHT_PATH")); - oc.doRegister("phemlight-path", new Option_FileName(plp)); + oc.doRegister("phemlight-path", new Option_FileName("./PHEMlight/")); oc.addDescription("phemlight-path", "Input", "Determines where to load PHEMlight definitions from."); } @@ -115,6 +114,9 @@ oc.addSynonyme("unsorted-input", "unsorted"); oc.addDescription("unsorted-input", "Processing", "Assume input is unsorted"); + oc.doRegister("route-steps", 's', new Option_String("200", "TIME")); + oc.addDescription("route-steps", "Processing", "Load routes for the next number of seconds ahead"); + oc.doRegister("randomize-flows", new Option_Bool(false)); oc.addDescription("randomize-flows", "Processing", "generate random departure times for flow input"); @@ -136,20 +138,17 @@ if (forDuarouter) { oc.doRegister("routing-algorithm", new Option_String("dijkstra")); - 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']" -#endif - ); + oc.addDescription("routing-algorithm", "Processing", "Select among routing algorithms ['dijkstra', 'astar', 'bulkstar', 'CH', 'CHWrapper']"); -#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 Hierarchy"); -#endif } +#ifdef HAVE_FOX + oc.doRegister("routing-threads", new Option_Integer(0)); + oc.addDescription("routing-threads", "Processing", "The number of parallel execution threads used for routing"); +#endif + // register defaults options oc.doRegister("departlane", new Option_String()); oc.addDescription("departlane", "Defaults", "Assigns a default depart lane"); diff -Nru sumo-0.21.0+dfsg/src/router/ROFrame.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROFrame.h --- sumo-0.21.0+dfsg/src/router/ROFrame.h 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROFrame.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: ROFrame.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ROFrame.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Sets and checks options for routing /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/router/ROHelper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROHelper.cpp --- sumo-0.21.0+dfsg/src/router/ROHelper.cpp 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROHelper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROHelper.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ROHelper.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Some helping methods for router /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,7 +41,9 @@ namespace ROHelper { void -recheckForLoops(std::vector& edges) { +recheckForLoops(ConstROEdgeVector& edges) { + // XXX check for stops, departLane, departPos, departSpeed, .... + // 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(); @@ -66,9 +68,23 @@ if (firstEnd < edges.size() - 1) { edges.erase(edges.begin() + firstEnd + 2, edges.end()); } - // remove loops within the route + + // removal of edge loops within the route (edge occurs twice) + std::map lastOccurence; // index of the last occurence of this edge + for (size_t ii = 0; ii < edges.size(); ++ii) { + std::map::iterator it_pre = lastOccurence.find(edges[ii]); + if (it_pre != lastOccurence.end()) { + edges.erase(edges.begin() + it_pre->second, edges.begin() + ii); + ii = it_pre->second; + } else { + lastOccurence[edges[ii]] = ii; + } + } + + // removal of node loops (node occurs twice) is not done because these may occur legitimately + /* std::vector nodes; - for (std::vector::iterator i = edges.begin(); i != edges.end(); ++i) { + for (ConstROEdgeVector::iterator i = edges.begin(); i != edges.end(); ++i) { nodes.push_back((*i)->getFromNode()); } nodes.push_back(edges.back()->getToNode()); @@ -86,7 +102,6 @@ } } } while (changed); - /* */ } diff -Nru sumo-0.21.0+dfsg/src/router/ROHelper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROHelper.h --- sumo-0.21.0+dfsg/src/router/ROHelper.h 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROHelper.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROHelper.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ROHelper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some helping methods for router /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -67,10 +67,10 @@ * @todo Check whether both vehicles can be const */ bool operator()(ROVehicle* veh1, ROVehicle* veh2) const { - if (veh1->getDepartureTime() == veh2->getDepartureTime()) { + if (veh1->getDepart() == veh2->getDepart()) { return veh1->getID() > veh2->getID(); } - return veh1->getDepartureTime() > veh2->getDepartureTime(); + return veh1->getDepart() > veh2->getDepart(); } }; @@ -84,7 +84,7 @@ * * @param[in] edges The list of edges to remove loops from */ -void recheckForLoops(std::vector& edges); +void recheckForLoops(ConstROEdgeVector& edges); } diff -Nru sumo-0.21.0+dfsg/src/router/ROLane.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROLane.h --- sumo-0.21.0+dfsg/src/router/ROLane.h 2014-05-08 22:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROLane.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: ROLane.h 16328 2014-05-08 13:08:00Z namdre $ +/// @version $Id: ROLane.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A single lane the router may use /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -86,7 +86,7 @@ /** @brief Returns the list of allowed vehicle classes * @return The list of vehicle classes allowed on this lane */ - inline SVCPermissions getPermissions() { + inline SVCPermissions getPermissions() const { return myPermissions; } diff -Nru sumo-0.21.0+dfsg/src/router/ROLoader.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROLoader.cpp --- sumo-0.21.0+dfsg/src/router/ROLoader.cpp 2014-04-29 22:02:41.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROLoader.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Christian Roessel /// @date Sept 2002 -/// @version $Id: ROLoader.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: ROLoader.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Loader for networks and route imports /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -54,10 +54,7 @@ #include "ROLoader.h" #include "ROEdge.h" #include "RORouteHandler.h" - -#ifdef HAVE_INTERNAL // catchall for internal stuff -#include -#endif // have HAVE_INTERNAL +#include "RORouteAggregator.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -181,8 +178,12 @@ // check if (ok) { myLoaders.loadNext(string2time(myOptions.getString("begin"))); - if (!MsgHandler::getErrorInstance()->wasInformed() && !net.furtherStored()) { - throw ProcessError("No route input specified or all routes were invalid."); + if (!net.furtherStored()) { + if (MsgHandler::getErrorInstance()->wasInformed()) { + throw ProcessError(); + } else { + throw ProcessError("No route input specified or all routes were invalid."); + } } // skip routes prior to the begin time if (!myOptions.getBool("unsorted-input")) { @@ -193,22 +194,30 @@ void -ROLoader::processRoutes(SUMOTime start, SUMOTime end, +ROLoader::processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment, RONet& net, SUMOAbstractRouter& router) { - SUMOTime absNo = end - start; + const SUMOTime absNo = end - start; + const bool endGiven = !OptionsCont::getOptions().isDefault("end"); // skip routes that begin before the simulation's begin // loop till the end - bool endReached = false; - bool errorOccured = false; const SUMOTime firstStep = myLoaders.getFirstLoadTime(); SUMOTime lastStep = firstStep; - for (SUMOTime time = firstStep; time < end && !errorOccured && !endReached; time += DELTA_T) { - writeStats(time, start, absNo); + SUMOTime time = MIN2(firstStep, end); + while (time <= end) { + writeStats(time, start, absNo, endGiven); myLoaders.loadNext(time); - net.saveAndRemoveRoutesUntil(myOptions, router, time); - endReached = !net.furtherStored(); - lastStep = time; - errorOccured = MsgHandler::getErrorInstance()->wasInformed() && !myOptions.getBool("ignore-errors"); + if (!net.furtherStored() || MsgHandler::getErrorInstance()->wasInformed()) { + break; + } + lastStep = net.saveAndRemoveRoutesUntil(myOptions, router, time); + if ((!net.furtherStored() && myLoaders.haveAllLoaded()) || MsgHandler::getErrorInstance()->wasInformed()) { + break; + } + if (time < end && time + increment > end) { + time = end; + } else { + time += increment; + } } if (myLogSteps) { WRITE_MESSAGE("Routes found between time steps " + time2string(firstStep) + " and " + time2string(lastStep) + "."); @@ -216,15 +225,13 @@ } -#ifdef HAVE_INTERNAL // catchall for internal stuff void ROLoader::processAllRoutesWithBulkRouter(SUMOTime /* start */, SUMOTime end, RONet& net, SUMOAbstractRouter& router) { myLoaders.loadNext(SUMOTime_MAX); - RouteAggregator::processAllRoutes(net, router); + RORouteAggregator::processAllRoutes(net, router); net.saveAndRemoveRoutesUntil(myOptions, router, end); } -#endif bool @@ -306,10 +313,14 @@ void -ROLoader::writeStats(SUMOTime time, SUMOTime start, int absNo) { +ROLoader::writeStats(SUMOTime time, SUMOTime start, int absNo, bool endGiven) { if (myLogSteps) { - const SUMOReal perc = (SUMOReal)(time - start) / (SUMOReal) absNo; - std::cout << "Reading time step: " + time2string(time) + " (" + time2string(time - start) + "/" + time2string(absNo) + " = " + toString(perc * 100) + "% done) \r"; + if (endGiven) { + const SUMOReal perc = (SUMOReal)(time - start) / (SUMOReal) absNo; + std::cout << "Reading up to time step: " + time2string(time) + " (" + time2string(time - start) + "/" + time2string(absNo) + " = " + toString(perc * 100) + "% done) \r"; + } else { + std::cout << "Reading up to time step: " + time2string(time) + "\r"; + } } } diff -Nru sumo-0.21.0+dfsg/src/router/ROLoader.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROLoader.h --- sumo-0.21.0+dfsg/src/router/ROLoader.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROLoader.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: ROLoader.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: ROLoader.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Loader for networks and route imports /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -34,7 +34,7 @@ #endif #include -#include +#include #include #include #include @@ -85,14 +85,12 @@ void openRoutes(RONet& net); /** @brief Loads routes from all previously build route loaders */ - void processRoutes(SUMOTime start, SUMOTime end, + void processRoutes(const SUMOTime start, const SUMOTime end, const SUMOTime increment, 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); -#endif protected: /** @brief Opens route handler of the given type @@ -183,7 +181,7 @@ protected: - void writeStats(SUMOTime time, SUMOTime start, int absNo); + void writeStats(SUMOTime time, SUMOTime start, int absNo, bool endGiven); private: diff -Nru sumo-0.21.0+dfsg/src/router/RONet.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RONet.cpp --- sumo-0.21.0+dfsg/src/router/RONet.cpp 2014-04-11 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RONet.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RONet.cpp 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: RONet.cpp 18136 2015-03-24 15:10:45Z behrisch $ /// // The router's network representation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -37,11 +37,11 @@ #include "RORoute.h" #include "RORouteDef.h" #include "ROVehicle.h" -#include -#include +#include +#include +#include #include #include -#include #include #include #include @@ -60,7 +60,9 @@ myRoutesOutput(0), myRouteAlternativesOutput(0), myTypesOutput(0), myReadRouteNo(0), myDiscardedRouteNo(0), myWrittenRouteNo(0), myHaveRestrictions(false), - myNumInternalEdges(0) { + myNumInternalEdges(0), + myErrorHandler(OptionsCont::getOptions().exists("ignore-errors") + && OptionsCont::getOptions().getBool("ignore-errors") ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) { SUMOVTypeParameter* type = new SUMOVTypeParameter(DEFAULT_VTYPE_ID, SVC_IGNORING); type->onlyReferenced = true; myVehicleTypes.add(type->id, type); @@ -90,6 +92,45 @@ } +bool +RONet::addDistrict(const std::string id, ROEdge* source, ROEdge* sink) { + if (myDistricts.count(id) > 0) { + WRITE_ERROR("The TAZ '" + id + "' occurs at least twice."); + delete source; + delete sink; + return false; + } + sink->setType(ROEdge::ET_DISTRICT); + addEdge(sink); + source->setType(ROEdge::ET_DISTRICT); + addEdge(source); + myDistricts[id] = std::make_pair(std::vector(), std::vector()); + return true; +} + + +bool +RONet::addDistrictEdge(const std::string tazID, const std::string edgeID, const bool isSource) { + if (myDistricts.count(tazID) == 0) { + WRITE_ERROR("The TAZ '" + tazID + "' is unknown."); + return false; + } + ROEdge* edge = getEdge(edgeID); + if (edge == 0) { + WRITE_ERROR("The edge '" + edgeID + "' for TAZ '" + tazID + "' is unknown."); + return false; + } + if (isSource) { + getEdge(tazID + "-source")->addSuccessor(edge); + myDistricts[tazID].first.push_back(edgeID); + } else { + edge->addSuccessor(getEdge(tazID + "-sink")); + myDistricts[tazID].second.push_back(edgeID); + } + return true; +} + + void RONet::addNode(RONode* node) { if (!myNodes.add(node->getID(), node)) { @@ -110,6 +151,17 @@ } +void +RONet::addContainerStop(const std::string& id, SUMOVehicleParameter::Stop* stop) { + std::map::const_iterator it = myContainerStops.find(id); + if (it != myContainerStops.end()) { + WRITE_ERROR("The container stop '" + id + "' occurs at least twice."); + delete stop; + } + myContainerStops[id] = stop; +} + + bool RONet::addRouteDef(RORouteDef* def) { return myRoutes.add(def->getID(), def); @@ -121,22 +173,22 @@ if (filename != "") { myRoutesOutput = &OutputDevice::getDevice(filename); myRoutesOutput->writeHeader(SUMO_TAG_ROUTES); - myRoutesOutput->writeAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance").writeAttr("xsi:noNamespaceSchemaLocation", "http://sumo-sim.org/xsd/routes_file.xsd"); + myRoutesOutput->writeAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance").writeAttr("xsi:noNamespaceSchemaLocation", "http://sumo.dlr.de/xsd/routes_file.xsd"); } if (altFilename != "") { myRouteAlternativesOutput = &OutputDevice::getDevice(altFilename); myRouteAlternativesOutput->writeHeader(SUMO_TAG_ROUTES); - myRouteAlternativesOutput->writeAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance").writeAttr("xsi:noNamespaceSchemaLocation", "http://sumo-sim.org/xsd/routes_file.xsd"); + myRouteAlternativesOutput->writeAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance").writeAttr("xsi:noNamespaceSchemaLocation", "http://sumo.dlr.de/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-sim.org/xsd/routes_file.xsd\""); + myTypesOutput->writeXMLHeader("routes", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/routes_file.xsd\""); } } void -RONet::closeOutput() { +RONet::cleanup(SUMOAbstractRouter* router) { // end writing if (myRoutesOutput != 0) { myRoutesOutput->close(); @@ -149,6 +201,14 @@ if (myTypesOutput != 0) { myTypesOutput->close(); } + RouteCostCalculator::cleanup(); +#ifdef HAVE_FOX + if (myThreadPool.size() > 0) { + myThreadPool.clear(); + return; + } +#endif + delete router; } @@ -168,16 +228,11 @@ return it2->second->get(); } if (id == "") { - // ok, no vehicle type was given within the user input + // ok, no vehicle type or an unknown type was given within the user input // return the default type myDefaultVTypeMayBeDeleted = false; return myVehicleTypes.get(DEFAULT_VTYPE_ID); } - // Assume, the user will define the type somewhere else - // return a type which contains the id only - type = new SUMOVTypeParameter(id, SVC_IGNORING); - type->onlyReferenced = true; - addVehicleType(type); return type; } @@ -230,7 +285,7 @@ myReadRouteNo++; return true; } - WRITE_ERROR("The vehicle '" + id + "' occurs at least twice."); + WRITE_ERROR("Another vehicle with the id '" + id + "' exists."); return false; } @@ -254,37 +309,36 @@ myPersons.insert(std::pair(depart, desc)); } +void +RONet::addContainer(const SUMOTime depart, const std::string desc) { + myContainers.insert(std::pair(depart, desc)); +} + bool -RONet::computeRoute(OptionsCont& options, SUMOAbstractRouter& router, - const ROVehicle* const veh) { - MsgHandler* mh = (OptionsCont::getOptions().getBool("ignore-errors") ? - MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()); +RONet::computeRoute(SUMOAbstractRouter& router, + const ROVehicle* const veh, const bool removeLoops, + MsgHandler* errorHandler) { std::string noRouteMsg = "The vehicle '" + veh->getID() + "' has no valid route."; RORouteDef* const routeDef = veh->getRouteDefinition(); // check if the route definition is valid if (routeDef == 0) { - mh->inform(noRouteMsg); + errorHandler->inform(noRouteMsg); return false; } - // check whether the route was already saved - if (routeDef->isSaved()) { - return true; - } - // RORoute* current = routeDef->buildCurrentRoute(router, veh->getDepartureTime(), *veh); if (current == 0 || current->size() == 0) { delete current; - mh->inform(noRouteMsg); + errorHandler->inform(noRouteMsg); return false; } // check whether we have to evaluate the route for not containing loops - if (options.getBool("remove-loops")) { + if (removeLoops) { current->recheckForLoops(); // check whether the route is still valid if (current->size() == 0) { delete current; - mh->inform(noRouteMsg + " (after removing loops)"); + errorHandler->inform(noRouteMsg + " (after removing loops)"); return false; } } @@ -299,30 +353,65 @@ std::vector toRemove; for (NamedObjectCont::IDMap::const_iterator i = myFlows.getMyMap().begin(); i != myFlows.getMyMap().end(); ++i) { SUMOVehicleParameter* pars = i->second; - while (pars->repetitionsDone < pars->repetitionNumber) { - SUMOTime depart = static_cast(pars->depart + pars->repetitionsDone * pars->repetitionOffset); - if (myDepartures.find(pars->id) != myDepartures.end()) { - depart = myDepartures[pars->id].back(); - } - if (depart >= time + DELTA_T) { - break; - } - if (myDepartures.find(pars->id) != myDepartures.end()) { - myDepartures[pars->id].pop_back(); - } - SUMOVehicleParameter* newPars = new SUMOVehicleParameter(*pars); - newPars->id = pars->id + "." + toString(pars->repetitionsDone); - newPars->depart = depart; - pars->repetitionsDone++; - // try to build the vehicle - SUMOVTypeParameter* type = getVehicleTypeSecure(pars->vtypeid); - RORouteDef* route = getRouteDef(pars->routeid)->copy("!" + newPars->id); - ROVehicle* veh = new ROVehicle(*newPars, route, type, this); - addVehicle(newPars->id, veh); - delete newPars; - } - if (pars->repetitionsDone == pars->repetitionNumber) { - toRemove.push_back(i->first); + if (pars->repetitionProbability > 0) { + while (pars->depart < time) { + if (pars->repetitionEnd <= pars->depart) { + toRemove.push_back(i->first); + break; + } + // only call rand if all other conditions are met + if (RandHelper::rand() < (pars->repetitionProbability * TS)) { + SUMOVehicleParameter* newPars = new SUMOVehicleParameter(*pars); + newPars->id = pars->id + "." + toString(pars->repetitionsDone); + newPars->depart = pars->depart; + pars->repetitionsDone++; + // try to build the vehicle + SUMOVTypeParameter* type = getVehicleTypeSecure(pars->vtypeid); + if (type == 0) { + type = getVehicleTypeSecure(DEFAULT_VTYPE_ID); + } else { + // fix the type id in case we used a distribution + newPars->vtypeid = type->id; + } + RORouteDef* route = getRouteDef(pars->routeid)->copy("!" + newPars->id); + ROVehicle* veh = new ROVehicle(*newPars, route, type, this); + addVehicle(newPars->id, veh); + delete newPars; + } + pars->depart += DELTA_T; + } + } else { + while (pars->repetitionsDone < pars->repetitionNumber) { + SUMOTime depart = static_cast(pars->depart + pars->repetitionsDone * pars->repetitionOffset); + if (myDepartures.find(pars->id) != myDepartures.end()) { + depart = myDepartures[pars->id].back(); + } + if (depart >= time + DELTA_T) { + break; + } + if (myDepartures.find(pars->id) != myDepartures.end()) { + myDepartures[pars->id].pop_back(); + } + SUMOVehicleParameter* newPars = new SUMOVehicleParameter(*pars); + newPars->id = pars->id + "." + toString(pars->repetitionsDone); + newPars->depart = depart; + pars->repetitionsDone++; + // try to build the vehicle + SUMOVTypeParameter* type = getVehicleTypeSecure(pars->vtypeid); + if (type == 0) { + type = getVehicleTypeSecure(DEFAULT_VTYPE_ID); + } else { + // fix the type id in case we used a distribution + newPars->vtypeid = type->id; + } + RORouteDef* route = getRouteDef(pars->routeid)->copy("!" + newPars->id); + ROVehicle* veh = new ROVehicle(*newPars, route, type, this); + addVehicle(newPars->id, veh); + delete newPars; + } + if (pars->repetitionsDone == pars->repetitionNumber) { + toRemove.push_back(i->first); + } } } for (std::vector::const_iterator i = toRemove.begin(); i != toRemove.end(); ++i) { @@ -336,19 +425,52 @@ SUMOTime time) { checkFlows(time); SUMOTime lastTime = -1; + const bool removeLoops = options.getBool("remove-loops"); +#ifdef HAVE_FOX + const int maxNumThreads = options.getInt("routing-threads"); +#endif + if (myVehicles.size() != 0) { + const std::map& mmap = myVehicles.getMyMap(); + for (std::map::const_iterator i = mmap.begin(); i != mmap.end(); ++i) { + if (i->second->getDepart() >= time) { + // we cannot go through a sorted list here, because the priority queue in the myVehicles container is not fully sorted + continue; + } + i->second->setRoutingSuccess(false); +#ifdef HAVE_FOX + // add thread if necessary + const int numThreads = (int)myThreadPool.size(); + if (numThreads < maxNumThreads && myThreadPool.isFull()) { + new WorkerThread(myThreadPool, numThreads == 0 ? &router : router.clone()); + } + // add task + if (maxNumThreads > 0) { + myThreadPool.add(new RoutingTask(i->second, removeLoops, myErrorHandler)); + continue; + } +#endif + i->second->setRoutingSuccess(computeRoute(router, i->second, removeLoops, myErrorHandler)); + } +#ifdef HAVE_FOX + myThreadPool.waitAll(); +#endif + } // write all vehicles (and additional structures) - while (myVehicles.size() != 0 || myPersons.size() != 0) { - // get the next vehicle and person + while (myVehicles.size() != 0 || myPersons.size() != 0 || myContainers.size() != 0) { + // get the next vehicle, person or container const ROVehicle* const veh = myVehicles.getTopVehicle(); - const SUMOTime vehicleTime = veh == 0 ? SUMOTime_MAX : veh->getDepartureTime(); + const SUMOTime vehicleTime = veh == 0 ? SUMOTime_MAX : veh->getDepart(); PersonMap::iterator person = myPersons.begin(); const SUMOTime personTime = person == myPersons.end() ? SUMOTime_MAX : person->first; + ContainerMap::iterator container = myContainers.begin(); + const SUMOTime containerTime = container == myContainers.end() ? SUMOTime_MAX : container->first; // check whether it shall not yet be computed - if (vehicleTime > time && personTime > time) { - lastTime = MIN2(vehicleTime, personTime); + if (vehicleTime >= time && personTime >= time && containerTime >= time) { + lastTime = MIN3(vehicleTime, personTime, containerTime); break; } - if (vehicleTime < personTime) { + SUMOTime minTime = MIN3(vehicleTime, personTime, containerTime); + if (vehicleTime == minTime) { // check whether to print the output if (lastTime != vehicleTime && lastTime != -1) { // report writing progress @@ -359,9 +481,13 @@ lastTime = vehicleTime; // ok, compute the route (try it) - if (computeRoute(options, router, veh)) { + if (veh->getRoutingSuccess()) { // write the route - veh->saveAllAsXML(*myRoutesOutput, myRouteAlternativesOutput, myTypesOutput, options.getBool("exit-times")); + veh->saveTypeAsXML(*myRoutesOutput, myRouteAlternativesOutput, myTypesOutput); + veh->saveAllAsXML(*myRoutesOutput, false, options.getBool("exit-times")); + if (myRouteAlternativesOutput != 0) { + veh->saveAllAsXML(*myRouteAlternativesOutput, true, options.getBool("exit-times")); + } myWrittenRouteNo++; } else { myDiscardedRouteNo++; @@ -373,13 +499,21 @@ } } myVehicles.erase(veh->getID()); - } else { + } + if (personTime == minTime) { myRoutesOutput->writePreformattedTag(person->second); if (myRouteAlternativesOutput != 0) { myRouteAlternativesOutput->writePreformattedTag(person->second); } myPersons.erase(person); } + if (containerTime == minTime) { + myRoutesOutput->writePreformattedTag(container->second); + if (myRouteAlternativesOutput != 0) { + myRouteAlternativesOutput->writePreformattedTag(container->second); + } + myContainers.erase(container); + } } return lastTime; } @@ -387,19 +521,19 @@ bool RONet::furtherStored() { - return myVehicles.size() > 0 || myFlows.size() > 0 || myPersons.size() > 0; + return myVehicles.size() > 0 || myFlows.size() > 0 || myPersons.size() > 0 || myContainers.size() > 0; } -unsigned int +size_t RONet::getEdgeNo() const { - return (unsigned int) myEdges.size(); + return myEdges.size(); } -unsigned int -RONet::getEdgeNoWithoutInternal() const { - return (unsigned int)(myEdges.size() - myNumInternalEdges); +int +RONet::getInternalEdgeNumber() const { + return myNumInternalEdges; } @@ -421,6 +555,16 @@ } +#ifdef HAVE_FOX +// --------------------------------------------------------------------------- +// RONet::RoutingTask-methods +// --------------------------------------------------------------------------- +void +RONet::RoutingTask::run(FXWorkerThread* context) { + myVehicle->setRoutingSuccess(RONet::computeRoute(static_cast(context)->getRouter(), myVehicle, myRemoveLoops, myErrorHandler)); +} +#endif + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/router/RONet.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RONet.h --- sumo-0.21.0+dfsg/src/router/RONet.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RONet.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Yun-Pang Floetteroed /// @date Sept 2002 -/// @version $Id: RONet.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RONet.h 18136 2015-03-24 15:10:45Z behrisch $ /// // The router's network representation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -39,10 +39,15 @@ #include "ROVehicleCont.h" #include "ROVehicle.h" #include "RORouteDef.h" -#include -#include +#include +#include +#include #include +#ifdef HAVE_FOX +#include +#endif + // =========================================================================== // class declarations @@ -65,7 +70,7 @@ * @todo Vehicle ids are not tracked; it may happen that the same id is added twice... */ class RONet { - friend class RouteAggregator; + friend class RORouteAggregator; public: /// @brief Constructor @@ -91,6 +96,37 @@ virtual bool addEdge(ROEdge* edge); + /* @brief Adds a district and connecting edges to the network + * + * If the district is already known (another one with the same id exists), + * an error is generated and given to msg-error-handler. The edges + * are deleted in this case and false is returned. + * + * @param[in] id The district to add + * @return Whether the district was added + */ + bool addDistrict(const std::string id, ROEdge* source, ROEdge* sink); + + + /* @brief Adds a district and connecting edges to the network + * + * If the district is already known (another one with the same id exists), + * an error is generated and given to msg-error-handler. The edges + * are deleted in this case and false is returned. + * + * @param[in] id The district to add + * @return Whether the district was added + */ + bool addDistrictEdge(const std::string tazID, const std::string edgeID, const bool isSource); + + /** @brief Retrieves all TAZ (districts) from the network + * + * @return The map of all districts + */ + const std::map, std::vector > >& getDistricts() const { + return myDistricts; + } + /** @brief Retrieves an edge from the network * * This is not very pretty, but necessary, though, as routes run @@ -137,6 +173,17 @@ void addBusStop(const std::string& id, SUMOVehicleParameter::Stop* stop); + /* @brief Adds a read container stop to the network + * + * If the container stop is already known (another one with the same id exists), + * an error is generated and given to msg-error-handler. The stop + * is deleted in this case + * + * @param[in] node The stop to add + */ + void addContainerStop(const std::string& id, SUMOVehicleParameter::Stop* stop); + + /** @brief Retrieves a bus stop from the network * * @param[in] name The name of the stop to retrieve @@ -149,6 +196,20 @@ } return it->second; } + + + /** @brief Retrieves a container stop from the network + * + * @param[in] name The name of the stop to retrieve + * @return The named stop if known, otherwise 0 + */ + const SUMOVehicleParameter::Stop* getContainerStop(const std::string& id) const { + std::map::const_iterator it = myContainerStops.find(id); + if (it == myContainerStops.end()) { + return 0; + } + return it->second; + } //@} @@ -195,11 +256,9 @@ /** @brief Retrieves the named vehicle type * - * If the named vehicle type was not added to the net before, a default - * vehicle type which consists of the id only is generated, added to the net - * and returned. - * - * Only if the name is "", 0 is returned. + * If the name is "" the default type is returned. + * If the named vehicle type (or typeDistribution) was not added to the net before + * 0 is returned * * @param[in] id The id of the vehicle type to return * @return The named vehicle type @@ -266,6 +325,14 @@ * @param[in] desc The xml description of the person */ void addPerson(const SUMOTime depart, const std::string desc); + + + /* @brief Adds a container to the network + * + * @param[in] depart The departure time of the container + * @param[in] desc The xml description of the container + */ + void addContainer(const SUMOTime depart, const std::string desc); // @} @@ -274,20 +341,20 @@ /** @brief Computes routes described by their definitions and saves them * - * As long a vehicle with a departure time not larger than the given + * As long as a vehicle with a departure time smaller than the given * exists, its route is computed and it is written and removed from * the internal container. * * @param[in] options The options used during this process * @param[in] router The router to use for routes computation - * @param[in] options The time until which route definitions shall be processed + * @param[in] time The time until which route definitions shall be processed * @return The last seen departure time>=time */ SUMOTime saveAndRemoveRoutesUntil(OptionsCont& options, SUMOAbstractRouter& router, SUMOTime time); - /// Returns the information whether further vehicles are stored + /// Returns the information whether further vehicles, persons or containers are stored virtual bool furtherStored(); //@} @@ -308,15 +375,15 @@ void openOutput(const std::string& filename, const std::string altFilename, const std::string typeFilename); - /** @brief closes the file output for computed routes */ - void closeOutput(); + /** @brief closes the file output for computed routes and deletes routers and associated threads if necessary */ + void cleanup(SUMOAbstractRouter* router); - /// Returns the number of edges the network contains - unsigned int getEdgeNo() const; + /// Returns the total number of edges the network contains including internal edges + size_t getEdgeNo() const; - /// Returns the number of non-internal edges the network contains - unsigned int getEdgeNoWithoutInternal() const; + /// Returns the number of internal edges the network contains + int getInternalEdgeNumber() const; const std::map& getEdgeMap() const; @@ -332,8 +399,9 @@ } protected: - bool computeRoute(OptionsCont& options, - SUMOAbstractRouter& router, const ROVehicle* const veh); + static bool computeRoute(SUMOAbstractRouter& router, + const ROVehicle* const veh, const bool removeLoops, + MsgHandler* errorHandler); /// @brief return vehicles for use by RouteAggregator ROVehicleCont& getVehicles() { @@ -357,6 +425,9 @@ /// @brief Known bus stops std::map myBusStops; + /// @brief Known container stops + std::map myContainerStops; + /// @brief Known vehicle types NamedObjectCont myVehicleTypes; @@ -381,9 +452,16 @@ typedef std::multimap PersonMap; PersonMap myPersons; + /// @brief Known containers + typedef std::multimap ContainerMap; + ContainerMap myContainers; + /// @brief Departure times for randomized flows std::map > myDepartures; + /// @brief traffic assignment zones with sources and sinks + std::map, std::vector > > myDistricts; + /// @brief The file to write the computed routes into OutputDevice* myRoutesOutput; @@ -408,6 +486,44 @@ /// @brief The number of internal edges in the dictionary int myNumInternalEdges; + /// @brief handler for ignorable error messages + MsgHandler* myErrorHandler; + +#ifdef HAVE_FOX + FXWorkerThread::Pool myThreadPool; + +private: + class WorkerThread : public FXWorkerThread { + public: + WorkerThread(FXWorkerThread::Pool& pool, + SUMOAbstractRouter* router) + : FXWorkerThread(pool), myRouter(router) {} + SUMOAbstractRouter& getRouter() const { + return *myRouter; + } + virtual ~WorkerThread() { + stop(); + delete myRouter; + } + private: + SUMOAbstractRouter* myRouter; + }; + + class RoutingTask : public FXWorkerThread::Task { + public: + RoutingTask(ROVehicle* v, const bool removeLoops, MsgHandler* errorHandler) + : myVehicle(v), myRemoveLoops(removeLoops), myErrorHandler(errorHandler) {} + void run(FXWorkerThread* context); + private: + ROVehicle* const myVehicle; + const bool myRemoveLoops; + MsgHandler* const myErrorHandler; + private: + /// @brief Invalidated assignment operator. + RoutingTask& operator=(const RoutingTask&); + }; +#endif + private: /// @brief Invalidated copy constructor RONet(const RONet& src); diff -Nru sumo-0.21.0+dfsg/src/router/RONetHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RONetHandler.cpp --- sumo-0.21.0+dfsg/src/router/RONetHandler.cpp 2014-06-06 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RONetHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Yun-Pang Floetteroed /// @date Sept 2002 -/// @version $Id: RONetHandler.cpp 16555 2014-06-06 13:42:25Z behrisch $ +/// @version $Id: RONetHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The handler for SUMO-Networks /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -90,6 +90,9 @@ case SUMO_TAG_BUS_STOP: parseBusStop(attrs); break; + case SUMO_TAG_CONTAINER_STOP: + parseContainerStop(attrs); + break; case SUMO_TAG_TAZ: parseDistrict(attrs); break; @@ -291,7 +294,7 @@ throw ProcessError("invalid toLane '" + toString(toLane) + "' in connection to '" + toID + "'."); } from->getLanes()[fromLane]->addOutgoingLane(to->getLanes()[toLane]); - from->addFollower(to, dir); + from->addSuccessor(to, dir); } @@ -322,6 +325,32 @@ void +RONetHandler::parseContainerStop(const SUMOSAXAttributes& attrs) { + bool ok = true; + SUMOVehicleParameter::Stop* stop = new SUMOVehicleParameter::Stop(); + // get the id, throw if not given or empty... + std::string id = attrs.get(SUMO_ATTR_ID, "containerStop", ok); + // get the lane + stop->lane = attrs.get(SUMO_ATTR_LANE, "containerStop", ok); + if (!ok) { + throw ProcessError(); + } + const ROEdge* edge = myNet.getEdge(stop->lane.substr(0, stop->lane.rfind("_"))); + if (edge == 0) { + throw InvalidArgument("Unknown lane '" + stop->lane + "' for container stop '" + id + "'."); + } + // get the positions + stop->startPos = attrs.getOpt(SUMO_ATTR_STARTPOS, id.c_str(), ok, 0); + stop->endPos = attrs.getOpt(SUMO_ATTR_ENDPOS, id.c_str(), ok, edge->getLength()); + const bool friendlyPos = attrs.getOpt(SUMO_ATTR_FRIENDLY_POS, id.c_str(), ok, false); + if (!ok || !SUMORouteHandler::checkStopPos(stop->startPos, stop->endPos, edge->getLength(), POSITION_EPS, friendlyPos)) { + throw InvalidArgument("Invalid position for container stop '" + id + "'."); + } + myNet.addContainerStop(id, stop); +} + + +void RONetHandler::parseDistrict(const SUMOSAXAttributes& attrs) { myCurrentEdge = 0; bool ok = true; @@ -329,22 +358,12 @@ if (!ok) { return; } - ROEdge* sink = myEdgeBuilder.buildEdge(myCurrentName + "-sink", 0, 0, 0); - sink->setType(ROEdge::ET_DISTRICT); - myNet.addEdge(sink); - ROEdge* source = myEdgeBuilder.buildEdge(myCurrentName + "-source", 0, 0, 0); - source->setType(ROEdge::ET_DISTRICT); - myNet.addEdge(source); + myNet.addDistrict(myCurrentName, myEdgeBuilder.buildEdge(myCurrentName + "-source", 0, 0, 0), myEdgeBuilder.buildEdge(myCurrentName + "-sink", 0, 0, 0)); if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { std::vector desc = attrs.getStringVector(SUMO_ATTR_EDGES); for (std::vector::const_iterator i = desc.begin(); i != desc.end(); ++i) { - ROEdge* edge = myNet.getEdge(*i); - // check whether the edge exists - if (edge == 0) { - throw ProcessError("The edge '" + *i + "' within district '" + myCurrentName + "' is not known."); - } - source->addFollower(edge); - edge->addFollower(sink); + myNet.addDistrictEdge(myCurrentName, *i, true); + myNet.addDistrictEdge(myCurrentName, *i, false); } } } @@ -354,17 +373,7 @@ RONetHandler::parseDistrictEdge(const SUMOSAXAttributes& attrs, bool isSource) { bool ok = true; std::string id = attrs.get(SUMO_ATTR_ID, myCurrentName.c_str(), ok); - ROEdge* succ = myNet.getEdge(id); - if (succ != 0) { - // connect edge - if (isSource) { - myNet.getEdge(myCurrentName + "-source")->addFollower(succ); - } else { - succ->addFollower(myNet.getEdge(myCurrentName + "-sink")); - } - } else { - WRITE_ERROR("At district '" + myCurrentName + "': succeeding edge '" + id + "' does not exist."); - } + myNet.addDistrictEdge(myCurrentName, id, isSource); } diff -Nru sumo-0.21.0+dfsg/src/router/RONetHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RONetHandler.h --- sumo-0.21.0+dfsg/src/router/RONetHandler.h 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RONetHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RONetHandler.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: RONetHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The handler that parses a SUMO-network for its usage in a router /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -147,6 +147,13 @@ void parseBusStop(const SUMOSAXAttributes& attrs); + /** @begin Parses a container stop + * Called on the occurence of a "containerStop" element + * @param[in] attrs The attributes (of the "containerStop"-element) to parse + */ + void parseContainerStop(const SUMOSAXAttributes& attrs); + + /** @begin Parses a district and creates a pseudo edge for it * * Called on the occurence of a "district" element, this method diff -Nru sumo-0.21.0+dfsg/src/router/RONode.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RONode.cpp --- sumo-0.21.0+dfsg/src/router/RONode.cpp 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RONode.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RONode.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: RONode.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A single router's node /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/router/RONode.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RONode.h --- sumo-0.21.0+dfsg/src/router/RONode.h 2014-05-05 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RONode.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RONode.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: RONode.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Base class for nodes used by the router /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,6 +41,8 @@ // =========================================================================== class ROEdge; +typedef std::vector ConstROEdgeVector; + // =========================================================================== // class definitions // =========================================================================== @@ -74,11 +76,11 @@ } - inline const std::vector& getIncoming() const { + inline const ConstROEdgeVector& getIncoming() const { return myIncoming; } - inline const std::vector& getOutgoing() const { + inline const ConstROEdgeVector& getOutgoing() const { return myOutgoing; } @@ -95,9 +97,9 @@ Position myPosition; /// @brief incoming edges - std::vector myIncoming; + ConstROEdgeVector myIncoming; /// @brief outgoing edges - std::vector myOutgoing; + ConstROEdgeVector myOutgoing; private: diff -Nru sumo-0.21.0+dfsg/src/router/RORouteAggregator.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORouteAggregator.h --- sumo-0.21.0+dfsg/src/router/RORouteAggregator.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORouteAggregator.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,197 @@ +/****************************************************************************/ +/// @file RORouteAggregator.h +/// @author Jakob Erdmann +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date February 2012 +/// @version $Id: RORouteAggregator.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Handles grouping of routes to supply input for BulkStarRouter +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 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 RORouteAggregator_h +#define RORouteAggregator_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +// +class RORouteAggregator { + +public: + + /** @brief precomputes all routes grouped by their destination edge + * @note: the current setup is not suitable for using RORouteDef_Complete + * along with --repair since the sequence is not optimized for in-between destinations + */ + static void processAllRoutes(RONet& net, SUMOAbstractRouter& router) { + // simple version: group by destination edge + SameTargetMap stm; + NamedObjectCont::IDMap vehicles = net.getVehicles().getMyMap(); + if (vehicles.size() == 0) { + throw ProcessError("No vehicles loaded"); + } + // XXX @todo: use a configurable default vehicle + const ROVehicle* defaultVehicle = vehicles.begin()->second; + for (NamedObjectCont::IDMap::const_iterator it = vehicles.begin(); it != vehicles.end(); it++) { + ROVehicle* veh = it->second; + stm[veh->getRouteDefinition()->getDestination()].push_back(veh); + } + WRITE_MESSAGE("Loaded " + toString(vehicles.size()) + " vehicles with " + toString(stm.size()) + " unique destinations"); + + // merge nearby destinations for efficiency + const int MERGE_DISTANCE = 6; // XXX @todo make configurable + for (int i = 1; i <= MERGE_DISTANCE; i++) { + stm = mergeTargets(stm, MERGE_DISTANCE); + } + WRITE_MESSAGE("Kept " + toString(stm.size()) + " unique destinations after merging"); + + // skip precomputation if not enough vehicles have the same destination + // this value could be set automatically: num_edges / avg_number_of_nodes_visited_for_astar + const size_t SKIP_LIMIT = 11; // XXX @todo make configurable + int num_prepared = 0; + int num_unprepared = 0; + int num_routes_prepared = 0; + int num_routes_unprepared = 0; + // process by destination edge + for (SameTargetMap::iterator it = stm.begin(); it != stm.end(); it++) { + const ROEdge* dest = it->first; + VehVec& bulkVehicles = it->second; + bool skip = false; + if (bulkVehicles.size() < SKIP_LIMIT) { + skip = true; + num_routes_unprepared += (int)bulkVehicles.size(); + num_unprepared += 1; + } else { + num_routes_prepared += (int)bulkVehicles.size(); + num_prepared += 1; + } + router.prepare(dest, defaultVehicle, skip); + for (VehVec::iterator it = bulkVehicles.begin(); it != bulkVehicles.end(); it++) { + ROVehicle* veh = *it; + RORouteDef* routeDef = veh->getRouteDefinition(); + routeDef->preComputeCurrentRoute(router, veh->getDepartureTime(), *veh); + } + } + WRITE_MESSAGE("Performed pre-computation for " + toString(num_prepared) + " destinations"); + WRITE_MESSAGE("Skipped pre-computation for " + toString(num_unprepared) + " destinations"); + WRITE_MESSAGE("Computed " + toString(num_routes_prepared) + " routes with pre-computation"); + WRITE_MESSAGE("Computed " + toString(num_routes_unprepared) + " routes without pre-computation"); + } + +private: + typedef std::vector VehVec; + typedef std::map SameTargetMap; + typedef std::set EdgeSet; + + + /** Function-object for sorting from highest to lowest vehicle count. */ + struct ComparatorNumVehicles { + + ComparatorNumVehicles(SameTargetMap& sameTargetMap): + mySameTargetMap(sameTargetMap) {} + + bool operator()(const ROEdge* const a, const ROEdge* const b) { + return (mySameTargetMap[a].size() > mySameTargetMap[b].size()); + } + + SameTargetMap& mySameTargetMap; + + private: + /// @brief Invalidated assignment operator. + ComparatorNumVehicles& operator=(const ComparatorNumVehicles&); + + }; + + + static SameTargetMap mergeTargets(SameTargetMap& stm, const int distance) { + SameTargetMap result; + // we want to merg edges with few vehicles to edges with many vehicles + // so we have to sort by number of vehicles first + ConstROEdgeVector heap; + heap.reserve(stm.size()); + ComparatorNumVehicles cmp(stm); + for (SameTargetMap::iterator it = stm.begin(); it != stm.end(); it++) { + heap.push_back(it->first); + } + make_heap(heap.begin(), heap.end(), cmp); + while (heap.size() > 0) { + const ROEdge* dest = heap.front(); + pop_heap(heap.begin(), heap.end(), cmp); + heap.pop_back(); + if (stm.count(dest) > 0 && // dest has not been merged yet + stm[dest].size() > 0) { // for some strange reason 0-length vectors are found despite erase + result[dest] = stm[dest]; + stm.erase(dest); + EdgeSet nearby = getNearby(dest, distance); + for (EdgeSet::iterator it = nearby.begin(); it != nearby.end(); it++) { + const ROEdge* nearEdge = *it; + if (stm.count(nearEdge) > 0) { + // nearEdge occurs as destination and has not been merged yet + result[dest].insert(result[dest].end(), stm[nearEdge].begin(), stm[nearEdge].end()); + stm.erase(nearEdge); + } + } + } + } + return result; + } + + + static EdgeSet getNearby(const ROEdge* edge, const int distance) { + EdgeSet result; + result.insert(edge); + EdgeSet fringe(result); + for (int i = 0; i < distance; i++) { + fringe = approachingEdges(fringe); + result.insert(fringe.begin(), fringe.end()); + } + return result; + } + + + static EdgeSet approachingEdges(EdgeSet edges) { + EdgeSet result; + for (EdgeSet::iterator it = edges.begin(); it != edges.end(); it++) { + result.insert((*it)->getPredecessors().begin(), (*it)->getPredecessors().end()); + } + return result; + } + + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/router/RORoute.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORoute.cpp --- sumo-0.21.0+dfsg/src/router/RORoute.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORoute.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Yun-Pang Floetteroed /// @date Sept 2002 -/// @version $Id: RORoute.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RORoute.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A complete router's route /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -49,7 +49,7 @@ // method definitions // =========================================================================== RORoute::RORoute(const std::string& id, SUMOReal costs, SUMOReal prop, - const std::vector& route, + const ConstROEdgeVector& route, const RGBColor* const color, const std::vector& stops) : Named(StringUtils::convertUmlaute(id)), myCosts(costs), @@ -107,16 +107,22 @@ if (myColor != 0) { dev.writeAttr(SUMO_ATTR_COLOR, *myColor); } - if (!myRoute.empty() && myRoute.front()->getType() == ROEdge::ET_DISTRICT) { - std::vector temp(myRoute.begin() + 1, myRoute.end() - 1); - dev.writeAttr(SUMO_ATTR_EDGES, temp); + if (!myRoute.empty()) { + const int frontOffset = myRoute.front()->getType() == ROEdge::ET_DISTRICT ? 1 : 0; + const int backOffset = myRoute.back()->getType() == ROEdge::ET_DISTRICT ? 1 : 0; + if (frontOffset + backOffset > 0) { + ConstROEdgeVector temp(myRoute.begin() + frontOffset, myRoute.end() - backOffset); + dev.writeAttr(SUMO_ATTR_EDGES, temp); + } else { + dev.writeAttr(SUMO_ATTR_EDGES, myRoute); + } } else { dev.writeAttr(SUMO_ATTR_EDGES, myRoute); } if (withExitTimes) { std::string exitTimes; SUMOReal time = STEPS2TIME(veh->getDepartureTime()); - for (std::vector::const_iterator i = myRoute.begin(); i != myRoute.end(); ++i) { + for (ConstROEdgeVector::const_iterator i = myRoute.begin(); i != myRoute.end(); ++i) { if (i != myRoute.begin()) { exitTimes += " "; } diff -Nru sumo-0.21.0+dfsg/src/router/RORouteDef.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORouteDef.cpp --- sumo-0.21.0+dfsg/src/router/RORouteDef.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORouteDef.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: RORouteDef.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RORouteDef.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Base class for a vehicle's route definition /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -43,30 +43,35 @@ #include #include "ROEdge.h" #include "RORoute.h" -#include -#include "ReferencedItem.h" +#include +#include #include "RORouteDef.h" #include "ROVehicle.h" -#include "ROCostCalculator.h" #ifdef CHECK_MEMORY_LEAKS #include #endif // CHECK_MEMORY_LEAKS +// =========================================================================== +// static members +// =========================================================================== +bool RORouteDef::myUsingJTRR(false); // =========================================================================== // method definitions // =========================================================================== RORouteDef::RORouteDef(const std::string& id, const unsigned int lastUsed, - const bool tryRepair) : - ReferencedItem(), Named(StringUtils::convertUmlaute(id)), - myPrecomputed(0), myLastUsed(lastUsed), myTryRepair(tryRepair) + const bool tryRepair, const bool mayBeDisconnected) : + Named(StringUtils::convertUmlaute(id)), + myPrecomputed(0), myLastUsed(lastUsed), myTryRepair(tryRepair), myMayBeDisconnected(mayBeDisconnected) {} RORouteDef::~RORouteDef() { for (std::vector::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { - delete *i; + if (myRouteRefs.count(*i) == 0) { + delete *i; + } } } @@ -81,6 +86,8 @@ RORouteDef::addAlternativeDef(const RORouteDef* alt) { std::copy(alt->myAlternatives.begin(), alt->myAlternatives.end(), back_inserter(myAlternatives)); + std::copy(alt->myAlternatives.begin(), alt->myAlternatives.end(), + std::inserter(myRouteRefs, myRouteRefs.end())); } @@ -117,11 +124,12 @@ repairCurrentRoute(router, begin, veh); return; } - if (ROCostCalculator::getCalculator().skipRouteCalculation()) { + if (RouteCostCalculator::getCalculator().skipRouteCalculation() + || OptionsCont::getOptions().getBool("remove-loops")) { myPrecomputed = myAlternatives[myLastUsed]; } else { // build a new route to test whether it is better - std::vector edges; + ConstROEdgeVector edges; router.compute(myAlternatives[0]->getFirst(), myAlternatives[0]->getLast(), &veh, begin, edges); // check whether the same route was already used int cheapest = -1; @@ -147,17 +155,21 @@ SUMOTime begin, const ROVehicle& veh) const { MsgHandler* mh = (OptionsCont::getOptions().getBool("ignore-errors") ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()); - std::vector oldEdges = myAlternatives[0]->getEdgeVector(); - std::vector newEdges; - std::vector mandatory; + ConstROEdgeVector oldEdges = myAlternatives[0]->getEdgeVector(); + ConstROEdgeVector newEdges; + ConstROEdgeVector mandatory; if (oldEdges.size() == 1) { - /// should happen with jtrrouter only - router.compute(oldEdges.front(), oldEdges.front(), &veh, begin, newEdges); + if (myUsingJTRR) { + /// only ROJTRRouter is supposed to handle this type of input + router.compute(oldEdges.front(), 0, &veh, begin, newEdges); + } else { + newEdges = oldEdges; + } } else { // prepare mandatory edges mandatory.push_back(oldEdges.front()); - std::vector stops = veh.getStopEdges(); - for (std::vector::const_iterator i = stops.begin(); i != stops.end(); ++i) { + ConstROEdgeVector stops = veh.getStopEdges(); + for (ConstROEdgeVector::const_iterator i = stops.begin(); i != stops.end(); ++i) { if (*i != mandatory.back()) { mandatory.push_back(*i); } @@ -167,7 +179,7 @@ } assert(mandatory.size() >= 2); // removed prohibited - for (std::vector::iterator i = oldEdges.begin(); i != oldEdges.end();) { + for (ConstROEdgeVector::iterator i = oldEdges.begin(); i != oldEdges.end();) { if ((*i)->prohibits(&veh)) { if (std::find(mandatory.begin(), mandatory.end(), *i) != mandatory.end()) { mh->inform("Mandatory edge '" + (*i)->getID() + "' does not allow vehicle '" + veh.getID() + "'."); @@ -180,15 +192,14 @@ } // reconnect remaining edges newEdges.push_back(*(oldEdges.begin())); - std::vector::iterator nextMandatory = mandatory.begin() + 1; + ConstROEdgeVector::iterator nextMandatory = mandatory.begin() + 1; size_t lastMandatory = 0; - for (std::vector::iterator i = oldEdges.begin() + 1; + for (ConstROEdgeVector::iterator i = oldEdges.begin() + 1; i != oldEdges.end() && nextMandatory != mandatory.end(); ++i) { - if ((*(i - 1))->isConnectedTo(*i)) { - /// XXX could be connected from a prohibited lane only + if ((*(i - 1))->isConnectedTo(*i, &veh)) { newEdges.push_back(*i); } else { - std::vector edges; + ConstROEdgeVector edges; router.compute(newEdges.back(), *i, &veh, begin, edges); if (edges.size() == 0) { // backtrack: try to route from last mandatory edge to next mandatory edge @@ -196,7 +207,9 @@ // (i.e. previous edge to edge after *i) // we would then need to decide whether we have found a good // tradeoff between faithfulness to the input data and detour-length - router.compute(newEdges[lastMandatory], *nextMandatory, &veh, begin, edges); + if (newEdges.back() != newEdges[lastMandatory]) { + router.compute(newEdges[lastMandatory], *nextMandatory, &veh, begin, edges); + } if (edges.size() == 0) { mh->inform("Mandatory edge '" + (*i)->getID() + "' not reachable by vehicle '" + veh.getID() + "'."); return; @@ -216,7 +229,9 @@ } } if (myAlternatives[0]->getEdgeVector() != newEdges) { - WRITE_MESSAGE("Repaired route of vehicle '" + veh.getID() + "'."); + if (!myMayBeDisconnected) { + WRITE_WARNING("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, myAlternatives[0]->getProbability(), newEdges, col, myAlternatives[0]->getStops()); @@ -266,11 +281,11 @@ alt->setProbability(alt->getProbability() * scale); } } - ROCostCalculator::getCalculator().setCosts(alt, newCosts, *i == myAlternatives[myLastUsed]); + RouteCostCalculator::getCalculator().setCosts(alt, newCosts, *i == myAlternatives[myLastUsed]); } assert(myAlternatives.size() != 0); - ROCostCalculator::getCalculator().calculateProbabilities(myAlternatives, veh, veh->getDepartureTime()); - if (!ROCostCalculator::getCalculator().keepRoutes()) { + RouteCostCalculator::getCalculator().calculateProbabilities(myAlternatives, veh, veh->getDepartureTime()); + if (!RouteCostCalculator::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) { @@ -281,13 +296,13 @@ } } } - if (myAlternatives.size() > ROCostCalculator::getCalculator().getMaxRouteNumber()) { + if (myAlternatives.size() > RouteCostCalculator::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++) { + for (std::vector::iterator i = myAlternatives.begin() + RouteCostCalculator::getCalculator().getMaxRouteNumber(); i != myAlternatives.end(); i++) { delete *i; } - myAlternatives.erase(myAlternatives.begin() + ROCostCalculator::getCalculator().getMaxRouteNumber(), myAlternatives.end()); + myAlternatives.erase(myAlternatives.begin() + RouteCostCalculator::getCalculator().getMaxRouteNumber(), myAlternatives.end()); // rescale probabilities SUMOReal newSum = 0; for (std::vector::iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { @@ -338,10 +353,10 @@ RORouteDef* RORouteDef::copyOrigDest(const std::string& id) const { - RORouteDef* result = new RORouteDef(id, 0, true); + RORouteDef* result = new RORouteDef(id, 0, true, true); RORoute* route = myAlternatives[0]; RGBColor* col = route->getColor() != 0 ? new RGBColor(*route->getColor()) : 0; - std::vector edges; + ConstROEdgeVector edges; edges.push_back(route->getFirst()); edges.push_back(route->getLast()); result->addLoadedAlternative(new RORoute(id, 0, 1, edges, col, route->getStops())); @@ -351,7 +366,7 @@ RORouteDef* RORouteDef::copy(const std::string& id) const { - RORouteDef* result = new RORouteDef(id, 0, myTryRepair); + RORouteDef* result = new RORouteDef(id, 0, myTryRepair, myMayBeDisconnected); 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; diff -Nru sumo-0.21.0+dfsg/src/router/RORouteDef.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORouteDef.h --- sumo-0.21.0+dfsg/src/router/RORouteDef.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORouteDef.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: RORouteDef.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RORouteDef.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Base class for a vehicle's route definition /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,8 +35,7 @@ #include #include #include -#include "ReferencedItem.h" -#include +#include #include "RORoute.h" @@ -61,7 +60,7 @@ * route through the network or even a route with alternatives depends on * the derived class. */ -class RORouteDef : public ReferencedItem, public Named { +class RORouteDef : public Named { public: /** @brief Constructor * @@ -69,7 +68,7 @@ * @param[in] color The color of the route */ RORouteDef(const std::string& id, const unsigned int lastUsed, - const bool tryRepair); + const bool tryRepair, const bool mayBeDisconnected); /// @brief Destructor @@ -144,6 +143,10 @@ /** @brief Returns the sum of the probablities of the contained routes */ SUMOReal getOverallProb() const; + static void setUsingJTRR() { + myUsingJTRR = true; + } + protected: /// @brief precomputed route for out-of-order computation mutable RORoute* myPrecomputed; @@ -154,10 +157,16 @@ /// @brief The alternatives std::vector myAlternatives; + /// @brief Routes which are deleted someplace else + std::set myRouteRefs; + /// @brief Information whether a new route was generated mutable bool myNewRoute; const bool myTryRepair; + const bool myMayBeDisconnected; + + static bool myUsingJTRR; private: /** Function-object for sorting routes from highest to lowest probability. */ diff -Nru sumo-0.21.0+dfsg/src/router/RORoute.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORoute.h --- sumo-0.21.0+dfsg/src/router/RORoute.h 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORoute.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Yun-Pang Floetteroed /// @date Sept 2002 -/// @version $Id: RORoute.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RORoute.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A complete router's route /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,8 +36,8 @@ #include #include #include -#include -#include +#include +#include // =========================================================================== @@ -47,6 +47,7 @@ class ROVehicle; class OutputDevice; +typedef std::vector ConstROEdgeVector; // =========================================================================== // class definitions @@ -71,7 +72,7 @@ * @todo Are costs/prob really mandatory? */ RORoute(const std::string& id, SUMOReal costs, SUMOReal prob, - const std::vector& route, const RGBColor* const color, + const ConstROEdgeVector& route, const RGBColor* const color, const std::vector& stops); @@ -151,7 +152,7 @@ * * @return The edges this route consists of */ - const std::vector& getEdgeVector() const { + const ConstROEdgeVector& getEdgeVector() const { return myRoute; } @@ -192,7 +193,7 @@ SUMOReal myProbability; /// @brief The edges the route consists of - std::vector myRoute; + ConstROEdgeVector myRoute; /// @brief The color of the route const RGBColor* myColor; diff -Nru sumo-0.21.0+dfsg/src/router/RORouteHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORouteHandler.cpp --- sumo-0.21.0+dfsg/src/router/RORouteHandler.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORouteHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: RORouteHandler.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: RORouteHandler.cpp 18136 2015-03-24 15:10:45Z behrisch $ /// // Parser and container for routes during their loading /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -66,7 +66,9 @@ myPedestrianRouter(0), myNet(net), myActivePlan(0), + myActiveContainerPlan(0), myActivePlanSize(0), + myActiveContainerPlanSize(0), myTryRepair(tryRepair), myEmptyDestinationsAllowed(emptyDestinationsAllowed), myErrorOutput(ignoreErrors ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()), @@ -84,47 +86,51 @@ void RORouteHandler::parseFromViaTo(std::string element, const SUMOSAXAttributes& attrs) { + myActiveRoute.clear(); bool useTaz = OptionsCont::getOptions().getBool("with-taz"); - if (useTaz && !myVehicleParameter->wasSet(VEHPARS_TAZ_SET)) { + if (useTaz && !myVehicleParameter->wasSet(VEHPARS_FROM_TAZ_SET) && !myVehicleParameter->wasSet(VEHPARS_TO_TAZ_SET)) { WRITE_WARNING("Taz usage was requested but no taz present in " + element + " '" + myVehicleParameter->id + "'!"); useTaz = false; - } else if (!useTaz && !attrs.hasAttribute(SUMO_ATTR_FROM) && myVehicleParameter->wasSet(VEHPARS_TAZ_SET)) { - WRITE_WARNING("'from' attribute missing using taz for " + element + " '" + myVehicleParameter->id + "'!"); - useTaz = true; } - if (useTaz) { + bool ok = true; + if ((useTaz || !attrs.hasAttribute(SUMO_ATTR_FROM)) && myVehicleParameter->wasSet(VEHPARS_FROM_TAZ_SET)) { const ROEdge* fromTaz = myNet.getEdge(myVehicleParameter->fromTaz + "-source"); if (fromTaz == 0) { myErrorOutput->inform("Source taz '" + myVehicleParameter->fromTaz + "' not known for " + element + " '" + myVehicleParameter->id + "'!"); - } else if (fromTaz->getNoFollowing() == 0) { + } else if (fromTaz->getNumSuccessors() == 0) { myErrorOutput->inform("Source taz '" + myVehicleParameter->fromTaz + "' has no outgoing edges for " + element + " '" + myVehicleParameter->id + "'!"); } else { myActiveRoute.push_back(fromTaz); } + } else { + parseEdges(attrs.getOpt(SUMO_ATTR_FROM, myVehicleParameter->id.c_str(), ok, "", true), + myActiveRoute, "for " + element + " '" + myVehicleParameter->id + "'"); + } + if (!attrs.hasAttribute(SUMO_ATTR_VIA)) { + myInsertStopEdgesAt = (int)myActiveRoute.size(); + } + parseEdges(attrs.getOpt(SUMO_ATTR_VIA, myVehicleParameter->id.c_str(), ok, "", true), + myActiveRoute, "for " + element + " '" + myVehicleParameter->id + "'"); + if ((useTaz || !attrs.hasAttribute(SUMO_ATTR_TO)) && myVehicleParameter->wasSet(VEHPARS_TO_TAZ_SET)) { const ROEdge* toTaz = myNet.getEdge(myVehicleParameter->toTaz + "-sink"); if (toTaz == 0) { myErrorOutput->inform("Sink taz '" + myVehicleParameter->toTaz + "' not known for " + element + " '" + myVehicleParameter->id + "'!"); + } else if (toTaz->getNumPredecessors() == 0) { + myErrorOutput->inform("Sink taz '" + myVehicleParameter->toTaz + "' has no incoming edges for " + element + " '" + myVehicleParameter->id + "'!"); } else { myActiveRoute.push_back(toTaz); } } else { - bool ok = true; - parseEdges(attrs.get(SUMO_ATTR_FROM, myVehicleParameter->id.c_str(), ok), - myActiveRoute, "for " + element + " '" + myVehicleParameter->id + "'"); - parseEdges(attrs.getOpt(SUMO_ATTR_VIA, myVehicleParameter->id.c_str(), ok, "", true), - myActiveRoute, "for " + element + " '" + myVehicleParameter->id + "'"); - parseEdges(attrs.get(SUMO_ATTR_TO, myVehicleParameter->id.c_str(), ok, !myEmptyDestinationsAllowed), + parseEdges(attrs.getOpt(SUMO_ATTR_TO, myVehicleParameter->id.c_str(), ok, "", true), myActiveRoute, "for " + element + " '" + myVehicleParameter->id + "'"); } myActiveRouteID = "!" + myVehicleParameter->id; if (myVehicleParameter->routeid == "") { myVehicleParameter->routeid = myActiveRouteID; } - closeRoute(true); } - void RORouteHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { @@ -156,6 +162,32 @@ } break; } + case SUMO_TAG_CONTAINER: + myActiveContainerPlan = new OutputDevice_String(false, 1); + myActiveContainerPlanSize = 0; + myActiveContainerPlan->openTag(SUMO_TAG_CONTAINER); + (*myActiveContainerPlan) << attrs; + break; + case SUMO_TAG_TRANSPORT: { + myActiveContainerPlan->openTag(SUMO_TAG_TRANSPORT); + (*myActiveContainerPlan) << attrs; + myActiveContainerPlan->closeTag(); + myActiveContainerPlanSize++; + break; + } + case SUMO_TAG_TRANSHIP: { + if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { + // copy walk as it is + // XXX allow --repair? + myActiveContainerPlan->openTag(SUMO_TAG_TRANSHIP); + (*myActiveContainerPlan) << attrs; + myActiveContainerPlan->closeTag(); + myActiveContainerPlanSize++; + } else { + routePedestrian(attrs, *myActiveContainerPlan); + } + break; + } case SUMO_TAG_FLOW: myActiveRouteProbability = DEFAULT_VEH_PROB; parseFromViaTo("flow", attrs); @@ -163,14 +195,13 @@ case SUMO_TAG_TRIP: { myActiveRouteProbability = DEFAULT_VEH_PROB; parseFromViaTo("trip", attrs); - closeVehicle(); } break; default: break; } // parse embedded vtype information - if (myCurrentVType != 0 && element != SUMO_TAG_VTYPE) { + if (myCurrentVType != 0 && element != SUMO_TAG_VTYPE && element != SUMO_TAG_PARAM) { SUMOVehicleParserHelper::parseVTypeEmbedded(*myCurrentVType, element, attrs); return; } @@ -212,6 +243,8 @@ void RORouteHandler::openRoute(const SUMOSAXAttributes& attrs) { + myActiveRoute.clear(); + myInsertStopEdgesAt = -1; // check whether the id is really necessary std::string rid; if (myCurrentAlternatives != 0) { @@ -263,15 +296,21 @@ RORouteHandler::myEndElement(int element) { SUMORouteHandler::myEndElement(element); switch (element) { - case SUMO_TAG_VTYPE: { + case SUMO_TAG_VTYPE: if (myNet.addVehicleType(myCurrentVType)) { if (myCurrentVTypeDistribution != 0) { myCurrentVTypeDistribution->add(myCurrentVType->defaultProbability, myCurrentVType); } } myCurrentVType = 0; - } - break; + break; + case SUMO_TAG_TRIP: + closeRoute(true); + closeVehicle(); + delete myVehicleParameter; + myVehicleParameter = 0; + myInsertStopEdgesAt = -1; + break; default: break; } @@ -288,7 +327,7 @@ return; } if (myVehicleParameter != 0) { - myErrorOutput->inform("Vehicle's '" + myVehicleParameter->id + "' route has no edges."); + myErrorOutput->inform("The route for vehicle '" + myVehicleParameter->id + "' has no edges."); } else { myErrorOutput->inform("Route '" + myActiveRouteID + "' has no edges."); } @@ -296,6 +335,12 @@ myActiveRouteStops.clear(); return; } + if (myActiveRoute.size() == 1 && myActiveRoute.front()->getType() == ROEdge::ET_DISTRICT) { + myErrorOutput->inform("The routing information for vehicle '" + myVehicleParameter->id + "' is insufficient."); + myActiveRouteID = ""; + myActiveRouteStops.clear(); + return; + } RORoute* route = new RORoute(myActiveRouteID, myCurrentCosts, myActiveRouteProbability, myActiveRoute, myActiveRouteColor, myActiveRouteStops); myActiveRoute.clear(); @@ -311,7 +356,7 @@ myActiveRouteStops.clear(); return; } else { - myCurrentAlternatives = new RORouteDef(myActiveRouteID, 0, mayBeDisconnected || myTryRepair); + myCurrentAlternatives = new RORouteDef(myActiveRouteID, 0, mayBeDisconnected || myTryRepair, mayBeDisconnected); myCurrentAlternatives->addLoadedAlternative(route); myNet.addRouteDef(myCurrentAlternatives); myCurrentAlternatives = 0; @@ -349,7 +394,7 @@ return; } // build the alternative cont - myCurrentAlternatives = new RORouteDef(id, index, myTryRepair); + myCurrentAlternatives = new RORouteDef(id, index, myTryRepair, false); if (attrs.hasAttribute(SUMO_ATTR_ROUTES)) { ok = true; StringTokenizer st(attrs.get(SUMO_ATTR_ROUTES, id.c_str(), ok)); @@ -389,6 +434,13 @@ } // get vehicle type SUMOVTypeParameter* type = myNet.getVehicleTypeSecure(myVehicleParameter->vtypeid); + if (type == 0) { + myErrorOutput->inform("The vehicle type '" + myVehicleParameter->vtypeid + "' for vehicle '" + myVehicleParameter->id + "' is not known."); + type = myNet.getVehicleTypeSecure(DEFAULT_VTYPE_ID); + } else { + // fix the type id in case we used a distribution + myVehicleParameter->vtypeid = type->id; + } // get the route RORouteDef* route = myNet.getRouteDef(myVehicleParameter->routeid); if (route == 0) { @@ -401,8 +453,9 @@ // build the vehicle if (!MsgHandler::getErrorInstance()->wasInformed()) { ROVehicle* veh = new ROVehicle(*myVehicleParameter, route, type, &myNet); - myNet.addVehicle(myVehicleParameter->id, veh); - registerLastDepart(); + if (myNet.addVehicle(myVehicleParameter->id, veh)) { + registerLastDepart(); + } } } @@ -423,6 +476,22 @@ myActivePlanSize = 0; } +void +RORouteHandler::closeContainer() { + myActiveContainerPlan->closeTag(); + if (myActiveContainerPlanSize > 0) { + myNet.addContainer(myVehicleParameter->depart, myActiveContainerPlan->getString()); + registerLastDepart(); + } else { + WRITE_WARNING("Discarding container '" + myVehicleParameter->id + "' because it's plan is empty"); + } + delete myVehicleParameter; + myVehicleParameter = 0; + delete myActiveContainerPlan; + myActiveContainerPlan = 0; + myActiveContainerPlanSize = 0; +} + void RORouteHandler::closeFlow() { @@ -443,24 +512,28 @@ return; } } - SUMOVTypeParameter* type = myNet.getVehicleTypeSecure(myVehicleParameter->vtypeid); - RORouteDef* route = myNet.getRouteDef(myVehicleParameter->routeid); - if (type == 0) { - myErrorOutput->inform("The vehicle type '" + myVehicleParameter->vtypeid + "' for vehicle '" + myVehicleParameter->id + "' is not known."); - delete myVehicleParameter; - myVehicleParameter = 0; - return; + if (myNet.getVehicleTypeSecure(myVehicleParameter->vtypeid) == 0) { + myErrorOutput->inform("The vehicle type '" + myVehicleParameter->vtypeid + "' for flow '" + myVehicleParameter->id + "' is not known."); } - if (route == 0) { - myErrorOutput->inform("Vehicle '" + myVehicleParameter->id + "' has no route."); + if (myVehicleParameter->routeid[0] == '!' && myNet.getRouteDef(myVehicleParameter->routeid) == 0) { + closeRoute(true); + } + if (myNet.getRouteDef(myVehicleParameter->routeid) == 0) { + myErrorOutput->inform("The route '" + myVehicleParameter->routeid + "' for flow '" + myVehicleParameter->id + "' is not known."); delete myVehicleParameter; myVehicleParameter = 0; return; } myActiveRouteID = ""; - myNet.addFlow(myVehicleParameter, OptionsCont::getOptions().getBool("randomize-flows")); - registerLastDepart(); + if (!MsgHandler::getErrorInstance()->wasInformed()) { + if (myNet.addFlow(myVehicleParameter, OptionsCont::getOptions().getBool("randomize-flows"))) { + registerLastDepart(); + } else { + myErrorOutput->inform("Another flow with the id '" + myVehicleParameter->id + "' exists."); + } + } myVehicleParameter = 0; + myInsertStopEdgesAt = -1; } @@ -473,11 +546,18 @@ myActivePlanSize++; return; } + if (myActiveContainerPlan) { + myActiveContainerPlan->openTag(SUMO_TAG_STOP); + (*myActiveContainerPlan) << attrs; + myActiveContainerPlan->closeTag(); + myActiveContainerPlanSize++; + return; + } std::string errorSuffix; - if (myActiveRouteID != "") { - errorSuffix = " in route '" + myActiveRouteID + "'."; - } else { + if (myVehicleParameter != 0) { errorSuffix = " in vehicle '" + myVehicleParameter->id + "'."; + } else { + errorSuffix = " in route '" + myActiveRouteID + "'."; } SUMOVehicleParameter::Stop stop; bool ok = parseStop(stop, attrs, errorSuffix, myErrorOutput); @@ -485,23 +565,35 @@ return; } // try to parse the assigned bus stop + ROEdge* edge = 0; if (stop.busstop != "") { const SUMOVehicleParameter::Stop* busstop = myNet.getBusStop(stop.busstop); if (busstop == 0) { myErrorOutput->inform("Unknown bus stop '" + stop.busstop + "'" + errorSuffix); - } else { - stop.lane = busstop->lane; - stop.endPos = busstop->endPos; - stop.startPos = busstop->startPos; + return; } + stop.lane = busstop->lane; + stop.endPos = busstop->endPos; + stop.startPos = busstop->startPos; + edge = myNet.getEdge(stop.lane.substr(0, stop.lane.rfind('_'))); + } // try to parse the assigned container stop + else if (stop.containerstop != "") { + const SUMOVehicleParameter::Stop* containerstop = myNet.getContainerStop(stop.containerstop); + if (containerstop == 0) { + myErrorOutput->inform("Unknown container stop '" + stop.containerstop + "'" + errorSuffix); + } + stop.lane = containerstop->lane; + stop.endPos = containerstop->endPos; + stop.startPos = containerstop->startPos; + edge = myNet.getEdge(stop.lane.substr(0, stop.lane.rfind('_'))); } else { // no, the lane and the position should be given stop.lane = attrs.getOpt(SUMO_ATTR_LANE, 0, ok, ""); if (!ok || stop.lane == "") { - myErrorOutput->inform("A stop must be placed on a bus stop or a lane" + errorSuffix); + myErrorOutput->inform("A stop must be placed on a bus stop, a container stop or a lane" + errorSuffix); return; } - ROEdge* edge = myNet.getEdge(stop.lane.substr(0, stop.lane.rfind('_'))); + edge = myNet.getEdge(stop.lane.substr(0, stop.lane.rfind('_'))); if (edge == 0) { myErrorOutput->inform("The lane '" + stop.lane + "' for a stop is not known" + errorSuffix); return; @@ -519,11 +611,15 @@ } else { myActiveRouteStops.push_back(stop); } + if (myInsertStopEdgesAt >= 0) { + myActiveRoute.insert(myActiveRoute.begin() + myInsertStopEdgesAt, edge); + myInsertStopEdgesAt++; + } } void -RORouteHandler::parseEdges(const std::string& desc, std::vector& into, +RORouteHandler::parseEdges(const std::string& desc, ConstROEdgeVector& into, const std::string& rid) { if (desc[0] == BinaryFormatter::BF_ROUTE) { std::istringstream in(desc, std::ios::binary); @@ -603,5 +699,4 @@ } - /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/router/RORouteHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORouteHandler.h --- sumo-0.21.0+dfsg/src/router/RORouteHandler.h 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/RORouteHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: RORouteHandler.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: RORouteHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Parser and container for routes during their loading /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include @@ -136,6 +136,9 @@ /// Ends the processing of a person void closePerson(); + /// Ends the processing of a container + void closeContainer(); + /// Ends the processing of a flow void closeFlow(); @@ -143,7 +146,7 @@ void addStop(const SUMOSAXAttributes& attrs); /// Parse edges from strings - void parseEdges(const std::string& desc, std::vector& into, + void parseEdges(const std::string& desc, ConstROEdgeVector& into, const std::string& rid); /// @brief route a walking person and write the corresponding walk element (return whether sucessful) @@ -158,14 +161,20 @@ RONet& myNet; /// @brief The current route - std::vector myActiveRoute; + ConstROEdgeVector myActiveRoute; /// @brief The plan of the current person OutputDevice_String* myActivePlan; + /// @brief The plan of the current container + OutputDevice_String* myActiveContainerPlan; + /// @brief The number of stages in myActivePlan int myActivePlanSize; + /// @brief The number of stages in myActiveContainerPlan + int myActiveContainerPlanSize; + /// @brief Information whether routes shall be repaired const bool myTryRepair; @@ -184,9 +193,6 @@ /// @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); diff -Nru sumo-0.21.0+dfsg/src/router/ROVehicleCont.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROVehicleCont.cpp --- sumo-0.21.0+dfsg/src/router/ROVehicleCont.cpp 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROVehicleCont.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROVehicleCont.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ROVehicleCont.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A container for vehicles sorted by their departure time /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/router/ROVehicleCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROVehicleCont.h --- sumo-0.21.0+dfsg/src/router/ROVehicleCont.h 2014-02-22 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROVehicleCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ROVehicleCont.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ROVehicleCont.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A container for vehicles sorted by their departure time /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/router/ROVehicle.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROVehicle.cpp --- sumo-0.21.0+dfsg/src/router/ROVehicle.cpp 2014-03-24 23:02:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROVehicle.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: ROVehicle.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: ROVehicle.cpp 18136 2015-03-24 15:10:45Z behrisch $ /// // A vehicle as used by router /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -55,7 +55,7 @@ // =========================================================================== ROVehicle::ROVehicle(const SUMOVehicleParameter& pars, RORouteDef* route, const SUMOVTypeParameter* type, const RONet* net) - : myParameter(pars), myType(type), myRoute(route) { + : myParameter(pars), myType(type), myRoute(route), myRoutingSuccess(false) { myParameter.stops.clear(); if (route != 0) { for (std::vector::const_iterator s = route->getFirstRoute()->getStops().begin(); s != route->getFirstRoute()->getStops().end(); ++s) { @@ -77,7 +77,7 @@ } // where to insert the stop std::vector::iterator iter = myParameter.stops.begin(); - std::vector::iterator edgeIter = myStopEdges.begin(); + ConstROEdgeVector::iterator edgeIter = myStopEdges.begin(); if (stopPar.index == STOP_INDEX_END || stopPar.index >= static_cast(myParameter.stops.size())) { if (myParameter.stops.size() > 0) { iter = myParameter.stops.end(); @@ -85,8 +85,8 @@ } } else { if (stopPar.index == STOP_INDEX_FIT) { - const std::vector edges = myRoute->getFirstRoute()->getEdgeVector(); - std::vector::const_iterator stopEdgeIt = std::find(edges.begin(), edges.end(), stopEdge); + const ConstROEdgeVector edges = myRoute->getFirstRoute()->getEdgeVector(); + ConstROEdgeVector::const_iterator stopEdgeIt = std::find(edges.begin(), edges.end(), stopEdge); if (stopEdgeIt == edges.end()) { iter = myParameter.stops.end(); edgeIter = myStopEdges.end(); @@ -113,8 +113,8 @@ void -ROVehicle::saveAllAsXML(OutputDevice& os, OutputDevice* const altos, - OutputDevice* const typeos, bool withExitTimes) const { +ROVehicle::saveTypeAsXML(OutputDevice& os, OutputDevice* const altos, + OutputDevice* const typeos) const { // check whether the vehicle's type was saved before if (myType != 0 && !myType->saved) { // ... save if not @@ -128,28 +128,24 @@ } myType->saved = true; } +} + +void +ROVehicle::saveAllAsXML(OutputDevice& os, bool asAlternatives, bool withExitTimes) const { // write the vehicle (new style, with included routes) myParameter.write(os, OptionsCont::getOptions()); - if (altos != 0) { - myParameter.write(*altos, OptionsCont::getOptions()); - } - // check whether the route shall be saved - if (!myRoute->isSaved()) { - myRoute->writeXMLDefinition(os, this, false, withExitTimes); - if (altos != 0) { - myRoute->writeXMLDefinition(*altos, this, true, withExitTimes); - } - } + // save the route + myRoute->writeXMLDefinition(os, this, asAlternatives, withExitTimes); myParameter.writeStops(os); - if (altos != 0) { - myParameter.writeStops(*altos); + for (std::map::const_iterator j = myParameter.getMap().begin(); j != myParameter.getMap().end(); ++j) { + os.openTag(SUMO_TAG_PARAM); + os.writeAttr(SUMO_ATTR_KEY, (*j).first); + os.writeAttr(SUMO_ATTR_VALUE, (*j).second); + os.closeTag(); } os.closeTag(); - if (altos != 0) { - altos->closeTag(); - } } diff -Nru sumo-0.21.0+dfsg/src/router/ROVehicle.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROVehicle.h --- sumo-0.21.0+dfsg/src/router/ROVehicle.h 2014-04-11 22:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/router/ROVehicle.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: ROVehicle.h 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: ROVehicle.h 18136 2015-03-24 15:10:45Z behrisch $ /// // A vehicle as used by router /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -34,10 +34,10 @@ #include #include +#include #include -#include -#include -#include +#include +#include // =========================================================================== @@ -48,6 +48,7 @@ class ROEdge; class RONet; +typedef std::vector ConstROEdgeVector; // =========================================================================== // class definitions @@ -104,15 +105,23 @@ } - /** @brief Returns the time the vehicle starts at + /** @brief Returns the time the vehicle starts at, 0 for triggered vehicles * * @return The vehicle's depart time */ SUMOTime getDepartureTime() const { + return MAX2(0, myParameter.depart); + } + + /** @brief Returns the time the vehicle starts at, -1 for triggered vehicles + * + * @return The vehicle's depart time + */ + SUMOTime getDepart() const { return myParameter.depart; } - const std::vector& getStopEdges() const { + const ConstROEdgeVector& getStopEdges() const { return myStopEdges; } @@ -124,23 +133,43 @@ return getType() != 0 ? getType()->vehicleClass : SVC_IGNORING; } - - /** @brief Saves the complete vehicle description. + /** @brief Returns an upper bound for the speed factor of this vehicle * - * Saves the vehicle type if it was not saved before. - * Saves the vehicle route if it was not saved before. - * Saves the vehicle itself. + * @return the maximum speed factor + */ + inline SUMOReal getChosenSpeedFactor() const { + return SUMOReal(2. * getType()->speedDev + 1.) * getType()->speedFactor; + } + + + /** @brief Saves the vehicle type if it was not saved before. * * @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 + * @exception IOError If something fails (not yet implemented) + */ + void saveTypeAsXML(OutputDevice& os, OutputDevice* const altos, + OutputDevice* const typeos) const; + + /** @brief Saves the complete vehicle description. + * + * Saves the vehicle itself including the route and stops. + * + * @param[in] os The routes or alternatives output device to store the vehicle's description into + * @param[in] asAlternatives Whether the route shall be saved as route alternatives * @param[in] withExitTimes whether exit times for the edges shall be written * @exception IOError If something fails (not yet implemented) */ - void saveAllAsXML(OutputDevice& os, OutputDevice* const altos, - OutputDevice* const typeos, bool withExitTimes) const; + void saveAllAsXML(OutputDevice& os, bool asAlternatives, bool withExitTimes) const; + inline void setRoutingSuccess(const bool val) { + myRoutingSuccess = val; + } + inline bool getRoutingSuccess() const { + return myRoutingSuccess; + } private: /** @brief Adds a stop to this vehicle * @@ -161,7 +190,10 @@ RORouteDef* const myRoute; /// @brief The edges where the vehicle stops - std::vector myStopEdges; + ConstROEdgeVector myStopEdges; + + /// @brief Whether the last routing was successful + bool myRoutingSuccess; private: diff -Nru sumo-0.21.0+dfsg/src/sumo_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/sumo_main.cpp --- sumo-0.21.0+dfsg/src/sumo_main.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/sumo_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Thimor Bohn /// @author Michael Behrisch /// @date Tue, 20 Nov 2001 -/// @version $Id: sumo_main.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: sumo_main.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Main for SUMO /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -126,7 +127,7 @@ OptionsCont& oc = OptionsCont::getOptions(); // give some application descriptions oc.setApplicationDescription("A microscopic road traffic simulation."); - oc.setApplicationName("sumo", "SUMO sumo Version " + (std::string)VERSION_STRING); + oc.setApplicationName("sumo", "SUMO Version " + getBuildName(VERSION_STRING)); int ret = 0; MSNet* net = 0; try { @@ -144,7 +145,7 @@ throw ProcessError(); } RandHelper::initRandGlobal(); - RandHelper::initRandGlobal(&MSVehicleControl::myVehicleParamsRNG); + RandHelper::initRandGlobal(MSRouteHandler::getParsingRNG()); // load the net net = load(oc); if (net != 0) { diff -Nru sumo-0.21.0+dfsg/src/tools/emissionsDrivingCycle_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/tools/emissionsDrivingCycle_main.cpp --- sumo-0.21.0+dfsg/src/tools/emissionsDrivingCycle_main.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/tools/emissionsDrivingCycle_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 21.08.2013 -/// @version $Id: emissionsDrivingCycle_main.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: emissionsDrivingCycle_main.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Main for an emissions calculator /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -73,7 +73,7 @@ OptionsCont& oc = OptionsCont::getOptions(); // give some application descriptions oc.setApplicationDescription("Computes emissions by driving a time line."); - oc.setApplicationName("emissionsDrivingCycle", "SUMO emissionsDrivingCycle Version " + (std::string)VERSION_STRING); + oc.setApplicationName("emissionsDrivingCycle", "SUMO emissionsDrivingCycle Version " + getBuildName(VERSION_STRING)); // add options SystemFrame::addConfigurationOptions(oc); @@ -143,15 +143,20 @@ if (!oc.isSet("output-file") && (oc.isSet("timeline-file") || !oc.isSet("emission-output"))) { throw ProcessError("The output file must be given."); } - std::ofstream o(oc.getString("output-file").c_str()); + std::ostream* out = 0; + if (oc.isSet("output-file")) { + out = new std::ofstream(oc.getString("output-file").c_str()); + } OutputDevice::createDeviceByOption("emission-output", "emission-export", "emission_file.xsd"); OutputDevice* xmlOut = 0; if (oc.isSet("emission-output")) { xmlOut = &OutputDevice::getDeviceByOption("emission-output"); + } else if (out == 0) { + out = &std::cout; } const SUMOEmissionClass defaultClass = PollutantsInterface::getClassByName(oc.getString("emission-class")); - TrajectoriesHandler handler(oc.getBool("compute-a"), defaultClass, oc.getFloat("slope"), xmlOut); + TrajectoriesHandler handler(oc.getBool("compute-a"), defaultClass, oc.getFloat("slope"), out, xmlOut); if (oc.isSet("timeline-file")) { bool skipFirst = oc.getBool("skip-first"); @@ -180,7 +185,7 @@ l += v; const SUMOReal a = !computeA && st.hasNext() ? TplConvert::_2SUMOReal(st.next().c_str()) : TrajectoriesHandler::INVALID_VALUE; const SUMOReal s = haveSlope ? TplConvert::_2SUMOReal(st.next().c_str()) : TrajectoriesHandler::INVALID_VALUE; - handler.writeEmissions(o, "", defaultClass, t, v, a, s); + handler.writeEmissions(*out, "", defaultClass, t, v, a, s); } catch (EmptyData&) { throw ProcessError("Missing an entry in line '" + line + "'."); } catch (NumberFormatException&) { @@ -190,12 +195,14 @@ if (!quiet) { std::cout << "sums" << std::endl << "length:" << l << std::endl; - handler.writeSums(std::cout, ""); } } if (oc.isSet("netstate-file")) { XMLSubSys::runParser(handler, oc.getString("netstate-file")); } + if (!quiet) { + handler.writeSums(std::cout, ""); + } } catch (InvalidArgument& e) { MsgHandler::getErrorInstance()->inform(e.what()); MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); diff -Nru sumo-0.21.0+dfsg/src/tools/emissionsMap_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/tools/emissionsMap_main.cpp --- sumo-0.21.0+dfsg/src/tools/emissionsMap_main.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/tools/emissionsMap_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,11 +3,11 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 21.08.2013 -/// @version $Id: emissionsMap_main.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: emissionsMap_main.cpp 17682 2015-01-23 07:27:34Z behrisch $ /// // Main for an emissions map writer /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ // Copyright (C) 2013-2013 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // @@ -95,7 +95,7 @@ OptionsCont& oc = OptionsCont::getOptions(); // give some application descriptions oc.setApplicationDescription("Builds and writes an emissions map."); - oc.setApplicationName("emissionsMap", "SUMO emissionsMap Version " + (std::string)VERSION_STRING); + oc.setApplicationName("emissionsMap", "SUMO emissionsMap Version " + getBuildName(VERSION_STRING)); // add options SystemFrame::addConfigurationOptions(oc); oc.addOptionSubTopic("Processing"); diff -Nru sumo-0.21.0+dfsg/src/tools/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/tools/Makefile.am --- sumo-0.21.0+dfsg/src/tools/Makefile.am 2014-04-11 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/tools/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -21,7 +21,7 @@ -l$(LIB_XERCES) -emissionsMap_SOURCES = emissionsMap_main.cpp +emissionsMap_SOURCES = emissionsMap_main.cpp emissionsMap_LDFLAGS = $(XERCES_LDFLAGS) diff -Nru sumo-0.21.0+dfsg/src/tools/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/tools/Makefile.in --- sumo-0.21.0+dfsg/src/tools/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/tools/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -240,6 +240,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -250,7 +252,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -360,7 +361,7 @@ $(MEM_LIBS) \ -l$(LIB_XERCES) -emissionsMap_SOURCES = emissionsMap_main.cpp +emissionsMap_SOURCES = emissionsMap_main.cpp emissionsMap_LDFLAGS = $(XERCES_LDFLAGS) emissionsMap_LDADD = $(emissionsDrivingCycle_LDADD) all: all-am diff -Nru sumo-0.21.0+dfsg/src/tools/TrajectoriesHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/tools/TrajectoriesHandler.cpp --- sumo-0.21.0+dfsg/src/tools/TrajectoriesHandler.cpp 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/tools/TrajectoriesHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file TrajectoriesHandler.cpp /// @author Michael Behrisch /// @date 14.03.2014 -/// @version $Id: TrajectoriesHandler.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: TrajectoriesHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An XML-Handler for amitran and netstate trajectories /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -49,9 +50,9 @@ // method definitions // =========================================================================== TrajectoriesHandler::TrajectoriesHandler(const bool computeA, const SUMOEmissionClass defaultClass, - const SUMOReal defaultSlope, OutputDevice* xmlOut) + const SUMOReal defaultSlope, std::ostream* stdOut, OutputDevice* xmlOut) : SUMOSAXHandler(""), myComputeA(computeA), myDefaultClass(defaultClass), - myDefaultSlope(defaultSlope), myXMLOut(xmlOut), myCurrentTime(-1) {} + myDefaultSlope(defaultSlope), myStdOut(stdOut), myXMLOut(xmlOut), myCurrentTime(-1), myStepSize(TS) {} TrajectoriesHandler::~TrajectoriesHandler() {} @@ -62,6 +63,9 @@ const SUMOSAXAttributes& attrs) { bool ok = true; switch (element) { + case SUMO_TAG_TRAJECTORIES: + myStepSize = attrs.getFloat("timeStepSize") / 1000.; + break; case SUMO_TAG_TIMESTEP: myCurrentTime = attrs.getSUMOTimeReporting(SUMO_ATTR_TIME, 0, ok); break; @@ -69,7 +73,13 @@ if (attrs.hasAttribute(SUMO_ATTR_SPEED)) { writeEmissions(std::cout, attrs.getString(SUMO_ATTR_ID), myDefaultClass, myCurrentTime, attrs.getFloat(SUMO_ATTR_SPEED)); } else { - myEmissionClassByVehicle[attrs.getString(SUMO_ATTR_ID)] = myEmissionClassByType[attrs.getString(SUMO_ATTR_ACTORCONFIG)]; + const std::string acId = attrs.getString(SUMO_ATTR_ACTORCONFIG); + const std::string id = attrs.getString(SUMO_ATTR_ID); + if (myEmissionClassByType.count(acId) == 0) { + WRITE_WARNING("Unknown actor configuration '" + acId + "' for vehicle '" + id + "'!"); + } else { + myEmissionClassByVehicle[id] = myEmissionClassByType.count(acId) > 0 ? myEmissionClassByType[acId] : myDefaultClass; + } } break; case SUMO_TAG_ACTORCONFIG: { @@ -83,15 +93,20 @@ } case SUMO_TAG_MOTIONSTATE: { const std::string id = attrs.getString(SUMO_ATTR_VEHICLE); + if (myEmissionClassByVehicle.count(id) == 0) { + WRITE_WARNING("Motion state for unknown vehicle '" + id + "'!"); + myEmissionClassByVehicle[id] = myDefaultClass; + } const SUMOEmissionClass c = myEmissionClassByVehicle[id]; const SUMOReal v = attrs.getFloat(SUMO_ATTR_SPEED) / 100.; - const SUMOReal a = attrs.getOpt(SUMO_ATTR_ACCELERATION, id.c_str(), ok, INVALID_VALUE); - const SUMOReal s = attrs.getOpt(SUMO_ATTR_SLOPE, id.c_str(), ok, INVALID_VALUE); + const SUMOReal a = attrs.hasAttribute(SUMO_ATTR_ACCELERATION) ? attrs.get(SUMO_ATTR_ACCELERATION, id.c_str(), ok) / 1000. : INVALID_VALUE; + const SUMOReal s = attrs.hasAttribute(SUMO_ATTR_SLOPE) ? RAD2DEG(asin(attrs.get(SUMO_ATTR_SLOPE, id.c_str(), ok) / 10000.)) : INVALID_VALUE; const SUMOTime time = attrs.getOpt(SUMO_ATTR_TIME, id.c_str(), ok, INVALID_VALUE); if (myXMLOut != 0) { writeXMLEmissions(id, c, time, v, a, s); - } else { - writeEmissions(std::cout, id, c, time, v, a, s); + } + if (myStdOut != 0) { + writeEmissions(*myStdOut, id, c, time, v, a, s); } break; } @@ -119,7 +134,10 @@ s = myDefaultSlope; } const PollutantsInterface::Emissions result = PollutantsInterface::computeAll(c, v, a, s); - mySums[id].addScaled(result); + mySums[id].addScaled(result, myStepSize); + if (id != "") { + mySums[""].addScaled(result, myStepSize); + } return result; } diff -Nru sumo-0.21.0+dfsg/src/tools/TrajectoriesHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/tools/TrajectoriesHandler.h --- sumo-0.21.0+dfsg/src/tools/TrajectoriesHandler.h 2014-06-09 22:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/tools/TrajectoriesHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file TrajectoriesHandler.h /// @author Michael Behrisch /// @date 14.03.2014 -/// @version $Id: TrajectoriesHandler.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: TrajectoriesHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An XML-Handler for amitran and netstate trajectories /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -54,7 +54,7 @@ * @param[in] file The file that will be processed */ TrajectoriesHandler(const bool computeA, const SUMOEmissionClass defaultClass, - const SUMOReal defaultSlope, OutputDevice* xmlOut); + const SUMOReal defaultSlope, std::ostream* stdOut, OutputDevice* xmlOut); /// @brief Destructor @@ -99,9 +99,11 @@ const bool myComputeA; const SUMOEmissionClass myDefaultClass; const SUMOReal myDefaultSlope; + std::ostream* myStdOut; OutputDevice* myXMLOut; std::map myLastV; SUMOTime myCurrentTime; + SUMOReal myStepSize; std::map mySums; std::map myEmissionClassByType; std::map myEmissionClassByVehicle; diff -Nru sumo-0.21.0+dfsg/src/traci-server/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/Makefile.am --- sumo-0.21.0+dfsg/src/traci-server/Makefile.am 2013-09-15 22:02:17.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -9,6 +9,7 @@ TraCIServerAPI_Lane.h TraCIServerAPI_Lane.cpp \ TraCIServerAPI_MeMeDetector.h TraCIServerAPI_MeMeDetector.cpp \ TraCIServerAPI_ArealDetector.h TraCIServerAPI_ArealDetector.cpp \ +TraCIServerAPI_Person.h TraCIServerAPI_Person.cpp \ TraCIServerAPI_POI.h TraCIServerAPI_POI.cpp \ TraCIServerAPI_Polygon.h TraCIServerAPI_Polygon.cpp \ TraCIServerAPI_Route.h TraCIServerAPI_Route.cpp \ diff -Nru sumo-0.21.0+dfsg/src/traci-server/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/Makefile.in --- sumo-0.21.0+dfsg/src/traci-server/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -105,7 +105,8 @@ TraCIServerAPI_Lane.$(OBJEXT) \ TraCIServerAPI_MeMeDetector.$(OBJEXT) \ TraCIServerAPI_ArealDetector.$(OBJEXT) \ - TraCIServerAPI_POI.$(OBJEXT) TraCIServerAPI_Polygon.$(OBJEXT) \ + TraCIServerAPI_Person.$(OBJEXT) TraCIServerAPI_POI.$(OBJEXT) \ + TraCIServerAPI_Polygon.$(OBJEXT) \ TraCIServerAPI_Route.$(OBJEXT) \ TraCIServerAPI_Simulation.$(OBJEXT) \ TraCIServerAPI_TLS.$(OBJEXT) TraCIServerAPI_Vehicle.$(OBJEXT) \ @@ -231,6 +232,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -241,7 +244,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -345,6 +347,7 @@ TraCIServerAPI_Lane.h TraCIServerAPI_Lane.cpp \ TraCIServerAPI_MeMeDetector.h TraCIServerAPI_MeMeDetector.cpp \ TraCIServerAPI_ArealDetector.h TraCIServerAPI_ArealDetector.cpp \ +TraCIServerAPI_Person.h TraCIServerAPI_Person.cpp \ TraCIServerAPI_POI.h TraCIServerAPI_POI.cpp \ TraCIServerAPI_Polygon.h TraCIServerAPI_Polygon.cpp \ TraCIServerAPI_Route.h TraCIServerAPI_Route.cpp \ @@ -410,6 +413,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TraCIServerAPI_Lane.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TraCIServerAPI_MeMeDetector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TraCIServerAPI_POI.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TraCIServerAPI_Person.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TraCIServerAPI_Polygon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TraCIServerAPI_Route.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TraCIServerAPI_Simulation.Po@am__quote@ diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIConstants.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIConstants.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIConstants.h 2014-05-08 22:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIConstants.h 2015-04-17 05:44:20.000000000 +0000 @@ -12,12 +12,12 @@ /// @author Jakob Erdmann /// @author Laura Bieker /// @date 2007/10/24 -/// @version $Id: TraCIConstants.h 16331 2014-05-08 17:59:28Z mkrumnow $ +/// @version $Id: TraCIConstants.h 18095 2015-03-17 09:39:00Z behrisch $ /// /// holds codes used for TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -34,7 +34,7 @@ // **************************************** // VERSION // **************************************** -#define TRACI_VERSION 8 +#define TRACI_VERSION 9 // **************************************** @@ -78,21 +78,6 @@ // response: subscribe induction loop (e1) variable #define RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE 0xe0 - -// command: subscribe areal detector (e2) context -#define CMD_SUBSCRIBE_AREAL_DETECTOR_CONTEXT 0x8D -// response: subscribe areal detector (e2) context -#define RESPONSE_SUBSCRIBE_AREAL_DETECTOR_CONTEXT 0x9D -// command: get areal detector (e2) variable -#define CMD_GET_AREAL_DETECTOR_VARIABLE 0x8E -// response: get areal detector (e2) variable -#define RESPONSE_GET_AREAL_DETECTOR_VARIABLE 0x9E -// command: subscribe areal detector (e2) variable -#define CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE 0x8F -// response: subscribe areal detector (e2) variable -#define RESPONSE_SUBSCRIBE_AREAL_DETECTOR_VARIABLE 0x9F - - // command: subscribe multi-entry/multi-exit detector (e3) context #define CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT 0x81 // response: subscribe multi-entry/multi-exit detector (e3) context @@ -106,7 +91,6 @@ // response: subscribe multi-entry/multi-exit 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 @@ -272,6 +256,34 @@ // response: subscribe GUI variable #define RESPONSE_SUBSCRIBE_GUI_VARIABLE 0xec +// command: subscribe areal detector (e2) context +#define CMD_SUBSCRIBE_AREAL_DETECTOR_CONTEXT 0x8d +// response: subscribe areal detector (e2) context +#define RESPONSE_SUBSCRIBE_AREAL_DETECTOR_CONTEXT 0x9d +// command: get areal detector (e2) variable +#define CMD_GET_AREAL_DETECTOR_VARIABLE 0xad +// response: get areal detector (e2) variable +#define RESPONSE_GET_AREAL_DETECTOR_VARIABLE 0xbd +// command: subscribe areal detector (e2) variable +#define CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE 0xdd +// response: subscribe areal detector (e2) variable +#define RESPONSE_SUBSCRIBE_AREAL_DETECTOR_VARIABLE 0xed + +// command: subscribe person context +#define CMD_SUBSCRIBE_PERSON_CONTEXT 0x8e +// response: subscribe person context +#define RESPONSE_SUBSCRIBE_PERSON_CONTEXT 0x9e +// command: get person variable +#define CMD_GET_PERSON_VARIABLE 0xae +// response: get person variable +#define RESPONSE_GET_PERSON_VARIABLE 0xbe +// command: set person variable +#define CMD_SET_PERSON_VARIABLE 0xce +// command: subscribe person variable +#define CMD_SUBSCRIBE_PERSON_VARIABLE 0xde +// response: subscribe person variable +#define RESPONSE_SUBSCRIBE_PERSON_VARIABLE 0xee + // **************************************** // POSITION REPRESENTATIONS @@ -454,6 +466,9 @@ // assumed time to next switch (get: traffic lights) #define TL_NEXT_SWITCH 0x2d +// current state, using external signal names (get: traffic lights) +#define TL_EXTERNAL_STATE 0x2e + // outgoing link number (get: lanes) @@ -698,6 +713,8 @@ // clears the simulation of all not inserted vehicles (set: simulation) #define CMD_CLEAR_PENDING_VEHICLES 0x94 +// sets/retrieves abstract parameter +#define VAR_PARAMETER 0x7e diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIException.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIException.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIException.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIException.h 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2007/10/24 -/// @version $Id: TraCIException.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIException.h 18095 2015-03-17 09:39:00Z behrisch $ /// /// Exception thrown by TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_ArealDetector.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_ArealDetector.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_ArealDetector.cpp 2014-05-05 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_ArealDetector.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,11 +5,11 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 03.02.2014 -/// @version $Id: TraCIServerAPI_ArealDetector.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: TraCIServerAPI_ArealDetector.cpp 17682 2015-01-23 07:27:34Z behrisch $ /// // APIs for getting/setting areal detector values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ // Copyright (C) 2014 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // @@ -35,7 +35,6 @@ #include "TraCIConstants.h" #include -#include #include "TraCIServerAPI_ArealDetector.h" #ifdef CHECK_MEMORY_LEAKS @@ -99,7 +98,7 @@ break; case LAST_STEP_VEHICLE_HALTING_NUMBER: tempMsg.writeUnsignedByte(TYPE_INTEGER); - tempMsg.writeInt((int) e2->getCurrentHaltingNumber()); + tempMsg.writeInt(e2->getCurrentHaltingNumber()); break; case JAM_LENGTH_VEHICLE: tempMsg.writeUnsignedByte(TYPE_INTEGER); diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_ArealDetector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_ArealDetector.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_ArealDetector.h 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_ArealDetector.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Mario Krumnow /// @author Michael Behrisch /// @date 15.09.2013 -/// @version $Id: TraCIServerAPI_ArealDetector.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: TraCIServerAPI_ArealDetector.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting areal detector values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Edge.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Edge.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Edge.cpp 2014-04-02 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Edge.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Laura Bieker /// @author Mario Krumnow /// @date Sept 2002 -/// @version $Id: TraCIServerAPI_Edge.cpp 16099 2014-04-02 07:41:36Z behrisch $ +/// @version $Id: TraCIServerAPI_Edge.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // APIs for getting/setting edge values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -66,7 +66,7 @@ && variable != VAR_NOXEMISSION && variable != VAR_FUELCONSUMPTION && variable != VAR_NOISEEMISSION && variable != VAR_WAITING_TIME && variable != LAST_STEP_VEHICLE_NUMBER && variable != LAST_STEP_MEAN_SPEED && variable != LAST_STEP_OCCUPANCY && variable != LAST_STEP_VEHICLE_HALTING_NUMBER && variable != LAST_STEP_LENGTH - && variable != LAST_STEP_VEHICLE_ID_LIST && variable != ID_COUNT) { + && variable != LAST_STEP_VEHICLE_ID_LIST && variable != ID_COUNT && variable != VAR_PARAMETER) { return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "Get Edge Variable: unsupported variable specified", outputStorage); } // begin response building @@ -290,6 +290,15 @@ } } break; + case VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(CMD_GET_EDGE_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + tempMsg.writeUnsignedByte(TYPE_STRING); + tempMsg.writeString(e->getParameter(paramName, "")); + } + break; default: break; } @@ -306,7 +315,7 @@ std::string warning = ""; // additional description for response // variable int variable = inputStorage.readUnsignedByte(); - if (variable != VAR_EDGE_TRAVELTIME && variable != VAR_EDGE_EFFORT && variable != VAR_MAXSPEED) { + if (variable != VAR_EDGE_TRAVELTIME && variable != VAR_EDGE_EFFORT && variable != VAR_MAXSPEED && variable != VAR_PARAMETER) { return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "Change Edge State: unsupported variable specified", outputStorage); } // id @@ -421,6 +430,23 @@ } } break; + case VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { + return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //readt itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(CMD_SET_EDGE_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + e->addParameter(name, value); + } + break; default: break; } diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Edge.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Edge.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Edge.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Edge.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Edge.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_Edge.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting edge values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_InductionLoop.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_InductionLoop.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_InductionLoop.cpp 2014-06-08 22:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_InductionLoop.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_InductionLoop.cpp 16558 2014-06-07 22:22:51Z behrisch $ +/// @version $Id: TraCIServerAPI_InductionLoop.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting induction loop values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,7 +36,6 @@ #include "TraCIConstants.h" #include #include -#include #include "TraCIServerAPI_InductionLoop.h" #ifdef CHECK_MEMORY_LEAKS diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_InductionLoop.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_InductionLoop.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_InductionLoop.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_InductionLoop.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_InductionLoop.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_InductionLoop.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting induction loop values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Junction.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Junction.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Junction.cpp 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Junction.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Mario Krumnow /// @author Jakob Erdmann /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Junction.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: TraCIServerAPI_Junction.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting junction values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Junction.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Junction.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Junction.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Junction.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Junction.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_Junction.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting junction values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Lane.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Lane.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Lane.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Lane.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Laura Bieker /// @author Mario Krumnow /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Lane.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: TraCIServerAPI_Lane.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // APIs for getting/setting lane values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -65,6 +65,7 @@ && variable != LAST_STEP_VEHICLE_ID_LIST && variable != LAST_STEP_OCCUPANCY && variable != LAST_STEP_VEHICLE_HALTING_NUMBER && variable != LAST_STEP_LENGTH && variable != VAR_CURRENT_TRAVELTIME && variable != LANE_ALLOWED && variable != LANE_DISALLOWED && variable != VAR_WIDTH && variable != ID_COUNT + && variable != VAR_PARAMETER ) { return server.writeErrorStatusCmd(CMD_GET_LANE_VARIABLE, "Get Lane Variable: unsupported variable specified", outputStorage); } @@ -279,6 +280,15 @@ tempMsg.writeUnsignedByte(TYPE_DOUBLE); tempMsg.writeDouble(lane->getWidth()); break; + case VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(RESPONSE_GET_LANE_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + tempMsg.writeUnsignedByte(TYPE_STRING); + tempMsg.writeString(lane->getParameter(paramName, "")); + } + break; default: break; } @@ -295,7 +305,8 @@ std::string warning = ""; // additional description for response // variable int variable = inputStorage.readUnsignedByte(); - if (variable != VAR_MAXSPEED && variable != VAR_LENGTH && variable != LANE_ALLOWED && variable != LANE_DISALLOWED) { + if (variable != VAR_MAXSPEED && variable != VAR_LENGTH && variable != LANE_ALLOWED && variable != LANE_DISALLOWED + && variable != VAR_PARAMETER) { return server.writeErrorStatusCmd(CMD_SET_LANE_VARIABLE, "Change Lane State: unsupported variable specified", outputStorage); } // id @@ -340,6 +351,23 @@ l->getEdge().rebuildAllowedLanes(); } break; + case VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { + return server.writeErrorStatusCmd(CMD_SET_LANE_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //readt itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(CMD_SET_LANE_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(CMD_SET_LANE_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + l->addParameter(name, value); + } + break; default: break; } diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Lane.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Lane.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Lane.h 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Lane.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Lane.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: TraCIServerAPI_Lane.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting lane values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_MeMeDetector.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_MeMeDetector.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_MeMeDetector.cpp 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_MeMeDetector.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_MeMeDetector.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_MeMeDetector.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting multi-entry/multi-exit detector values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -33,7 +33,6 @@ #include "TraCIConstants.h" #include -#include #include "TraCIServerAPI_MeMeDetector.h" #ifdef CHECK_MEMORY_LEAKS @@ -82,7 +81,7 @@ break; case LAST_STEP_VEHICLE_NUMBER: tempMsg.writeUnsignedByte(TYPE_INTEGER); - tempMsg.writeInt((int) e3->getVehiclesWithin()); + tempMsg.writeInt(e3->getVehiclesWithin()); break; case LAST_STEP_MEAN_SPEED: tempMsg.writeUnsignedByte(TYPE_DOUBLE); @@ -96,7 +95,7 @@ break; case LAST_STEP_VEHICLE_HALTING_NUMBER: tempMsg.writeUnsignedByte(TYPE_INTEGER); - tempMsg.writeInt((int) e3->getCurrentHaltingNumber()); + tempMsg.writeInt(e3->getCurrentHaltingNumber()); break; default: break; diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_MeMeDetector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_MeMeDetector.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_MeMeDetector.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_MeMeDetector.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_MeMeDetector.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_MeMeDetector.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting multi-entry/multi-exit detector values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Person.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Person.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Person.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Person.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,234 @@ +/****************************************************************************/ +/// @file TraCIServerAPI_Person.cpp +/// @author Daniel Krajzewicz +/// @date 26.05.2014 +/// @version $Id: TraCIServerAPI_Person.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// APIs for getting/setting person values via TraCI +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 + +#ifndef NO_TRACI + +#include +#include +#include +#include +#include "TraCIConstants.h" +#include "TraCIServer.h" +#include "TraCIServerAPI_Person.h" +#include "TraCIServerAPI_VehicleType.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +bool +TraCIServerAPI_Person::processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + // variable + int variable = inputStorage.readUnsignedByte(); + std::string id = inputStorage.readString(); + // check variable + if (variable != ID_LIST && variable != ID_COUNT + && variable != VAR_POSITION && variable != VAR_POSITION3D && variable != VAR_ANGLE && variable != VAR_SPEED + && variable != VAR_ROAD_ID && variable != VAR_LANEPOSITION + && variable != VAR_WIDTH && variable != VAR_LENGTH && variable != VAR_MINGAP + && variable != VAR_TYPE && variable != VAR_SHAPECLASS && variable != VAR_COLOR + && variable != VAR_WAITING_TIME && variable != VAR_PARAMETER + ) { + return server.writeErrorStatusCmd(CMD_GET_PERSON_VARIABLE, "Get Person Variable: unsupported variable specified", outputStorage); + } + // begin response building + tcpip::Storage tempMsg; + // response-code, variableID, objectID + tempMsg.writeUnsignedByte(RESPONSE_GET_PERSON_VARIABLE); + tempMsg.writeUnsignedByte(variable); + tempMsg.writeString(id); + MSPersonControl& c = MSNet::getInstance()->getPersonControl(); + if (variable == ID_LIST || variable == ID_COUNT) { + if (variable == ID_LIST) { + std::vector ids; + for (MSPersonControl::constVehIt i = c.loadedPersonsBegin(); i != c.loadedPersonsEnd(); ++i) { + ids.push_back((*i).first); + } + tempMsg.writeUnsignedByte(TYPE_STRINGLIST); + tempMsg.writeStringList(ids); + } else { + tempMsg.writeUnsignedByte(TYPE_INTEGER); + tempMsg.writeInt((int) c.size()); + } + } else { + MSPerson* p = c.get(id); + if (p == 0) { + return server.writeErrorStatusCmd(CMD_GET_PERSON_VARIABLE, "Person '" + id + "' is not known", outputStorage); + } + switch (variable) { + case VAR_POSITION: { + tempMsg.writeUnsignedByte(POSITION_2D); + tempMsg.writeDouble(p->getPosition().x()); + tempMsg.writeDouble(p->getPosition().y()); + } + break; + case VAR_POSITION3D: + tempMsg.writeUnsignedByte(POSITION_3D); + tempMsg.writeDouble(p->getPosition().x()); + tempMsg.writeDouble(p->getPosition().y()); + tempMsg.writeDouble(p->getPosition().z()); + break; + case VAR_ANGLE: + tempMsg.writeUnsignedByte(TYPE_DOUBLE); + tempMsg.writeDouble(p->getAngle()); + break; + case VAR_SPEED: + tempMsg.writeUnsignedByte(TYPE_DOUBLE); + tempMsg.writeDouble(p->getSpeed()); + break; + case VAR_ROAD_ID: + tempMsg.writeUnsignedByte(TYPE_STRING); + tempMsg.writeString(p->getEdge()->getID()); + break; + case VAR_LANEPOSITION: + tempMsg.writeUnsignedByte(TYPE_DOUBLE); + tempMsg.writeDouble(p->getEdgePos()); + break; + case VAR_COLOR: + tempMsg.writeUnsignedByte(TYPE_COLOR); + tempMsg.writeUnsignedByte(p->getParameter().color.red()); + tempMsg.writeUnsignedByte(p->getParameter().color.green()); + tempMsg.writeUnsignedByte(p->getParameter().color.blue()); + tempMsg.writeUnsignedByte(p->getParameter().color.alpha()); + break; + case VAR_WAITING_TIME: + tempMsg.writeUnsignedByte(TYPE_DOUBLE); + tempMsg.writeDouble(p->getWaitingSeconds()); + break; + case VAR_TYPE: + tempMsg.writeUnsignedByte(TYPE_STRING); + tempMsg.writeString(p->getVehicleType().getID()); + break; + case VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(CMD_GET_PERSON_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + tempMsg.writeUnsignedByte(TYPE_STRING); + tempMsg.writeString(p->getParameter().getParameter(paramName, "")); + } + default: + TraCIServerAPI_VehicleType::getVariable(variable, p->getVehicleType(), tempMsg); + break; + } + } + server.writeStatusCmd(CMD_GET_PERSON_VARIABLE, RTYPE_OK, "", outputStorage); + server.writeResponseWithLength(outputStorage, tempMsg); + return true; +} + + +bool +TraCIServerAPI_Person::processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + std::string warning = ""; // additional description for response + // variable + int variable = inputStorage.readUnsignedByte(); + if (variable != VAR_PARAMETER + ) { + return server.writeErrorStatusCmd(CMD_SET_PERSON_VARIABLE, "Change Person State: unsupported variable specified", outputStorage); + } + // id + MSPersonControl& c = MSNet::getInstance()->getPersonControl(); + std::string id = inputStorage.readString(); + MSPerson* p = c.get(id); + if (p == 0) { + return server.writeErrorStatusCmd(CMD_SET_PERSON_VARIABLE, "Person '" + id + "' is not known", outputStorage); + } + // process + switch (variable) { + case VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { + return server.writeErrorStatusCmd(CMD_SET_PERSON_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //readt itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(CMD_SET_PERSON_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(CMD_SET_PERSON_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + ((SUMOVehicleParameter&) p->getParameter()).addParameter(name, value); + } + break; + default: + /* + try { + if (!TraCIServerAPI_VehicleType::setVariable(CMD_SET_PERSON_VARIABLE, variable, getSingularType(v), server, inputStorage, outputStorage)) { + return false; + } + } catch (ProcessError& e) { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, e.what(), outputStorage); + } + */ + break; + } + server.writeStatusCmd(CMD_SET_PERSON_VARIABLE, RTYPE_OK, warning, outputStorage); + return true; +} + + +bool +TraCIServerAPI_Person::getPosition(const std::string& id, Position& p) { + MSPerson* person = dynamic_cast(MSNet::getInstance()->getPersonControl().get(id)); + if (person == 0) { + return false; + } + p = person->getPosition(); + return true; +} + + +/* +MSVehicleType& +TraCIServerAPI_Person::getSingularType(MSPerson* const person) { + const MSVehicleType& oType = person->getVehicleType(); + std::string newID = oType.getID().find('@') == std::string::npos ? oType.getID() + "@" + person->getID() : oType.getID(); + MSVehicleType* type = MSVehicleType::build(newID, &oType); + person->replaceVehicleType(type); + return *type; +} +*/ + + + +#endif + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Person.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Person.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Person.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Person.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,98 @@ +/****************************************************************************/ +/// @file TraCIServerAPI_Person.h +/// @author Daniel Krajzewicz +/// @date 26.05.2014 +/// @version $Id: TraCIServerAPI_Person.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// APIs for getting/setting person values via TraCI +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 TraCIServerAPI_Person_h +#define TraCIServerAPI_Person_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#ifndef NO_TRACI + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class TraCIServer; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class TraCIServerAPI_Person + * @brief APIs for getting/setting person values via TraCI + */ +class TraCIServerAPI_Person { +public: + /** @brief Processes a get value command (Command 0xae: Get Person Variable) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + + /** @brief Processes a set value command (Command 0xce: Change Person State) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + + /** @brief Returns the named persons's position + * @param[in] id The id of the searched person + * @param[out] p The position, if the person is on the network + * @return Whether the person is known + */ + static bool getPosition(const std::string& id, Position& p); + +private: + //static MSVehicleType& getSingularType(MSPerson* const person); + +private: + /// @brief invalidated copy constructor + TraCIServerAPI_Person(const TraCIServerAPI_Person& s); + + /// @brief invalidated assignment operator + TraCIServerAPI_Person& operator=(const TraCIServerAPI_Person& s); + + +}; + + +#endif + +#endif + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_POI.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_POI.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_POI.cpp 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_POI.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_POI.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: TraCIServerAPI_POI.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // APIs for getting/setting POI values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 20019-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 20019-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -54,7 +54,8 @@ int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); // check variable - if (variable != ID_LIST && variable != VAR_TYPE && variable != VAR_COLOR && variable != VAR_POSITION && variable != ID_COUNT) { + if (variable != ID_LIST && variable != VAR_TYPE && variable != VAR_COLOR && variable != VAR_POSITION && variable != ID_COUNT + && variable != VAR_PARAMETER) { return server.writeErrorStatusCmd(CMD_GET_POI_VARIABLE, "Get PoI Variable: unsupported variable specified", outputStorage); } // begin response building @@ -97,6 +98,15 @@ tempMsg.writeDouble(p->x()); tempMsg.writeDouble(p->y()); break; + case VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(CMD_GET_POI_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + tempMsg.writeUnsignedByte(TYPE_STRING); + tempMsg.writeString(p->getParameter(paramName, "")); + } + break; default: break; } @@ -114,7 +124,7 @@ // variable int variable = inputStorage.readUnsignedByte(); if (variable != VAR_TYPE && variable != VAR_COLOR && variable != VAR_POSITION - && variable != ADD && variable != REMOVE) { + && variable != ADD && variable != REMOVE && variable != VAR_PARAMETER) { return server.writeErrorStatusCmd(CMD_SET_POI_VARIABLE, "Change PoI State: unsupported variable specified", outputStorage); } // id @@ -194,6 +204,23 @@ } } break; + case VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { + return server.writeErrorStatusCmd(CMD_SET_POI_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //readt itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(CMD_SET_POI_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(CMD_SET_POI_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + p->addParameter(name, value); + } + break; default: break; } diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_POI.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_POI.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_POI.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_POI.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_POI.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_POI.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting POI values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Polygon.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Polygon.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Polygon.cpp 2014-03-24 23:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Polygon.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Jakob Erdmann /// @author Christoph Sommer /// @date Sept 2002 -/// @version $Id: TraCIServerAPI_Polygon.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: TraCIServerAPI_Polygon.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // APIs for getting/setting polygon values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -57,7 +57,7 @@ std::string id = inputStorage.readString(); // check variable if (variable != ID_LIST && variable != VAR_TYPE && variable != VAR_COLOR && variable != VAR_SHAPE && variable != VAR_FILL - && variable != ID_COUNT) { + && variable != ID_COUNT && variable != VAR_PARAMETER) { return server.writeErrorStatusCmd(CMD_GET_POLYGON_VARIABLE, "Get Polygon Variable: unsupported variable specified", outputStorage); } // begin response building @@ -107,6 +107,15 @@ tempMsg.writeUnsignedByte(TYPE_UBYTE); tempMsg.writeUnsignedByte(p->getFill() ? 1 : 0); break; + case VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(CMD_GET_POLYGON_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + tempMsg.writeUnsignedByte(TYPE_STRING); + tempMsg.writeString(p->getParameter(paramName, "")); + } + break; default: break; } @@ -124,7 +133,7 @@ // variable int variable = inputStorage.readUnsignedByte(); if (variable != VAR_TYPE && variable != VAR_COLOR && variable != VAR_SHAPE && variable != VAR_FILL - && variable != ADD && variable != REMOVE) { + && variable != ADD && variable != REMOVE && variable != VAR_PARAMETER) { return server.writeErrorStatusCmd(CMD_SET_POLYGON_VARIABLE, "Change Polygon State: unsupported variable specified", outputStorage); } // id @@ -216,6 +225,23 @@ } } break; + case VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { + return server.writeErrorStatusCmd(CMD_SET_POLYGON_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //readt itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(CMD_SET_POLYGON_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(CMD_SET_POLYGON_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + p->addParameter(name, value); + } + break; default: break; } diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Polygon.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Polygon.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Polygon.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Polygon.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Polygon.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_Polygon.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting polygon values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Route.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Route.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Route.cpp 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Route.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Route.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_Route.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // APIs for getting/setting route values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -53,7 +53,7 @@ int variable = inputStorage.readUnsignedByte(); std::string id = inputStorage.readString(); // check variable - if (variable != ID_LIST && variable != VAR_EDGES && variable != ID_COUNT) { + if (variable != ID_LIST && variable != VAR_EDGES && variable != ID_COUNT && variable != VAR_PARAMETER) { return server.writeErrorStatusCmd(CMD_GET_ROUTE_VARIABLE, "Get Route Variable: unsupported variable specified", outputStorage); } // begin response building @@ -86,6 +86,15 @@ tempMsg.writeString((*i)->getID()); } break; + case VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(CMD_GET_ROUTE_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + tempMsg.writeUnsignedByte(TYPE_STRING); + tempMsg.writeString(r->getParameter(paramName, "")); + } + break; default: break; } @@ -102,11 +111,18 @@ std::string warning = ""; // additional description for response // variable int variable = inputStorage.readUnsignedByte(); - if (variable != ADD) { + if (variable != ADD && variable != VAR_PARAMETER) { return server.writeErrorStatusCmd(CMD_SET_ROUTE_VARIABLE, "Change Route State: unsupported variable specified", outputStorage); } // id std::string id = inputStorage.readString(); + const MSRoute* r = 0; + if (variable != ADD) { + r = MSRoute::dictionary(id); + if (r == 0) { + return server.writeErrorStatusCmd(CMD_SET_ROUTE_VARIABLE, "Route '" + id + "' is not known", outputStorage); + } + } // process switch (variable) { case ADD: { @@ -115,7 +131,7 @@ return server.writeErrorStatusCmd(CMD_SET_ROUTE_VARIABLE, "A string list is needed for adding a new route.", outputStorage); } //read itemNo - MSEdgeVector edges; + ConstMSEdgeVector edges; for (std::vector::const_iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) { MSEdge* edge = MSEdge::dictionary(*i); if (edge == 0) { @@ -129,6 +145,23 @@ } } break; + case VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { + return server.writeErrorStatusCmd(CMD_SET_ROUTE_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //readt itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(CMD_SET_ROUTE_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(CMD_SET_ROUTE_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + ((MSRoute*) r)->addParameter(name, value); + } + break; default: break; } diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Route.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Route.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Route.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Route.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Route.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_Route.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting route values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Simulation.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Simulation.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Simulation.cpp 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Simulation.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: TraCIServerAPI_Simulation.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_Simulation.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting edge values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -415,7 +415,7 @@ pos1.set(p1x, p1y); } if (posType == POSITION_3D) { - inputStorage.readDouble(); // z value is ignored + inputStorage.readDouble();// z value is ignored } roadPos1 = convertCartesianToRoadMap(pos1); break; @@ -445,7 +445,7 @@ pos2.set(p2x, p2y); } if (posType == POSITION_3D) { - inputStorage.readDouble(); // z value is ignored + inputStorage.readDouble();// z value is ignored } roadPos2 = convertCartesianToRoadMap(pos2); break; @@ -464,7 +464,7 @@ // same edge distance = roadPos2.second - roadPos1.second; } else { - MSEdgeVector newRoute; + ConstMSEdgeVector newRoute; MSNet::getInstance()->getRouterTT().compute( &roadPos1.first->getEdge(), &roadPos2.first->getEdge(), 0, MSNet::getInstance()->getCurrentTimeStep(), newRoute); MSRoute route("", newRoute, false, 0, std::vector()); diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Simulation.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Simulation.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Simulation.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Simulation.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Simulation.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_Simulation.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting edge values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_TLS.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_TLS.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_TLS.cpp 2014-05-05 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_TLS.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_TLS.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: TraCIServerAPI_TLS.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // APIs for getting/setting traffic light values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,6 +36,7 @@ #include "TraCIConstants.h" #include #include +#include #include "TraCIServerAPI_TLS.h" #ifdef CHECK_MEMORY_LEAKS @@ -56,7 +57,8 @@ if (variable != ID_LIST && variable != TL_RED_YELLOW_GREEN_STATE && variable != TL_COMPLETE_DEFINITION_RYG && variable != TL_CONTROLLED_LANES && variable != TL_CONTROLLED_LINKS && variable != TL_CURRENT_PHASE && variable != TL_CURRENT_PROGRAM - && variable != TL_NEXT_SWITCH && variable != TL_PHASE_DURATION && variable != ID_COUNT) { + && variable != TL_NEXT_SWITCH && variable != TL_PHASE_DURATION && variable != ID_COUNT + && variable != VAR_PARAMETER && variable != TL_EXTERNAL_STATE) { return server.writeErrorStatusCmd(CMD_GET_TL_VARIABLE, "Get TLS Variable: unsupported variable specified", outputStorage); } // begin response building @@ -208,9 +210,75 @@ tempMsg.writeUnsignedByte(TYPE_INTEGER); tempMsg.writeInt((int) vars.getActive()->getNextSwitchTime()); break; + case VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(CMD_GET_TL_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + tempMsg.writeUnsignedByte(TYPE_STRING); + tempMsg.writeString(vars.getActive()->getParameter(paramName, "")); + } + break; case TL_CONTROLLED_JUNCTIONS: { } break; + case TL_EXTERNAL_STATE: { + MSTrafficLightLogic* tls = vars.getActive(); + const std::string& state = tls->getCurrentPhaseDef().getState(); + const std::map& params = tls->getMap(); + unsigned int num = 0; + for (std::map::const_iterator i = params.begin(); i != params.end(); ++i) { + if ("connection:" == (*i).first.substr(0, 11)) { + ++num; + } + } + + tempMsg.writeUnsignedByte(TYPE_COMPOUND); + tempMsg.writeUnsignedByte(TYPE_INTEGER); + tempMsg.writeInt(num * 2); + for (std::map::const_iterator i = params.begin(); i != params.end(); ++i) { + if ("connection:" != (*i).first.substr(0, 11)) { + continue; + } + tempMsg.writeUnsignedByte(TYPE_STRING); + tempMsg.writeString((*i).second); // foreign id + std::string connection = (*i).first.substr(11); + std::string from, to; + size_t b = connection.find("->"); + if (b == std::string::npos) { + from = connection; + } else { + from = connection.substr(0, b); + to = connection.substr(b + 2); + } + bool denotesEdge = from.find("_") == std::string::npos; + MSLane* fromLane = 0; + const MSTrafficLightLogic::LaneVectorVector& lanes = tls->getLaneVectors(); + MSTrafficLightLogic::LaneVectorVector::const_iterator j = lanes.begin(); + for (; j != lanes.end() && fromLane == 0;) { + for (MSTrafficLightLogic::LaneVector::const_iterator k = (*j).begin(); k != (*j).end() && fromLane == 0;) { + if (denotesEdge && (*k)->getEdge().getID() == from) { + fromLane = *k; + } else if (!denotesEdge && (*k)->getID() == from) { + fromLane = *k; + } + if (fromLane == 0) { + ++k; + } + } + if (fromLane == 0) { + ++j; + } + } + if (fromLane == 0) { + return server.writeErrorStatusCmd(CMD_GET_TL_VARIABLE, "Could not find edge or lane '" + from + "' in traffic light '" + id + "'.", outputStorage); + } + int pos = (int)std::distance(lanes.begin(), j); + tempMsg.writeUnsignedByte(TYPE_UBYTE); + tempMsg.writeUnsignedByte(state[pos]); // state + } + } + break; default: break; } @@ -227,8 +295,9 @@ std::string warning = ""; // additional description for response // variable int variable = inputStorage.readUnsignedByte(); - if (variable != TL_PHASE_INDEX && variable != TL_PROGRAM - && variable != TL_PHASE_DURATION && variable != TL_RED_YELLOW_GREEN_STATE && variable != TL_COMPLETE_PROGRAM_RYG) { + if (variable != TL_PHASE_INDEX && variable != TL_PROGRAM && variable != TL_PHASE_DURATION + && variable != TL_RED_YELLOW_GREEN_STATE && variable != TL_COMPLETE_PROGRAM_RYG + && variable != VAR_PARAMETER) { return server.writeErrorStatusCmd(CMD_SET_TL_VARIABLE, "Change TLS State: unsupported variable specified", outputStorage); } std::string id = inputStorage.readString(); @@ -336,6 +405,23 @@ } } break; + case VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { + return server.writeErrorStatusCmd(CMD_SET_TL_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //readt itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(CMD_SET_TL_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(CMD_SET_TL_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + vars.getActive()->addParameter(name, value); + } + break; default: break; } diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_TLS.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_TLS.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_TLS.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_TLS.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_TLS.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_TLS.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting traffic light values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Vehicle.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Vehicle.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Vehicle.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Vehicle.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -8,12 +8,12 @@ /// @author Mario Krumnow /// @author Jakob Erdmann /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Vehicle.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: TraCIServerAPI_Vehicle.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // APIs for getting/setting vehicle values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -42,13 +42,13 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include #include #include -#include +#include #include "TraCIConstants.h" #include "TraCIServerAPI_Simulation.h" #include "TraCIServerAPI_Vehicle.h" @@ -58,6 +58,9 @@ #include #endif // CHECK_MEMORY_LEAKS +//#define DEBUG_VTD 1 +//#define DEBUG_VTD_ANGLE 1 + // =========================================================================== // static member variables @@ -94,6 +97,7 @@ && variable != VAR_ACCEL && variable != VAR_DECEL && variable != VAR_IMPERFECTION && variable != VAR_TAU && variable != VAR_BEST_LANES && variable != DISTANCE_REQUEST && variable != ID_COUNT && variable != VAR_STOPSTATE && variable != VAR_WAITING_TIME + && variable != VAR_PARAMETER ) { return server.writeErrorStatusCmd(CMD_GET_VEHICLE_VARIABLE, "Get Vehicle Variable: unsupported variable specified", outputStorage); } @@ -349,7 +353,9 @@ ++cnt; std::vector bestContIDs; for (std::vector::const_iterator j = lq.bestContinuations.begin(); j != lq.bestContinuations.end(); ++j) { - bestContIDs.push_back((*j)->getID()); + if ((*j) != 0) { + bestContIDs.push_back((*j)->getID()); + } } tempContent.writeUnsignedByte(TYPE_STRINGLIST); tempContent.writeStringList(bestContIDs); @@ -390,6 +396,15 @@ tempMsg.writeUnsignedByte(TYPE_DOUBLE); tempMsg.writeDouble(v->getChosenSpeedFactor()); break; + case VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(CMD_GET_VEHICLE_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + tempMsg.writeUnsignedByte(TYPE_STRING); + tempMsg.writeString(v->getParameter().getParameter(paramName, "")); + } + break; default: TraCIServerAPI_VehicleType::getVariable(variable, v->getVehicleType(), tempMsg); break; @@ -420,7 +435,7 @@ && variable != VAR_TAU && variable != VAR_LANECHANGE_MODE && variable != VAR_SPEED && variable != VAR_SPEEDSETMODE && variable != VAR_COLOR && variable != ADD && variable != ADD_FULL && variable != REMOVE - && variable != VAR_MOVE_TO_VTD + && variable != VAR_MOVE_TO_VTD && variable != VAR_PARAMETER/* && variable != VAR_SPEED_TIME_LINE && variable != VAR_LANE_TIME_LINE*/ ) { return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Change Vehicle State: unsupported variable specified", outputStorage); } @@ -467,6 +482,7 @@ // optional stop flags bool parking = false; bool triggered = false; + bool containerTriggered = false; if (compoundSize == 5) { int stopFlags; if (!server.readTypeCheckingByte(inputStorage, stopFlags)) { @@ -489,8 +505,9 @@ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "No lane with index '" + toString(laneIndex) + "' on road '" + roadId + "'.", outputStorage); } // Forward command to vehicle - if (!v->addTraciStop(allLanes[laneIndex], pos, 0, waitTime, parking, triggered)) { - return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Vehicle is too close or behind the stop on '" + allLanes[laneIndex]->getID() + "'.", outputStorage); + std::string error; + if (!v->addTraciStop(allLanes[laneIndex], pos, 0, waitTime, parking, triggered, containerTriggered, error)) { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, error, outputStorage); } } break; @@ -547,6 +564,38 @@ v->getInfluencer().setLaneTimeLine(laneTimeLine); } break; + /* + case VAR_LANE_TIME_LINE: { + if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Lane change needs a compound object description.", outputStorage); + } + if (inputStorage.readInt() != 2) { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Lane change needs a compound object description of two items.", outputStorage); + } + // Lane ID + int laneIndex = 0; + if (!server.readTypeCheckingByte(inputStorage, laneIndex)) { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The first lane change parameter must be the lane index given as a byte.", outputStorage); + } + // stickyTime + SUMOTime stickyTime = 0; + if (!server.readTypeCheckingInt(inputStorage, stickyTime)) { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The second lane change parameter must be the duration given as an integer.", outputStorage); + } + if ((laneIndex < 0) || (laneIndex >= (int)(v->getEdge()->getLanes().size()))) { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "No lane existing with given id on the current road", outputStorage); + } + // Forward command to vehicle + std::vector > laneTimeLine; + laneTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep(), laneIndex)); + laneTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep() + stickyTime, laneIndex)); + 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: { if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Slow down needs a compound object description.", outputStorage); @@ -584,7 +633,7 @@ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Can not retrieve road with ID " + edgeID, outputStorage); } // build a new route between the vehicle's current edge and destination edge - MSEdgeVector newRoute; + ConstMSEdgeVector newRoute; const MSEdge* currentEdge = v->getRerouteOrigin(); MSNet::getInstance()->getRouterTT().compute( currentEdge, destEdge, (const MSVehicle * const) v, MSNet::getInstance()->getCurrentTimeStep(), newRoute); @@ -625,7 +674,7 @@ if (!server.readTypeCheckingStringList(inputStorage, edgeIDs)) { return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "A route must be defined as a list of edge ids.", outputStorage); } - std::vector edges; + ConstMSEdgeVector edges; MSEdge::parseEdgesList(edgeIDs, edges, ""); if (!v->replaceRouteEdges(edges, v->getLane() == 0)) { return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Route replacement failed for " + v->getID(), outputStorage); @@ -972,7 +1021,7 @@ SUMOVehicleParameter* params = new SUMOVehicleParameter(vehicleParams); try { - SUMOVehicle* vehicle = MSNet::getInstance()->getVehicleControl().buildVehicle(params, route, vehicleType); + SUMOVehicle* vehicle = MSNet::getInstance()->getVehicleControl().buildVehicle(params, route, vehicleType, true, false); MSNet::getInstance()->getVehicleControl().addVehicle(vehicleParams.id, vehicle); MSNet::getInstance()->getInsertionControl().add(vehicle); } catch (ProcessError& e) { @@ -1083,7 +1132,7 @@ SUMOVehicleParameter* params = new SUMOVehicleParameter(vehicleParams); try { - SUMOVehicle* vehicle = MSNet::getInstance()->getVehicleControl().buildVehicle(params, route, vehicleType); + SUMOVehicle* vehicle = MSNet::getInstance()->getVehicleControl().buildVehicle(params, route, vehicleType, true, false); MSNet::getInstance()->getVehicleControl().addVehicle(vehicleParams.id, vehicle); MSNet::getInstance()->getInsertionControl().add(vehicle); } catch (ProcessError& e) { @@ -1133,8 +1182,8 @@ if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting VTD vehicle requires a compound object.", outputStorage); } - if (inputStorage.readInt() != 4) { - return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting VTD vehicle should obtain: edgeID, lane, x, y.", outputStorage); + if (inputStorage.readInt() != 5) { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Setting VTD vehicle should obtain: edgeID, lane, x, y, angle.", outputStorage); } // edge ID std::string edgeID; @@ -1147,7 +1196,7 @@ return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The second parameter for setting a VTD vehicle must be lane given as an int.", outputStorage); } // x - double x = 0, y = 0; + double x = 0, y = 0, angle = 0; if (!server.readTypeCheckingDouble(inputStorage, x)) { return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The third parameter for setting a VTD vehicle must be the x-position given as a double.", outputStorage); } @@ -1155,6 +1204,10 @@ if (!server.readTypeCheckingDouble(inputStorage, y)) { return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The fourth parameter for setting a VTD vehicle must be the y-position given as a double.", outputStorage); } + // angle + if (!server.readTypeCheckingDouble(inputStorage, angle)) { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The fifth parameter for setting a VTD vehicle must be the angle given as a double.", outputStorage); + } // process if (!v->isOnRoad()) { break; @@ -1165,48 +1218,40 @@ laneNum = -laneNum; } Position pos(x, y); + angle *= -1.; + if (fabs(angle) > 180.) { + angle = 180. - angle; + } Position vehPos = v->getPosition(); - v->updateBestLanes(); - bool report = server.vtdDebug(); - if (report) { - std::cout << std::endl << "begin vehicle " << v->getID() << " vehPos:" << vehPos << " lane:" << v->getLane()->getID() << std::endl; - } - if (report) { - std::cout << " want pos:" << pos << " edge:" << edgeID << " laneNum:" << laneNum << std::endl; - } - - MSEdgeVector edgesA, edgesB, edgesC; - MSLane* laneA, *laneB, *laneC; - laneA = laneB = laneC = 0; - SUMOReal lanePosA, lanePosB, lanePosC; - SUMOReal bestDistanceA, bestDistanceB, bestDistanceC; - bestDistanceA = bestDistanceB = bestDistanceC = 1000.;//pos.distanceSquaredTo2D(vehPos); - int routeOffsetA, routeOffsetB, routeOffsetC; - routeOffsetA = routeOffsetB = routeOffsetC = 0; + v->getBestLanes(); +#ifdef DEBUG_VTD + std::cout << std::endl << "begin vehicle " << v->getID() << " vehPos:" << vehPos << " lane:" << v->getLane()->getID() << std::endl; + std::cout << " want pos:" << pos << " edge:" << edgeID << " laneNum:" << laneNum << " angle:" << angle << std::endl; +#endif + + ConstMSEdgeVector edges; + MSLane* lane = 0; + SUMOReal lanePos; + SUMOReal bestDistance = std::numeric_limits::max(); + int routeOffset = 0; // case a): edge/lane is known and matches route - bool aFound = vtdMap_matchingEdgeLane(pos, origID, *v, server.vtdDebug(), bestDistanceA, &laneA, lanePosA, routeOffsetA, edgesA); - // case b): position is at route, should be somewhere near to it - bool bFound = vtdMap_matchingRoutePosition(pos, origID, *v, server.vtdDebug(), bestDistanceB, &laneB, lanePosB, routeOffsetB, edgesB); - // case c) nearest matching lane - bool cFound = vtdMap_matchingNearest(pos, origID, *v, server, server.vtdDebug(), bestDistanceC, &laneC, lanePosC, routeOffsetC, edgesC); + bool dFound = vtdMap(pos, origID, angle, *v, server, bestDistance, &lane, lanePos, routeOffset, edges); // - SUMOReal maxRouteDistance = 50; + SUMOReal maxRouteDistance = 100; + /* if (cFound && (bestDistanceA > maxRouteDistance && bestDistanceC > maxRouteDistance)) { // both route-based approach yield in a position too far away from the submitted --> new route!? server.setVTDControlled(v, laneC, lanePosC, routeOffsetC, edgesC); } else { - // use the best we have - if (bFound) { - server.setVTDControlled(v, laneB, lanePosB, routeOffsetB, edgesB); - } else if (aFound) { - server.setVTDControlled(v, laneA, lanePosA, routeOffsetA, edgesA); - } else if (cFound) { - server.setVTDControlled(v, laneC, lanePosC, routeOffsetC, edgesC); - } else { - return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Could not map vehicle.", outputStorage); - } + */ + // use the best we have + if (dFound && maxRouteDistance > bestDistance) { + server.setVTDControlled(v, lane, lanePos, routeOffset, edges, MSNet::getInstance()->getCurrentTimeStep()); + } else { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "Could not map vehicle '" + id + "'.", outputStorage); } + //} } break; case VAR_SPEED_FACTOR: { @@ -1217,6 +1262,23 @@ v->setChosenSpeedFactor(factor); } break; + case VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //readt itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(CMD_SET_VEHICLE_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + ((SUMOVehicleParameter&) v->getParameter()).addParameter(name, value); + } + break; default: try { if (!TraCIServerAPI_VehicleType::setVariable(CMD_SET_VEHICLE_VARIABLE, variable, getSingularType(v), server, inputStorage, outputStorage)) { @@ -1233,203 +1295,134 @@ bool -TraCIServerAPI_Vehicle::vtdMap_matchingEdgeLane(const Position& pos, const std::string& origID, MSVehicle& v, bool report, - SUMOReal& bestDistance, MSLane** lane, SUMOReal& lanePos, int& routeOffset, MSEdgeVector& edges) { - UNUSED_PARAMETER(edges); - const std::map >& vtdMap = getOrBuildVTDMap(); - if (vtdMap.find(origID) == vtdMap.end()) { - if (report) { - std::cout << " a failed - lane not in map" << std::endl; - } - return false; - } - const std::vector& lanes = vtdMap.find(origID)->second; - for (std::vector::const_iterator i = lanes.begin(); i != lanes.end() && bestDistance > POSITION_EPS; ++i) { - MSLane* l = *i; - SUMOReal dist = l->getShape().distance(pos); - if (report) { - std::cout << " a at lane " << l->getID() << " dist:" << dist << " best:" << bestDistance << std::endl; - } - if (dist < bestDistance) { - bestDistance = dist; - *lane = l; - } - } - MSLane* pni = *lane; - while (pni != 0 && pni->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL && pni->getIncomingLanes().size() != 0) { - pni = pni->getIncomingLanes()[0].lane; - } - if (pni == 0 || pni->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { - // not found - if (report) { - std::cout << " a failed - no incoming lane" << std::endl; - } - return false; - } - const MSEdgeVector& tedges = v.getRoute().getEdges(); - MSEdgeVector::const_iterator p = std::find(tedges.begin() + v.getRoutePosition(), tedges.end(), &pni->getEdge()); - if (p != tedges.end()) { - lanePos = MAX2(SUMOReal(0), MIN2(SUMOReal((*lane)->getLength() - POSITION_EPS), (*lane)->getShape().nearest_offset_to_point2D(pos, false))); - routeOffset = (int)(std::distance(tedges.begin(), p) - v.getRoutePosition()); - if (report) { - std::cout << " a ok lane:" << (*lane)->getID() << " lanePos:" << lanePos << " routeOffset:" << routeOffset << std::endl; +TraCIServerAPI_Vehicle::vtdMap(const Position& pos, const std::string& origID, const SUMOReal angle, MSVehicle& v, TraCIServer& server, + SUMOReal& bestDistance, MSLane** lane, SUMOReal& lanePos, int& routeOffset, ConstMSEdgeVector& edges) { + SUMOReal speed = pos.distanceTo2D(v.getPosition()); // !!!v.getSpeed(); + std::set into; + PositionVector shape; + shape.push_back(pos); + server.collectObjectsInRange(CMD_GET_EDGE_VARIABLE, shape, speed * 2, into); + SUMOReal maxDist = 0; + std::map lane2utility; + for (std::set::const_iterator j = into.begin(); j != into.end(); ++j) { + MSEdge* e = MSEdge::dictionary(*j); + const MSEdge* prevEdge = 0; + const MSEdge* nextEdge = 0; + MSEdge::EdgeBasicFunction ef = e->getPurpose(); + bool onRoute = false; + if (ef != MSEdge::EDGEFUNCTION_INTERNAL) { + const ConstMSEdgeVector& ev = v.getRoute().getEdges(); + unsigned int routePosition = v.getRoutePosition(); + if (v.getLane()->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { + ++routePosition; + } + ConstMSEdgeVector::const_iterator edgePos = std::find(ev.begin() + routePosition, ev.end(), e); + onRoute = edgePos != ev.end(); + if (edgePos == ev.end() - 1 && v.getEdge() == e) { + onRoute &= v.getEdge()->getLanes()[0]->getLength() > v.getPositionOnLane() + SPEED2DIST(speed); + } + prevEdge = e; + nextEdge = !onRoute || edgePos == ev.end() - 1 ? 0 : *(edgePos + 1); + } else { + prevEdge = e; + while (prevEdge != 0 && prevEdge->getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { + MSLane* l = prevEdge->getLanes()[0]; + l = l->getLogicalPredecessorLane(); + prevEdge = l == 0 ? 0 : &l->getEdge(); + } + const ConstMSEdgeVector& ev = v.getRoute().getEdges(); + ConstMSEdgeVector::const_iterator prevEdgePos = std::find(ev.begin() + v.getRoutePosition(), ev.end(), prevEdge); + if (prevEdgePos != ev.end() && ev.size() > 1 && prevEdgePos != ev.end() - 1) { + const MSJunction* junction = e->getFromJunction(); + const ConstMSEdgeVector& outgoing = junction->getOutgoing(); + ConstMSEdgeVector::const_iterator nextEdgePos = std::find(outgoing.begin(), outgoing.end(), *(ev.begin() + v.getRoutePosition() + 1)); + if (nextEdgePos != outgoing.end()) { + nextEdge = *nextEdgePos; + onRoute = true; + } + } } - return true; - } - if (report) { - std::cout << " a failed - route position beyond route length" << std::endl; - } - return false; -} -bool -TraCIServerAPI_Vehicle::vtdMap_matchingRoutePosition(const Position& pos, const std::string& origID, MSVehicle& v, bool report, - SUMOReal& bestDistance, MSLane** lane, SUMOReal& lanePos, int& routeOffset, MSEdgeVector& edges) { - UNUSED_PARAMETER(edges); - UNUSED_PARAMETER(origID); - int lastBestRouteEdge = 0; - int lastRouteEdge = 0; - MSLane* bestRouteLane = 0; - const std::vector& bestLaneConts = v.getBestLanesContinuation(v.getLane()); - for (std::vector::const_iterator i = bestLaneConts.begin(); i != bestLaneConts.end() && bestDistance > POSITION_EPS; ++i) { - MSEdge& e = (*i)->getEdge(); - if (i != bestLaneConts.begin() && e.getPurpose() != MSEdge::EDGEFUNCTION_INTERNAL) { - ++lastRouteEdge; - } - const std::vector& lanes = e.getLanes(); - for (std::vector::const_iterator k = lanes.begin(); k != lanes.end() && bestDistance > POSITION_EPS; ++k) { - MSLane* cl = *k; - SUMOReal dist = cl->getShape().distance(pos); - if (report) { - std::cout << " b at lane " << cl->getID() << " dist:" << dist << " best:" << bestDistance << std::endl; - } - if (dist < bestDistance) { - bestDistance = dist; - *lane = cl; - lastBestRouteEdge = lastRouteEdge; - if (e.getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { - bestRouteLane = *i; + const std::vector& lanes = e->getLanes(); + for (std::vector::const_iterator k = lanes.begin(); k != lanes.end(); ++k) { + MSLane* lane = *k; + SUMOReal off = lane->getShape().nearest_offset_to_point2D(pos); + SUMOReal langle = 180.; + SUMOReal dist = 1000.; + if (off >= 0) { + dist = lane->getShape().distance(pos); + if (dist > lane->getLength()) { // this is a workaround + // a SmartDB, running at :49_2 delivers off=~9.24 while dist>24.? + dist = 1000.; } else { - bestRouteLane = *lane; + langle = lane->getShape().rotationDegreeAtOffset(off); } } + maxDist = MAX2(maxDist, dist); + bool sameEdge = &lane->getEdge() == &v.getLane()->getEdge() && v.getEdge()->getLanes()[0]->getLength() > v.getPositionOnLane() + SPEED2DIST(speed); + const MSEdge* rNextEdge = nextEdge; + if (rNextEdge == 0 && lane->getEdge().getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL) { + MSLane* next = lane->getLinkCont()[0]->getLane(); + rNextEdge = next == 0 ? 0 : &next->getEdge(); + } +#ifdef DEBUG_VTD_ANGLE + std::cout << lane->getID() << ": " << langle << " " << off << std::endl; +#endif + lane2utility[lane] = LaneUtility( + dist, GeomHelper::getMinAngleDiff(angle, langle), + lane->getParameter("origId", "") == origID, + onRoute, sameEdge, prevEdge, rNextEdge); } } - if (bestRouteLane == 0) { - if (report) { - std::cout << " b failed - no best route lane" << std::endl; - } - return false; - } - lanePos = MAX2(SUMOReal(0), MIN2(SUMOReal(bestRouteLane->getLength() - POSITION_EPS), bestRouteLane->getShape().nearest_offset_to_point2D(pos, false))); - routeOffset = lastBestRouteEdge; - if (report) { - std::cout << " b ok lane " << bestRouteLane->getID() << " lanePos:" << lanePos << " best:" << lastBestRouteEdge << std::endl; - } - return true; -} - -bool -TraCIServerAPI_Vehicle::vtdMap_matchingNearest(const Position& pos, const std::string& origID, MSVehicle& v, TraCIServer& server, bool report, - SUMOReal& bestDistance, MSLane** lane, SUMOReal& lanePos, int& routeOffset, MSEdgeVector& edges) { - UNUSED_PARAMETER(bestDistance); - 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; - SUMOReal dist = lane->getShape().distance(pos); - if (lane->knowsParameter("origId")) { - if (lane->getParameter("origId", "") == origID) { - if (dist < minDistNameMatchingLane) { - minDistNameMatchingLane = dist; - nameMatchingLane = lane; - } - } - } - if (dist < minDist) { - minDist = dist; - minDistLane = lane; - } - } + SUMOReal bestValue = 0; + MSLane* bestLane = 0; + for (std::map::iterator i = lane2utility.begin(); i != lane2utility.end(); ++i) { + MSLane* l = (*i).first; + const LaneUtility& u = (*i).second; + SUMOReal distN = u.dist > 999 ? -10 : 1. - (u.dist / maxDist); + SUMOReal angleDiffN = 1. - (u.angleDiff / 180.); + SUMOReal idN = u.ID ? 1 : 0; + SUMOReal onRouteN = u.onRoute ? 1 : 0; + SUMOReal sameEdgeN = u.sameEdge ? MIN2(v.getEdge()->getLength() / speed, (SUMOReal)1.) : 0; + SUMOReal value = distN * .5 + + angleDiffN * 0 /*.5 */ + + idN * .5 + + onRouteN * 0.5 + + sameEdgeN * 0.5 + ; +#ifdef DEBUG_VTD + std::cout << " x; l:" << l->getID() << " d:" << u.dist << " dN:" << distN << " aD:" << angleDiffN << + " ID:" << idN << " oRN:" << onRouteN << " sEN:" << sameEdgeN << " value:" << value << std::endl; +#endif + if (value > bestValue || bestLane == 0) { + bestValue = value; + bestLane = l; } } - *lane = nameMatchingLane != 0 ? nameMatchingLane : minDistLane; - if (lane == 0) { - if (report) { - std::cout << " c failed - no matching lane" << std::endl; - } + if (bestLane == 0) { return false; } - lanePos = (*lane)->interpolateGeometryPosToLanePos((*lane)->getShape().nearest_offset_to_point2D(pos, false)); - if (*lane == v.getLane()) { - routeOffset = 0; - if (report) { - std::cout << " c ok, on same lane" << std::endl; - } - return true; - } - 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 (found) { - // the matching lane is part of the route - routeOffset = rindex - v.getRoutePosition(); - if (report) { - std::cout << " c ok, on a different edge of same route" << std::endl; - } - return true; - } - // build new route - MSLane* firstLane = *lane; - if (destinationEdge.getPurpose() != MSEdge::EDGEFUNCTION_INTERNAL) { - edges.push_back(&destinationEdge); + const LaneUtility& u = lane2utility.find(bestLane)->second; + bestDistance = u.dist; + *lane = bestLane; + lanePos = bestLane->getShape().nearest_offset_to_point2D(pos); + const MSEdge* prevEdge = u.prevEdge; + if (u.onRoute) { + const ConstMSEdgeVector& ev = v.getRoute().getEdges(); + ConstMSEdgeVector::const_iterator prevEdgePos = std::find(ev.begin() + v.getRoutePosition(), ev.end(), prevEdge); + routeOffset = (int)std::distance(ev.begin(), prevEdgePos) - v.getRoutePosition(); } 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()); - } - if (report) { - std::cout << " c ok, on a different route" << std::endl; + edges.push_back(prevEdge); + if (u.nextEdge != 0) { + edges.push_back(u.nextEdge); + } + routeOffset = 0; } return true; } - bool TraCIServerAPI_Vehicle::commandDistanceRequest(TraCIServer& server, tcpip::Storage& inputStorage, tcpip::Storage& outputStorage, const MSVehicle* v) { @@ -1521,8 +1514,8 @@ const std::map >& TraCIServerAPI_Vehicle::getOrBuildVTDMap() { if (gVTDMap.size() == 0) { - const std::vector& edges = MSNet::getInstance()->getEdgeControl().getEdges(); - for (std::vector::const_iterator i = edges.begin(); i != edges.end(); ++i) { + const MSEdgeVector& edges = MSNet::getInstance()->getEdgeControl().getEdges(); + for (MSEdgeVector::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) { if ((*j)->knowsParameter("origId")) { diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Vehicle.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Vehicle.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_Vehicle.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_Vehicle.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_Vehicle.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_Vehicle.h 18096 2015-03-17 09:50:59Z behrisch $ /// // APIs for getting/setting vehicle values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -84,16 +84,29 @@ static const std::map >& getOrBuildVTDMap(); - static bool vtdMap_matchingEdgeLane(const Position& pos, const std::string& origID, MSVehicle& v, bool report, - SUMOReal& bestDistance, MSLane** lane, SUMOReal& lanePos, int& routeOffset, MSEdgeVector& edges); - static bool vtdMap_matchingRoutePosition(const Position& pos, const std::string& origID, MSVehicle& v, bool report, - SUMOReal& bestDistance, MSLane** lane, SUMOReal& lanePos, int& routeOffset, MSEdgeVector& edges); - static bool vtdMap_matchingNearest(const Position& pos, const std::string& origID, MSVehicle& v, TraCIServer& server, bool report, - SUMOReal& bestDistance, MSLane** lane, SUMOReal& lanePos, int& routeOffset, MSEdgeVector& edges); + static bool vtdMap(const Position& pos, const std::string& origID, const SUMOReal angle, MSVehicle& v, TraCIServer& server, + SUMOReal& bestDistance, MSLane** lane, SUMOReal& lanePos, int& routeOffset, ConstMSEdgeVector& edges); static std::map > gVTDMap; + class LaneUtility { + public: + LaneUtility(SUMOReal dist_, SUMOReal angleDiff_, bool ID_, bool onRoute_, bool sameEdge_, const MSEdge* prevEdge_, const MSEdge* nextEdge_) : + dist(dist_), angleDiff(angleDiff_), ID(ID_), onRoute(onRoute_), sameEdge(sameEdge_), prevEdge(prevEdge_), nextEdge(nextEdge_) {} + LaneUtility() {} + ~LaneUtility() {} + + SUMOReal dist; + SUMOReal angleDiff; + bool ID; + bool onRoute; + bool sameEdge; + const MSEdge* prevEdge; + const MSEdge* nextEdge; + }; + + private: /// @brief invalidated copy constructor TraCIServerAPI_Vehicle(const TraCIServerAPI_Vehicle& s); diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_VehicleType.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_VehicleType.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_VehicleType.cpp 2014-04-11 22:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_VehicleType.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_VehicleType.cpp 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: TraCIServerAPI_VehicleType.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // APIs for getting/setting vehicle type values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -58,7 +58,8 @@ if (variable != ID_LIST && variable != VAR_LENGTH && variable != VAR_MAXSPEED && variable != VAR_ACCEL && variable != VAR_DECEL && variable != VAR_TAU && variable != VAR_VEHICLECLASS && variable != VAR_EMISSIONCLASS && variable != VAR_SHAPECLASS && variable != VAR_SPEED_FACTOR && variable != VAR_SPEED_DEVIATION && variable != VAR_IMPERFECTION - && variable != VAR_MINGAP && variable != VAR_WIDTH && variable != VAR_COLOR && variable != ID_COUNT) { + && variable != VAR_MINGAP && variable != VAR_WIDTH && variable != VAR_COLOR && variable != ID_COUNT + && variable != VAR_PARAMETER) { return server.writeErrorStatusCmd(CMD_GET_VEHICLETYPE_VARIABLE, "Get Vehicle Type Variable: unsupported variable specified", outputStorage); } // begin response building @@ -83,7 +84,20 @@ if (v == 0) { return server.writeErrorStatusCmd(CMD_GET_VEHICLETYPE_VARIABLE, "Vehicle type '" + id + "' is not known", outputStorage); } - getVariable(variable, *v, tempMsg); + switch (variable) { + case VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(CMD_GET_VEHICLETYPE_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + tempMsg.writeUnsignedByte(TYPE_STRING); + tempMsg.writeString(v->getParameter().getParameter(paramName, "")); + } + break; + default: + getVariable(variable, *v, tempMsg); + break; + } } server.writeStatusCmd(CMD_GET_VEHICLETYPE_VARIABLE, RTYPE_OK, "", outputStorage); server.writeResponseWithLength(outputStorage, tempMsg); @@ -168,7 +182,7 @@ && variable != VAR_SPEED_FACTOR && variable != VAR_SPEED_DEVIATION && variable != VAR_EMISSIONCLASS && variable != VAR_WIDTH && variable != VAR_MINGAP && variable != VAR_SHAPECLASS && variable != VAR_ACCEL && variable != VAR_DECEL && variable != VAR_IMPERFECTION - && variable != VAR_TAU && variable != VAR_COLOR + && variable != VAR_TAU && variable != VAR_COLOR && variable != VAR_PARAMETER ) { return server.writeErrorStatusCmd(CMD_SET_VEHICLETYPE_VARIABLE, "Change Vehicle Type State: unsupported variable specified", outputStorage); } @@ -201,7 +215,7 @@ if (!server.readTypeCheckingDouble(inputStorage, value)) { return server.writeErrorStatusCmd(cmd, "Setting length requires a double.", outputStorage); } - if (value == 0.0 || fabs(value) == std::numeric_limits::infinity()) { + if (value <= 0.0 || fabs(value) == std::numeric_limits::infinity()) { return server.writeErrorStatusCmd(cmd, "Invalid length.", outputStorage); } v.setLength(value); @@ -212,7 +226,7 @@ if (!server.readTypeCheckingDouble(inputStorage, value)) { return server.writeErrorStatusCmd(cmd, "Setting maximum speed requires a double.", outputStorage); } - if (value == 0.0 || fabs(value) == std::numeric_limits::infinity()) { + if (value <= 0.0 || fabs(value) == std::numeric_limits::infinity()) { return server.writeErrorStatusCmd(cmd, "Invalid maximum speed.", outputStorage); } v.setMaxSpeed(value); @@ -223,7 +237,11 @@ if (!server.readTypeCheckingString(inputStorage, vclass)) { return server.writeErrorStatusCmd(cmd, "Setting vehicle class requires a string.", outputStorage); } - v.setVClass(getVehicleClassID(vclass)); + try { + v.setVClass(getVehicleClassID(vclass)); + } catch (InvalidArgument e) { + return server.writeErrorStatusCmd(cmd, "Unknown vehicle class '" + vclass + "'.", outputStorage); + } } break; case VAR_SPEED_FACTOR: { @@ -231,6 +249,9 @@ if (!server.readTypeCheckingDouble(inputStorage, value)) { return server.writeErrorStatusCmd(cmd, "Setting speed factor requires a double.", outputStorage); } + if (value <= 0.0 || fabs(value) == std::numeric_limits::infinity()) { + return server.writeErrorStatusCmd(cmd, "Invalid speed factor.", outputStorage); + } v.setSpeedFactor(value); } break; @@ -239,6 +260,9 @@ if (!server.readTypeCheckingDouble(inputStorage, value)) { return server.writeErrorStatusCmd(cmd, "Setting speed deviation requires a double.", outputStorage); } + if (value < 0.0 || fabs(value) == std::numeric_limits::infinity()) { + return server.writeErrorStatusCmd(cmd, "Invalid speed deviation.", outputStorage); + } v.setSpeedDeviation(value); } break; @@ -259,6 +283,9 @@ if (!server.readTypeCheckingDouble(inputStorage, value)) { return server.writeErrorStatusCmd(cmd, "Setting width requires a double.", outputStorage); } + if (value <= 0.0 || fabs(value) == std::numeric_limits::infinity()) { + return server.writeErrorStatusCmd(cmd, "Invalid width.", outputStorage); + } v.setWidth(value); } break; @@ -267,6 +294,9 @@ if (!server.readTypeCheckingDouble(inputStorage, value)) { return server.writeErrorStatusCmd(cmd, "Setting minimum gap requires a double.", outputStorage); } + if (value < 0.0 || fabs(value) == std::numeric_limits::infinity()) { + return server.writeErrorStatusCmd(cmd, "Invalid minimum gap.", outputStorage); + } v.setMinGap(value); } break; @@ -275,7 +305,11 @@ if (!server.readTypeCheckingString(inputStorage, sclass)) { return server.writeErrorStatusCmd(cmd, "Setting vehicle shape requires a string.", outputStorage); } - v.setShape(getVehicleShapeID(sclass)); + try { + v.setShape(getVehicleShapeID(sclass)); + } catch (InvalidArgument e) { + return server.writeErrorStatusCmd(cmd, "Unknown vehicle shape " + sclass + "'.", outputStorage); + } } break; case VAR_ACCEL: { @@ -283,6 +317,9 @@ if (!server.readTypeCheckingDouble(inputStorage, value)) { return server.writeErrorStatusCmd(cmd, "Setting acceleration requires a double.", outputStorage); } + if (value < 0.0 || fabs(value) == std::numeric_limits::infinity()) { + return server.writeErrorStatusCmd(cmd, "Invalid acceleration.", outputStorage); + } v.getCarFollowModel().setMaxAccel(value); } break; @@ -291,6 +328,9 @@ if (!server.readTypeCheckingDouble(inputStorage, value)) { return server.writeErrorStatusCmd(cmd, "Setting deceleration requires a double.", outputStorage); } + if (value < 0.0 || fabs(value) == std::numeric_limits::infinity()) { + return server.writeErrorStatusCmd(cmd, "Invalid deceleration.", outputStorage); + } v.getCarFollowModel().setMaxDecel(value); } break; @@ -299,6 +339,9 @@ if (!server.readTypeCheckingDouble(inputStorage, value)) { return server.writeErrorStatusCmd(cmd, "Setting driver imperfection requires a double.", outputStorage); } + if (value < 0.0 || fabs(value) == std::numeric_limits::infinity()) { + return server.writeErrorStatusCmd(cmd, "Invalid driver imperfection.", outputStorage); + } v.getCarFollowModel().setImperfection(value); } break; @@ -307,6 +350,9 @@ if (!server.readTypeCheckingDouble(inputStorage, value)) { return server.writeErrorStatusCmd(cmd, "Setting headway time requires a double.", outputStorage); } + if (value < 0.0 || fabs(value) == std::numeric_limits::infinity()) { + return server.writeErrorStatusCmd(cmd, "Invalid headway time.", outputStorage); + } v.getCarFollowModel().setHeadwayTime(value); } break; @@ -318,6 +364,23 @@ v.setColor(col); } break; + case VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != TYPE_COMPOUND) { + return server.writeErrorStatusCmd(cmd, "A compound object is needed for setting a parameter.", outputStorage); + } + //readt itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(cmd, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(cmd, "The value of the parameter must be given as a string.", outputStorage); + } + ((SUMOVTypeParameter&) v.getParameter()).addParameter(name, value); + } + break; default: break; } diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_VehicleType.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_VehicleType.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServerAPI_VehicleType.h 2014-02-22 23:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServerAPI_VehicleType.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 07.05.2009 -/// @version $Id: TraCIServerAPI_VehicleType.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCIServerAPI_VehicleType.h 18095 2015-03-17 09:39:00Z behrisch $ /// // APIs for getting/setting vehicle type values via TraCI /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServer.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServer.cpp --- sumo-0.21.0+dfsg/src/traci-server/TraCIServer.cpp 2014-03-25 23:02:09.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServer.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -11,12 +11,12 @@ /// @author Michael Behrisch /// @author Mario Krumnow /// @date 2007/10/24 -/// @version $Id: TraCIServer.cpp 16029 2014-03-25 13:30:27Z namdre $ +/// @version $Id: TraCIServer.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// /// TraCI server used to control sumo by a remote TraCI client (e.g., ns2) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -52,11 +52,11 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include #include #include @@ -78,7 +78,6 @@ #include "TraCIServerAPI_Lane.h" #include "TraCIServerAPI_MeMeDetector.h" #include "TraCIServerAPI_ArealDetector.h" - #include "TraCIServerAPI_TLS.h" #include "TraCIServerAPI_Vehicle.h" #include "TraCIServerAPI_VehicleType.h" @@ -87,6 +86,7 @@ #include "TraCIServerAPI_Polygon.h" #include "TraCIServerAPI_Edge.h" #include "TraCIServerAPI_Simulation.h" +#include "TraCIServerAPI_Person.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -141,6 +141,8 @@ myExecutors[CMD_SET_EDGE_VARIABLE] = &TraCIServerAPI_Edge::processSet; myExecutors[CMD_GET_SIM_VARIABLE] = &TraCIServerAPI_Simulation::processGet; myExecutors[CMD_SET_SIM_VARIABLE] = &TraCIServerAPI_Simulation::processSet; + myExecutors[CMD_GET_PERSON_VARIABLE] = &TraCIServerAPI_Person::processGet; + myExecutors[CMD_SET_PERSON_VARIABLE] = &TraCIServerAPI_Person::processSet; myParameterSizes[VAR_LEADER] = 9; @@ -182,13 +184,14 @@ // ---------- Initialisation and Shutdown void TraCIServer::openSocket(const std::map& execs) { - if (myInstance == 0) { - if (!myDoCloseConnection && OptionsCont::getOptions().getInt("remote-port") != 0) { - myInstance = new TraCIServer(string2time(OptionsCont::getOptions().getString("begin")), - OptionsCont::getOptions().getInt("remote-port")); - for (std::map::const_iterator i = execs.begin(); i != execs.end(); ++i) { - myInstance->myExecutors[i->first] = i->second; - } + if (myInstance != 0) { + return; + } + if (!myDoCloseConnection && OptionsCont::getOptions().getInt("remote-port") != 0) { + myInstance = new TraCIServer(string2time(OptionsCont::getOptions().getString("begin")), + OptionsCont::getOptions().getInt("remote-port")); + for (std::map::const_iterator i = execs.begin(); i != execs.end(); ++i) { + myInstance->myExecutors[i->first] = i->second; } } } @@ -196,11 +199,12 @@ void TraCIServer::close() { - if (myInstance != 0) { - delete myInstance; - myInstance = 0; - myDoCloseConnection = true; + if (myInstance == 0) { + return; } + delete myInstance; + myInstance = 0; + myDoCloseConnection = true; } @@ -211,11 +215,13 @@ void -TraCIServer::setVTDControlled(MSVehicle* v, MSLane* l, SUMOReal pos, int edgeOffset, MSEdgeVector route) { +TraCIServer::setVTDControlled(MSVehicle* v, MSLane* l, SUMOReal pos, int edgeOffset, ConstMSEdgeVector route, + SUMOTime t) { myVTDControlledVehicles[v->getID()] = v; - v->getInfluencer().setVTDControlled(true, l, pos, edgeOffset, route); + v->getInfluencer().setVTDControlled(true, l, pos, edgeOffset, route, t); } + void TraCIServer::postProcessVTD() { for (std::map::const_iterator i = myVTDControlledVehicles.begin(); i != myVTDControlledVehicles.end(); ++i) { @@ -229,12 +235,6 @@ } -bool -TraCIServer::vtdDebug() const { - return true; -} - - // ---------- Initialisation and Shutdown @@ -440,6 +440,7 @@ case CMD_SUBSCRIBE_TL_VARIABLE: case CMD_SUBSCRIBE_LANE_VARIABLE: case CMD_SUBSCRIBE_VEHICLE_VARIABLE: + case CMD_SUBSCRIBE_PERSON_VARIABLE: case CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE: case CMD_SUBSCRIBE_ROUTE_VARIABLE: case CMD_SUBSCRIBE_POI_VARIABLE: @@ -455,6 +456,7 @@ case CMD_SUBSCRIBE_TL_CONTEXT: case CMD_SUBSCRIBE_LANE_CONTEXT: case CMD_SUBSCRIBE_VEHICLE_CONTEXT: + case CMD_SUBSCRIBE_PERSON_CONTEXT: case CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT: case CMD_SUBSCRIBE_ROUTE_CONTEXT: case CMD_SUBSCRIBE_POI_CONTEXT: @@ -643,6 +645,12 @@ shape.push_back(p); return true; } + break; + case CMD_SUBSCRIBE_PERSON_CONTEXT: + if (TraCIServerAPI_Person::getPosition(id, p)) { + shape.push_back(p); + return true; + } break; case CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT: break; diff -Nru sumo-0.21.0+dfsg/src/traci-server/TraCIServer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServer.h --- sumo-0.21.0+dfsg/src/traci-server/TraCIServer.h 2014-02-25 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci-server/TraCIServer.h 2015-04-17 05:44:20.000000000 +0000 @@ -9,12 +9,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date 2007/10/24 -/// @version $Id: TraCIServer.h 15727 2014-02-25 08:09:54Z behrisch $ +/// @version $Id: TraCIServer.h 18096 2015-03-17 09:50:59Z behrisch $ /// /// TraCI server used to control sumo by a remote TraCI client /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -109,12 +109,11 @@ /// @brief process all commands until a simulation step is wanted static void processCommandsUntilSimStep(SUMOTime step); - void setVTDControlled(MSVehicle* v, MSLane* l, SUMOReal pos, int edgeOffset, MSEdgeVector route); + void setVTDControlled(MSVehicle* v, MSLane* l, SUMOReal pos, int edgeOffset, ConstMSEdgeVector route, + SUMOTime t); void postProcessVTD(); - bool vtdDebug() const; - #ifdef HAVE_PYTHON @@ -259,6 +258,7 @@ bool readTypeCheckingPolygon(tcpip::Storage& inputStorage, PositionVector& into); /// @} + private: /** @brief Constructor * @param[in] port The port to listen to (to open) diff -Nru sumo-0.21.0+dfsg/src/traci_testclient/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci_testclient/Makefile.in --- sumo-0.21.0+dfsg/src/traci_testclient/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci_testclient/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -223,6 +223,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -233,7 +235,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/traci_testclient/TraCITestClient.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci_testclient/TraCITestClient.cpp --- sumo-0.21.0+dfsg/src/traci_testclient/TraCITestClient.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci_testclient/TraCITestClient.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2008/04/07 -/// @version $Id: TraCITestClient.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: TraCITestClient.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// /// A test execution class /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci_testclient/TraCITestClient.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci_testclient/TraCITestClient.h --- sumo-0.21.0+dfsg/src/traci_testclient/TraCITestClient.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci_testclient/TraCITestClient.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Axel Wegener /// @author Michael Behrisch /// @date 2008/04/07 -/// @version $Id: TraCITestClient.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TraCITestClient.h 18095 2015-03-17 09:39:00Z behrisch $ /// /// A test execution class /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/traci_testclient/tracitestclient_main.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci_testclient/tracitestclient_main.cpp --- sumo-0.21.0+dfsg/src/traci_testclient/tracitestclient_main.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/traci_testclient/tracitestclient_main.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Daniel Krajzewicz /// @date 2008/04/07 -/// @version $Id: tracitestclient_main.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: tracitestclient_main.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// /// Main method for TraCITestClient /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/AbstractMutex.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/AbstractMutex.h --- sumo-0.21.0+dfsg/src/utils/common/AbstractMutex.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/AbstractMutex.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2005-07-12 -/// @version $Id: AbstractMutex.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AbstractMutex.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An abstract class for encapsulating mutex implementations /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/AStarRouter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/AStarRouter.h --- sumo-0.21.0+dfsg/src/utils/common/AStarRouter.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/AStarRouter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,302 +0,0 @@ -/****************************************************************************/ -/// @file AStarRouter.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @author Jakob Erdmann -/// @date January 2012 -/// @version $Id: AStarRouter.h 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// 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-sim.org/ -// Copyright (C) 2012-2014 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 AStarRouterTT_h -#define AStarRouterTT_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "SUMOAbstractRouter.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class AStarRouterTT - * @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) - * @param V The vehicle class to use (MSVehicle/ROVehicle) - * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions) - * @param EC The class to retrieve the effort for an edge from - * - * The router is edge-based. It must know the number of edges for internal reasons - * and whether a missing connection between two given edges (unbuild route) shall - * be reported as an error or as a warning. - * - */ -template -class AStarRouterTTBase : public SUMOAbstractRouter, public PF { - using SUMOAbstractRouter::startQuery; - using SUMOAbstractRouter::endQuery; - -public: - /// Constructor - AStarRouterTTBase(size_t noE, bool unbuildIsWarning): - SUMOAbstractRouter("AStarRouter"), - myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) { - for (size_t i = 0; i < noE; i++) { - myEdgeInfos.push_back(EdgeInfo(i)); - } - } - - /// Destructor - virtual ~AStarRouterTTBase() {} - - /** - * @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(size_t id) : - edge(E::dictionary(id)), - traveltime(std::numeric_limits::max()), - heuristicTime(std::numeric_limits::max()), - prev(0), - visited(false) - {} - - /// The current edge - const E* edge; - - /// Effort to reach the edge - SUMOReal traveltime; - - /// Estimated time to reach the edge (traveltime + lower bound on remaining time) - SUMOReal heuristicTime; - - /// The previous edge - EdgeInfo* prev; - - /// The previous edge - bool visited; - - inline void reset() { - // heuristicTime is set before adding to the frontier, thus no reset is needed - traveltime = std::numeric_limits::max(); - visited = false; - } - - }; - - /** - * @class EdgeInfoComparator - * Class to compare (and so sort) nodes by their effort - */ - class EdgeInfoComparator { - public: - /// Comparing method - bool operator()(const EdgeInfo* nod1, const EdgeInfo* nod2) const { - if (nod1->heuristicTime == nod2->heuristicTime) { - return nod1->edge->getNumericalID() > nod2->edge->getNumericalID(); - } - return nod1->heuristicTime > nod2->heuristicTime; - } - }; - - virtual SUMOReal getEffort(const E* const e, const V* const v, SUMOReal t) const = 0; - - - void init() { - // all EdgeInfos touched in the previous query are either in myFrontierList or myFound: clean those up - for (typename std::vector::iterator i = myFrontierList.begin(); i != myFrontierList.end(); i++) { - (*i)->reset(); - } - myFrontierList.clear(); - for (typename std::vector::iterator i = myFound.begin(); i != myFound.end(); i++) { - (*i)->reset(); - } - myFound.clear(); - } - - - /** @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) { - assert(from != 0 && to != 0); - startQuery(); - const SUMOReal time = STEPS2TIME(msTime); - init(); - // add begin node - EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]); - fromInfo->traveltime = 0; - fromInfo->prev = 0; - myFrontierList.push_back(fromInfo); - // loop - int num_visited = 0; - while (!myFrontierList.empty()) { - num_visited += 1; - // use the node with the minimal length - EdgeInfo* const minimumInfo = myFrontierList.front(); - const E* const minEdge = minimumInfo->edge; - pop_heap(myFrontierList.begin(), myFrontierList.end(), myComparator); - myFrontierList.pop_back(); - myFound.push_back(minimumInfo); - // check whether the destination node was already reached - if (minEdge == to) { - buildPathFrom(minimumInfo, into); - endQuery(num_visited); - // DEBUG - //std::cout << "visited " + toString(num_visited) + " edges (final path length: " + toString(into.size()) + ")\n"; - return; - } - minimumInfo->visited = true; - const SUMOReal traveltime = minimumInfo->traveltime + getEffort(minEdge, vehicle, time + minimumInfo->traveltime); - // 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* const follower = minEdge->getFollower(i); - EdgeInfo* const followerInfo = &(myEdgeInfos[follower->getNumericalID()]); - // check whether it can be used - if (PF::operator()(follower, vehicle)) { - continue; - } - const SUMOReal oldEffort = followerInfo->traveltime; - if (!followerInfo->visited && traveltime < oldEffort) { - // admissible A* heuristic: straight line distance at maximum speed - const SUMOReal heuristic_remaining = minEdge->getDistanceTo(to) / vehicle->getMaxSpeed(); - followerInfo->traveltime = traveltime; - followerInfo->heuristicTime = traveltime + heuristic_remaining; - followerInfo->prev = minimumInfo; - if (oldEffort == std::numeric_limits::max()) { - myFrontierList.push_back(followerInfo); - push_heap(myFrontierList.begin(), myFrontierList.end(), myComparator); - } else { - push_heap(myFrontierList.begin(), - find(myFrontierList.begin(), myFrontierList.end(), followerInfo) + 1, - myComparator); - } - } - } - } - endQuery(num_visited); - myErrorMsgHandler->inform("No connection between '" + from->getID() + "' and '" + to->getID() + "' found."); - } - - - 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) { - if (PF::operator()(*i, v)) { - return -1; - } - costs += getEffort(*i, v, time + costs); - } - return costs; - } - -public: - /// Builds the path from marked edges - void buildPathFrom(EdgeInfo* rbegin, std::vector& edges) { - std::deque tmp; - while (rbegin != 0) { - tmp.push_front((E*) rbegin->edge); // !!! - rbegin = rbegin->prev; - } - std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges)); - } - -protected: - /// The container of edge information - std::vector myEdgeInfos; - - /// A container for reusage of the min edge heap - std::vector myFrontierList; - /// @brief list of visited Edges (for resetting) - std::vector myFound; - - EdgeInfoComparator myComparator; - - /// @brief the handler for routing errors - MsgHandler* const myErrorMsgHandler; - -}; - - -template -class AStarRouterTT_ByProxi : public AStarRouterTTBase { -public: - /// Type of the function that is used to retrieve the edge effort. - typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); - - 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 (*myOperation)(e, v, t); - } - -private: - /// @brief The object's operation to perform. - Operation myOperation; -}; - - -template -class AStarRouterTT_Direct : public AStarRouterTTBase { -public: - /// Type of the function that is used to retrieve the edge effort. - typedef SUMOReal(E::* Operation)(const V* const, SUMOReal) const; - - AStarRouterTT_Direct(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 (e->*myOperation)(v, t); - } - -private: - Operation myOperation; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/utils/common/Command.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/Command.h --- sumo-0.21.0+dfsg/src/utils/common/Command.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/Command.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Christian Roessel /// @author Daniel Krajzewicz /// @date Thu, 20 Dec 2001 -/// @version $Id: Command.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Command.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Base (microsim) event class /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/DijkstraRouterEffort.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/DijkstraRouterEffort.h --- sumo-0.21.0+dfsg/src/utils/common/DijkstraRouterEffort.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/DijkstraRouterEffort.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,313 +0,0 @@ -/****************************************************************************/ -/// @file DijkstraRouterEffort.h -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date Mon, 25 July 2005 -/// @version $Id: DijkstraRouterEffort.h 15692 2014-02-22 09:17:02Z behrisch $ -/// -// Dijkstra shortest path algorithm using other values -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 DijkstraRouterEffort_h -#define DijkstraRouterEffort_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "SUMOAbstractRouter.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class DijkstraRouterEffort - * @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) - * @param V The vehicle class to use (MSVehicle/ROVehicle) - * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions) - * @param EC The class to retrieve the effort for an edge from - * - * The router is edge-based. It must know the number of edges for internal reasons - * and whether a missing connection between two given edges (unbuild route) shall - * be reported as an error or as a warning. - * - */ -template -class DijkstraRouterEffortBase : public SUMOAbstractRouter, public PF { - using SUMOAbstractRouter::startQuery; - using SUMOAbstractRouter::endQuery; - -public: - /// Constructor - DijkstraRouterEffortBase(size_t noE, bool unbuildIsWarning) : - SUMOAbstractRouter("DijkstraRouterEffort"), - myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) { - for (size_t i = 0; i < noE; i++) { - myEdgeInfos.push_back(EdgeInfo(i)); - } - } - - /// Destructor - virtual ~DijkstraRouterEffortBase() { } - - /** - * @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(size_t id) - : edge(E::dictionary(id)), effort(std::numeric_limits::max()), leaveTime(0), prev(0), visited(false) {} - - /// The current edge - const E* edge; - - /// Effort to reach the edge - SUMOReal effort; - - /// The time the vehicle leaves the edge - SUMOReal leaveTime; - - /// The previous edge - EdgeInfo* prev; - - /// The previous edge - bool visited; - - inline void reset() { - effort = std::numeric_limits::max(); - visited = false; - } - }; - - /** - * @class EdgeInfoByEffortComparator - * Class to compare (and so sort) nodes by their effort - */ - class EdgeInfoByEffortComparator { - public: - /// Comparing method - bool operator()(EdgeInfo* nod1, EdgeInfo* nod2) const { - if (nod1->effort == nod2->effort) { - return nod1->edge->getNumericalID() > nod2->edge->getNumericalID(); - } - return nod1->effort > nod2->effort; - } - }; - - virtual SUMOReal getEffort(const E* const e, const V* const v, SUMOReal t) const = 0; - virtual SUMOReal getTravelTime(const E* const e, const V* const v, SUMOReal t) const = 0; - - - void init() { - // all EdgeInfos touched in the previous query are either in myFrontierList or myFound: clean those up - for (typename std::vector::iterator i = myFrontierList.begin(); i != myFrontierList.end(); i++) { - (*i)->reset(); - } - myFrontierList.clear(); - for (typename std::vector::iterator i = myFound.begin(); i != myFound.end(); i++) { - (*i)->reset(); - } - myFound.clear(); - } - - - /** @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) { - assert(from != 0 && to != 0); - startQuery(); - init(); - // add begin node - EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]); - fromInfo->effort = 0; - fromInfo->prev = 0; - fromInfo->leaveTime = STEPS2TIME(msTime); - myFrontierList.push_back(fromInfo); - // loop - int num_visited = 0; - while (!myFrontierList.empty()) { - num_visited += 1; - // use the node with the minimal length - EdgeInfo* const minimumInfo = myFrontierList.front(); - const E* const minEdge = minimumInfo->edge; - pop_heap(myFrontierList.begin(), myFrontierList.end(), myComparator); - myFrontierList.pop_back(); - myFound.push_back(minimumInfo); - // check whether the destination node was already reached - if (minEdge == to) { - buildPathFrom(minimumInfo, into); - endQuery(num_visited); - return; - } - minimumInfo->visited = true; - const SUMOReal effort = minimumInfo->effort + getEffort(minEdge, vehicle, minimumInfo->leaveTime); - const SUMOReal leaveTime = minimumInfo->leaveTime + getTravelTime(minEdge, vehicle, minimumInfo->leaveTime); - // 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* const follower = minEdge->getFollower(i); - EdgeInfo* const followerInfo = &(myEdgeInfos[follower->getNumericalID()]); - // check whether it can be used - if (PF::operator()(follower, vehicle)) { - continue; - } - const SUMOReal oldEffort = followerInfo->effort; - if (!followerInfo->visited && effort < oldEffort) { - followerInfo->effort = effort; - followerInfo->leaveTime = leaveTime; - followerInfo->prev = minimumInfo; - if (oldEffort == std::numeric_limits::max()) { - myFrontierList.push_back(followerInfo); - push_heap(myFrontierList.begin(), myFrontierList.end(), myComparator); - } else { - push_heap(myFrontierList.begin(), - find(myFrontierList.begin(), myFrontierList.end(), followerInfo) + 1, - myComparator); - } - } - } - } - endQuery(num_visited); - myErrorMsgHandler->inform("No connection between '" + from->getID() + "' and '" + to->getID() + "' found."); - } - - - 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) { - if (PF::operator()(*i, v)) { - return -1; - } - costs += getEffort(*i, v, t); - t += getTravelTime(*i, v, t); - } - return costs; - } - -public: - /// Builds the path from marked edges - void buildPathFrom(EdgeInfo* rbegin, std::vector& edges) { - std::deque tmp; - while (rbegin != 0) { - tmp.push_front((E*) rbegin->edge); // !!! - rbegin = rbegin->prev; - } - std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges)); - } - -protected: - /// The container of edge information - std::vector myEdgeInfos; - - /// A container for reusage of the min edge heap - std::vector myFrontierList; - /// @brief list of visited Edges (for resetting) - std::vector myFound; - - EdgeInfoByEffortComparator myComparator; - - /// @brief the handler for routing errors - MsgHandler* const myErrorMsgHandler; - -}; - - -template -class DijkstraRouterEffort_ByProxi : public DijkstraRouterEffortBase { -public: - /// Type of the function that is used to retrieve the edge effort. - typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); - - 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 (*myEffortOperation)(e, v, t); - } - - inline SUMOReal getTravelTime(const E* const e, const V* const v, SUMOReal t) const { - return (*myTTOperation)(e, v, t); - } - -private: - /// @brief The object's operation to perform for obtaining the effort - Operation myEffortOperation; - - /// @brief The object's operation to perform for obtaining the travel time - Operation myTTOperation; - -}; - - -template -class DijkstraRouterEffort_Direct : public DijkstraRouterEffortBase { -public: - /// Type of the function that is used to retrieve the edge effort. - typedef SUMOReal(E::* Operation)(const V* const, SUMOReal) const; - - DijkstraRouterEffort_Direct(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 (e->*myEffortOperation)(v, t); - } - - inline SUMOReal getTravelTime(const E* const e, const V* const v, SUMOReal t) const { - return (e->*myTTOperation)(v, t); - } - -private: - /// @brief The object's operation to perform for obtaining the effort - Operation myEffortOperation; - - /// @brief The object's operation to perform for obtaining the travel time - Operation myTTOperation; - - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/utils/common/DijkstraRouterTT.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/DijkstraRouterTT.h --- sumo-0.21.0+dfsg/src/utils/common/DijkstraRouterTT.h 2014-05-05 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/DijkstraRouterTT.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,306 +0,0 @@ -/****************************************************************************/ -/// @file DijkstraRouterTT.h -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date Mon, 25 July 2005 -/// @version $Id: DijkstraRouterTT.h 16290 2014-05-05 12:38:38Z namdre $ -/// -// Dijkstra shortest path algorithm using travel time -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 DijkstraRouterTT_h -#define DijkstraRouterTT_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "SUMOAbstractRouter.h" - -//#define DijkstraRouterTT_DEBUG_QUERY -//#define DijkstraRouterTT_DEBUG_QUERY_PERF - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class DijkstraRouterTT - * @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) - * @param V The vehicle class to use (MSVehicle/ROVehicle) - * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions) - * @param EC The class to retrieve the effort for an edge from - * - * The router is edge-based. It must know the number of edges for internal reasons - * and whether a missing connection between two given edges (unbuild route) shall - * be reported as an error or as a warning. - * - */ -template -class DijkstraRouterTTBase : public SUMOAbstractRouter, public PF { - using SUMOAbstractRouter::startQuery; - using SUMOAbstractRouter::endQuery; - -public: - /// Constructor - DijkstraRouterTTBase(size_t noE, bool unbuildIsWarning) : - SUMOAbstractRouter("DijkstraRouterTT"), - myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) { - for (size_t i = 0; i < noE; i++) { - myEdgeInfos.push_back(EdgeInfo(i)); - } - } - - /// Destructor - virtual ~DijkstraRouterTTBase() { } - - /** - * @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(size_t id) - : edge(E::dictionary(id)), traveltime(std::numeric_limits::max()), prev(0), visited(false) {} - - /// The current edge - const E* edge; - - /// Effort to reach the edge - SUMOReal traveltime; - - /// The previous edge - EdgeInfo* prev; - - /// The previous edge - bool visited; - - inline void reset() { - traveltime = std::numeric_limits::max(); - visited = false; - } - }; - - /** - * @class EdgeInfoByEffortComparator - * Class to compare (and so sort) nodes by their effort - */ - class EdgeInfoByTTComparator { - public: - /// Comparing method - bool operator()(const EdgeInfo* nod1, const EdgeInfo* nod2) const { - if (nod1->traveltime == nod2->traveltime) { - return nod1->edge->getNumericalID() > nod2->edge->getNumericalID(); - } - return nod1->traveltime > nod2->traveltime; - } - }; - - virtual SUMOReal getEffort(const E* const e, const V* const v, SUMOReal t) const = 0; - - - void init() { - // all EdgeInfos touched in the previous query are either in myFrontierList or myFound: clean those up - for (typename std::vector::iterator i = myFrontierList.begin(); i != myFrontierList.end(); i++) { - (*i)->reset(); - } - myFrontierList.clear(); - for (typename std::vector::iterator i = myFound.begin(); i != myFound.end(); i++) { - (*i)->reset(); - } - myFound.clear(); - } - - - /** @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) { - assert(from != 0 && to != 0); - startQuery(); - const SUMOReal time = STEPS2TIME(msTime); - init(); - // add begin node - EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]); - fromInfo->traveltime = 0; - fromInfo->prev = 0; - myFrontierList.push_back(fromInfo); - // loop - int num_visited = 0; - while (!myFrontierList.empty()) { - num_visited += 1; - // use the node with the minimal length - EdgeInfo* const minimumInfo = myFrontierList.front(); - const E* const minEdge = minimumInfo->edge; - pop_heap(myFrontierList.begin(), myFrontierList.end(), myComparator); - myFrontierList.pop_back(); - myFound.push_back(minimumInfo); -#ifdef DijkstraRouterTT_DEBUG_QUERY - std::cout << "DEBUG: hit '" << minEdge->getID() << "' TT: " << minimumInfo->traveltime << " Q: "; - for (typename std::vector::iterator it = myFrontierList.begin(); it != myFrontierList.end(); it++) { - std::cout << (*it)->traveltime << "," << (*it)->edge->getID() << " "; - } - std::cout << "\n"; -#endif - // check whether the destination node was already reached - if (minEdge == to) { - buildPathFrom(minimumInfo, into); - endQuery(num_visited); -#ifdef DijkstraRouterTT_DEBUG_QUERY_PERF - std::cout << "visited " + toString(num_visited) + " edges (final path length: " + toString(into.size()) + ")\n"; -#endif - return; - } - minimumInfo->visited = true; - const SUMOReal traveltime = minimumInfo->traveltime + getEffort(minEdge, vehicle, time + minimumInfo->traveltime); - // 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* const follower = minEdge->getFollower(i); - EdgeInfo* const followerInfo = &(myEdgeInfos[follower->getNumericalID()]); - // check whether it can be used - if (PF::operator()(follower, vehicle)) { - continue; - } - const SUMOReal oldEffort = followerInfo->traveltime; - if (!followerInfo->visited && traveltime < oldEffort) { - followerInfo->traveltime = traveltime; - followerInfo->prev = minimumInfo; - if (oldEffort == std::numeric_limits::max()) { - myFrontierList.push_back(followerInfo); - push_heap(myFrontierList.begin(), myFrontierList.end(), myComparator); - } else { - push_heap(myFrontierList.begin(), - find(myFrontierList.begin(), myFrontierList.end(), followerInfo) + 1, - myComparator); - } - } - } - } - endQuery(num_visited); -#ifdef DijkstraRouterTT_DEBUG_QUERY_PERF - std::cout << "visited " + toString(num_visited) + " edges (final path length: " + toString(into.size()) + ")\n"; -#endif - myErrorMsgHandler->inform("No connection between '" + from->getID() + "' and '" + to->getID() + "' found."); - } - - - 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) { - if (PF::operator()(*i, v)) { - return -1; - } - costs += getEffort(*i, v, time + costs); - } - return costs; - } - -public: - /// Builds the path from marked edges - void buildPathFrom(EdgeInfo* rbegin, std::vector& edges) { - std::deque tmp; - while (rbegin != 0) { - tmp.push_front((E*) rbegin->edge); // !!! - rbegin = rbegin->prev; - } - std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges)); - } - -protected: - /// The container of edge information - std::vector myEdgeInfos; - - /// A container for reusage of the min edge heap - std::vector myFrontierList; - /// @brief list of visited Edges (for resetting) - std::vector myFound; - - EdgeInfoByTTComparator myComparator; - - /// @brief the handler for routing errors - MsgHandler* const myErrorMsgHandler; -}; - - -template -class DijkstraRouterTT_ByProxi : public DijkstraRouterTTBase { -public: - /// Type of the function that is used to retrieve the edge effort. - typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); - - 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 (*myOperation)(e, v, t); - } - -private: - /// @brief The object's operation to perform. - Operation myOperation; - - -}; - - -template -class DijkstraRouterTT_Direct : public DijkstraRouterTTBase { -public: - /// Type of the function that is used to retrieve the edge effort. - typedef SUMOReal(E::* Operation)(const V* const, SUMOReal) const; - - DijkstraRouterTT_Direct(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 (e->*myOperation)(v, t); - } - -private: - Operation myOperation; - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/utils/common/FileHelpers.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/FileHelpers.cpp --- sumo-0.21.0+dfsg/src/utils/common/FileHelpers.cpp 2014-04-29 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/FileHelpers.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: FileHelpers.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: FileHelpers.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Functions for an easier usage of files /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -136,6 +136,16 @@ } +std::string +FileHelpers::prependToLastPathComponent(const std::string& prefix, const std::string& path) { + size_t sep_index = path.find_last_of("\\/"); + if (sep_index == std::string::npos) { + return prefix + path; + } else { + return path.substr(0, sep_index + 1) + prefix + path.substr(sep_index + 1); + } +} + // --------------------------------------------------------------------------- // binary reading/writing functions // --------------------------------------------------------------------------- diff -Nru sumo-0.21.0+dfsg/src/utils/common/FileHelpers.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/FileHelpers.h --- sumo-0.21.0+dfsg/src/utils/common/FileHelpers.h 2014-04-29 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/FileHelpers.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 17 Dec 2001 -/// @version $Id: FileHelpers.h 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: FileHelpers.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Functions for an easier usage of files /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -125,6 +125,10 @@ */ static std::string checkForRelativity(const std::string& filename, const std::string& basePath); + + /// @brief prepend the given prefix to the last path component of the given file path + static std::string prependToLastPathComponent(const std::string& prefix, const std::string& path); + //@} @@ -227,11 +231,11 @@ 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) { + for (; idx < prev->getNumSuccessors(); ++idx) { if (idx > 15) { break; } - if (prev->getFollower(idx) == (*i)) { + if (prev->getSuccessors()[idx] == (*i)) { follow.push_back(idx); if (idx > maxFollow) { maxFollow = idx; @@ -239,7 +243,7 @@ break; } } - if (idx > 15 || idx == prev->getNoFollowing()) { + if (idx > 15 || idx == prev->getNumSuccessors()) { follow.clear(); break; } @@ -300,10 +304,10 @@ field = 0; } unsigned int followIndex = (data >> ((numFields - field - 1) * bits)) & mask; - if (followIndex >= prev->getNoFollowing()) { + if (followIndex >= prev->getNumSuccessors()) { throw ProcessError("Invalid follower index in route '" + rid + "'!"); } - prev = prev->getFollower(followIndex); + prev = prev->getSuccessors()[followIndex]; edges.push_back(prev); field++; } diff -Nru sumo-0.21.0+dfsg/src/utils/common/IDSupplier.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/IDSupplier.cpp --- sumo-0.21.0+dfsg/src/utils/common/IDSupplier.cpp 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/IDSupplier.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: IDSupplier.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: IDSupplier.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A class that generates enumerated and prefixed string-ids /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/IDSupplier.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/IDSupplier.h --- sumo-0.21.0+dfsg/src/utils/common/IDSupplier.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/IDSupplier.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: IDSupplier.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: IDSupplier.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A class that generates enumerated and prefixed string-ids /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/InstancePool.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/InstancePool.h --- sumo-0.21.0+dfsg/src/utils/common/InstancePool.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/InstancePool.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -/****************************************************************************/ -/// @file InstancePool.h -/// @author Daniel Krajzewicz -/// @date Fri, 29.04.2005 -/// @version $Id: InstancePool.h 15692 2014-02-22 09:17:02Z behrisch $ -/// -// A pool of resuable instances -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 InstancePool_h -#define InstancePool_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class InstancePool - * @brief A pool of resuable instances - */ -template -class InstancePool { -public: - /** @brief Constructor - * - * @param[in] deleteOnQuit Information whether stored instances shall be deleted when this container is deleted - */ - InstancePool(bool deleteOnQuit) : myDeleteOnQuit(deleteOnQuit) { } - - - /// @brief Destructor - ~InstancePool() { - typedef typename std::vector::iterator It; - if (myDeleteOnQuit) { - for (It i = myFreeInstances.begin(); i != myFreeInstances.end(); i++) { - delete *i; - } - } - } - - - /** @brief Returns a free instance or 0 if no such exists - * - * If any free instance is stored, it is returned and removed from - * the storage. If no one is stored, 0 is returned. - * - * @return A free instance or 0 if no such exists - */ - T* getFreeInstance() { - if (myFreeInstances.size() == 0) { - return 0; - } else { - T* instance = myFreeInstances.back(); - myFreeInstances.pop_back(); - return instance; - } - } - - - /** @brief Adds a free, reusable instance - * - * @param[in] instance An instance to add - */ - void addFreeInstance(T* instance) { - myFreeInstances.push_back(instance); - } - - - /** @brief Adds some free, reusable instances - * - * @param[in] instances A vector of instances to add - */ - void addFreeInstances(const std::vector instances) { - std::copy(instances.begin(), instances.end(), - std::back_inserter(myFreeInstances)); - } - - -private: - /// @brief List of reusable instances - std::vector myFreeInstances; - - /// @brief Information whether the stored instances shall be deleted - bool myDeleteOnQuit; - - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/utils/common/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/Makefile.am --- sumo-0.21.0+dfsg/src/utils/common/Makefile.am 2014-05-05 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -1,31 +1,24 @@ noinst_LIBRARIES = libcommon.a -EXTRA_DIST = VectorHelper.h Command.h \ -NamedObjectCont.h NamedRTree.h StaticCommand.h RandomDistributor.h \ -SUMOAbstractRouter.h DijkstraRouterTT.h DijkstraRouterEffort.h \ -AStarRouter.h \ -PedestrianRouter.h \ -SUMOVehicle.h \ -WrappingCommand.h ValueRetriever.h ValueSource.h \ -StringBijection.h - libcommon_a_SOURCES = AbstractMutex.h \ +Command.h \ FileHelpers.cpp FileHelpers.h \ -InstancePool.h \ IDSupplier.h IDSupplier.cpp \ -Named.h Parameterised.cpp Parameterised.h \ -StringTokenizer.cpp StringTokenizer.h \ -StringUtils.cpp StringUtils.h UtilExceptions.h \ MsgHandler.h MsgHandler.cpp \ -StdDefs.h StdDefs.cpp \ -RGBColor.cpp RGBColor.h RandHelper.h RandHelper.cpp \ -SUMOTime.cpp SUMOTime.h \ -SystemFrame.cpp SystemFrame.h SysUtils.h SysUtils.cpp \ -SUMOVehicleParameter.cpp SUMOVehicleParameter.h \ -SUMOVTypeParameter.cpp SUMOVTypeParameter.h \ MsgRetrievingFunction.h \ +Named.h NamedObjectCont.h NamedRTree.h \ +Parameterised.cpp Parameterised.h \ +RandHelper.h RandHelper.cpp RandomDistributor.h \ +RGBColor.cpp RGBColor.h \ +StaticCommand.h StdDefs.h StdDefs.cpp \ +StringBijection.h \ +StringTokenizer.cpp StringTokenizer.h \ +StringUtils.cpp StringUtils.h \ +SUMOTime.cpp SUMOTime.h \ SUMOVehicleClass.cpp SUMOVehicleClass.h \ -ToString.h TplConvert.h \ -ValueTimeLine.h - - +SystemFrame.cpp SystemFrame.h \ +SysUtils.h SysUtils.cpp \ +ToString.h TplConvert.h UtilExceptions.h \ +ValueRetriever.h ValueSource.h \ +ValueTimeLine.h VectorHelper.h \ +WrappingCommand.h diff -Nru sumo-0.21.0+dfsg/src/utils/common/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/Makefile.in --- sumo-0.21.0+dfsg/src/utils/common/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -99,12 +99,11 @@ libcommon_a_AR = $(AR) $(ARFLAGS) libcommon_a_LIBADD = am_libcommon_a_OBJECTS = FileHelpers.$(OBJEXT) IDSupplier.$(OBJEXT) \ - Parameterised.$(OBJEXT) StringTokenizer.$(OBJEXT) \ - StringUtils.$(OBJEXT) MsgHandler.$(OBJEXT) StdDefs.$(OBJEXT) \ - RGBColor.$(OBJEXT) RandHelper.$(OBJEXT) SUMOTime.$(OBJEXT) \ - SystemFrame.$(OBJEXT) SysUtils.$(OBJEXT) \ - SUMOVehicleParameter.$(OBJEXT) SUMOVTypeParameter.$(OBJEXT) \ - SUMOVehicleClass.$(OBJEXT) + MsgHandler.$(OBJEXT) Parameterised.$(OBJEXT) \ + RandHelper.$(OBJEXT) RGBColor.$(OBJEXT) StdDefs.$(OBJEXT) \ + StringTokenizer.$(OBJEXT) StringUtils.$(OBJEXT) \ + SUMOTime.$(OBJEXT) SUMOVehicleClass.$(OBJEXT) \ + SystemFrame.$(OBJEXT) SysUtils.$(OBJEXT) libcommon_a_OBJECTS = $(am_libcommon_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -226,6 +225,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -236,7 +237,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -331,33 +331,28 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libcommon.a -EXTRA_DIST = VectorHelper.h Command.h \ -NamedObjectCont.h NamedRTree.h StaticCommand.h RandomDistributor.h \ -SUMOAbstractRouter.h DijkstraRouterTT.h DijkstraRouterEffort.h \ -AStarRouter.h \ -PedestrianRouter.h \ -SUMOVehicle.h \ -WrappingCommand.h ValueRetriever.h ValueSource.h \ -StringBijection.h - libcommon_a_SOURCES = AbstractMutex.h \ +Command.h \ FileHelpers.cpp FileHelpers.h \ -InstancePool.h \ IDSupplier.h IDSupplier.cpp \ -Named.h Parameterised.cpp Parameterised.h \ -StringTokenizer.cpp StringTokenizer.h \ -StringUtils.cpp StringUtils.h UtilExceptions.h \ MsgHandler.h MsgHandler.cpp \ -StdDefs.h StdDefs.cpp \ -RGBColor.cpp RGBColor.h RandHelper.h RandHelper.cpp \ -SUMOTime.cpp SUMOTime.h \ -SystemFrame.cpp SystemFrame.h SysUtils.h SysUtils.cpp \ -SUMOVehicleParameter.cpp SUMOVehicleParameter.h \ -SUMOVTypeParameter.cpp SUMOVTypeParameter.h \ MsgRetrievingFunction.h \ +Named.h NamedObjectCont.h NamedRTree.h \ +Parameterised.cpp Parameterised.h \ +RandHelper.h RandHelper.cpp RandomDistributor.h \ +RGBColor.cpp RGBColor.h \ +StaticCommand.h StdDefs.h StdDefs.cpp \ +StringBijection.h \ +StringTokenizer.cpp StringTokenizer.h \ +StringUtils.cpp StringUtils.h \ +SUMOTime.cpp SUMOTime.h \ SUMOVehicleClass.cpp SUMOVehicleClass.h \ -ToString.h TplConvert.h \ -ValueTimeLine.h +SystemFrame.cpp SystemFrame.h \ +SysUtils.h SysUtils.cpp \ +ToString.h TplConvert.h UtilExceptions.h \ +ValueRetriever.h ValueSource.h \ +ValueTimeLine.h VectorHelper.h \ +WrappingCommand.h all: all-am @@ -415,9 +410,7 @@ @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@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOVTypeParameter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOVehicleClass.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOVehicleParameter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StdDefs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StringTokenizer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StringUtils.Po@am__quote@ diff -Nru sumo-0.21.0+dfsg/src/utils/common/MsgHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/MsgHandler.cpp --- sumo-0.21.0+dfsg/src/utils/common/MsgHandler.cpp 2014-04-04 22:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/MsgHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 17 Jun 2003 -/// @version $Id: MsgHandler.cpp 16118 2014-04-04 09:27:44Z behrisch $ +/// @version $Id: MsgHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Retrieves messages about the process and gives them further to output /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/MsgHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/MsgHandler.h --- sumo-0.21.0+dfsg/src/utils/common/MsgHandler.h 2014-04-04 22:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/MsgHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Tue, 17 Jun 2003 -/// @version $Id: MsgHandler.h 16118 2014-04-04 09:27:44Z behrisch $ +/// @version $Id: MsgHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Retrieves messages about the process and gives them further to output /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/MsgRetrievingFunction.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/MsgRetrievingFunction.h --- sumo-0.21.0+dfsg/src/utils/common/MsgRetrievingFunction.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/MsgRetrievingFunction.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 24 Oct 2003 -/// @version $Id: MsgRetrievingFunction.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: MsgRetrievingFunction.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Encapsulates an object's method for using it as a message retriever /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/Named.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/Named.h --- sumo-0.21.0+dfsg/src/utils/common/Named.h 2014-03-08 23:02:24.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/Named.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: Named.h 15870 2014-03-08 19:51:55Z behrisch $ +/// @version $Id: Named.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Base class for objects which have an id. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/NamedObjectCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/NamedObjectCont.h --- sumo-0.21.0+dfsg/src/utils/common/NamedObjectCont.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/NamedObjectCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: NamedObjectCont.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NamedObjectCont.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A map of named object pointers /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/NamedRTree.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/NamedRTree.h --- sumo-0.21.0+dfsg/src/utils/common/NamedRTree.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/NamedRTree.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 27.10.2008 -/// @version $Id: NamedRTree.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: NamedRTree.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A RT-tree for efficient storing of SUMO's Named objects /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -38,7 +38,7 @@ // specialized implementation for speedup and avoiding warnings -#define NAMED_RTREE_QUAL RTree +#define NAMED_RTREE_QUAL RTree template<> inline float NAMED_RTREE_QUAL::RectSphericalVolume(Rect* a_rect) { @@ -69,11 +69,10 @@ * It stores names of "Named"-objects. * @see Named */ -class NamedRTree : private RTree { +class NamedRTree : private NAMED_RTREE_QUAL { public: /// @brief Constructor - NamedRTree() - : RTree(&Named::addTo) { + NamedRTree() : NAMED_RTREE_QUAL(&Named::addTo) { } @@ -88,8 +87,8 @@ * @param a_data The instance of a Named-object to add (the ID is added) * @see RTree::Insert */ - void Insert(const float a_min[2], const float a_max[2], Named* a_data) { - RTree::Insert(a_min, a_max, a_data); + void Insert(const float a_min[2], const float a_max[2], Named* const& a_data) { + NAMED_RTREE_QUAL::Insert(a_min, a_max, a_data); } @@ -99,8 +98,8 @@ * @param a_data The instance of a Named-object to remove * @see RTree::Remove */ - void Remove(const float a_min[2], const float a_max[2], Named* a_data) { - RTree::Remove(a_min, a_max, a_data); + void Remove(const float a_min[2], const float a_max[2], Named* const& a_data) { + NAMED_RTREE_QUAL::Remove(a_min, a_max, a_data); } @@ -108,7 +107,7 @@ * @see RTree::RemoveAll */ void RemoveAll() { - RTree::RemoveAll(); + NAMED_RTREE_QUAL::RemoveAll(); } @@ -122,7 +121,7 @@ * @see RTree::Search */ int Search(const float a_min[2], const float a_max[2], const Named::StoringVisitor& c) const { - return RTree::Search(a_min, a_max, c); + return NAMED_RTREE_QUAL::Search(a_min, a_max, c); } @@ -132,4 +131,3 @@ #endif /****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/utils/common/Parameterised.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/Parameterised.cpp --- sumo-0.21.0+dfsg/src/utils/common/Parameterised.cpp 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/Parameterised.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file Parameterised.cpp /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: Parameterised.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Parameterised.cpp 18137 2015-03-24 15:12:38Z behrisch $ /// -// A RGB-color definition +// A super class for objects with additional parameters /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/Parameterised.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/Parameterised.h --- sumo-0.21.0+dfsg/src/utils/common/Parameterised.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/Parameterised.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Melanie Knocke /// @date Sept 2002 -/// @version $Id: Parameterised.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: Parameterised.h 18137 2015-03-24 15:12:38Z behrisch $ /// -// An upper class for objects with additional parameters +// A super class for objects with additional parameters /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/PedestrianRouter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/PedestrianRouter.h --- sumo-0.21.0+dfsg/src/utils/common/PedestrianRouter.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/PedestrianRouter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,466 +0,0 @@ -/****************************************************************************/ -/// @file PedestrianRouter.h -/// @author Jakob Erdmann -/// @date Mon, 03 March 2014 -/// @version $Id: PedestrianRouter.h 16560 2014-06-09 20:54:15Z behrisch $ -/// -// The Pedestrian Router build a special network and (delegegates to a SUMOAbstractRouter) -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 PedestrianRouter_h -#define PedestrianRouter_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define TL_RED_PENALTY 20 - -//#define PedestrianRouter_DEBUG_NETWORK -//#define PedestrianRouter_DEBUG_ROUTES -//#define PedestrianRouter_DEBUG_EFFORTS - -template -inline const L* getSidewalk(const E* edge) { - if (edge == 0) { - return 0; - } - const std::vector& lanes = edge->getLanes(); - for (typename std::vector::const_iterator it = lanes.begin(); it != lanes.end(); ++it) { - if ((*it)->allowsVehicleClass(SVC_PEDESTRIAN)) { - return *it; - } - } - return 0; -} - -// =========================================================================== -// class definitions -// =========================================================================== - -/// @brief the "vehicle" type that is given to the internal router (SUMOAbstractRouter) -template -struct PedestrianTrip { - - PedestrianTrip(const E* _from, const E* _to, SUMOReal _departPos, SUMOReal _arrivalPos, SUMOReal _speed, SUMOReal _departTime, const N* _node) : - from(_from), - to(_to), - node(_node), - departPos(_departPos < 0 ? _from->getLength() + _departPos : _departPos), - arrivalPos(_arrivalPos < 0 ? _to->getLength() + _arrivalPos : _arrivalPos), - speed(_speed), - departTime(_departTime) - {} - - const E* from; - const E* to; - const N* node; // indicates whether only routing across this node shall be performed - const SUMOReal departPos; - const SUMOReal arrivalPos; - const SUMOReal speed; - const SUMOReal departTime; -private: - /// @brief Invalidated assignment operator. - PedestrianTrip& operator=(const PedestrianTrip&); -}; - - -/// @brief the edge type that is given to the internal router (SUMOAbstractRouter) -template -class PedestrianEdge : public Named { - typedef std::pair EdgePair; - /* brief build the pedestrian network (once) - * @param noE The number of edges in the dictionary of E - */ - -public: - static size_t dictSize() { - return myEdgeDict.size(); - } - - static void cleanup() { - myFromToLookup.clear(); - myBidiLookup.clear(); - myEdgeDict.clear(); - } - - static void initPedestrianNetwork(size_t noE) { - if (myEdgeDict.size() > 0) { - return; - } -#ifdef PedestrianRouter_DEBUG_NETWORK - std::cout << "initPedestrianNetwork\n"; -#endif - // build the Pedestrian edges - unsigned int numericalID = 0; - for (size_t i = 0; i < noE; i++) { - E* edge = E::dictionary(i); - const L* lane = getSidewalk(edge); - if (edge->isInternal() || lane == 0) { - continue; - } else if (edge->isWalkingArea()) { - // only a single edge - myEdgeDict.push_back(PedestrianEdge(numericalID++, edge, lane, true)); - } else { // regular edge or crossing - // forward and backward edges - myEdgeDict.push_back(PedestrianEdge(numericalID++, edge, lane, true)); - myEdgeDict.push_back(PedestrianEdge(numericalID++, edge, lane, false)); - // depart and arrival edges for (the router can decide the initial direction to take and the direction to arrive from) - myEdgeDict.push_back(PedestrianEdge(numericalID++, edge, lane, true, true)); - myEdgeDict.push_back(PedestrianEdge(numericalID++, edge, lane, false, true)); - } - - } - // build the lookup tables after myEdgeDict is complete - numericalID = 0; - for (size_t i = 0; i < noE; i++) { - E* edge = E::dictionary(i); - const L* lane = getSidewalk(edge); - if (edge->isInternal() || lane == 0) { - continue; - } else if (edge->isWalkingArea()) { - // only a single edge and no connector edges - myBidiLookup[edge] = std::make_pair(&myEdgeDict[numericalID], &myEdgeDict[numericalID]); - myFromToLookup[edge] = std::make_pair(&myEdgeDict[numericalID], &myEdgeDict[numericalID]); - numericalID += 1; - } else { // regular edge or crossing - myBidiLookup[edge] = std::make_pair(&myEdgeDict[numericalID], &myEdgeDict[numericalID + 1]); - myFromToLookup[edge] = std::make_pair(&myEdgeDict[numericalID + 2], &myEdgeDict[numericalID + 3]); - numericalID += 4; - } - } - - // build the connections - for (size_t i = 0; i < noE; i++) { - E* edge = E::dictionary(i); - const L* lane = getSidewalk(edge); - if (edge->isInternal() || lane == 0) { - continue; - } - // find all incoming and outgoing lanes for the sidewalk and - // connect the corresponding PedestrianEdges - const L* sidewalk = getSidewalk(edge); - const EdgePair& pair = getBothDirections(edge); - -#ifdef PedestrianRouter_DEBUG_NETWORK - std::cout << " building connections from " << sidewalk->getID() << "\n"; -#endif - std::vector outgoing = sidewalk->getOutgoingLanes(); - for (typename std::vector::iterator it = outgoing.begin(); it != outgoing.end(); ++it) { - const L* target = *it; - const E* targetEdge = &(target->getEdge()); -#ifdef PedestrianRouter_DEBUG_NETWORK - std::cout << " lane=" << getSidewalk(targetEdge)->getID() << (target == getSidewalk(targetEdge) ? "(used)" : "") << "\n"; -#endif - if (target == getSidewalk(targetEdge)) { - const EdgePair& targetPair = getBothDirections(targetEdge); - pair.first->myFollowingEdges.push_back(targetPair.first); - targetPair.second->myFollowingEdges.push_back(pair.second); -#ifdef PedestrianRouter_DEBUG_NETWORK - std::cout << " " << pair.first->getID() << " -> " << targetPair.first->getID() << "\n"; - std::cout << " " << targetPair.second->getID() << " -> " << pair.second->getID() << "\n"; -#endif - } - } - if (edge->isWalkingArea()) { - continue; - } - // build connections from depart connector - PedestrianEdge* startConnector = getDepartEdge(edge); - startConnector->myFollowingEdges.push_back(pair.first); - startConnector->myFollowingEdges.push_back(pair.second); - // build connections to arrival connector - PedestrianEdge* endConnector = getArrivalEdge(edge); - pair.first->myFollowingEdges.push_back(endConnector); - pair.second->myFollowingEdges.push_back(endConnector); -#ifdef PedestrianRouter_DEBUG_NETWORK - std::cout << " " << startConnector->getID() << " -> " << pair.first->getID() << "\n"; - std::cout << " " << startConnector->getID() << " -> " << pair.second->getID() << "\n"; - std::cout << " " << pair.first->getID() << " -> " << endConnector->getID() << "\n"; - std::cout << " " << pair.second->getID() << " -> " << endConnector->getID() << "\n"; -#endif - } - } - - bool includeInRoute(bool allEdges) const { - return !myAmConnector && (allEdges || (!myEdge->isCrossing() && !myEdge->isWalkingArea())); - } - - const E* getEdge() const { - return myEdge; - } - - /// @brief Returns the pair of forward and backward edge - static const EdgePair& getBothDirections(const E* e) { - typename std::map::const_iterator it = myBidiLookup.find(e); - if (it == myBidiLookup.end()) { - assert(false); - throw ProcessError("Edge '" + e->getID() + "' not found in pedestrian network '"); - } - return (*it).second; - } - - /// @brief Returns the departing Pedestrian edge - static PedestrianEdge* getDepartEdge(const E* e) { - typename std::map::const_iterator it = myFromToLookup.find(e); - if (it == myFromToLookup.end()) { - assert(false); - throw ProcessError("Edge '" + e->getID() + "' not found in pedestrian network '"); - } - return (*it).second.first; - } - - /// @brief Returns the arriving Pedestrian edge - static PedestrianEdge* getArrivalEdge(const E* e) { - typename std::map::const_iterator it = myFromToLookup.find(e); - if (it == myFromToLookup.end()) { - assert(false); - throw ProcessError("Edge '" + e->getID() + "' not found in pedestrian network '"); - } - return (*it).second.second; - } - - /// @name The interface as required by SUMOAbstractRouter routes - /// @{ - - unsigned int getNumericalID() const { - return myNumericalID; - } - - /// @brief Returns the PedstrianEdge with the given numericalID - static const PedestrianEdge* dictionary(size_t index) { - assert(index < myEdgeDict.size()); - return &myEdgeDict[index]; - } - - unsigned int getNoFollowing() const { - return (unsigned int)myFollowingEdges.size(); - } - - PedestrianEdge* getFollower(unsigned int i) const { - return myFollowingEdges[i]; - } - - bool prohibits(const PedestrianTrip* const trip) const { - if (trip->node == 0) { - // network only includes PedestrianEdges - return false; - } else { - // limit routing to the surroundings of the specified node - return (myEdge->getFromJunction() != trip->node - && myEdge->getToJunction() != trip->node); - } - } - - /// @} - - /*@brief the function called by RouterTT_direct - * (distance is used as effort, effort is assumed to be independent of time - */ - SUMOReal getEffort(const PedestrianTrip* const trip, SUMOReal time) const { - if (myAmConnector) { - return 0; - } - SUMOReal length = myEdge->getLength(); - if (myEdge == trip->from) { - if (myForward) { - length -= trip->departPos; - } else { - length = trip->departPos; - } - } - if (myEdge == trip->to) { - if (myForward) { - length = trip->arrivalPos; - } else { - length -= trip->arrivalPos; - } - } - // ensure that 'normal' edges always have a higher weight than connector edges - length = MAX2(length, POSITION_EPS); - SUMOReal tlsDelay = 0; - if (myEdge->isCrossing() && myLane->getIncomingLinkState() == LINKSTATE_TL_RED) { - // red traffic lights occurring later in the route may be green by the time we arive - tlsDelay += MAX2(SUMOReal(0), TL_RED_PENALTY - (time - trip->departTime)); - - } -#ifdef PedestrianRouter_DEBUG_EFFORTS - std::cout << " effort for " << getID() << " at " << time << ": " << length / trip->speed + tlsDelay << " l=" << length << " s=" << trip->speed << " tlsDelay=" << tlsDelay << "\n"; -#endif - return length / trip->speed + tlsDelay; - } - -private: - PedestrianEdge(unsigned int numericalID, const E* edge, const L* lane, bool forward, bool connector = false) : - Named(edge->getID() + (edge->isWalkingArea() ? "" : - ((forward ? "_fwd" : "_bwd") + std::string(connector ? "_connector" : "")))), - myNumericalID(numericalID), - myEdge(edge), - myLane(lane), - myForward(forward), - myAmConnector(connector) { } - - /// @brief the index in myEdgeDict - unsigned int myNumericalID; - - /// @brief the original edge - const E* myEdge; - - /// @brief the original edge - const L* myLane; - - /// @brief the direction of this edge - bool myForward; - - /// @brief the direction of this edge - bool myAmConnector; - - /// @brief List of edges that may be approached from this edge - std::vector myFollowingEdges; - - /// @brief the edge dictionary - static std::vector myEdgeDict; - - /// @brief retrieve the forward and backward edge for the given input edge E - static std::map myBidiLookup; - - /// @brief retrieve the depart and arrival edge for the given input edge E - static std::map myFromToLookup; - -}; - - -/** - * @class PedestrianRouter - * The router for pedestrians (on a bidirectional network of sidewalks and crossings - */ -template -class PedestrianRouter : public SUMOAbstractRouter > { -public: - - typedef PedestrianEdge _PedestrianEdge; - typedef PedestrianTrip _PedestrianTrip; - - /// Constructor - PedestrianRouter(): - SUMOAbstractRouter("PedestrianRouter") { - _PedestrianEdge::initPedestrianNetwork(E::dictSize()); - myInternalRouter = new INTERNALROUTER(_PedestrianEdge::dictSize(), true, &_PedestrianEdge::getEffort); - } - - /// Destructor - virtual ~PedestrianRouter() { - delete myInternalRouter; - } - - /** @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 */ - void compute(const E* from, const E* to, SUMOReal departPos, SUMOReal arrivalPos, SUMOReal speed, - SUMOTime msTime, const N* onlyNode, std::vector& into, bool allEdges = false) { - //startQuery(); - _PedestrianTrip trip(from, to, departPos, arrivalPos, speed, msTime, onlyNode); - std::vector intoPed; - myInternalRouter->compute(_PedestrianEdge::getDepartEdge(from), - _PedestrianEdge::getArrivalEdge(to), &trip, msTime, intoPed); - for (size_t i = 0; i < intoPed.size(); ++i) { - if (intoPed[i]->includeInRoute(allEdges)) { - into.push_back(intoPed[i]->getEdge()); - } - } -#ifdef PedestrianRouter_DEBUG_ROUTES - std::cout << TIME2STEPS(msTime) << " trip from " << from->getID() << " to " << to->getID() - << " departPos=" << departPos - << " arrivalPos=" << arrivalPos - << " onlyNode=" << (onlyNode == 0 ? "NULL" : onlyNode->getID()) - << " edges=" << toString(intoPed) - << " resultEdges=" << toString(into) - << "\n"; -#endif - //endQuery(); - } - - /** @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 */ - void compute(const E*, const E*, const _PedestrianTrip* const, - SUMOTime, std::vector&) { - throw ProcessError("Do not use this method"); - } - - SUMOReal recomputeCosts(const std::vector&, const _PedestrianTrip* const, SUMOTime) const { - throw ProcessError("Do not use this method"); - } - - void prohibit(const std::vector& toProhibit) { - std::vector<_PedestrianEdge*> toProhibitPE; - for (typename std::vector::const_iterator it = toProhibit.begin(); it != toProhibit.end(); ++it) { - toProhibitPE.push_back(_PedestrianEdge::getBothDirections(*it).first); - toProhibitPE.push_back(_PedestrianEdge::getBothDirections(*it).second); - } - myInternalRouter->prohibit(toProhibitPE); - } - -private: - INTERNALROUTER* myInternalRouter; - - -private: - /// @brief Invalidated assignment operator - PedestrianRouter& operator=(const PedestrianRouter& s); - -private: - -}; - -// common specializations -template -class PedestrianRouterDijkstra : public PedestrianRouter < E, L, N, - DijkstraRouterTT_Direct, PedestrianTrip, prohibited_withRestrictions, PedestrianTrip > > > { }; - - -// =========================================================================== -// static member definitions (PedestrianEdge) -// =========================================================================== - -template -std::vector > PedestrianEdge::myEdgeDict; - -template -std::map::EdgePair> PedestrianEdge::myBidiLookup; - -template -std::map::EdgePair> PedestrianEdge::myFromToLookup; - -#endif - - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/utils/common/RandHelper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/RandHelper.cpp --- sumo-0.21.0+dfsg/src/utils/common/RandHelper.cpp 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/RandHelper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Tue, 29.05.2005 -/// @version $Id: RandHelper.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: RandHelper.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/RandHelper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/RandHelper.h --- sumo-0.21.0+dfsg/src/utils/common/RandHelper.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/RandHelper.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Fri, 29.04.2005 -/// @version $Id: RandHelper.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RandHelper.h 18096 2015-03-17 09:50:59Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -89,8 +89,18 @@ } /// @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); + static inline SUMOReal randNorm(SUMOReal mean, SUMOReal variance, MTRand* rng = 0) { + if (rng == 0) { + rng = &myRandomNumberGenerator; + } + // Polar method to avoid cosine + double u, q; + do { + u = rng->randExc(2.0) - 1; + const double v = rng->randExc(2.0) - 1; + q = u * u + v * v; + } while (q == 0.0 || q >= 1.0); + return (SUMOReal)(mean + variance * u * sqrt(-2 * log(q) / q)); } /// @brief Returns a random element from the given vector diff -Nru sumo-0.21.0+dfsg/src/utils/common/RandomDistributor.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/RandomDistributor.h --- sumo-0.21.0+dfsg/src/utils/common/RandomDistributor.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/RandomDistributor.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2005-09-15 -/// @version $Id: RandomDistributor.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: RandomDistributor.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Represents a generic random distribution /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/RGBColor.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/RGBColor.cpp --- sumo-0.21.0+dfsg/src/utils/common/RGBColor.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/RGBColor.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: RGBColor.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: RGBColor.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A RGB-color definition /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -56,6 +56,7 @@ const RGBColor RGBColor::YELLOW = RGBColor(255, 255, 0, 255); const RGBColor RGBColor::CYAN = RGBColor(0, 255, 255, 255); const RGBColor RGBColor::MAGENTA = RGBColor(255, 0, 255, 255); +const RGBColor RGBColor::ORANGE = RGBColor(255, 128, 0, 255); const RGBColor RGBColor::WHITE = RGBColor(255, 255, 255, 255); const RGBColor RGBColor::BLACK = RGBColor(0, 0, 0, 255); const RGBColor RGBColor::GREY = RGBColor(128, 128, 128, 255); @@ -111,6 +112,9 @@ if (col == RGBColor::MAGENTA) { return os << "magenta"; } + if (col == RGBColor::ORANGE) { + return os << "orange"; + } if (col == RGBColor::WHITE) { return os << "white"; } @@ -185,6 +189,9 @@ if (coldef == "magenta") { return MAGENTA; } + if (coldef == "orange") { + return ORANGE; + } if (coldef == "white") { return WHITE; } @@ -275,10 +282,10 @@ if (weight > 1) { weight = 1; } - const unsigned char r = minColor.myRed + static_cast((maxColor.myRed - minColor.myRed) * weight); - const unsigned char g = minColor.myGreen + static_cast((maxColor.myGreen - minColor.myGreen) * weight); - const unsigned char b = minColor.myBlue + static_cast((maxColor.myBlue - minColor.myBlue) * weight); - const unsigned char a = minColor.myAlpha + static_cast((maxColor.myAlpha - minColor.myAlpha) * weight); + const unsigned char r = (unsigned char)((int)minColor.myRed + (((int)maxColor.myRed - (int)minColor.myRed) * weight)); + const unsigned char g = (unsigned char)((int)minColor.myGreen + (((int)maxColor.myGreen - (int)minColor.myGreen) * weight)); + const unsigned char b = (unsigned char)((int)minColor.myBlue + (((int)maxColor.myBlue - (int)minColor.myBlue) * weight)); + const unsigned char a = (unsigned char)((int)minColor.myAlpha + (((int)maxColor.myAlpha - (int)minColor.myAlpha) * weight)); return RGBColor(r, g, b, a); } diff -Nru sumo-0.21.0+dfsg/src/utils/common/RGBColor.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/RGBColor.h --- sumo-0.21.0+dfsg/src/utils/common/RGBColor.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/RGBColor.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: RGBColor.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: RGBColor.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A RGB-color definition /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -192,6 +192,7 @@ static const RGBColor YELLOW; static const RGBColor CYAN; static const RGBColor MAGENTA; + static const RGBColor ORANGE; static const RGBColor WHITE; static const RGBColor BLACK; static const RGBColor GREY; diff -Nru sumo-0.21.0+dfsg/src/utils/common/StaticCommand.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StaticCommand.h --- sumo-0.21.0+dfsg/src/utils/common/StaticCommand.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StaticCommand.h 2015-04-17 05:44:20.000000000 +0000 @@ -7,8 +7,8 @@ /// // A wrapper for a Command function /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/StdDefs.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StdDefs.cpp --- sumo-0.21.0+dfsg/src/utils/common/StdDefs.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StdDefs.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,11 +4,11 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 2014-01-07 -/// @version $Id: StdDefs.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: StdDefs.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2014-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2014-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -37,15 +37,16 @@ const RGBColor SUMO_color_TL_GREEN_MAJOR(0, 255, 0); const RGBColor SUMO_color_TL_GREEN_MINOR(0, 179, 0); const RGBColor SUMO_color_TL_RED(255, 0, 0); +const RGBColor SUMO_color_TL_REDYELLOW(255, 128, 0); const RGBColor SUMO_color_TL_YELLOW_MAJOR(255, 255, 0); const RGBColor SUMO_color_TL_YELLOW_MINOR(255, 255, 0); -const RGBColor SUMO_color_TL_OFF_BLINKING(255, 140, 0); +const RGBColor SUMO_color_TL_OFF_BLINKING(128, 64, 0); const RGBColor SUMO_color_TL_OFF_NOSIGNAL(0, 255, 255); const RGBColor SUMO_color_MAJOR(255, 255, 255); const RGBColor SUMO_color_MINOR(51, 51, 51); const RGBColor SUMO_color_EQUAL(128, 128, 128); -const RGBColor SUMO_color_STOP(102, 51, 51); -const RGBColor SUMO_color_ALLWAY_STOP(51, 51, 102); +const RGBColor SUMO_color_STOP(128, 0, 128); +const RGBColor SUMO_color_ALLWAY_STOP(0, 0, 192); const RGBColor SUMO_color_DEADEND(0, 0, 0); const RGBColor& getLinkColor(const LinkState& ls) { @@ -56,6 +57,8 @@ return SUMO_color_TL_GREEN_MINOR; case LINKSTATE_TL_RED: return SUMO_color_TL_RED; + case LINKSTATE_TL_REDYELLOW: + return SUMO_color_TL_REDYELLOW; case LINKSTATE_TL_YELLOW_MAJOR: return SUMO_color_TL_YELLOW_MAJOR; case LINKSTATE_TL_YELLOW_MINOR: @@ -81,6 +84,18 @@ } } + +const std::string getBuildName(const std::string& version) { + std::string result = version; +#ifdef HAVE_INTERNAL + result += "I"; +#endif +#ifdef _DEBUG + result += "D"; +#endif + return result; +} + bool gDebugFlag1 = false; bool gDebugFlag2 = false; diff -Nru sumo-0.21.0+dfsg/src/utils/common/StdDefs.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StdDefs.h --- sumo-0.21.0+dfsg/src/utils/common/StdDefs.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StdDefs.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Fri, 29.04.2005 -/// @version $Id: StdDefs.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: StdDefs.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -57,6 +57,8 @@ */ const RGBColor& getLinkColor(const LinkState& ls); +/// @brief attach some build flags to the version string +const std::string getBuildName(const std::string& version); /* ------------------------------------------------------------------------- * templates for mathematical functions missing in some c++-implementations diff -Nru sumo-0.21.0+dfsg/src/utils/common/StringBijection.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StringBijection.h --- sumo-0.21.0+dfsg/src/utils/common/StringBijection.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StringBijection.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mar 2011 -/// @version $Id: StringBijection.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: StringBijection.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Bidirectional map between string and something else /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/StringTokenizer.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StringTokenizer.cpp --- sumo-0.21.0+dfsg/src/utils/common/StringTokenizer.cpp 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StringTokenizer.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date ? -/// @version $Id: StringTokenizer.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: StringTokenizer.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A java-style StringTokenizer for c++ (stl) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/StringTokenizer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StringTokenizer.h --- sumo-0.21.0+dfsg/src/utils/common/StringTokenizer.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StringTokenizer.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date ? -/// @version $Id: StringTokenizer.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: StringTokenizer.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A java-style StringTokenizer for c++ (stl) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/StringUtils.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StringUtils.cpp --- sumo-0.21.0+dfsg/src/utils/common/StringUtils.cpp 2014-02-25 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StringUtils.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date unknown -/// @version $Id: StringUtils.cpp 15727 2014-02-25 08:09:54Z behrisch $ +/// @version $Id: StringUtils.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Some static methods for string processing /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -147,6 +147,22 @@ } +bool +StringUtils::startsWith(const std::string& str, const std::string prefix) { + return str.compare(0, prefix.length(), prefix) == 0; +} + + +bool +StringUtils::endsWith(const std::string& str, const std::string suffix) { + if (str.length() >= suffix.length()) { + return str.compare(str.length() - suffix.length(), suffix.length(), suffix) == 0; + } else { + return false; + } +} + + std::string StringUtils::escapeXML(const std::string& orig) { std::string result = replace(orig, "&", "&"); diff -Nru sumo-0.21.0+dfsg/src/utils/common/StringUtils.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StringUtils.h --- sumo-0.21.0+dfsg/src/utils/common/StringUtils.h 2014-02-25 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/StringUtils.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date unknown -/// @version $Id: StringUtils.h 15727 2014-02-25 08:09:54Z behrisch $ +/// @version $Id: StringUtils.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some static methods for string processing /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -64,6 +64,12 @@ /// Builds a time string (hh:mm:ss) from the given seconds static std::string toTimeString(int time); + /// Checks whether a given string starts with the prefix + static bool startsWith(const std::string& str, const std::string prefix); + + /// Checks whether a given string ends with the suffix + static bool endsWith(const std::string& str, const std::string suffix); + /** * @brief Replaces the standard escapes by their XML entities. * diff -Nru sumo-0.21.0+dfsg/src/utils/common/SUMOAbstractRouter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOAbstractRouter.h --- sumo-0.21.0+dfsg/src/utils/common/SUMOAbstractRouter.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOAbstractRouter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,143 +0,0 @@ -/****************************************************************************/ -/// @file SUMOAbstractRouter.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @author Jakob Erdmann -/// @date 25.Jan 2006 -/// @version $Id: SUMOAbstractRouter.h 16005 2014-03-24 12:46:02Z cschmidt87 $ -/// -// The dijkstra-router -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 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 SUMOAbstractRouter_h -#define SUMOAbstractRouter_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class SUMOAbstractRouter - * The interface for routing the vehicles over the network. - */ -template -class SUMOAbstractRouter { -public: - /// Constructor - SUMOAbstractRouter(const std::string& type): - myType(type), - myQueryVisits(0), - myNumQueries(0), - myQueryStartTime(0), - myQueryTimeSum(0) - { } - - /// Destructor - 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)."); - } - } - - /** @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; - - virtual SUMOReal recomputeCosts(const std::vector& edges, - const V* const v, SUMOTime msTime) const = 0; - - // interface extension for BulkStarRouter - virtual void prepare(const E*, const V*, bool) { - assert(false); - } - - inline void startQuery() { - myNumQueries++; - myQueryStartTime = SysUtils::getCurrentMillis(); - } - - inline void endQuery(int visits) { - myQueryVisits += visits; - myQueryTimeSum += (SysUtils::getCurrentMillis() - myQueryStartTime); - } - -private: - /// @brief the type of this router - const std::string myType; - /// @brief counters for performance logging - int myQueryVisits; - int myNumQueries; - /// @brief the time spent querying in milliseconds - long myQueryStartTime; - long myQueryTimeSum; -private: - /// @brief Invalidated assignment operator - SUMOAbstractRouter& operator=(const SUMOAbstractRouter& s); -}; - - -template -struct prohibited_withRestrictions { -public: - inline bool operator()(const E* edge, const V* vehicle) const { - if (std::find(myProhibited.begin(), myProhibited.end(), edge) != myProhibited.end()) { - return true; - } - return edge->prohibits(vehicle); - } - - void prohibit(const std::vector& toProhibit) { - myProhibited = toProhibit; - } - -protected: - std::vector myProhibited; - -}; - -template -struct prohibited_noRestrictions { -public: - inline bool operator()(const E*, const V*) const { - return false; - } -}; - - - - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/utils/common/SUMOTime.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOTime.cpp --- sumo-0.21.0+dfsg/src/utils/common/SUMOTime.cpp 2014-05-26 22:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOTime.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: SUMOTime.cpp 16427 2014-05-26 11:11:19Z behrisch $ +/// @version $Id: SUMOTime.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Variables, methods, and tools for internal time representation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/SUMOTime.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOTime.h --- sumo-0.21.0+dfsg/src/utils/common/SUMOTime.h 2014-04-11 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOTime.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: SUMOTime.h 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: SUMOTime.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Variables, methods, and tools for internal time representation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/SUMOVehicleClass.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVehicleClass.cpp --- sumo-0.21.0+dfsg/src/utils/common/SUMOVehicleClass.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVehicleClass.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date 2006-01-24 -/// @version $Id: SUMOVehicleClass.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: SUMOVehicleClass.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Definitions of SUMO vehicle classes and helper functions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -81,6 +81,7 @@ {"bicycle", SVC_BICYCLE}, {"pedestrian", SVC_PEDESTRIAN}, {"evehicle", SVC_E_VEHICLE}, + {"ship", SVC_SHIP}, {"custom1", SVC_CUSTOM1}, {"custom2", SVC_CUSTOM2} }; @@ -123,6 +124,7 @@ {"rail/cargo", SVS_RAIL_CARGO}, {"evehicle", SVS_E_VEHICLE}, {"ant", SVS_ANT}, + {"ship", SVS_SHIP}, {"", SVS_UNKNOWN} }; @@ -137,6 +139,7 @@ const int SUMOVehicleClass_MAX = SVC_CUSTOM2; const SVCPermissions SVCAll = 2 * SUMOVehicleClass_MAX - 1; // all relevant bits set to 1 +const SVCPermissions SVC_UNSPECIFIED = -1; // =========================================================================== @@ -190,7 +193,7 @@ if (SumoVehicleClassStrings.hasString(name)) { return SumoVehicleClassStrings.get(name); } - throw ProcessError("Unknown vehicle class '" + name + "'."); + throw InvalidArgument("Unknown vehicle class '" + name + "'."); } @@ -276,7 +279,7 @@ if (SumoVehicleShapeStrings.hasString(name)) { return SumoVehicleShapeStrings.get(name); } else { - throw ProcessError("Unknown vehicle shape '" + name + "'."); + throw InvalidArgument("Unknown vehicle shape '" + name + "'."); } } @@ -292,16 +295,24 @@ } +bool isWaterway(SVCPermissions permissions) { + return permissions == SVC_SHIP; +} + + bool isForbidden(SVCPermissions permissions) { return (permissions & SVCAll) == 0; } const std::string DEFAULT_VTYPE_ID("DEFAULT_VEHTYPE"); +const std::string DEFAULT_PEDTYPE_ID("DEFAULT_PEDTYPE"); const SUMOReal DEFAULT_VEH_PROB(1.); const SUMOReal DEFAULT_PEDESTRIAN_SPEED(5. / 3.6); +const SUMOReal DEFAULT_CONTAINER_TRANSHIP_SPEED(5. / 3.6); + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/common/SUMOVehicleClass.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVehicleClass.h --- sumo-0.21.0+dfsg/src/utils/common/SUMOVehicleClass.h 2014-05-05 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVehicleClass.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date 2006-01-24 -/// @version $Id: SUMOVehicleClass.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: SUMOVehicleClass.h 18096 2015-03-17 09:50:59Z behrisch $ /// // Definitions of SUMO vehicle classes and helper functions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -93,7 +93,9 @@ /// @brief render as a (futuristic) e-vehicle SVS_E_VEHICLE, /// @brief render as a giant ant - SVS_ANT + SVS_ANT, + /// @brief render as a arbitrary ship + SVS_SHIP }; @@ -176,10 +178,12 @@ SVC_PEDESTRIAN = 1 << 20, /// @brief is an electric vehicle SVC_E_VEHICLE = 1 << 21, + /// @brief is an arbitrary ship + SVC_SHIP = 1 << 22, /// @brief is a user-defined type - SVC_CUSTOM1 = 1 << 22, + SVC_CUSTOM1 = 1 << 23, /// @brief is a user-defined type - SVC_CUSTOM2 = 1 << 23 + SVC_CUSTOM2 = 1 << 24 //@} }; @@ -191,7 +195,8 @@ /* @brief bitset where each bit declares whether a certain SVC may use this edge/lane */ typedef int SVCPermissions; -extern const SVCPermissions SVCAll; +extern const SVCPermissions SVCAll; // everything allowed +extern const SVCPermissions SVC_UNSPECIFIED; // permissions not specified /** @@ -295,6 +300,12 @@ */ extern bool isRailway(SVCPermissions permissions); +/** @brief Returns whether an edge with the given permission is a waterway edge + * @param[in] permissions The permissions of the edge + * @return Whether the edge is a waterway edge + */ +extern bool isWaterway(SVCPermissions permissions); + /** @brief Returns whether an edge with the given permission is a forbidden edge * @param[in] permissions The permissions of the edge * @return Whether the edge is forbidden @@ -305,11 +316,14 @@ // default vehicle type parameter // --------------------------------------------------------------------------- extern const std::string DEFAULT_VTYPE_ID; +extern const std::string DEFAULT_PEDTYPE_ID; extern const SUMOReal DEFAULT_VEH_PROB; // !!! does this belong here? extern const SUMOReal DEFAULT_PEDESTRIAN_SPEED; +extern const SUMOReal DEFAULT_CONTAINER_TRANSHIP_SPEED; + #endif /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/common/SUMOVehicle.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVehicle.h --- sumo-0.21.0+dfsg/src/utils/common/SUMOVehicle.h 2014-06-02 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVehicle.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,233 +0,0 @@ -/****************************************************************************/ -/// @file SUMOVehicle.h -/// @author Michael Behrisch -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @date Tue, 17 Feb 2009 -/// @version $Id: SUMOVehicle.h 16458 2014-06-02 12:29:04Z namdre $ -/// -// Abstract base class for vehicle representations -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 SUMOVehicle_h -#define SUMOVehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class MSVehicleType; -class MSRoute; -class MSEdge; -class MSLane; -class MSDevice; -class MSPerson; -class SUMOSAXAttributes; - -typedef std::vector MSEdgeVector; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class SUMOVehicle - * @brief Representation of a vehicle - */ -class SUMOVehicle { -public: - /// @brief Destructor - virtual ~SUMOVehicle() {} - - /** @brief Get the vehicle's ID - * @return The the ID of the vehicle - */ - virtual const std::string& getID() const = 0; - - /** @brief Get the vehicle's position along the lane - * @return The position of the vehicle (in m from the lane's begin) - */ - virtual SUMOReal getPositionOnLane() const = 0; - - /** @brief Returns the vehicle's maximum speed - * @return The vehicle's maximum speed - */ - virtual SUMOReal getMaxSpeed() const = 0; - - /** @brief Returns the vehicle's current speed - * @return The vehicle's speed - */ - virtual SUMOReal getSpeed() const = 0; - - /** @brief Returns the vehicle's type - * @return The vehicle's type - */ - virtual const MSVehicleType& getVehicleType() const = 0; - - /// Returns the current route - virtual const MSRoute& getRoute() const = 0; - - /** @brief Returns the nSuccs'th successor of edge the vehicle is currently at - * - * If the rest of the route (counted from the current edge) than nSuccs, - * 0 is returned. - * @param[in] nSuccs The number of edge to look forward - * @return The nSuccs'th following edge in the vehicle's route - */ - virtual const MSEdge* succEdge(unsigned int nSuccs) const = 0; - - /// Replaces the current route by the given edges - virtual bool replaceRouteEdges(MSEdgeVector& edges, bool onInit = false) = 0; - - /// Replaces the current route by the given one - virtual bool replaceRoute(const MSRoute* route, bool onInit = false, int offset = 0) = 0; - - /** @brief Performs a rerouting using the given router - * - * Tries to find a new route between the current edge and the destination edge, first. - * Tries to replace the current route by the new one using replaceRoute. - * - * @param[in] t The time for which the route is computed - * @param[in] router The router to use - * @see replaceRoute - */ - virtual void reroute(SUMOTime t, SUMOAbstractRouter& router, bool withTaz = false) = 0; - - /** @brief Returns the vehicle's acceleration - * @return The acceleration - */ - virtual SUMOReal getAcceleration() const = 0; - - /** @brief Returns the slope of the road at vehicle's position - * @return The slope - */ - virtual SUMOReal getSlope() const = 0; - - /** @brief Returns the edge the vehicle is currently at - * - * @return The current edge in the vehicle's route - */ - virtual const MSEdge* getEdge() const = 0; - - /** @brief Returns the vehicle's parameter (including departure definition) - * - * @return The vehicle's parameter - */ - virtual const SUMOVehicleParameter& getParameter() const = 0; - - /** @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. - */ - virtual void onDepart() = 0; - - /** @brief Returns the information whether the vehicle is on a road (is simulated) - * @return Whether the vehicle is simulated - */ - virtual bool isOnRoad() const = 0; - - /** @brief Returns this vehicle's real departure time - * @return This vehicle's real departure time - */ - virtual SUMOTime getDeparture() const = 0; - - /** @brief Returns this vehicle's desired arrivalPos for its current route - * (may change on reroute) - * @return This vehicle's real arrivalPos - */ - virtual SUMOReal getArrivalPos() 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 - */ - virtual unsigned int getNumberReroutes() const = 0; - - /** @brief Returns this vehicle's devices - * @return This vehicle's devices - */ - virtual const std::vector& getDevices() const = 0; - - /** @brief Adds a person to this vehicle - * - * May do nothing since persons are not supported by default - * - * @param[in] person The person to add - */ - virtual void addPerson(MSPerson* person) = 0; - - /** @brief Adds a stop - * - * The stop is put into the sorted list. - * @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; - - /** @brief Returns whether the vehicle is at a stop - * @return Whether the has stopped - */ - virtual bool isStopped() const = 0; - - /// @brief Returns a device of the given type if it exists or 0 - virtual MSDevice* getDevice(const std::type_info& type) const = 0; - - - virtual SUMOReal getChosenSpeedFactor() const = 0; - - virtual SUMOTime getWaitingTime() const = 0; - - /// @brief Returns this vehicles impatience - virtual SUMOReal getImpatience() const = 0; - - /// @name state io - //@{ - - /// Saves the states of a vehicle - virtual void saveState(OutputDevice& out) = 0; - - /** @brief Loads the state of this vehicle from the given description - */ - virtual void loadState(const SUMOSAXAttributes& attrs, const SUMOTime offset) = 0; - //@} -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/common/SUMOVehicleParameter.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVehicleParameter.cpp --- sumo-0.21.0+dfsg/src/utils/common/SUMOVehicleParameter.cpp 2014-05-14 22:02:38.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVehicleParameter.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,479 +0,0 @@ -/****************************************************************************/ -/// @file SUMOVehicleParameter.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date Tue, 31.03.2009 -/// @version $Id: SUMOVehicleParameter.cpp 16381 2014-05-14 12:31:03Z namdre $ -/// -// Structure representing possible vehicle parameter -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 "SUMOVehicleParameter.h" -#include -#include -#include -#include -#include - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// member method definitions -// =========================================================================== -SUMOVehicleParameter::SUMOVehicleParameter() - : vtypeid(DEFAULT_VTYPE_ID), color(RGBColor::DEFAULT_COLOR), - depart(-1), departProcedure(DEPART_GIVEN), - departLane(0), departLaneProcedure(DEPART_LANE_DEFAULT), - departPos(0), departPosProcedure(DEPART_POS_DEFAULT), - departSpeed(-1), departSpeedProcedure(DEPART_SPEED_DEFAULT), - arrivalLane(0), arrivalLaneProcedure(ARRIVAL_LANE_DEFAULT), - arrivalPos(0), arrivalPosProcedure(ARRIVAL_POS_DEFAULT), - arrivalSpeed(-1), arrivalSpeedProcedure(ARRIVAL_SPEED_DEFAULT), - repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1), repetitionProbability(-1), - line(), fromTaz(), toTaz(), personCapacity(0), personNumber(0), setParameter(0) { -} - - -bool -SUMOVehicleParameter::defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const { - return oc.isSet(optionName) && oc.getBool("defaults-override"); -} - - -void -SUMOVehicleParameter::write(OutputDevice& dev, const OptionsCont& oc) const { - dev.openTag(SUMO_TAG_VEHICLE).writeAttr(SUMO_ATTR_ID, id); - if (wasSet(VEHPARS_VTYPE_SET)) { - dev.writeAttr(SUMO_ATTR_TYPE, vtypeid); - } - if (departProcedure == DEPART_TRIGGERED) { - dev.writeAttr(SUMO_ATTR_DEPART, "triggered"); - } else { - dev.writeAttr(SUMO_ATTR_DEPART, time2string(depart)); - } - - // optional parameter - // departlane - if (wasSet(VEHPARS_DEPARTLANE_SET) && !defaultOptionOverrides(oc, "departlane")) { - std::string val; - switch (departLaneProcedure) { - case DEPART_LANE_GIVEN: - val = toString(departLane); - break; - case DEPART_LANE_RANDOM: - val = "random"; - break; - case DEPART_LANE_FREE: - val = "free"; - break; - case DEPART_LANE_ALLOWED_FREE: - val = "allowed"; - break; - case DEPART_LANE_BEST_FREE: - val = "best"; - break; - case DEPART_LANE_DEFAULT: - default: - break; - } - dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTLANE, val); - } else if (oc.isSet("departlane")) { - dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTLANE, oc.getString("departlane")); - } - // departpos - if (wasSet(VEHPARS_DEPARTPOS_SET) && !defaultOptionOverrides(oc, "departpos")) { - std::string val; - switch (departPosProcedure) { - case DEPART_POS_GIVEN: - val = toString(departPos); - break; - case DEPART_POS_RANDOM: - val = "random"; - break; - case DEPART_POS_RANDOM_FREE: - val = "random_free"; - break; - case DEPART_POS_FREE: - val = "free"; - break; - case DEPART_POS_PWAG_SIMPLE: - val = "pwagSimple"; - break; - case DEPART_POS_PWAG_GENERIC: - val = "pwagGeneric"; - break; - case DEPART_POS_MAX_SPEED_GAP: - val = "maxSpeedGap"; - break; - case DEPART_POS_BASE: - val = "base"; - break; - case DEPART_POS_DEFAULT: - default: - break; - } - dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTPOS, val); - } else if (oc.isSet("departpos")) { - dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTPOS, oc.getString("departpos")); - } - // departspeed - if (wasSet(VEHPARS_DEPARTSPEED_SET) && !defaultOptionOverrides(oc, "departspeed")) { - std::string val; - switch (departSpeedProcedure) { - case DEPART_SPEED_GIVEN: - val = toString(departSpeed); - break; - case DEPART_SPEED_RANDOM: - val = "random"; - break; - case DEPART_SPEED_MAX: - val = "max"; - break; - case DEPART_SPEED_DEFAULT: - default: - break; - } - dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTSPEED, val); - } else if (oc.isSet("departspeed")) { - dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTSPEED, oc.getString("departspeed")); - } - - // arrivallane - if (wasSet(VEHPARS_ARRIVALLANE_SET) && !defaultOptionOverrides(oc, "arrivallane")) { - std::string val; - switch (arrivalLaneProcedure) { - case ARRIVAL_LANE_GIVEN: - val = toString(arrivalLane); - break; - case ARRIVAL_LANE_CURRENT: - val = "current"; - break; - case ARRIVAL_LANE_DEFAULT: - default: - break; - } - dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALLANE, val); - } else if (oc.isSet("arrivallane")) { - dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALLANE, oc.getString("arrivallane")); - } - // arrivalpos - if (wasSet(VEHPARS_ARRIVALPOS_SET) && !defaultOptionOverrides(oc, "arrivalpos")) { - std::string val; - switch (arrivalPosProcedure) { - case ARRIVAL_POS_GIVEN: - val = toString(arrivalPos); - break; - case ARRIVAL_POS_RANDOM: - val = "random"; - break; - case ARRIVAL_POS_MAX: - val = "max"; - break; - case ARRIVAL_POS_DEFAULT: - default: - break; - } - dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALPOS, val); - } else if (oc.isSet("arrivalpos")) { - dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALPOS, oc.getString("arrivalpos")); - } - // arrivalspeed - if (wasSet(VEHPARS_ARRIVALSPEED_SET) && !defaultOptionOverrides(oc, "arrivalspeed")) { - std::string val; - switch (arrivalSpeedProcedure) { - case ARRIVAL_SPEED_GIVEN: - val = toString(arrivalSpeed); - break; - case ARRIVAL_SPEED_CURRENT: - val = "current"; - break; - case ARRIVAL_SPEED_DEFAULT: - default: - break; - } - dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALSPEED, val); - } else if (oc.isSet("arrivalspeed")) { - dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALSPEED, oc.getString("arrivalspeed")); - } - - // color - if (wasSet(VEHPARS_COLOR_SET)) { - dev.writeAttr(SUMO_ATTR_COLOR, color); - } - if (wasSet(VEHPARS_LINE_SET)) { - dev.writeAttr(SUMO_ATTR_LINE, line); - } - 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); - } -} - - -void -SUMOVehicleParameter::writeStops(OutputDevice& dev) const { - for (std::vector::const_iterator stop = stops.begin(); stop != stops.end(); ++stop) { - dev.openTag(SUMO_TAG_STOP); - if (stop->busstop != "") { - dev.writeAttr(SUMO_ATTR_BUS_STOP, stop->busstop); - } else { - dev.writeAttr(SUMO_ATTR_LANE, stop->lane); - if ((stop->setParameter & STOP_START_SET) != 0) { - dev.writeAttr(SUMO_ATTR_STARTPOS, stop->startPos); - } - if ((stop->setParameter & STOP_END_SET) != 0) { - dev.writeAttr(SUMO_ATTR_ENDPOS, stop->endPos); - } - } - if (stop->duration >= 0) { - dev.writeAttr(SUMO_ATTR_DURATION, STEPS2TIME(stop->duration)); - } - if (stop->until >= 0) { - dev.writeAttr(SUMO_ATTR_UNTIL, STEPS2TIME(stop->until)); - } - if ((stop->setParameter & STOP_TRIGGER_SET) != 0) { - dev.writeAttr(SUMO_ATTR_TRIGGERED, stop->triggered); - } - if ((stop->setParameter & STOP_PARKING_SET) != 0) { - dev.writeAttr(SUMO_ATTR_PARKING, stop->parking); - } - // look, we are writing the set of expected persons in its current state... - // if this method is used somewhere in the simulation output, - // one should consider keeping the original values additionally, - // as the ones we write may hev changed. - if ((stop->setParameter & STOP_EXPECTED_SET) != 0) { - dev.writeAttr(SUMO_ATTR_EXPECTED, stop->awaitedPersons); - } - dev.closeTag(); - } -} - - -bool -SUMOVehicleParameter::parseDepart(const std::string& val, const std::string& element, const std::string& id, - SUMOTime& depart, DepartDefinition& dd, std::string& error) { - if (val == "triggered") { - dd = DEPART_TRIGGERED; - } else if (val == "now") { - dd = DEPART_NOW; - } else { - try { - depart = string2time(val); - dd = DEPART_GIVEN; - if (depart < 0) { - error = "Negative departure time in the definition of '" + id + "'."; - return false; - } - } catch (...) { - error = "Invalid departure time for " + element + " '" + id + "';\n must be one of (\"triggered\", \"now\", or a float >= 0)"; - return false; - } - } - return true; -} - - -bool -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)"; - } - return ok; -} - - -bool -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)"; - } - return ok; -} - - -bool -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)"; - } - return ok; -} - - -bool -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") { - ald = ARRIVAL_LANE_CURRENT; - } else { - try { - lane = TplConvert::_2int(val.c_str()); - ald = ARRIVAL_LANE_GIVEN; - if (lane < 0) { - ok = false; - } - } catch (...) { - ok = false; - } - } - if (!ok) { - error = "Invalid arrivalLane definition for " + element + " '" + id + "';\n must be one of (\"current\", or an int>=0)"; - } - return ok; -} - - -bool -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; - } - } - if (!ok) { - error = "Invalid arrivalPos definition for " + element + " '" + id + "';\n must be one of (\"random\", \"max\", or a float)"; - } - return ok; -} - - -bool -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") { - asd = ARRIVAL_SPEED_CURRENT; - } else { - try { - speed = TplConvert::_2SUMOReal(val.c_str()); - if (speed < 0) { - ok = false; - } - asd = ARRIVAL_SPEED_GIVEN; - } catch (...) { - ok = false; - } - } - if (!ok) { - error = "Invalid arrivalSpeed definition for " + element + " '" + id + "';\n must be one of (\"current\", or a float>=0)"; - } - 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.21.0+dfsg/src/utils/common/SUMOVehicleParameter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVehicleParameter.h --- sumo-0.21.0+dfsg/src/utils/common/SUMOVehicleParameter.h 2014-05-14 22:02:38.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVehicleParameter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,501 +0,0 @@ -/****************************************************************************/ -/// @file SUMOVehicleParameter.h -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Axel Wegener -/// @author Michael Behrisch -/// @date 2006-01-24 -/// @version $Id: SUMOVehicleParameter.h 16381 2014-05-14 12:31:03Z namdre $ -/// -// Structure representing possible vehicle parameter -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 SUMOVehicleParameter_h -#define SUMOVehicleParameter_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include "SUMOVehicleClass.h" -#include "RGBColor.h" -#include "SUMOTime.h" -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class OutputDevice; -class OptionsCont; - - -// =========================================================================== -// value definitions -// =========================================================================== -const int VEHPARS_COLOR_SET = 1; -const int VEHPARS_VTYPE_SET = 2; -const int VEHPARS_DEPARTLANE_SET = 2 << 1; -const int VEHPARS_DEPARTPOS_SET = 2 << 2; -const int VEHPARS_DEPARTSPEED_SET = 2 << 3; -const int VEHPARS_PERIODNUM_SET = 2 << 4; -const int VEHPARS_PERIODFREQ_SET = 2 << 5; -const int VEHPARS_ROUTE_SET = 2 << 6; -const int VEHPARS_ARRIVALLANE_SET = 2 << 7; -const int VEHPARS_ARRIVALPOS_SET = 2 << 8; -const int VEHPARS_ARRIVALSPEED_SET = 2 << 9; -const int VEHPARS_LINE_SET = 2 << 10; -const int VEHPARS_TAZ_SET = 2 << 11; -const int VEHPARS_FORCE_REROUTE = 2 << 12; -const int VEHPARS_PERSON_CAPACITY_SET = 2 << 13; -const int VEHPARS_PERSON_NUMBER_SET = 2 << 14; - -const int STOP_INDEX_END = -1; -const int STOP_INDEX_FIT = -2; - -const int STOP_END_SET = 1; -const int STOP_START_SET = 2; -const int STOP_TRIGGER_SET = 2 << 1; -const int STOP_PARKING_SET = 2 << 2; -const int STOP_EXPECTED_SET = 2 << 3; - - -// =========================================================================== -// enum definitions -// =========================================================================== -/** - * @enum DepartDefinition - * @brief Possible ways to depart - */ -enum DepartDefinition { - /// @brief The time is given - DEPART_GIVEN, - /// @brief The departure is person triggered - DEPART_TRIGGERED, - /// @brief The vehicle is discarded if emission fails (not fully implemented yet) - DEPART_NOW, - /// @brief Tag for the last element in the enum for safe int casting - DEPART_DEF_MAX -}; - - -/** - * @enum DepartLaneDefinition - * @brief Possible ways to choose a lane on depart - */ -enum DepartLaneDefinition { - /// @brief No information given; use default - DEPART_LANE_DEFAULT, - /// @brief The lane is given - DEPART_LANE_GIVEN, - /// @brief The lane is chosen randomly - DEPART_LANE_RANDOM, - /// @brief The least occupied lane is used - DEPART_LANE_FREE, - /// @brief The least occupied lane from lanes which allow the continuation - DEPART_LANE_ALLOWED_FREE, - /// @brief The least occupied lane from best lanes - DEPART_LANE_BEST_FREE, - /// @brief Tag for the last element in the enum for safe int casting - DEPART_LANE_DEF_MAX -}; - - -/** - * @enum DepartPosDefinition - * @brief Possible ways to choose the departure position - */ -enum DepartPosDefinition { - /// @brief No information given; use default - DEPART_POS_DEFAULT, - /// @brief The position is given - DEPART_POS_GIVEN, - /// @brief The position is chosen randomly - DEPART_POS_RANDOM, - /// @brief A free position is chosen - DEPART_POS_FREE, - /// @brief Back-at-zero position - DEPART_POS_BASE, - /// @brief Simple max-flow insertion by P.Wagner - DEPART_POS_PWAG_SIMPLE, - /// @brief Generic max-flow insertion by P.Wagner - DEPART_POS_PWAG_GENERIC, - /// @brief A gap is chosen where the maximum speed may be achieved - DEPART_POS_MAX_SPEED_GAP, - /// @brief If a fixed number of random choices fails, a free position is chosen - DEPART_POS_RANDOM_FREE, - /// @brief Tag for the last element in the enum for safe int casting - DEPART_POS_DEF_MAX -}; - - -/** - * @enum DepartSpeedDefinition - * @brief Possible ways to choose the departure speed - */ -enum DepartSpeedDefinition { - /// @brief No information given; use default - DEPART_SPEED_DEFAULT, - /// @brief The speed is given - DEPART_SPEED_GIVEN, - /// @brief The speed is chosen randomly - DEPART_SPEED_RANDOM, - /// @brief The maximum speed is used - DEPART_SPEED_MAX, - /// @brief Tag for the last element in the enum for safe int casting - DEPART_SPEED_DEF_MAX -}; - - -/** - * @enum ArrivalLaneDefinition - * @brief Possible ways to choose the arrival lane - */ -enum ArrivalLaneDefinition { - /// @brief No information given; use default - ARRIVAL_LANE_DEFAULT, - /// @brief The arrival lane is given - ARRIVAL_LANE_GIVEN, - /// @brief The current lane shall be used - ARRIVAL_LANE_CURRENT, - /// @brief Tag for the last element in the enum for safe int casting - ARRIVAL_LANE_DEF_MAX -}; - - -/** - * @enum ArrivalPosDefinition - * @brief Possible ways to choose the arrival position - */ -enum ArrivalPosDefinition { - /// @brief No information given; use default - ARRIVAL_POS_DEFAULT, - /// @brief The arrival position is given - ARRIVAL_POS_GIVEN, - /// @brief The arrival position is chosen randomly - ARRIVAL_POS_RANDOM, - /// @brief The maximum arrival position is used - ARRIVAL_POS_MAX, - /// @brief Tag for the last element in the enum for safe int casting - ARRIVAL_POS_DEF_MAX -}; - - -/** - * @enum ArrivalSpeedDefinition - * @brief Possible ways to choose the arrival speed - */ -enum ArrivalSpeedDefinition { - /// @brief No information given; use default - ARRIVAL_SPEED_DEFAULT, - /// @brief The speed is given - ARRIVAL_SPEED_GIVEN, - /// @brief The current speed is used - ARRIVAL_SPEED_CURRENT, - /// @brief Tag for the last element in the enum for safe int casting - ARRIVAL_SPEED_DEF_MAX -}; - - -// =========================================================================== -// struct definitions -// =========================================================================== -/** - * @class SUMOVehicleParameter - * @brief Structure representing possible vehicle parameter - * - * The fields yielding with "Procedure" describe whether the according value - * shall be used or another procedure is used to choose the value. - * @see DepartLaneDefinition - * @see DepartPosDefinition - * @see DepartSpeedDefinition - */ -class SUMOVehicleParameter : public Parameterised { -public: - /** @brief Constructor - * - * Initialises the structure with default values - */ - SUMOVehicleParameter(); - - - /** @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 (setParameter & what) != 0; - } - - - /** @brief Writes the parameters as a beginning element - * - * @param[in, out] dev The device to write into - * @param[in] oc The options to get defaults from - * @exception IOError not yet implemented - */ - void write(OutputDevice& dev, const OptionsCont& oc) const; - - - /** @brief Writes the enclosed stops - * - * @param[in, out] dev The device to write into - * @exception IOError not yet implemented - */ - void writeStops(OutputDevice& dev) const; - - /** @brief Returns whether the defaults shall be used - * @param[in] oc The options to get the options from - * @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; - - - - /// @name Depart/arrival-attributes verification - /// @{ - - /** @brief Validates a given depart value - * @param[in] val The depart 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] depart The parsed depart time, if given - * @param[out] dd The parsed departProcedure definition - * @param[out] error Error message, if an error occures - * @return Whether the given value is a valid depart definition - */ - static bool parseDepart(const std::string& val, const std::string& element, const std::string& id, - SUMOTime& depart, DepartDefinition& dd, std::string& error); - - - /** @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 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; - - /// @brief The vehicle's route id - std::string routeid; - /// @brief The vehicle's type id - std::string vtypeid; - /// @brief The vehicle's color - mutable RGBColor color; - - - /// @name Departure definition - /// @{ - - /// @brief The vehicle's departure time - SUMOTime depart; - /// @brief Information how the vehicle shall choose the depart time - DepartDefinition departProcedure; - /// @brief (optional) The lane the vehicle shall depart from (index in edge) - int departLane; - /// @brief Information how the vehicle shall choose the lane to depart from - DepartLaneDefinition departLaneProcedure; - /// @brief (optional) The position the vehicle shall depart from - SUMOReal departPos; - /// @brief Information how the vehicle shall choose the departure position - DepartPosDefinition departPosProcedure; - /// @brief (optional) The initial speed of the vehicle - SUMOReal departSpeed; - /// @brief Information how the vehicle's initial speed shall be chosen - DepartSpeedDefinition departSpeedProcedure; - /// @} - - - /// @name Arrival definition - /// @{ - - /// @brief (optional) The lane the vehicle shall arrive on (not used yet) - int arrivalLane; - /// @brief Information how the vehicle shall choose the lane to arrive on - ArrivalLaneDefinition arrivalLaneProcedure; - /// @brief (optional) The position the vehicle shall arrive on - SUMOReal arrivalPos; - /// @brief Information how the vehicle shall choose the arrival position - ArrivalPosDefinition arrivalPosProcedure; - /// @brief (optional) The final speed of the vehicle (not used yet) - SUMOReal arrivalSpeed; - /// @brief Information how the vehicle's end speed shall be chosen - ArrivalSpeedDefinition arrivalSpeedProcedure; - /// @} - - - /// @name Repetition definition - /// @{ - - /// @brief The number of times the vehicle shall be repeatedly inserted - int repetitionNumber; - /// @brief The number of times the vehicle was already inserted - int repetitionsDone; - /// @brief The time offset between vehicle reinsertions -#ifdef HAVE_SUBSECOND_TIMESTEPS - SUMOTime repetitionOffset; -#else - SUMOReal repetitionOffset; -#endif - /// @brief The probability for emitting a vehicle per second - SUMOReal repetitionProbability; - /// @} - - - /// @brief The vehicle's line (mainly for public transport) - std::string line; - - /// @brief The vehicle's origin zone (district) - std::string fromTaz; - - /// @brief The vehicle's destination zone (district) - std::string toTaz; - - /** @struct Stop - * @brief Definition of vehicle stop (position and duration) - */ - struct Stop { - /// @brief The lane to stop at - std::string lane; - /// @brief (Optional) bus stop if one is assigned to the stop - std::string busstop; - /// @brief The stopping position start - SUMOReal startPos; - /// @brief The stopping position end - SUMOReal endPos; - /// @brief The stopping duration - SUMOTime duration; - /// @brief The time at which the vehicle may continue its journey - SUMOTime until; - /// @brief whether an arriving person lets the vehicle continue - bool triggered; - /// @brief whether the vehicle is removed from the net while stopping - bool parking; - /// @brief IDs of persons the vehicle has to wait for until departing - std::set awaitedPersons; - /// @brief at which position in the stops list - int index; - /// @brief Information for the output which parameter were set - int setParameter; - }; - - /// @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 - mutable int setParameter; - - -}; - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/utils/common/SUMOVTypeParameter.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVTypeParameter.cpp --- sumo-0.21.0+dfsg/src/utils/common/SUMOVTypeParameter.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVTypeParameter.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,345 +0,0 @@ -/****************************************************************************/ -/// @file SUMOVTypeParameter.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date 10.09.2009 -/// @version $Id: SUMOVTypeParameter.cpp 16560 2014-06-09 20:54:15Z behrisch $ -/// -// Structure representing possible vehicle parameter -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 - -#ifdef CHECK_MEMORY_LEAKS -#include -#endif // CHECK_MEMORY_LEAKS - - -// =========================================================================== -// member method definitions -// =========================================================================== -SUMOVTypeParameter::SUMOVTypeParameter(const std::string& vtid, const SUMOVehicleClass vclass) - : id(vtid), length(5./*4.3*/), minGap(2.5), maxSpeed(200. / 3.6), - defaultProbability(DEFAULT_VEH_PROB), - speedFactor(1.0), speedDev(0.0), - emissionClass(PollutantsInterface::getClassByName("unknown", vclass)), color(RGBColor::DEFAULT_COLOR), - vehicleClass(vclass), impatience(0.0), - width(1.8), height(1.5), shape(SVS_UNKNOWN), - cfModel(SUMO_TAG_CF_KRAUSS), lcModel(LCM_LC2013), - setParameter(0), saved(false), onlyReferenced(false) { - switch (vclass) { - case SVC_PEDESTRIAN: - length = 0.215; - minGap = 0.5; - maxSpeed = DEFAULT_PEDESTRIAN_SPEED; - width = 0.478; - height = 1.719; - shape = SVS_PEDESTRIAN; - break; - case SVC_BICYCLE: - length = 1.6; - minGap = 0.5; - maxSpeed = 20. / 3.6; - width = 0.65; - height = 1.7; - shape = SVS_BICYCLE; - break; - case SVC_MOPED: - length = 2.1; - maxSpeed = 60. / 3.6; - width = 0.8; - height = 1.7; - shape = SVS_MOPED; - break; - case SVC_MOTORCYCLE: - length = 2.2; - width = 0.9; - height = 1.5; - shape = SVS_MOTORCYCLE; - break; - case SVC_TRUCK: - length = 7.1; - maxSpeed = 130. / 3.6; - width = 2.4; - height = 2.4; - shape = SVS_TRUCK; - break; - case SVC_TRAILER: - length = 16.5; - maxSpeed = 130. / 3.6; - width = 2.55; - height = 4.; - shape = SVS_TRUCK_SEMITRAILER; - break; - case SVC_BUS: - length = 12.; - maxSpeed = 100. / 3.6; - width = 2.5; - height = 3.4; - shape = SVS_BUS; - break; - case SVC_COACH: - length = 14.; - maxSpeed = 100. / 3.6; - width = 2.6; - height = 4.; - shape = SVS_BUS_COACH; - break; - case SVC_TRAM: - length = 22.; - maxSpeed = 80. / 3.6; - width = 2.4; - height = 3.2; - shape = SVS_RAIL_CAR; - break; - case SVC_RAIL_URBAN: - length = 36.5 * 3; - maxSpeed = 100. / 3.6; - width = 3.0; - height = 3.6; - shape = SVS_RAIL_CAR; - break; - case SVC_RAIL: - length = 67.5 * 2; - maxSpeed = 160. / 3.6; - width = 2.84; - height = 3.75; - shape = SVS_RAIL; - break; - case SVC_RAIL_ELECTRIC: - length = 25. * 8; - maxSpeed = 330. / 3.6; - width = 2.95; - height = 3.89; - shape = SVS_RAIL; - break; - case SVC_DELIVERY: - length = 6.5; - width = 2.16; - height = 2.86; - shape = SVS_DELIVERY; - break; - case SVC_EMERGENCY: - length = 6.5; - width = 2.16; - height = 2.86; - shape = SVS_DELIVERY; - break; - case SVC_PASSENGER: - shape = SVS_PASSENGER; - break; - case SVC_E_VEHICLE: - shape = SVS_E_VEHICLE; - break; - default: - break; - } -} - - -void -SUMOVTypeParameter::write(OutputDevice& dev) const { - if (onlyReferenced) { - return; - } - dev.openTag(SUMO_TAG_VTYPE); - dev.writeAttr(SUMO_ATTR_ID, id); - if (wasSet(VTYPEPARS_LENGTH_SET)) { - dev.writeAttr(SUMO_ATTR_LENGTH, length); - } - if (wasSet(VTYPEPARS_MINGAP_SET)) { - dev.writeAttr(SUMO_ATTR_MINGAP, minGap); - } - if (wasSet(VTYPEPARS_MAXSPEED_SET)) { - dev.writeAttr(SUMO_ATTR_MAXSPEED, maxSpeed); - } - if (wasSet(VTYPEPARS_PROBABILITY_SET)) { - dev.writeAttr(SUMO_ATTR_PROB, defaultProbability); - } - if (wasSet(VTYPEPARS_SPEEDFACTOR_SET)) { - dev.writeAttr(SUMO_ATTR_SPEEDFACTOR, speedFactor); - } - if (wasSet(VTYPEPARS_SPEEDDEVIATION_SET)) { - dev.writeAttr(SUMO_ATTR_SPEEDDEV, speedDev); - } - if (wasSet(VTYPEPARS_VEHICLECLASS_SET)) { - dev.writeAttr(SUMO_ATTR_VCLASS, toString(vehicleClass)); - } - if (wasSet(VTYPEPARS_EMISSIONCLASS_SET)) { - dev.writeAttr(SUMO_ATTR_EMISSIONCLASS, PollutantsInterface::getName(emissionClass)); - } - if (wasSet(VTYPEPARS_IMPATIENCE_SET)) { - if (impatience == -std::numeric_limits::max()) { - dev.writeAttr(SUMO_ATTR_IMPATIENCE, "off"); - } else { - dev.writeAttr(SUMO_ATTR_IMPATIENCE, impatience); - } - } - if (wasSet(VTYPEPARS_SHAPE_SET)) { - dev.writeAttr(SUMO_ATTR_GUISHAPE, getVehicleShapeName(shape)); - } - if (wasSet(VTYPEPARS_WIDTH_SET)) { - dev.writeAttr(SUMO_ATTR_WIDTH, width); - } - if (wasSet(VTYPEPARS_HEIGHT_SET)) { - dev.writeAttr(SUMO_ATTR_HEIGHT, height); - } - if (wasSet(VTYPEPARS_COLOR_SET)) { - dev.writeAttr(SUMO_ATTR_COLOR, color); - } - if (wasSet(VTYPEPARS_OSGFILE_SET)) { - dev.writeAttr(SUMO_ATTR_OSGFILE, osgFile); - } - if (wasSet(VTYPEPARS_IMGFILE_SET)) { - dev.writeAttr(SUMO_ATTR_IMGFILE, imgFile); - } - if (wasSet(VTYPEPARS_LANE_CHANGE_MODEL_SET)) { - dev.writeAttr(SUMO_ATTR_LANE_CHANGE_MODEL, lcModel); - } - - if (cfParameter.size() != 0) { - dev.openTag(cfModel); - std::vector attrs; - for (CFParams::const_iterator i = cfParameter.begin(); i != cfParameter.end(); ++i) { - attrs.push_back(i->first); - } - std::sort(attrs.begin(), attrs.end()); - for (std::vector::const_iterator i = attrs.begin(); i != attrs.end(); ++i) { - dev.writeAttr(*i, cfParameter.find(*i)->second); - } - dev.closeTag(); - dev.closeTag(); - } else { - dev.closeTag(); - } -} - - -SUMOReal -SUMOVTypeParameter::get(const SumoXMLAttr attr, const SUMOReal defaultValue) const { - if (cfParameter.count(attr)) { - return cfParameter.find(attr)->second; - } else { - return defaultValue; - } -} - - -SUMOReal -SUMOVTypeParameter::getDefaultAccel(const SUMOVehicleClass vc) { - switch (vc) { - case SVC_PEDESTRIAN: - return 1.5; - case SVC_BICYCLE: - return 1.2; - case SVC_MOTORCYCLE: - return 6.; - case SVC_MOPED: - return 1.1; - case SVC_TRUCK: - return 1.3; - case SVC_TRAILER: - return 1.1; - case SVC_BUS: - return 1.2; - case SVC_COACH: - return 2.; - case SVC_TRAM: - return 1.; - case SVC_RAIL_URBAN: - return 1.; - case SVC_RAIL: - return 0.25; - case SVC_RAIL_ELECTRIC: - return 0.5; - default: - return 2.6;//2.9; - } -} - - -SUMOReal -SUMOVTypeParameter::getDefaultDecel(const SUMOVehicleClass vc) { - switch (vc) { - case SVC_PEDESTRIAN: - return 2.; - case SVC_BICYCLE: - return 3.; - case SVC_MOPED: - return 7.; - case SVC_MOTORCYCLE: - return 10.; - case SVC_TRUCK: - return 4.; - case SVC_TRAILER: - return 4.; - case SVC_BUS: - return 4.; - case SVC_COACH: - return 4.; - case SVC_TRAM: - return 3.; - case SVC_RAIL_URBAN: - return 3.; - case SVC_RAIL: - return 1.3; - case SVC_RAIL_ELECTRIC: - return 1.3; - default: - return 4.5;//7.5; - } -} - - -SUMOReal -SUMOVTypeParameter::getDefaultImperfection(const SUMOVehicleClass vc) { - switch (vc) { - case SVC_TRAM: - case SVC_RAIL_URBAN: - case SVC_RAIL: - case SVC_RAIL_ELECTRIC: - return 0.; - default: - return 0.5; - } -} - - -const SUMOVTypeParameter& -SUMOVTypeParameter::getDefault() { - static SUMOVTypeParameter defaultParams(""); - return defaultParams; -} - - -/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/common/SUMOVTypeParameter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVTypeParameter.h --- sumo-0.21.0+dfsg/src/utils/common/SUMOVTypeParameter.h 2014-04-18 22:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SUMOVTypeParameter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,210 +0,0 @@ -/****************************************************************************/ -/// @file SUMOVTypeParameter.h -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date 10.09.2009 -/// @version $Id: SUMOVTypeParameter.h 16221 2014-04-18 17:20:33Z behrisch $ -/// -// Structure representing possible vehicle parameter -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 SUMOVTypeParameter_h -#define SUMOVTypeParameter_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include "SUMOVehicleClass.h" -#include "RGBColor.h" -#include "SUMOTime.h" -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class OutputDevice; -class OptionsCont; - - -// =========================================================================== -// value definitions -// =========================================================================== -const int VTYPEPARS_LENGTH_SET = 1; -const int VTYPEPARS_MINGAP_SET = 2; -const int VTYPEPARS_MAXSPEED_SET = 2 << 2; -const int VTYPEPARS_PROBABILITY_SET = 2 << 3; -const int VTYPEPARS_SPEEDFACTOR_SET = 2 << 4; -const int VTYPEPARS_SPEEDDEVIATION_SET = 2 << 5; -const int VTYPEPARS_EMISSIONCLASS_SET = 2 << 6; -const int VTYPEPARS_COLOR_SET = 2 << 7; -const int VTYPEPARS_VEHICLECLASS_SET = 2 << 8; -const int VTYPEPARS_WIDTH_SET = 2 << 9; -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; -const int VTYPEPARS_IMPATIENCE_SET = 2 << 14; -const int VTYPEPARS_LANE_CHANGE_MODEL_SET = 2 << 15; - - -// =========================================================================== -// struct definitions -// =========================================================================== -/** - * @class SUMOVTypeParameter - * @brief Structure representing possible vehicle parameter - */ -class SUMOVTypeParameter : public Parameterised { -public: - /** @brief Constructor - * - * Initialises the structure with default values - */ - SUMOVTypeParameter(const std::string& vtid, const SUMOVehicleClass vc = SVC_IGNORING); - - - /** @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 (setParameter & what) != 0; - } - - - /** @brief Writes the vtype - * - * @param[in, out] dev The device to write into - * @exception IOError not yet implemented - */ - void write(OutputDevice& dev) const; - - /** @brief Validates stored car-following parameter - */ - void validateCFParameter() const; - - - /** @brief Returns the named value from the map, or the default if it is not contained there - * @param[in] attr The corresponding xml attribute - * @param[in] defaultValue The value to return if the given map does not contain the named variable - * @return The named value from the map or the default if it does not exist there - */ - SUMOReal get(const SumoXMLAttr attr, const SUMOReal defaultValue) const; - - - /// @brief The vehicle type's id - std::string id; - - /// @brief The physical vehicle length - SUMOReal length; - /// @brief This class' free space in front of the vehicle itself - SUMOReal minGap; - /// @brief The vehicle type's maximum speed [m/s] - SUMOReal maxSpeed; - /// @brief The probability when being added to a distribution without an explicit probability - SUMOReal defaultProbability; - /// @brief The factor by which the maximum speed may deviate from the allowed max speed on the street - SUMOReal speedFactor; - /// @brief The standard deviation for speed variations - SUMOReal speedDev; - /// @brief The emission class of this vehicle - SUMOEmissionClass emissionClass; - /// @brief The color - RGBColor color; - /// @brief The vehicle's class - SUMOVehicleClass vehicleClass; - /// @brief The vehicle's impatience (willingness to obstruct others) - SUMOReal impatience; - - - /// @name Values for drawing this class' vehicles - /// @{ - - /// @brief This class' width - SUMOReal width; - - /// @brief This class' height - SUMOReal height; - - /// @brief This class' shape - SUMOVehicleShape shape; - - /// @brief 3D model file for this class - std::string osgFile; - - /// @brief Image file for this class - std::string imgFile; - /// @} - - - /// @brief The enum-representation of the car-following model to use - SumoXMLTag cfModel; - - /// @brief Car-following parameter - typedef std::map CFParams; - CFParams cfParameter; - - /// @brief The lane-change model to use - LaneChangeModel lcModel; - - /// @brief Information for the router which parameter were set - int setParameter; - - - /// @brief Information whether this type was already saved (needed by routers) - mutable bool saved; - - /// @brief Information whether this is a type-stub, being only referenced but not defined (needed by routers) - mutable bool onlyReferenced; - - /** @brief Returns the default acceleration for the given vehicle class - * This needs to be a function because the actual value is stored in the car following model - * @param[in] vc the vehicle class - * @return the acceleration in m/s^2 - */ - static SUMOReal getDefaultAccel(const SUMOVehicleClass vc = SVC_IGNORING); - - /** @brief Returns the default deceleration for the given vehicle class - * This needs to be a function because the actual value is stored in the car following model - * @param[in] vc the vehicle class - * @return the deceleration in m/s^2 - */ - static SUMOReal getDefaultDecel(const SUMOVehicleClass vc = SVC_IGNORING); - - /** @brief Returns the default driver's imperfection (sigma or epsilon in Krauss' model) for the given vehicle class - * This needs to be a function because the actual value is stored in the car following model - * @param[in] vc the vehicle class - * @return the imperfection as a value between 0 and 1 - */ - static SUMOReal getDefaultImperfection(const SUMOVehicleClass vc = SVC_IGNORING); - - /// @brief return the default parameters, this is a function due to the http://www.parashift.com/c++-faq/static-init-order.html - static const SUMOVTypeParameter& getDefault(); - -}; - -#endif - -/****************************************************************************/ - diff -Nru sumo-0.21.0+dfsg/src/utils/common/SystemFrame.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SystemFrame.cpp --- sumo-0.21.0+dfsg/src/utils/common/SystemFrame.cpp 2014-04-11 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SystemFrame.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 23.06.2003 -/// @version $Id: SystemFrame.cpp 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: SystemFrame.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A set of actions common to all applications /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -105,6 +105,9 @@ oc.doRegister("error-log", new Option_FileName()); oc.addDescription("error-log", "Report", "Writes all warnings and errors to FILE"); + + oc.doRegister("output-prefix", new Option_FileName());//!!! check, describe + oc.addDescription("output-prefix", "Output", "Prefix which is applied to all output files. The special string 'TIME' is replaced by the current time."); } diff -Nru sumo-0.21.0+dfsg/src/utils/common/SystemFrame.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SystemFrame.h --- sumo-0.21.0+dfsg/src/utils/common/SystemFrame.h 2014-04-11 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SystemFrame.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 23.06.2003 -/// @version $Id: SystemFrame.h 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: SystemFrame.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A set of actions common to all applications /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/SysUtils.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SysUtils.cpp --- sumo-0.21.0+dfsg/src/utils/common/SysUtils.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SysUtils.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Tue, 29.05.2005 -/// @version $Id: SysUtils.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: SysUtils.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A few system-specific functions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/SysUtils.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SysUtils.h --- sumo-0.21.0+dfsg/src/utils/common/SysUtils.h 2014-03-19 23:02:08.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/SysUtils.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file SysUtils.h /// @author Daniel Krajzewicz /// @date Fri, 29.04.2005 -/// @version $Id: SysUtils.h 15974 2014-03-19 13:47:12Z namdre $ +/// @version $Id: SysUtils.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A few system-specific functions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/ToString.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/ToString.h --- sumo-0.21.0+dfsg/src/utils/common/ToString.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/ToString.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 23 Sep 2002 -/// @version $Id: ToString.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: ToString.h 18095 2015-03-17 09:39:00Z behrisch $ /// // ------------------- /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -137,10 +137,16 @@ template inline std::string toString(const std::vector& v, std::streamsize accuracy = OUTPUT_ACCURACY) { + return toString(v.begin(), v.end(), accuracy); +} + + +template +inline std::string toString(const typename std::vector::const_iterator& b, const typename std::vector::const_iterator& e, std::streamsize accuracy = OUTPUT_ACCURACY) { UNUSED_PARAMETER(accuracy); std::ostringstream oss; - for (typename std::vector::const_iterator it = v.begin(); it != v.end(); ++it) { - if (it != v.begin()) { + for (typename std::vector::const_iterator it = b; it != e; ++it) { + if (it != b) { oss << " "; } oss << (*it)->getID(); diff -Nru sumo-0.21.0+dfsg/src/utils/common/TplConvert.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/TplConvert.h --- sumo-0.21.0+dfsg/src/utils/common/TplConvert.h 2014-06-03 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/TplConvert.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sun, 09 Jun 2002 -/// @version $Id: TplConvert.h 16498 2014-06-03 14:37:26Z namdre $ +/// @version $Id: TplConvert.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some conversion methods (from strings to other) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/UtilExceptions.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/UtilExceptions.h --- sumo-0.21.0+dfsg/src/utils/common/UtilExceptions.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/UtilExceptions.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Felix Brack /// @date Mon, 17 Dec 2001 -/// @version $Id: UtilExceptions.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: UtilExceptions.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Exceptions for used by some utility classes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -41,20 +41,6 @@ // class definitions // =========================================================================== /** - * InvalidArgument - * Thrown when an argument was not proper in the current context - * A message will be supplied - */ -class InvalidArgument : public std::runtime_error { -public: - /** constructor */ - InvalidArgument(const std::string& message) - : std::runtime_error(message) {} - -}; - - -/** * ProcessError * A general exception type that may be thrown when the process is no * longer able to proceed due to any reason. The reason itself is mostly @@ -72,6 +58,20 @@ }; + +/** + * InvalidArgument + * Thrown when an argument was not proper in the current context + * A message will be supplied + */ +class InvalidArgument : public ProcessError { +public: + /** constructor */ + InvalidArgument(const std::string& message) + : ProcessError(message) {} + +}; + /** * EmptyData diff -Nru sumo-0.21.0+dfsg/src/utils/common/ValueRetriever.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/ValueRetriever.h --- sumo-0.21.0+dfsg/src/utils/common/ValueRetriever.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/ValueRetriever.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file ValueRetriever.h /// @author Daniel Krajzewicz /// @date Fri, 29.04.2005 -/// @version $Id: ValueRetriever.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ValueRetriever.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/ValueSource.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/ValueSource.h --- sumo-0.21.0+dfsg/src/utils/common/ValueSource.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/ValueSource.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file ValueSource.h /// @author Daniel Krajzewicz /// @date Fri, 29.04.2005 -/// @version $Id: ValueSource.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ValueSource.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/ValueTimeLine.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/ValueTimeLine.h --- sumo-0.21.0+dfsg/src/utils/common/ValueTimeLine.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/ValueTimeLine.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: ValueTimeLine.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: ValueTimeLine.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A list of time ranges with assigned values /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/common/VectorHelper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/VectorHelper.h --- sumo-0.21.0+dfsg/src/utils/common/VectorHelper.h 2014-06-04 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/VectorHelper.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: VectorHelper.h 16508 2014-06-04 06:06:36Z namdre $ +/// @version $Id: VectorHelper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A simple vector of SUMOReals /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -33,6 +33,7 @@ #endif #include +#include #include #include @@ -95,8 +96,8 @@ } 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++) { + T m = -std::numeric_limits::max(); + for (typename std::vector::const_iterator j = v.begin() ; j != v.end(); j++) { if ((*j) > m) { m = *j; } @@ -105,8 +106,8 @@ } 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++) { + T m = std::numeric_limits::max(); + for (typename std::vector::const_iterator j = v.begin(); j != v.end(); j++) { if ((*j) < m) { m = *j; } diff -Nru sumo-0.21.0+dfsg/src/utils/common/WrappingCommand.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/WrappingCommand.h --- sumo-0.21.0+dfsg/src/utils/common/WrappingCommand.h 2014-02-22 23:02:33.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/common/WrappingCommand.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Christian Roessel /// @author Daniel Krajzewicz /// @date Thu, 20 Dec 2001 -/// @version $Id: WrappingCommand.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: WrappingCommand.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A wrapper for a Command function /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/distribution/DistributionCont.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/DistributionCont.cpp --- sumo-0.21.0+dfsg/src/utils/distribution/DistributionCont.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/DistributionCont.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file DistributionCont.cpp /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: DistributionCont.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: DistributionCont.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A container for distributions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/distribution/DistributionCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/DistributionCont.h --- sumo-0.21.0+dfsg/src/utils/distribution/DistributionCont.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/DistributionCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file DistributionCont.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: DistributionCont.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: DistributionCont.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A container for distributions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/distribution/Distribution.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Distribution.h --- sumo-0.21.0+dfsg/src/utils/distribution/Distribution.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Distribution.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file Distribution.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: Distribution.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Distribution.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The base class for distribution descriptions. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/distribution/Distribution_MeanDev.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Distribution_MeanDev.cpp --- sumo-0.21.0+dfsg/src/utils/distribution/Distribution_MeanDev.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Distribution_MeanDev.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file Distribution_MeanDev.cpp /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: Distribution_MeanDev.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Distribution_MeanDev.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A distribution described by the mean value and std-dev amount /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/distribution/Distribution_MeanDev.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Distribution_MeanDev.h --- sumo-0.21.0+dfsg/src/utils/distribution/Distribution_MeanDev.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Distribution_MeanDev.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file Distribution_MeanDev.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: Distribution_MeanDev.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Distribution_MeanDev.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A distribution described by the mean value and std-dev amount /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/distribution/Distribution_Points.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Distribution_Points.cpp --- sumo-0.21.0+dfsg/src/utils/distribution/Distribution_Points.cpp 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Distribution_Points.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: Distribution_Points.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Distribution_Points.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The description of a distribution by a curve /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/distribution/Distribution_Points.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Distribution_Points.h --- sumo-0.21.0+dfsg/src/utils/distribution/Distribution_Points.h 2014-02-22 23:02:28.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Distribution_Points.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: Distribution_Points.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Distribution_Points.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The description of a distribution by a curve /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/distribution/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Makefile.am --- sumo-0.21.0+dfsg/src/utils/distribution/Makefile.am 2013-05-03 20:25:11.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -1,7 +1,5 @@ noinst_LIBRARIES = libdistribution.a -EXTRA_DIST = Distribution.h - libdistribution_a_SOURCES = DistributionCont.cpp \ Distribution_MeanDev.cpp \ Distribution_Points.cpp \ diff -Nru sumo-0.21.0+dfsg/src/utils/distribution/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Makefile.in --- sumo-0.21.0+dfsg/src/utils/distribution/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/distribution/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -221,6 +221,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -231,7 +233,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -326,7 +327,6 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libdistribution.a -EXTRA_DIST = Distribution.h libdistribution_a_SOURCES = DistributionCont.cpp \ Distribution_MeanDev.cpp \ Distribution_Points.cpp \ diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/HelpersHarmonoise.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersHarmonoise.cpp --- sumo-0.21.0+dfsg/src/utils/emissions/HelpersHarmonoise.cpp 2014-04-25 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersHarmonoise.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: HelpersHarmonoise.cpp 16253 2014-04-25 12:09:01Z behrisch $ +/// @version $Id: HelpersHarmonoise.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Noise data collector for edges/lanes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/HelpersHarmonoise.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersHarmonoise.h --- sumo-0.21.0+dfsg/src/utils/emissions/HelpersHarmonoise.h 2014-04-25 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersHarmonoise.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: HelpersHarmonoise.h 16253 2014-04-25 12:09:01Z behrisch $ +/// @version $Id: HelpersHarmonoise.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Helper methods for Harmonoise-based noise emission computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/HelpersHBEFA3.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersHBEFA3.cpp --- sumo-0.21.0+dfsg/src/utils/emissions/HelpersHBEFA3.cpp 2014-06-10 22:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersHBEFA3.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: HelpersHBEFA3.cpp 16575 2014-06-10 13:49:15Z behrisch $ +/// @version $Id: HelpersHBEFA3.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Helper methods for HBEFA3-based emission computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -477,7 +477,7 @@ myEmissionClassStrings.addAlias(heavy[i], index); index++; } - myEmissionClassStrings.addAlias("unknown", myEmissionClassStrings.get("PC")); + myEmissionClassStrings.addAlias("unknown", myEmissionClassStrings.get("PC_G_EU4")); } diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/HelpersHBEFA3.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersHBEFA3.h --- sumo-0.21.0+dfsg/src/utils/emissions/HelpersHBEFA3.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersHBEFA3.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: HelpersHBEFA3.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: HelpersHBEFA3.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Helper methods for HBEFA3-based emission computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/HelpersHBEFA.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersHBEFA.cpp --- sumo-0.21.0+dfsg/src/utils/emissions/HelpersHBEFA.cpp 2014-06-10 22:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersHBEFA.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: HelpersHBEFA.cpp 16575 2014-06-10 13:49:15Z behrisch $ +/// @version $Id: HelpersHBEFA.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Helper methods for HBEFA-based emission computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/HelpersHBEFA.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersHBEFA.h --- sumo-0.21.0+dfsg/src/utils/emissions/HelpersHBEFA.h 2014-04-28 22:02:24.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersHBEFA.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 10.05.2004 -/// @version $Id: HelpersHBEFA.h 16256 2014-04-28 08:20:32Z behrisch $ +/// @version $Id: HelpersHBEFA.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Helper methods for HBEFA-based emission computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/HelpersPHEMlight.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersPHEMlight.cpp --- sumo-0.21.0+dfsg/src/utils/emissions/HelpersPHEMlight.cpp 2014-06-10 22:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersPHEMlight.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Nikolaus Furian /// @date Sat, 20.04.2013 -/// @version $Id: HelpersPHEMlight.cpp 16575 2014-06-10 13:49:15Z behrisch $ +/// @version $Id: HelpersPHEMlight.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Helper methods for PHEMlight-based emission computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -79,7 +79,7 @@ SUMOReal -HelpersPHEMlight::getMaxAccel(SUMOEmissionClass c, double v, double a, double slope) { +HelpersPHEMlight::getMaxAccel(SUMOEmissionClass c, double v, double a, double slope) const { PHEMCEP* currCep = PHEMCEPHandler::getHandlerInstance().GetCep(c); if (currCep == 0) { return -1.; @@ -232,30 +232,35 @@ SUMOReal HelpersPHEMlight::compute(const SUMOEmissionClass c, const PollutantsInterface::EmissionType e, const double v, const double a, const double slope) const { - const PHEMCEP* const currCep = PHEMCEPHandler::getHandlerInstance().GetCep(c); - if (currCep == 0) { + if (c == PHEMLIGHT_BASE) { // zero emission class return 0.; } - const double power = currCep->CalcPower(v, a, slope); + const PHEMCEP* const currCep = PHEMCEPHandler::getHandlerInstance().GetCep(c); + const double corrSpeed = MAX2((double) 0.0, v); + const double decelCoast = currCep->GetDecelCoast(corrSpeed, a, slope, 0); + if (a < decelCoast) { + return 0; + } + double power = currCep->CalcPower(corrSpeed, a, slope); switch (e) { case PollutantsInterface::CO: - return currCep->GetEmission("CO", power) / SECONDS_PER_HOUR * 1000.; + return currCep->GetEmission("CO", power, corrSpeed) / SECONDS_PER_HOUR * 1000.; case PollutantsInterface::CO2: - return currCep->GetEmission("FC", power) * 3.15 / SECONDS_PER_HOUR * 1000.; + return currCep->GetEmission("FC", power, corrSpeed) * 3.15 / SECONDS_PER_HOUR * 1000.; case PollutantsInterface::HC: - return currCep->GetEmission("HC", power) / SECONDS_PER_HOUR * 1000.; + return currCep->GetEmission("HC", power, corrSpeed) / SECONDS_PER_HOUR * 1000.; case PollutantsInterface::NO_X: - return currCep->GetEmission("NOx", power) / SECONDS_PER_HOUR * 1000.; + return currCep->GetEmission("NOx", power, corrSpeed) / SECONDS_PER_HOUR * 1000.; case PollutantsInterface::PM_X: - return currCep->GetEmission("PM", power) / SECONDS_PER_HOUR * 1000.; + return currCep->GetEmission("PM", power, corrSpeed) / SECONDS_PER_HOUR * 1000.; case PollutantsInterface::FUEL: { std::string fuelType = currCep->GetVehicleFuelType(); if (fuelType == "D") { // divide by average diesel density of 836 g/l - return currCep->GetEmission("FC", power) / 836. / SECONDS_PER_HOUR * 1000.; + return currCep->GetEmission("FC", power, corrSpeed) / 836. / SECONDS_PER_HOUR * 1000.; } else if (fuelType == "G") { // divide by average gasoline density of 742 g/l - return currCep->GetEmission("FC", power) / 742. / SECONDS_PER_HOUR * 1000.; + return currCep->GetEmission("FC", power, corrSpeed) / 742. / SECONDS_PER_HOUR * 1000.; } else { - return currCep->GetEmission("FC", power) / SECONDS_PER_HOUR * 1000.; // surely false, but at least not additionally modified + return currCep->GetEmission("FC", power, corrSpeed) / SECONDS_PER_HOUR * 1000.; // surely false, but at least not additionally modified } } } diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/HelpersPHEMlight.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersPHEMlight.h --- sumo-0.21.0+dfsg/src/utils/emissions/HelpersPHEMlight.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/HelpersPHEMlight.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,11 +3,11 @@ /// @author Daniel Krajzewicz /// @author Nikolaus Furian /// @date Sat, 20.04.2013 -/// @version $Id: HelpersPHEMlight.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: HelpersPHEMlight.h 17682 2015-01-23 07:27:34Z behrisch $ /// // Helper methods for PHEMlight-based emission computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ // Copyright (C) 2013-2012 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // @@ -105,7 +105,7 @@ * @param[in] slope The road's slope at vehicle's position [°] * @return The maximum possible acceleration */ - SUMOReal getMaxAccel(SUMOEmissionClass c, double v, double a, double slope); + SUMOReal getMaxAccel(SUMOEmissionClass c, double v, double a, double slope) const; /** @brief Returns the amount of emitted pollutant given the vehicle type and state (in mg/s or in ml/s for fuel) diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/Makefile.in --- sumo-0.21.0+dfsg/src/utils/emissions/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -223,6 +223,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -233,7 +235,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/PHEMCEP.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PHEMCEP.cpp --- sumo-0.21.0+dfsg/src/utils/emissions/PHEMCEP.cpp 2014-04-11 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PHEMCEP.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Marek Heinrich /// @date Thu, 13.06.2013 -/// @version $Id: PHEMCEP.cpp 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: PHEMCEP.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Helper class for PHEM Light, holds a specific CEP for a PHEM emission class /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -46,37 +46,50 @@ // =========================================================================== // method definitions // =========================================================================== -PHEMCEP::PHEMCEP(bool heavyVehicel, SUMOEmissionClass emissionClass, const std::string& emissionClassIdentifier, +PHEMCEP::PHEMCEP(bool heavyVehicle, SUMOEmissionClass emissionClass, const std::string& emissionClassIdentifier, double vehicleMass, double vehicleLoading, double vehicleMassRot, - double crossArea, double cWValue, + double crossArea, double cdValue, double f0, double f1, double f2, double f3, double f4, - double ratedPower, double pNormV0, double pNormP0, double pNormV1, - double pNormP1, std::string vehicelFuelType, + double ratedPower, double pNormV0, double pNormP0, double pNormV1, double pNormP1, + double axleRatio, double engineIdlingSpeed, double engineRatedSpeed, double effectiveWheelDiameter, + double idlingFC, + const std::string& vehicleFuelType, const std::vector< std::vector >& matrixFC, const std::vector& headerLinePollutants, const std::vector< std::vector >& matrixPollutants, - const std::vector< std::vector > matrixSpeedRotational) { + const std::vector< std::vector >& matrixSpeedRotational, + const std::vector< std::vector >& normedDragTable, + const std::vector& idlingValuesPollutants) { _emissionClass = emissionClass; _resistanceF0 = f0; _resistanceF1 = f1; _resistanceF2 = f2; _resistanceF3 = f3; _resistanceF4 = f4; - _cwValue = cWValue; + _cdValue = cdValue; _crossSectionalArea = crossArea; _massVehicle = vehicleMass; _vehicleLoading = vehicleLoading; _massRot = vehicleMassRot; _ratedPower = ratedPower; - _vehicleFuelType = vehicelFuelType; + _vehicleFuelType = vehicleFuelType; _pNormV0 = pNormV0 / 3.6; _pNormP0 = pNormP0; _pNormV1 = pNormV1 / 3.6; _pNormP1 = pNormP1; + _axleRatio = axleRatio; + _engineIdlingSpeed = engineIdlingSpeed; + _engineRatedSpeed = engineRatedSpeed; + _effictiveWheelDiameter = effectiveWheelDiameter; + + _heavyVehicle = heavyVehicle; + _idlingFC = idlingFC; + std::vector pollutantIdentifier; std::vector< std::vector > pollutantMeasures; + std::vector > normalizedPollutantMeasures; // init pollutant identifiers for (int i = 0; i < (int)headerLinePollutants.size(); i++) { @@ -90,41 +103,67 @@ // initialize measures for (int i = 0; i < (int)headerLinePollutants.size(); i++) { pollutantMeasures.push_back(std::vector()); + normalizedPollutantMeasures.push_back(std::vector()); } // end for // looping through matrix and assigning values for speed rotational table _speedCurveRotational.clear(); _speedPatternRotational.clear(); + _gearTransmissionCurve.clear(); for (int i = 0; i < (int)matrixSpeedRotational.size(); i++) { - if (matrixSpeedRotational[i].size() != 2) { + if (matrixSpeedRotational[i].size() != 3) { throw InvalidArgument("Error loading vehicle file for: " + emissionClassIdentifier); } _speedPatternRotational.push_back(matrixSpeedRotational[i][0] / 3.6); _speedCurveRotational.push_back(matrixSpeedRotational[i][1]); + _gearTransmissionCurve.push_back(matrixSpeedRotational[i][2]); + } // end for + + // looping through matrix and assigning values for drag table + _nNormTable.clear(); + _dragNormTable.clear(); + for (int i = 0; i < (int) normedDragTable.size(); i++) { + if (normedDragTable[i].size() != 2) { + return; + } + + _nNormTable.push_back(normedDragTable[i][0]); + _dragNormTable.push_back(normedDragTable[i][1]); } // end for // looping through matrix and assigning values for Fuel consumption _cepCurveFC.clear(); + _powerPatternFC.clear(); + _normalizedPowerPatternFC.clear(); + _normedCepCurveFC.clear(); for (int i = 0; i < (int)matrixFC.size(); i++) { if (matrixFC[i].size() != 2) { throw InvalidArgument("Error loading vehicle file for: " + emissionClassIdentifier); } _powerPatternFC.push_back(matrixFC[i][0] * _ratedPower); - _cepCurveFC.push_back(matrixFC[i][1]); + _normalizedPowerPatternFC.push_back(matrixFC[i][0]); + _cepCurveFC.push_back(matrixFC[i][1] * _ratedPower); + _normedCepCurveFC.push_back(matrixFC[i][1]); } // end for + _powerPatternPollutants.clear(); + double pollutantMultiplyer = 1; + + _drivingPower = _normalizingPower = CalcPower(NORMALIZING_SPEED, NORMALIZING_ACCELARATION, 0, vehicleLoading); // looping through matrix and assigning values for pollutants - double normalizingPower = 0; - if (heavyVehicel) { - normalizingPower = _ratedPower; + if (heavyVehicle) { + _normalizingPower = _ratedPower; + pollutantMultiplyer = _ratedPower; + _normalizingType = RatedPower; } else { - normalizingPower = PHEMCEP::CalcPower(NORMALIZING_SPEED, NORMALIZING_ACCELARATION, 0); + _normalizingPower = _drivingPower; + _normalizingType = DrivingPower; } // end if const int headerCount = (int)headerLinePollutants.size(); @@ -135,17 +174,23 @@ } if (j == 0) { - _powerPatternPollutants.push_back(matrixPollutants[i][j] * normalizingPower); + _normailzedPowerPatternPollutants.push_back(matrixPollutants[i][j]); + _powerPatternPollutants.push_back(matrixPollutants[i][j] * _normalizingPower); } else { - pollutantMeasures[j - 1].push_back(matrixPollutants[i][j]); + pollutantMeasures[j - 1].push_back(matrixPollutants[i][j] * pollutantMultiplyer); + normalizedPollutantMeasures[j - 1].push_back(matrixPollutants[i][j]); } // end if } // end for } // end for - for (int i = 0; i < headerCount; i++) { + for (int i = 0; i < (int) headerLinePollutants.size(); i++) { _cepCurvePollutants.insert(pollutantIdentifier[i], pollutantMeasures[i]); + _normalizedCepCurvePollutants.insert(pollutantIdentifier[i], normalizedPollutantMeasures[i]); + _idlingValuesPollutants.insert(pollutantIdentifier[i], idlingValuesPollutants[i] * pollutantMultiplyer); } // end for + _idlingFC = idlingFC * _ratedPower; + } // end of Cep @@ -160,39 +205,39 @@ double -PHEMCEP::CalcPower(double v, double a, double slope) const { - const double rotFactor = GetRotationalCoeffecient(v); - double power = (_massVehicle + _vehicleLoading) * GRAVITY_CONST * (_resistanceF0 + _resistanceF1 * v + _resistanceF4 * pow(v, 4)) * v; - power += (_crossSectionalArea * _cwValue * AIR_DENSITY_CONST / 2) * pow(v, 3); - power += (_massVehicle * rotFactor + _massRot + _vehicleLoading) * a * v; - power += (_massVehicle + _vehicleLoading) * slope * 0.01 * v; - return power / 950.; -} - - -double -PHEMCEP::GetMaxAccel(double v, double a, double gradient) const { - UNUSED_PARAMETER(a); - const double pMaxForAcc = GetPMaxNorm(v) * _ratedPower - PHEMCEP::CalcPower(v, 0, gradient); - return (pMaxForAcc * 1000) / ((_massVehicle * GetRotationalCoeffecient(v) + _massRot + _vehicleLoading) * v); -} - - -double -PHEMCEP::GetEmission(const std::string& pollutant, double power) const { +PHEMCEP::GetEmission(const std::string& pollutant, double power, double speed, bool normalized) const { std::vector emissionCurve; std::vector powerPattern; + if (!normalized && fabs(speed) <= ZERO_SPEED_ACCURACY) { + if (pollutant == "FC") { + return _idlingFC; + } else { + return _idlingValuesPollutants.get(pollutant); + } + } // end if + if (pollutant == "FC") { - emissionCurve = _cepCurveFC; - powerPattern = _powerPatternFC; + if (normalized) { + emissionCurve = _normedCepCurveFC; + powerPattern = _normalizedPowerPatternFC; + } else { + emissionCurve = _cepCurveFC; + powerPattern = _powerPatternFC; + } } else { if (!_cepCurvePollutants.hasString(pollutant)) { throw InvalidArgument("Emission pollutant " + pollutant + " not found!"); } - emissionCurve = _cepCurvePollutants.get(pollutant); - powerPattern = _powerPatternPollutants; + if (normalized) { + emissionCurve = _normalizedCepCurvePollutants.get(pollutant); + powerPattern = _normailzedPowerPatternPollutants; + } else { + emissionCurve = _cepCurvePollutants.get(pollutant); + powerPattern = _powerPatternPollutants; + } + } // end if @@ -242,6 +287,45 @@ } // end of Interpolate +double PHEMCEP::GetDecelCoast(double speed, double acc, double gradient, double /* vehicleLoading */) const { + if (speed < SPEED_DCEL_MIN) { + return speed / SPEED_DCEL_MIN * GetDecelCoast(SPEED_DCEL_MIN, acc, gradient, _vehicleLoading); // !!!vehicleLoading + } // end if + + double rotCoeff = GetRotationalCoeffecient(speed); + + int upperIndex; + int lowerIndex; + + double iGear = GetGearCoeffecient(speed); + + double iTot = iGear * _axleRatio; + + double n = (30 * speed * iTot) / ((_effictiveWheelDiameter / 2) * M_PI2); + double nNorm = (n - _engineIdlingSpeed) / (_engineRatedSpeed - _engineIdlingSpeed); + + FindLowerUpperInPattern(lowerIndex, upperIndex, _nNormTable, nNorm); + + double fMot = 0; + + if (speed >= 10e-2) { + fMot = (-GetDragCoeffecient(nNorm) * _ratedPower * 1000 / speed) / 0.9; + } // end if + + double fRoll = (_resistanceF0 + + _resistanceF1 * speed + + pow(_resistanceF2 * speed, 2) + + pow(_resistanceF3 * speed, 3) + + pow(_resistanceF4 * speed, 4)) * (_massVehicle + _vehicleLoading) * GRAVITY_CONST; // !!!vehicleLoading + + double fAir = _cdValue * _crossSectionalArea * 1.2 * 0.5 * pow(speed, 2); + + double fGrad = (_massVehicle + _vehicleLoading) * GRAVITY_CONST * gradient / 100; // !!!vehicleLoading + + return -(fMot + fRoll + fAir + fGrad) / ((_massVehicle + _vehicleLoading) * rotCoeff); // !!!vehicleLoading +} // end of GetDecelCoast + + double PHEMCEP::GetRotationalCoeffecient(double speed) const { int upperIndex; @@ -256,8 +340,33 @@ _speedCurveRotational[upperIndex]); } // end of GetRotationalCoeffecient -void -PHEMCEP::FindLowerUpperInPattern(int& lowerIndex, int& upperIndex, std::vector pattern, double value) const { +double PHEMCEP::GetGearCoeffecient(double speed) const { + int upperIndex; + int lowerIndex; + + FindLowerUpperInPattern(lowerIndex, upperIndex, _gearTransmissionCurve, speed); + + return Interpolate(speed, + _speedPatternRotational[lowerIndex], + _speedPatternRotational[upperIndex], + _gearTransmissionCurve[lowerIndex], + _gearTransmissionCurve[upperIndex]); +} // end of GetGearCoefficient + +double PHEMCEP::GetDragCoeffecient(double nNorm) const { + int upperIndex; + int lowerIndex; + + FindLowerUpperInPattern(lowerIndex, upperIndex, _dragNormTable, nNorm); + + return Interpolate(nNorm, + _nNormTable[lowerIndex], + _nNormTable[upperIndex], + _dragNormTable[lowerIndex], + _dragNormTable[upperIndex]); +} // end of GetGearCoefficient + +void PHEMCEP::FindLowerUpperInPattern(int& lowerIndex, int& upperIndex, const std::vector& pattern, double value) const { if (value <= pattern.front()) { lowerIndex = 0; upperIndex = 0; @@ -298,6 +407,27 @@ } // end of FindLowerUpperInPattern +double +PHEMCEP::CalcPower(double v, double a, double slope, double /* vehicleLoading */) const { + const double rotFactor = GetRotationalCoeffecient(v); + double power = (_massVehicle + _vehicleLoading) * GRAVITY_CONST * (_resistanceF0 + _resistanceF1 * v + _resistanceF4 * pow(v, 4)) * v; + power += (_crossSectionalArea * _cdValue * AIR_DENSITY_CONST / 2) * pow(v, 3); + power += (_massVehicle * rotFactor + _massRot + _vehicleLoading) * a * v; + power += (_massVehicle + _vehicleLoading) * slope * 0.01 * v; + return power / 950.; +} + + +double +PHEMCEP::GetMaxAccel(double v, double a, double gradient, double /* vehicleLoading */) const { + UNUSED_PARAMETER(a); + double rotFactor = GetRotationalCoeffecient(v); + const double pMaxForAcc = GetPMaxNorm(v) * _ratedPower - PHEMCEP::CalcPower(v, 0, gradient, _vehicleLoading); // !!!vehicleLoading + return (pMaxForAcc * 1000) / ((_massVehicle * rotFactor + _massRot + _vehicleLoading) * v); // !!!vehicleLoading +} + + + double PHEMCEP::GetPMaxNorm(double speed) const { // Linear function between v0 and v1, constant elsewhere if (speed <= _pNormV0) { diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/PHEMCEP.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PHEMCEP.h --- sumo-0.21.0+dfsg/src/utils/emissions/PHEMCEP.h 2014-04-25 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PHEMCEP.h 2015-04-17 05:44:20.000000000 +0000 @@ -9,8 +9,8 @@ /// // Helper class for PHEM Light, holds a specific CEP for a PHEM emission class /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -39,6 +39,16 @@ #include "PHEMConstants.h" + +// =========================================================================== +// enumerations +// =========================================================================== +enum NormalizingType { + RatedPower, + DrivingPower +}; + + // =========================================================================== // class definitions // =========================================================================== @@ -74,16 +84,18 @@ */ PHEMCEP(bool heavyVehicel, SUMOEmissionClass emissionClass, const std::string& emissionClassIdentifier, double vehicleMass, double vehicleLoading, double vehicleMassRot, - double crossArea, double cWValue, + double crossArea, double cdValue, double f0, double f1, double f2, double f3, double f4, - double ratedPower, double pNormV0, double pNormP0, double pNormV1, - double pNormP1, std:: string vehicelFuelType, + double ratedPower, double pNormV0, double pNormP0, double pNormV1, double pNormP1, + double axleRatio, double engineIdlingSpeed, double engineRatedSpeed, double effectiveWheelDiameter, + double idlingFC, + const std::string& vehicleFuelType, const std::vector< std::vector >& matrixFC, const std::vector& headerLinePollutants, const std::vector< std::vector >& matrixPollutants, - const std::vector< std::vector > matrixSpeedRotational - ); - + const std::vector< std::vector >& matrixSpeedRotational, + const std::vector< std::vector >& normedDragTable, + const std::vector& idlingValuesPollutants); /// @brief Destructor ~PHEMCEP(); @@ -96,7 +108,7 @@ * @param{in] loading vehicle loading [kg] * @return The power demand for desired state [kW] */ - double CalcPower(double v, double a, double slope) const; + double CalcPower(double v, double a, double slope, double vehicleLoading = 0) const; /** @brief Returns the maximum accelaration for a vehicle at state v,a, slope and loading @@ -107,14 +119,15 @@ * @param{in] loading vehicle loading [kg] * @return The maximum accelaration for desired state [kW] */ - double GetMaxAccel(double v, double a, double gradient) const; + double GetMaxAccel(double v, double a, double gradient, double vehicleLoading = 0) const; /** @brief Returns a emission measure for power[kW] level * @param[in] pollutantIdentifier Desired pollutant, e.g. NOx * @param[in] power in [kW] * @return emission in [g/h] */ - double GetEmission(const std::string& pollutantIdentifier, double power) const; + double GetEmission(const std::string& pollutantIdentifier, double power, double speed, bool normalized = false) const; + double GetDecelCoast(double speed, double acc, double gradient, double vehicleLoading) const; /** @brief Getter function to recieve vehicle data from CEP @@ -170,7 +183,7 @@ * @todo: Why is it named "cdValue", here? */ double GetCdValue() const { - return _cwValue; + return _cdValue; } /** @brief Getter function to recieve vehicle data from CEP @@ -235,12 +248,14 @@ * @param[in] pattern to search * @param[in] value to search */ - void FindLowerUpperInPattern(int& lowerIndex, int& upperIndex, std::vector pattern, double value) const; + void FindLowerUpperInPattern(int& lowerIndex, int& upperIndex, const std::vector& pattern, double value) const; /** @brief Calculates rotational index for speed * @param[in] speed desired speed */ double GetRotationalCoeffecient(double speed) const; + double GetGearCoeffecient(double speed) const; + double GetDragCoeffecient(double nNorm) const; /** @brief Calculates maximum available rated power for speed * @param[in] speed desired speed @@ -250,6 +265,7 @@ private: /// @brief PHEM emission class of vehicle SUMOEmissionClass _emissionClass; + NormalizingType _normalizingType; /// @brief Rolling resistance f0 double _resistanceF0; /// @brief Rolling resistance f1 @@ -261,7 +277,7 @@ /// @brief Rolling resistance f4 double _resistanceF4; /// @brief Cw value - double _cwValue; + double _cdValue; /// @brief crosssectional area of vehicle double _crossSectionalArea; /// @brief vehicle mass @@ -280,24 +296,36 @@ double _pNormV1; /// @brief Step functions parameter for maximum rated power double _pNormP1; - /// @todo describe + double _axleRatio; + double _engineIdlingSpeed; + double _engineRatedSpeed; + double _effictiveWheelDiameter; + double _idlingFC; + std::string _vehicleFuelType; int _sizeOfPatternFC; /// @todo describe int _sizeOfPatternPollutants; + double _normalizingPower; + double _drivingPower; + bool _heavyVehicle; + std::vector _speedPatternRotational; /// @todo describe std::vector _powerPatternFC; /// @todo describe std::vector _powerPatternPollutants; + std::vector _normalizedPowerPatternFC; + std::vector _normailzedPowerPatternPollutants; /// @todo describe std::vector _cepCurveFC; /// @todo describe - StringBijection< std::vector > _cepCurvePollutants; - /// @todo describe - std::vector _speedPatternRotational; - /// @todo describe + std::vector _normedCepCurveFC; std::vector _speedCurveRotational; - /// @todo describe - std::string _vehicleFuelType; + std::vector _gearTransmissionCurve; + std::vector _nNormTable; + std::vector _dragNormTable; + StringBijection< std::vector > _cepCurvePollutants; + StringBijection > _normalizedCepCurvePollutants; + StringBijection _idlingValuesPollutants; }; diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/PHEMCEPHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PHEMCEPHandler.cpp --- sumo-0.21.0+dfsg/src/utils/emissions/PHEMCEPHandler.cpp 2014-04-25 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PHEMCEPHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -9,8 +9,8 @@ /// // Helper class for PHEM Light, holds CEP data for emission computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -30,6 +30,7 @@ #include #endif +#include #include #include #include @@ -67,10 +68,13 @@ PHEMCEPHandler::Load(SUMOEmissionClass emissionClass, const std::string& emissionClassIdentifier) { // to hold everything. std::vector< std::vector > matrixSpeedInertiaTable; + std::vector< std::vector > normedDragTable; std::vector< std::vector > matrixFC; std::vector< std::vector > matrixPollutants; std::vector headerFC; std::vector headerPollutants; + std::vector idlingValues; + std::vector idlingValuesFC; double vehicleMass; double vehicleLoading; @@ -82,7 +86,11 @@ double f2; double f3; double f4; + double axleRatio; double ratedPower; + double engineIdlingSpeed; + double engineRatedSpeed; + double effectiveWheelDiameter; std::string vehicleMassType; std::string vehicleFuelType; double pNormV0; @@ -91,27 +99,79 @@ double pNormP1; OptionsCont& oc = OptionsCont::getOptions(); - std::string phemPath = oc.getString("phemlight-path") + "/"; - if (!ReadVehicleFile(phemPath, emissionClassIdentifier, vehicleMass, vehicleLoading, vehicleMassRot, crosssectionalArea, cwValue, f0, f1, f2, f3, f4, ratedPower, vehicleMassType, vehicleFuelType, - pNormV0, pNormP0, pNormV1, pNormP1, matrixSpeedInertiaTable)) { + //std::string phemPath = oc.getString("phemlight-path") + "/"; + std::vector phemPath; + phemPath.push_back(oc.getString("phemlight-path") + "/"); + if (getenv("PHEMLIGHT_PATH") != 0) { + phemPath.push_back(std::string(getenv("PHEMLIGHT_PATH")) + "/"); + } + if (getenv("SUMO_HOME") != 0) { + phemPath.push_back(std::string(getenv("SUMO_HOME")) + "/data/emissions/PHEMlight/"); + } + if (!ReadVehicleFile(phemPath, emissionClassIdentifier, + vehicleMass, + vehicleLoading, + vehicleMassRot, + crosssectionalArea, + cwValue, + f0, + f1, + f2, + f3, + f4, + axleRatio, + ratedPower, + engineIdlingSpeed, + engineRatedSpeed, + effectiveWheelDiameter, + vehicleMassType, + vehicleFuelType, + pNormV0, + pNormP0, + pNormV1, + pNormP1, + matrixSpeedInertiaTable, + normedDragTable)) { return false; } - if (!ReadEmissionData(true, phemPath, emissionClassIdentifier, headerFC, matrixFC)) { + if (!ReadEmissionData(true, phemPath, emissionClassIdentifier, headerFC, matrixFC, idlingValuesFC)) { return false; } - if (!ReadEmissionData(false, phemPath, emissionClassIdentifier, headerPollutants, matrixPollutants)) { + if (!ReadEmissionData(false, phemPath, emissionClassIdentifier, headerPollutants, matrixPollutants, idlingValues)) { return false; } _ceps[emissionClass] = new PHEMCEP(vehicleMassType == "HV", emissionClass, emissionClassIdentifier, - vehicleMass, vehicleLoading, vehicleMassRot, - crosssectionalArea, cwValue, - f0, f1, f2, f3, f4, - ratedPower, pNormV0, pNormP0, pNormV1, pNormP1, - vehicleFuelType, matrixFC, headerPollutants, matrixPollutants, matrixSpeedInertiaTable); + vehicleMass, + vehicleLoading, + vehicleMassRot, + crosssectionalArea, + cwValue, + f0, + f1, + f2, + f3, + f4, + ratedPower, + pNormV0, + pNormP0, + pNormV1, + pNormP1, + axleRatio, + engineIdlingSpeed, + engineRatedSpeed, + effectiveWheelDiameter, + idlingValuesFC.front(), + vehicleFuelType, + matrixFC, + headerPollutants, + matrixPollutants, + matrixSpeedInertiaTable, + normedDragTable, + idlingValues); return true; } // end of Load() @@ -129,13 +189,39 @@ bool -PHEMCEPHandler::ReadVehicleFile(const std::string& path, const std::string& emissionClass, - double& vehicleMass, double& vehicleLoading, double& vehicleMassRot, - double& crossArea, double& cWValue, - double& f0, double& f1, double& f2, double& f3, double& f4, double& ratedPower, std::string& vehicleMassType, std::string& vehicleFuelType, - double& pNormV0, double& pNormP0, double& pNormV1, double& pNormP1, std::vector< std::vector >& matrixRotFactor) { - std::ifstream fileVehicle(std::string(path + emissionClass + ".veh").c_str()); - +PHEMCEPHandler::ReadVehicleFile(const std::vector& path, const std::string& emissionClass, + double& vehicleMass, + double& vehicleLoading, + double& vehicleMassRot, + double& crossArea, + double& cWValue, + double& f0, + double& f1, + double& f2, + double& f3, + double& f4, + double& axleRatio, + double& ratedPower, + double& engineIdlingSpeed, + double& engineRatedSpeed, + double& effectiveWheelDiameter, + std::string& vehicleMassType, + std::string& vehicleFuelType, + double& pNormV0, + double& pNormP0, + double& pNormV1, + double& pNormP1, + std::vector< std::vector >& matrixSpeedInertiaTable, + std::vector< std::vector >& normedDragTable) + +{ + std::ifstream fileVehicle; + for (std::vector::const_iterator i = path.begin(); i != path.end(); i++) { + fileVehicle.open(((*i) + emissionClass + ".PHEMLight.veh").c_str()); + if (fileVehicle.good()) { + break; + } + } if (!fileVehicle.good()) { return false; } @@ -149,6 +235,11 @@ std::getline(fileVehicle, line); while (std::getline(fileVehicle, line) && dataCount <= 49) { + // EOL handling for Linux + if (line.size() > 0 && line.substr(line.size() - 1) == "\r") { + line = line.substr(0, line.size() - 1); + } + std::stringstream lineStream(line); if (line.substr(0, 1) == commentPrefix) { @@ -189,6 +280,16 @@ std::istringstream(cell) >> ratedPower; } + // reading engine rated speed + if (dataCount == 11) { + std::istringstream(cell) >> engineRatedSpeed; + } + + // reading engine idling speed + if (dataCount == 12) { + std::istringstream(cell) >> engineIdlingSpeed; + } + // reading f0 if (dataCount == 14) { std::istringstream(cell) >> f0; @@ -213,6 +314,15 @@ if (dataCount == 18) { std::istringstream(cell) >> f4; } + // reading axleRatio + if (dataCount == 21) { + std::istringstream(cell) >> axleRatio; + } + + // reading effective wheel diameter + if (dataCount == 22) { + std::istringstream(cell) >> effectiveWheelDiameter; + } // reading vehicleMassType if (dataCount == 45) { @@ -245,7 +355,24 @@ } } // end while + while (std::getline(fileVehicle, line) && line.substr(0, 1) != commentPrefix) { + std::stringstream lineStream(line); + std::string cell; + std::vector vi; + while (std::getline(lineStream, cell, ',')) { + double entry; + std::istringstream(cell) >> entry; + vi.push_back(entry); + + } // end while + matrixSpeedInertiaTable.push_back(vi); + } // end while + while (std::getline(fileVehicle, line)) { + if (line.substr(0, 1) == commentPrefix) { + continue; + } + std::stringstream lineStream(line); std::string cell; std::vector vi; @@ -255,7 +382,7 @@ vi.push_back(entry); } // end while - matrixRotFactor.push_back(vi); + normedDragTable.push_back(vi); } // end while @@ -264,17 +391,21 @@ } // end of ReadVehicleFile -bool -PHEMCEPHandler::ReadEmissionData(bool readFC, const std::string& path, const std::string& emissionClass, - std::vector& header, std::vector >& matrix) { - +bool PHEMCEPHandler::ReadEmissionData(bool readFC, const std::vector& path, const std::string& emissionClass, + std::vector& header, std::vector >& matrix, std::vector& idlingValues) { std::string pollutantExtension = ""; if (readFC) { pollutantExtension += "_FC"; } // declare file stream - std::ifstream fileEmission(std::string(path + emissionClass + pollutantExtension + ".csv").c_str()); + std::ifstream fileEmission; + for (std::vector::const_iterator i = path.begin(); i != path.end(); i++) { + fileEmission.open(((*i) + emissionClass + pollutantExtension + ".csv").c_str()); + if (fileEmission.good()) { + break; + } + } if (!fileEmission.good()) { return false; @@ -298,6 +429,24 @@ // skip units std::getline(fileEmission, line); + // skip comments + std::getline(fileEmission, line); + + // reading idlingValues + std::getline(fileEmission, line); + + std::stringstream idlingStream(line); + std::string idlingCell; + + //skipping idle comment + std::getline(idlingStream, idlingCell, ','); + + while (std::getline(idlingStream, idlingCell, ',')) { + double entry; + std::istringstream(idlingCell) >> entry; + idlingValues.push_back(entry); + } // end while + while (std::getline(fileEmission, line)) { std::stringstream lineStream(line); std::string cell; diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/PHEMCEPHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PHEMCEPHandler.h --- sumo-0.21.0+dfsg/src/utils/emissions/PHEMCEPHandler.h 2014-04-25 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PHEMCEPHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -7,10 +7,10 @@ /// @date Thu, 13.06.2013 /// @version $$ /// -// Helper singelton class for PHEM Light, holds CEP data for emission computation +// Helper singleton class for PHEM Light, holds CEP data for emission computation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -72,7 +72,7 @@ private: /** @brief Helper method to read a vehicle file from file system - * @param[in] path The path to PHEMlight data files + * @param[in] path The possible paths to PHEMlight data files * @param[in] emissionClass desired PHEM emission class * @param[in] vehicleMass out variable for vehicle mass * @param[in] vehivleLoading out variable for vehicle loading @@ -93,27 +93,48 @@ * @param[in] matrixRotFactor out variable for rotational factors over speed for more accurate power calculation * @return Indicator if reading was successul */ - bool ReadVehicleFile(const std::string& path, const std::string& emissionClass, - double& vehicleMass, double& vehicleLoading, double& vehicleMassRot, - double& crossArea, double& cWValue, - double& f0, double& f1, double& f2, double& f3, double& f4, double& ratedPower, std::string& vehicleMassType, std::string& vehicleFuelType, - double& pNormV0, double& pNormP0, double& pNormV1, double& pNormP1, std::vector< std::vector >& matrixRotFactor); + bool ReadVehicleFile(const std::vector& path, const std::string& emissionClass, + double& vehicleMass, + double& vehicleLoading, + double& vehicleMassRot, + double& crossArea, + double& cWValue, + double& f0, + double& f1, + double& f2, + double& f3, + double& f4, + double& axleRatio, + double& ratedPower, + double& engineIdlingSpeed, + double& engineRatedSpeed, + double& effectiveWheelDiameter, + std::string& vehicleMassType, + std::string& vehicleFuelType, + double& pNormV0, + double& pNormP0, + double& pNormV1, + double& pNormP1, + std::vector< std::vector >& matrixSpeedInertiaTable, + std::vector< std::vector >& normedDragTable); + /** @brief Helper method to read a CEP file from file system - * @param[in] path The path to PHEMlight data files + * @param[in] path The possible paths to PHEMlight data files * @param[in] emissionClass desired PHEM emission class * @param[in] header vector of pollutant identifiers * @param[in] matrix matrix holding power pattern and CEP curves * @return Indicator if reading was successul */ - bool ReadEmissionData(bool readFC, const std::string& path, const std::string& emissionClass, - std::vector& header, std::vector >& matrix); + bool ReadEmissionData(bool readFC, const std::vector& path, const std::string& emissionClass, + std::vector& header, std::vector >& matrix, std::vector& idlingValues); private: /// @brief bijection between PHEMEmissionClass and CEPs std::map _ceps; +// StringBijection _stringRepsPhemEmissionClass; private: diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/PHEMConstants.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PHEMConstants.h --- sumo-0.21.0+dfsg/src/utils/emissions/PHEMConstants.h 2014-04-25 22:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PHEMConstants.h 2015-04-17 05:44:20.000000000 +0000 @@ -7,8 +7,8 @@ /// // Holds constants and data version info for PHEM Light /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -27,5 +27,16 @@ const double SECONDS_PER_HOUR = 3600; const double NORMALIZING_SPEED = 19.444; const double NORMALIZING_ACCELARATION = 0.45; +const double DENSITY_DIESEL = 1; +const double DENSITY_GASOLINE = 1; +const double SPEED_DCEL_MIN = 10 / 3.6; +const double M_PI2 = 3.14159265358979323846; +const double ZERO_SPEED_ACCURACY = 0.1; +const double SPEED_ROTATIONAL_INCREMENT = 10 / 3.6; +const double POWER_FC_INCREMENT = 0.1; +const double POWER_POLLUTANT_INCREMENT = 0.3; +const double NNORM_INCREMENT = 0.05; -#endif \ No newline at end of file +const std::string PHEM_DATA_VERSION = "V5"; + +#endif diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/PollutantsInterface.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PollutantsInterface.cpp --- sumo-0.21.0+dfsg/src/utils/emissions/PollutantsInterface.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PollutantsInterface.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 19.08.2013 -/// @version $Id: PollutantsInterface.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: PollutantsInterface.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Interface to capsulate different emission models /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/emissions/PollutantsInterface.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PollutantsInterface.h --- sumo-0.21.0+dfsg/src/utils/emissions/PollutantsInterface.h 2014-06-10 22:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/emissions/PollutantsInterface.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 19.08.2013 -/// @version $Id: PollutantsInterface.h 16575 2014-06-10 13:49:15Z behrisch $ +/// @version $Id: PollutantsInterface.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Interface to capsulate different emission models /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -123,7 +123,7 @@ * If this method is asked for the "unknown" class it should return the default * (possibly depending on the given vehicle class). * The class name is case insensitive. - * + * * @param[in] eClass the name of the emission class (string after the '/' in the emission class attribute) * @param[in] vc the vehicle class to use when determining default class * @return the name of the model (string before the '/' in the emission class) diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXBaseObject.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXBaseObject.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/FXBaseObject.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXBaseObject.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-03-19 -/// @version $Id: FXBaseObject.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: FXBaseObject.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXBaseObject.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXBaseObject.h --- sumo-0.21.0+dfsg/src/utils/foxtools/FXBaseObject.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXBaseObject.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-03-19 -/// @version $Id: FXBaseObject.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: FXBaseObject.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/fxexdefs.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/fxexdefs.h --- sumo-0.21.0+dfsg/src/utils/foxtools/fxexdefs.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/fxexdefs.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-03-19 -/// @version $Id: fxexdefs.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: fxexdefs.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -300,25 +300,25 @@ // thread stuff #ifndef WIN32 -typedef void* FXThreadHandle; // handle to a thread -typedef void* FXThreadMutex; // handle to a mutex -typedef void* FXThreadCondition; // handle to a condition variable -typedef void* FXThreadSemaphore; // handle to a semaphore -typedef FXInputHandle* FXThreadEventHandle; // handle to a thread event object +typedef void* FXThreadHandle; // handle to a thread +typedef void* FXThreadMutex; // handle to a mutex +typedef void* FXThreadCondition; // handle to a condition variable +typedef void* FXThreadSemaphore; // handle to a semaphore +typedef FXInputHandle* FXThreadEventHandle; // handle to a thread event object #else -typedef HANDLE FXThreadHandle; // handle to a thread -typedef HANDLE FXThreadMutex; // handle to a mutex -typedef HANDLE FXThreadCondition; // handle to a condition variable -typedef HANDLE FXThreadSemaphore; // handle to a semaphore -typedef FXInputHandle FXThreadEventHandle; // handle to a thread event object +typedef HANDLE FXThreadHandle; // handle to a thread +typedef HANDLE FXThreadMutex; // handle to a mutex +typedef HANDLE FXThreadCondition; // handle to a condition variable +typedef HANDLE FXThreadSemaphore; // handle to a semaphore +typedef FXInputHandle FXThreadEventHandle; // handle to a thread event object #endif // dynamic library loading #ifndef WIN32 -typedef void* FXDLLHandle; // handle to a dynamically loaded file +typedef void* FXDLLHandle; // handle to a dynamically loaded file #else -typedef HMODULE FXDLLHandle; // handle to a dynamically loaded file +typedef HMODULE FXDLLHandle; // handle to a dynamically loaded file #endif diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXLCDLabel.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXLCDLabel.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/FXLCDLabel.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXLCDLabel.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-03-19 -/// @version $Id: FXLCDLabel.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: FXLCDLabel.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXLCDLabel.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXLCDLabel.h --- sumo-0.21.0+dfsg/src/utils/foxtools/FXLCDLabel.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXLCDLabel.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-03-19 -/// @version $Id: FXLCDLabel.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: FXLCDLabel.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXLinkLabel.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXLinkLabel.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/FXLinkLabel.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXLinkLabel.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2006-03-08 -/// @version $Id: FXLinkLabel.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: FXLinkLabel.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXLinkLabel.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXLinkLabel.h --- sumo-0.21.0+dfsg/src/utils/foxtools/FXLinkLabel.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXLinkLabel.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2006-03-08 -/// @version $Id: FXLinkLabel.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: FXLinkLabel.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXRealSpinDial.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXRealSpinDial.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/FXRealSpinDial.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXRealSpinDial.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 2004-03-19 -/// @version $Id: FXRealSpinDial.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: FXRealSpinDial.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -21,6 +21,29 @@ // /****************************************************************************/ +/******************************************************************************** +* * +* R e a l - V a l u e d S p i n n e r / D i a l W i d g e t * +* * +********************************************************************************* +* Copyright (C) 2004 by Bill Baxter. All Rights Reserved. * +********************************************************************************* +* This library is free software; you can redistribute it and/or * +* modify it under the terms of the GNU Lesser General Public * +* License as published by the Free Software Foundation; either * +* version 2.1 of the License, or (at your option) any later version. * +* * +* This library is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +* Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* 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 18095 2015-03-17 09:39:00Z behrisch $ * +********************************************************************************/ /* ========================================================================= * included modules @@ -408,7 +431,7 @@ FXMAPFUNC(SEL_CHANGED, FXRealSpinDial::ID_ENTRY, FXRealSpinDial::onChgEntry), FXMAPFUNC(SEL_UPDATE, FXRealSpinDial::ID_DIAL, FXRealSpinDial::onUpdDial), FXMAPFUNC(SEL_CHANGED, FXRealSpinDial::ID_DIAL, FXRealSpinDial::onChgDial), - FXMAPFUNC(SEL_COMMAND, FXRealSpinDial::ID_DIAL, FXRealSpinDial::onCmdDial), + FXMAPFUNC(SEL_COMMAND, FXRealSpinDial::ID_DIAL, FXRealSpinDial::onChgDial), FXMAPFUNC(SEL_MOUSEWHEEL, FXRealSpinDial::ID_ENTRY, FXRealSpinDial::onMouseWheel), FXMAPFUNC(SEL_MOUSEWHEEL, FXRealSpinDial::ID_DIAL, FXRealSpinDial::onMouseWheel), FXMAPFUNC(SEL_MOUSEWHEEL, FXRealSpinDial::ID_INCREMENT, FXRealSpinDial::onMouseWheel), diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXRealSpinDial.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXRealSpinDial.h --- sumo-0.21.0+dfsg/src/utils/foxtools/FXRealSpinDial.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXRealSpinDial.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-03-19 -/// @version $Id: FXRealSpinDial.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: FXRealSpinDial.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXSevenSegment.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXSevenSegment.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/FXSevenSegment.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXSevenSegment.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-03-19 -/// @version $Id: FXSevenSegment.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: FXSevenSegment.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXSevenSegment.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXSevenSegment.h --- sumo-0.21.0+dfsg/src/utils/foxtools/FXSevenSegment.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXSevenSegment.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-03-19 -/// @version $Id: FXSevenSegment.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: FXSevenSegment.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXSingleEventThread.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXSingleEventThread.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/FXSingleEventThread.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXSingleEventThread.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Laura Bieker /// @author Jakob Erdmann /// @date 2004-03-19 -/// @version $Id: FXSingleEventThread.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: FXSingleEventThread.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXSingleEventThread.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXSingleEventThread.h --- sumo-0.21.0+dfsg/src/utils/foxtools/FXSingleEventThread.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXSingleEventThread.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-03-19 -/// @version $Id: FXSingleEventThread.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: FXSingleEventThread.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXThreadEvent.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXThreadEvent.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/FXThreadEvent.cpp 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXThreadEvent.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-03-19 -/// @version $Id: FXThreadEvent.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: FXThreadEvent.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXThreadEvent.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXThreadEvent.h --- sumo-0.21.0+dfsg/src/utils/foxtools/FXThreadEvent.h 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXThreadEvent.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-03-19 -/// @version $Id: FXThreadEvent.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: FXThreadEvent.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -58,8 +58,8 @@ * * // message IDs * enum { - * ID_THREAD_EVENT = FXWhatEver::ID_LAST, - * ID_LAST }; + * ID_THREAD_EVENT = FXWhatEver::ID_LAST, + * ID_LAST }; * * // message handler * long onThreadEvent(FXObject*, FXSelector, void*); diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXThreadMessageRetriever.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXThreadMessageRetriever.h --- sumo-0.21.0+dfsg/src/utils/foxtools/FXThreadMessageRetriever.h 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXThreadMessageRetriever.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file FXThreadMessageRetriever.h /// @author Daniel Krajzewicz /// @date 2004-03-19 -/// @version $Id: FXThreadMessageRetriever.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: FXThreadMessageRetriever.h 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/FXWorkerThread.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXWorkerThread.h --- sumo-0.21.0+dfsg/src/utils/foxtools/FXWorkerThread.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/FXWorkerThread.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,300 @@ +/****************************************************************************/ +/// @file FXWorkerThread.h +/// @author Michael Behrisch +/// @date 2014-07-13 +/// @version $Id: FXWorkerThread.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A thread class together with a pool and a task for parallelized computation +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 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 FXWorkerThread_h +#define FXWorkerThread_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class FXWorkerThread + * @brief A thread repeatingly calculating incoming tasks + */ +class FXWorkerThread : public FXThread { + +public: + /** + * @class FXWorkerThread::Task + * @brief Abstract superclass of a task to be run with an index to keep track of pending tasks + */ + class Task { + public: + /// @brief Desctructor + virtual ~Task() {}; + + /** @brief Abstract method which in subclasses should contain the computations to be performed. + * + * If there is data to be shared among several tasks (but not among several threads) it can be put in the + * a thread class subclassing the FXWorkerThread. the instance of the thread is then made available + * via the context parameter. + * + * @param[in] context The thread which runs the task + */ + virtual void run(FXWorkerThread* context) = 0; + + /** @brief Sets the running index of this task. + * + * Every task receive an index which is unique among all pending tasks of the same thread pool. + * + * @param[in] newIndex the index to assign + */ + void setIndex(const int newIndex) { + myIndex = newIndex; + } + private: + /// @brief the index of the task, valid only after the task has been added to the pool + int myIndex; + }; + + /** + * @class FXWorkerThread::Pool + * @brief A pool of worker threads which distributes the tasks and collects the results + */ + class Pool { + public: + /** @brief Constructor + * + * May initialize the pool with a given number of workers. + * + * @param[in] numThreads the number of threads to create + */ + Pool(int numThreads = 0) : myRunningIndex(0), myNumFinished(0) { + while (numThreads > 0) { + new FXWorkerThread(*this); + numThreads--; + } + } + + /** @brief Destructor + * + * Stopping and deleting all workers by calling clear. + */ + virtual ~Pool() { + clear(); + } + + /** @brief Stops and deletes all worker threads. + */ + void clear() { + for (std::vector::iterator it = myWorkers.begin(); it != myWorkers.end(); ++it) { + delete *it; + } + myWorkers.clear(); + } + + /** @brief Adds the given thread to the pool. + * + * @param[in] w the thread to add + */ + void addWorker(FXWorkerThread* const w) { +// if (myWorkers.empty()) std::cout << "created pool at " << SysUtils::getCurrentMillis() << std::endl; + myWorkers.push_back(w); + } + + /** @brief Gives a number to the given task and assigns it to a randomly chosen worker. + * + * @param[in] t the task to add + */ + void add(Task* const t) { + t->setIndex(myRunningIndex++); + myWorkers[myRunningIndex % myWorkers.size()]->add(t); + } + + /** @brief Adds the given task to the list of finished tasks and assigns it to a randomly chosen worker. + * + * Locks the internal mutex and counts the finished tasks. This is to be called by the worker thread only. + * + * @param[in] t the task to add + */ + void addFinished(Task* const t) { + myMutex.lock(); + myNumFinished++; + myFinishedTasks.push_back(t); + myCondition.signal(); + myMutex.unlock(); + } + + /// @brief waits for all tasks to be finished + void waitAll() { + myMutex.lock(); + while (myNumFinished < myRunningIndex) { + myCondition.wait(myMutex); + } +// if (myRunningIndex > 0) std::cout << "finished waiting for " << myRunningIndex << " tasks at " << SysUtils::getCurrentMillis() << std::endl; + for (std::list::iterator it = myFinishedTasks.begin(); it != myFinishedTasks.end(); ++it) { + delete *it; + } + myFinishedTasks.clear(); + myRunningIndex = 0; + myNumFinished = 0; + myMutex.unlock(); + } + + /** @brief Checks whether there are currently more pending tasks than threads. + * + * This is only a rough estimate because the tasks are already assigned and there could be an idle thread even though the + * number of tasks is large. + * + * @return whether there are enough tasks to let all threads work + */ + bool isFull() const { + return myRunningIndex - myNumFinished >= size(); + } + + /** @brief Returns the number of threads in the pool. + * + * @return the number of threads + */ + int size() const { + return (int)myWorkers.size(); + } + + /// @brief locks the pool mutex + void lock() { + myPoolMutex.lock(); + } + + /// @brief unlocks the pool mutex + void unlock() { + myPoolMutex.unlock(); + } + + private: + /// @brief the current worker threads + std::vector myWorkers; + /// @brief the internal mutex for the task list + FXMutex myMutex; + /// @brief the pool mutex for external sync + FXMutex myPoolMutex; + /// @brief the semaphore to wait on for finishing all tasks + FXCondition myCondition; + /// @brief list of finished tasks + std::list myFinishedTasks; + /// @brief the running index for the next task + int myRunningIndex; + /// @brief the number of finished tasks (is reset when the pool runs empty) + int myNumFinished; + }; + +public: + /** @brief Constructor + * + * Adds the thread to the given pool and starts it. + * + * @param[in] pool the pool for this thread + */ + FXWorkerThread(Pool& pool): FXThread(), myPool(pool), myStopped(false), myCounter(0) { + pool.addWorker(this); + start(); + } + + /** @brief Destructor + * + * Stops the thread by calling stop. + */ + virtual ~FXWorkerThread() { + stop(); + } + + /** @brief Adds the given task to this thread to be calculated + * + * @param[in] t the task to add + */ + void add(Task* t) { + myMutex.lock(); + myTasks.push_back(t); + myCondition.signal(); + myMutex.unlock(); + } + + /** @brief Main execution method of this thread. + * + * Checks for new tasks, calculates them and puts them in the finished list of the pool until being stopped. + * + * @return always 0 + */ + FXint run() { + while (!myStopped) { + myMutex.lock(); + while (!myStopped && myTasks.empty()) { + myCondition.wait(myMutex); + } + if (myStopped) { + myMutex.unlock(); + break; + } + Task* t = myTasks.front(); + myTasks.pop_front(); + myMutex.unlock(); + t->run(this); + myCounter++; +// if (myCounter % 1000 == 0) std::cout << (size_t)this << " ran " << myCounter << " tasks " << std::endl; + myPool.addFinished(t); + } +// std::cout << "ran " << myCounter << " tasks " << std::endl; + return 0; + } + + /** @brief Stops the thread + * + * The currently running task will be finished but all further tasks are discarded. + */ + void stop() { + myMutex.lock(); + myStopped = true; + myCondition.signal(); + myMutex.unlock(); + join(); + } + +private: + /// @brief the pool for this thread + Pool& myPool; + /// @brief the mutex for the task list + FXMutex myMutex; + /// @brief the semaphore when waiting for new tasks + FXCondition myCondition; + /// @brief the list of pending tasks + std::list myTasks; + /// @brief whether we are still running + bool myStopped; + /// @brief counting completed tasks for debugging / profiling + int myCounter; +}; + + +#endif diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/Makefile.am --- sumo-0.21.0+dfsg/src/utils/foxtools/Makefile.am 2013-05-03 20:25:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -12,6 +12,7 @@ FXSevenSegment.cpp FXSevenSegment.h \ FXSingleEventThread.cpp FXSingleEventThread.h \ FXThreadEvent.cpp FXThreadEvent.h \ +FXWorkerThread.h \ MFXCheckableButton.cpp MFXCheckableButton.h \ MFXEventQue.cpp MFXEventQue.h \ MFXInterThreadEventClient.h \ diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/Makefile.in --- sumo-0.21.0+dfsg/src/utils/foxtools/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -227,6 +227,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -237,7 +239,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -343,6 +344,7 @@ FXSevenSegment.cpp FXSevenSegment.h \ FXSingleEventThread.cpp FXSingleEventThread.h \ FXThreadEvent.cpp FXThreadEvent.h \ +FXWorkerThread.h \ MFXCheckableButton.cpp MFXCheckableButton.h \ MFXEventQue.cpp MFXEventQue.h \ MFXInterThreadEventClient.h \ diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXAddEditTypedTable.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXAddEditTypedTable.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXAddEditTypedTable.cpp 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXAddEditTypedTable.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXAddEditTypedTable.cpp /// @author Daniel Krajzewicz /// @date 2004-07-02 -/// @version $Id: MFXAddEditTypedTable.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXAddEditTypedTable.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXAddEditTypedTable.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXAddEditTypedTable.h --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXAddEditTypedTable.h 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXAddEditTypedTable.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXAddEditTypedTable.h /// @author Daniel Krajzewicz /// @date 2004-07-02 -/// @version $Id: MFXAddEditTypedTable.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXAddEditTypedTable.h 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXCheckableButton.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXCheckableButton.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXCheckableButton.cpp 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXCheckableButton.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXCheckableButton.cpp /// @author Daniel Krajzewicz /// @date 2004-03-19 -/// @version $Id: MFXCheckableButton.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXCheckableButton.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXCheckableButton.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXCheckableButton.h --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXCheckableButton.h 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXCheckableButton.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXCheckableButton.h /// @author Daniel Krajzewicz /// @date 2004-03-19 -/// @version $Id: MFXCheckableButton.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXCheckableButton.h 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXEditableTable.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXEditableTable.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXEditableTable.cpp 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXEditableTable.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXEditableTable.cpp /// @author Daniel Krajzewicz /// @date 2004-07-02 -/// @version $Id: MFXEditableTable.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXEditableTable.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXEditableTable.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXEditableTable.h --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXEditableTable.h 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXEditableTable.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXEditableTable.h /// @author Daniel Krajzewicz /// @date 2004-07-02 -/// @version $Id: MFXEditableTable.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXEditableTable.h 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXEventQue.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXEventQue.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXEventQue.cpp 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXEventQue.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXEventQue.cpp /// @author Daniel Krajzewicz /// @date void *ret = *(myEvents.begin()); -/// @version $Id: MFXEventQue.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXEventQue.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -28,57 +28,10 @@ #include #endif -#include "MFXEventQue.h" -#include - #ifdef CHECK_MEMORY_LEAKS #include #endif // CHECK_MEMORY_LEAKS -void* -MFXEventQue::top() { - assert(size() != 0); - myMutex.lock(); - void* ret = *(myEvents.begin()); - myMutex.unlock(); - return ret; -} - - -void -MFXEventQue::pop() { - myMutex.lock(); - myEvents.erase(myEvents.begin()); - myMutex.unlock(); -} - - -void -MFXEventQue::add(void* what) { - myMutex.lock(); - myEvents.push_back(what); - myMutex.unlock(); -} - - -size_t -MFXEventQue::size() { - myMutex.lock(); - size_t msize = myEvents.size(); - myMutex.unlock(); - return msize; -} - - -bool -MFXEventQue::empty() { - myMutex.lock(); - bool ret = size() == 0; - myMutex.unlock(); - return ret; -} - - /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXEventQue.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXEventQue.h --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXEventQue.h 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXEventQue.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXEventQue.h /// @author Daniel Krajzewicz /// @date 2004-03-19 -/// @version $Id: MFXEventQue.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXEventQue.h 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -32,21 +32,53 @@ #include #include +#include #include +template class MFXEventQue { public: MFXEventQue() { } ~MFXEventQue() { } - void* top(); - void pop(); - void add(void* what); - size_t size(); - bool empty(); + T top() { + assert(size() != 0); + myMutex.lock(); + T ret = myItems.front(); + myMutex.unlock(); + return ret; + } + + + void pop() { + myMutex.lock(); + myItems.erase(myItems.begin()); + myMutex.unlock(); + } + + void add(T what) { + myMutex.lock(); + myItems.push_back(what); + myMutex.unlock(); + } + + size_t size() { + myMutex.lock(); + const size_t ret = myItems.size(); + myMutex.unlock(); + return ret; + } + + bool empty() { + myMutex.lock(); + const bool ret = myItems.size() == 0; + myMutex.unlock(); + return ret; + } + private: MFXMutex myMutex; - std::list myEvents; + std::list myItems; }; diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXImageHelper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXImageHelper.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXImageHelper.cpp 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXImageHelper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXImageHelper.cpp /// @author Daniel Krajzewicz /// @date 2005-05-04 -/// @version $Id: MFXImageHelper.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXImageHelper.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXImageHelper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXImageHelper.h --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXImageHelper.h 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXImageHelper.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXImageHelper.h /// @author Daniel Krajzewicz /// @date 2005-05-04 -/// @version $Id: MFXImageHelper.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXImageHelper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // static helpers for loading and saving images in various formats /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXInterThreadEventClient.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXInterThreadEventClient.h --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXInterThreadEventClient.h 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXInterThreadEventClient.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXInterThreadEventClient.h /// @author Daniel Krajzewicz /// @date 2004-03-19 -/// @version $Id: MFXInterThreadEventClient.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXInterThreadEventClient.h 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXMenuHeader.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXMenuHeader.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXMenuHeader.cpp 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXMenuHeader.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXMenuHeader.cpp /// @author Daniel Krajzewicz /// @date 2004-07-02 -/// @version $Id: MFXMenuHeader.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXMenuHeader.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXMenuHeader.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXMenuHeader.h --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXMenuHeader.h 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXMenuHeader.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXMenuHeader.h /// @author Daniel Krajzewicz /// @date 2004-07-02 -/// @version $Id: MFXMenuHeader.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXMenuHeader.h 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXMutex.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXMutex.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXMutex.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXMutex.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2007-02-19 -/// @version $Id: MFXMutex.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MFXMutex.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXMutex.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXMutex.h --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXMutex.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXMutex.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2007-02-19 -/// @version $Id: MFXMutex.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: MFXMutex.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -38,12 +38,12 @@ #include #ifndef WIN32 -typedef void* FXThreadMutex; // handle to a mutex +typedef void* FXThreadMutex; // handle to a mutex #else #define NOMINMAX #include #undef NOMINMAX -typedef HANDLE FXThreadMutex; // handle to a mutex +typedef HANDLE FXThreadMutex; // handle to a mutex #endif diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXUtils.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXUtils.cpp --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXUtils.cpp 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXUtils.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXUtils.cpp /// @author Daniel Krajzewicz /// @date 2006-01-09 -/// @version $Id: MFXUtils.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXUtils.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Some helper functions for FOX /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/foxtools/MFXUtils.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXUtils.h --- sumo-0.21.0+dfsg/src/utils/foxtools/MFXUtils.h 2014-03-24 23:02:14.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/foxtools/MFXUtils.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file MFXUtils.h /// @author Daniel Krajzewicz /// @date 2006-01-09 -/// @version $Id: MFXUtils.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: MFXUtils.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some helper functions for FOX /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/AbstractPoly.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/AbstractPoly.h --- sumo-0.21.0+dfsg/src/utils/geom/AbstractPoly.h 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/AbstractPoly.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: AbstractPoly.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: AbstractPoly.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The base class for polygons /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/bezier.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/bezier.cpp --- sumo-0.21.0+dfsg/src/utils/geom/bezier.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/bezier.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2003-11-19 -/// @version $Id: bezier.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: bezier.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/bezier.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/bezier.h --- sumo-0.21.0+dfsg/src/utils/geom/bezier.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/bezier.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2003-11-19 -/// @version $Id: bezier.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: bezier.h 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/Boundary.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Boundary.cpp --- sumo-0.21.0+dfsg/src/utils/geom/Boundary.cpp 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Boundary.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: Boundary.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Boundary.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A class that stores the 2D geometrical boundary /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/Boundary.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Boundary.h --- sumo-0.21.0+dfsg/src/utils/geom/Boundary.h 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Boundary.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: Boundary.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Boundary.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A class that stores a 2D geometrical boundary /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/Bresenham.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Bresenham.cpp --- sumo-0.21.0+dfsg/src/utils/geom/Bresenham.cpp 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Bresenham.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 07 Jun 2002 -/// @version $Id: Bresenham.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Bresenham.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A class to realise a uniform n:m - relationship using the /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/Bresenham.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Bresenham.h --- sumo-0.21.0+dfsg/src/utils/geom/Bresenham.h 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Bresenham.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: Bresenham.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Bresenham.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A class to realise a uniform n:m - relationship using the /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/GeoConvHelper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/GeoConvHelper.cpp --- sumo-0.21.0+dfsg/src/utils/geom/GeoConvHelper.cpp 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/GeoConvHelper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2006-08-01 -/// @version $Id: GeoConvHelper.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GeoConvHelper.cpp 18171 2015-03-27 14:50:44Z behrisch $ /// // static methods for processing the coordinates conversion for the current net /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -38,6 +38,7 @@ #include #include #include +#include #include "GeoConvHelper.h" #ifdef CHECK_MEMORY_LEAKS @@ -172,7 +173,7 @@ proj = "DHDN"; } else if (oc.getBool("proj.dhdnutm")) { proj = "DHDN_UTM"; - } else { + } else if (!oc.isDefault("proj")) { proj = oc.getString("proj"); } #endif @@ -333,7 +334,12 @@ } else if (myUseInverseProjection) { cartesian2geo(from); } else { - if (x > 180.1 || x < -180.1 || y > 90.1 || y < -90.1) { + if (x > 180.1 || x < -180.1) { + WRITE_WARNING("Invalid longitude " + toString(x)); + return false; + } + if (y > 90.1 || y < -90.1) { + WRITE_WARNING("Invalid latitude " + toString(y)); return false; } #ifdef HAVE_PROJ @@ -439,5 +445,24 @@ } +void +GeoConvHelper::writeLocation(OutputDevice& into) { + into.openTag(SUMO_TAG_LOCATION); + into.writeAttr(SUMO_ATTR_NET_OFFSET, myFinal.getOffsetBase()); + into.writeAttr(SUMO_ATTR_CONV_BOUNDARY, myFinal.getConvBoundary()); + if (myFinal.usingGeoProjection()) { + into.setPrecision(GEO_OUTPUT_ACCURACY); + } + into.writeAttr(SUMO_ATTR_ORIG_BOUNDARY, myFinal.getOrigBoundary()); + if (myFinal.usingGeoProjection()) { + into.setPrecision(); + } + into.writeAttr(SUMO_ATTR_ORIG_PROJ, myFinal.getProjString()); + into.closeTag(); + into.lf(); +} + + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/geom/GeoConvHelper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/GeoConvHelper.h --- sumo-0.21.0+dfsg/src/utils/geom/GeoConvHelper.h 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/GeoConvHelper.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2006-08-01 -/// @version $Id: GeoConvHelper.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GeoConvHelper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // static methods for processing the coordinates conversion for the current net /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -47,6 +47,7 @@ // =========================================================================== class OptionsCont; class PositionVector; +class OutputDevice; // =========================================================================== @@ -168,6 +169,9 @@ /// Returns the network offset const std::string& getProjString() const; + /// @brief writes the location element + static void writeLocation(OutputDevice& into); + private: enum ProjectionMethod { NONE, diff -Nru sumo-0.21.0+dfsg/src/utils/geom/GeomConvHelper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/GeomConvHelper.cpp --- sumo-0.21.0+dfsg/src/utils/geom/GeomConvHelper.cpp 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/GeomConvHelper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2003 -/// @version $Id: GeomConvHelper.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GeomConvHelper.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Some helping functions for geometry parsing /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/GeomConvHelper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/GeomConvHelper.h --- sumo-0.21.0+dfsg/src/utils/geom/GeomConvHelper.h 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/GeomConvHelper.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2003 -/// @version $Id: GeomConvHelper.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GeomConvHelper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some helping functions for geometry parsing /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/GeomHelper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/GeomHelper.cpp --- sumo-0.21.0+dfsg/src/utils/geom/GeomHelper.cpp 2014-06-04 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/GeomHelper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GeomHelper.cpp 16522 2014-06-04 12:29:43Z behrisch $ +/// @version $Id: GeomHelper.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Some static methods performing geometrical operations /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -45,6 +45,11 @@ #include #endif // CHECK_MEMORY_LEAKS +// =========================================================================== +// static members +// =========================================================================== +const SUMOReal GeomHelper::INVALID_OFFSET = -1; + // =========================================================================== // method definitions @@ -116,10 +121,15 @@ return false; } /* Is the intersection along the segments */ - const double mua = numera / denominator; - const double mub = numerb / denominator; - if (mua < 0 || mua > 1 || mub < 0 || mub > 1) { - return false; + double mua = numera / denominator; + /* reduce rounding errors for lines ending in the same point */ + if (fabs(x2 - x4) < eps && fabs(y2 - y4) < eps) { + mua = 1.; + } else { + const double mub = numerb / denominator; + if (mua < 0 || mua > 1 || mub < 0 || mub > 1) { + return false; + } } if (x != 0) { *x = x1 + mua * (x2 - x1); @@ -200,7 +210,7 @@ // @todo calculate better "average" z value return Position(x, y, p11.z() + m * (p12.z() - p11.z())); } - return Position(-1, -1); + return Position::INVALID; } @@ -299,12 +309,12 @@ SUMOReal -GeomHelper::closestDistancePointLine(const Position& point, - const Position& lineStart, - const Position& lineEnd, - Position& outIntersection) { +GeomHelper::closestDistancePointLine2D(const Position& point, + const Position& lineStart, + const Position& lineEnd, + Position& outIntersection) { const SUMOReal length = nearest_offset_on_line_to_point2D(lineStart, lineEnd, point, false); - outIntersection.set(Line(lineStart, lineEnd).getPositionAtDistance(length)); + outIntersection.set(Line(lineStart, lineEnd).getPositionAtDistance2D(length)); return point.distanceTo2D(outIntersection); } diff -Nru sumo-0.21.0+dfsg/src/utils/geom/GeomHelper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/GeomHelper.h --- sumo-0.21.0+dfsg/src/utils/geom/GeomHelper.h 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/GeomHelper.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GeomHelper.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GeomHelper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some static methods performing geometrical operations /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -53,7 +53,11 @@ * @brief Some static methods performing geometrical operations */ class GeomHelper { + public: + /// @brief a value to signify offsets outside the range of [0, Line.length()] + static const SUMOReal INVALID_OFFSET; + /** @brief return whether given lines intersect * @param[in] p11 The begin position of the first line * @param[in] p12 The end position of the first line @@ -118,7 +122,7 @@ * Return the distance from point to line as well as the intersection point. * If intersection does not lie within the line segment, the start or end point of the segment is returned */ - static SUMOReal closestDistancePointLine(const Position& point, + static SUMOReal closestDistancePointLine2D(const Position& point, const Position& lineStart, const Position& lineEnd, Position& outIntersection); diff -Nru sumo-0.21.0+dfsg/src/utils/geom/Helper_ConvexHull.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Helper_ConvexHull.cpp --- sumo-0.21.0+dfsg/src/utils/geom/Helper_ConvexHull.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Helper_ConvexHull.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,7 +3,7 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-11-23 -/// @version $Id: Helper_ConvexHull.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: Helper_ConvexHull.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Copyright 2002, softSurfer (www.softsurfer.com) // This code may be freely used and modified for any purpose @@ -12,8 +12,8 @@ // liable for any real or imagined damage resulting from its use. // Users of this code must verify correctness for their application. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/Helper_ConvexHull.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Helper_ConvexHull.h --- sumo-0.21.0+dfsg/src/utils/geom/Helper_ConvexHull.h 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Helper_ConvexHull.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: Helper_ConvexHull.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Helper_ConvexHull.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/Line.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Line.cpp --- sumo-0.21.0+dfsg/src/utils/geom/Line.cpp 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Line.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 2003-08-14 -/// @version $Id: Line.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Line.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // } /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -66,6 +66,15 @@ void +Line::extrapolateBy2D(SUMOReal length) { + SUMOReal factor = length / myP1.distanceTo2D(myP2); + Position offset = (myP2 - myP1) * factor; + myP1.sub(offset); + myP2.add(offset); +} + + +void Line::extrapolateFirstBy(SUMOReal length) { myP1 = GeomHelper::extrapolate_first(myP1, myP2, length); } @@ -234,4 +243,12 @@ } +std::ostream& +operator<<(std::ostream& os, const Line& line) { + os << line.myP1 << " " << line.myP2; + return os; +} + + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/geom/Line.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Line.h --- sumo-0.21.0+dfsg/src/utils/geom/Line.h 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Line.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: Line.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Line.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -54,6 +54,7 @@ Line(const Position& p1, const Position& p2); ~Line(); void extrapolateBy(SUMOReal length); + void extrapolateBy2D(SUMOReal length); void extrapolateFirstBy(SUMOReal length); void extrapolateSecondBy(SUMOReal length); const Position& p1() const; @@ -80,6 +81,9 @@ Line& reverse(); void rotateAtP1(SUMOReal rot); + /// @brief Output operator + friend std::ostream& operator<<(std::ostream& os, const Line& geom); + private: Position myP1, myP2; }; diff -Nru sumo-0.21.0+dfsg/src/utils/geom/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Makefile.in --- sumo-0.21.0+dfsg/src/utils/geom/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -224,6 +224,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -234,7 +236,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/utils/geom/Position.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Position.cpp --- sumo-0.21.0+dfsg/src/utils/geom/Position.cpp 2014-02-22 23:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Position.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Axel Wegener /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: Position.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Position.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A position in the 2D- or 3D-world /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/Position.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Position.h --- sumo-0.21.0+dfsg/src/utils/geom/Position.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/Position.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Axel Wegener /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: Position.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: Position.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A position in the 2D- or 3D-world /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/geom/PositionVector.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/PositionVector.cpp --- sumo-0.21.0+dfsg/src/utils/geom/PositionVector.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/PositionVector.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Sept 2002 -/// @version $Id: PositionVector.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: PositionVector.cpp 18142 2015-03-25 08:32:29Z namdre $ /// // A list of positions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -53,7 +53,6 @@ #include #endif // CHECK_MEMORY_LEAKS - // =========================================================================== // method definitions // =========================================================================== @@ -166,7 +165,7 @@ return GeomHelper::intersection_position2D(*i, *(i + 1), p1, p2); } } - return Position(-1, -1); + return Position::INVALID; } @@ -182,7 +181,7 @@ return v1.intersectsAtPoint(*(end()-1), *(begin())); } */ - return Position(-1, -1); + return Position::INVALID; } @@ -277,7 +276,7 @@ SUMOReal pos, SUMOReal lateralOffset) { const SUMOReal dist = p1.distanceTo(p2); if (dist < pos) { - return Position(-1, -1); + return Position::INVALID; } if (lateralOffset != 0) { Line l(p1, p2); @@ -294,7 +293,7 @@ SUMOReal pos, SUMOReal lateralOffset) { const SUMOReal dist = p1.distanceTo2D(p2); if (dist < pos) { - return Position(-1, -1); + return Position::INVALID; } if (lateralOffset != 0) { Line l(p1, p2); @@ -414,6 +413,9 @@ SUMOReal PositionVector::area() const { + if (size() < 3) { + return 0; + } SUMOReal area = 0; PositionVector tmp = *this; if (!isClosed()) { // make sure its closed @@ -606,8 +608,8 @@ void -PositionVector::append(const PositionVector& v) { - if (back().distanceTo(v[0]) < 2) { +PositionVector::append(const PositionVector& v, SUMOReal sameThreshold) { + if (size() > 0 && v.size() > 0 && back().distanceTo(v[0]) < sameThreshold) { copy(v.begin() + 1, v.end(), back_inserter(*this)); } else { copy(v.begin(), v.end(), back_inserter(*this)); @@ -728,7 +730,7 @@ // replace first item by the new position SUMOReal lpos = GeomHelper::nearest_offset_on_line_to_point2D( (*this)[0], (*this)[1], p); - if (lpos == -1) { + if (lpos == GeomHelper::INVALID_OFFSET) { return; } Position np = positionAtOffset(lpos); @@ -789,7 +791,7 @@ SUMOReal lpos = GeomHelper::nearest_offset_on_line_to_point2D( (*this)[static_cast(size()) - 1], (*this)[static_cast(size()) - 2], p); - if (lpos == -1) { + if (lpos == GeomHelper::INVALID_OFFSET) { return; } Position np = positionAtOffset( @@ -830,17 +832,23 @@ for (const_iterator i = begin(); i != end() - 1; i++) { const SUMOReal pos = GeomHelper::nearest_offset_on_line_to_point2D(*i, *(i + 1), p, perpendicular); - const SUMOReal dist = pos < 0 ? minDist : p.distanceTo2D(Line(*i, *(i + 1)).getPositionAtDistance(pos)); + const SUMOReal dist = pos == GeomHelper::INVALID_OFFSET ? minDist : p.distanceTo2D(Line(*i, *(i + 1)).getPositionAtDistance2D(pos)); if (dist < minDist) { nearestPos = pos + seen; minDist = dist; } - if (perpendicular && i != begin()) { + if (perpendicular && i != begin() && pos == GeomHelper::INVALID_OFFSET) { // even if perpendicular is set we still need to check the distance to the inner points const SUMOReal cornerDist = p.distanceTo2D(*i); if (cornerDist < minDist) { - nearestPos = seen; - minDist = cornerDist; + const SUMOReal pos1 = + GeomHelper::nearest_offset_on_line_to_point2D(*(i - 1), *i, p, false); + const SUMOReal pos2 = + GeomHelper::nearest_offset_on_line_to_point2D(*i, *(i + 1), p, false); + if (pos1 == (*(i - 1)).distanceTo2D(*i) && pos2 == 0.) { + nearestPos = seen; + minDist = cornerDist; + } } } seen += (*i).distanceTo2D(*(i + 1)); @@ -849,6 +857,53 @@ } +Position +PositionVector::transformToVectorCoordinates(const Position& p, bool extend) const { + // XXX this duplicates most of the code in nearest_offset_to_point2D. It should be refactored + if (extend) { + PositionVector extended = *this; + const SUMOReal dist = 2 * distance(p); + extended.extrapolate(dist); + return extended.transformToVectorCoordinates(p) - Position(dist, 0); + } + SUMOReal minDist = std::numeric_limits::max(); + SUMOReal nearestPos = -1; + SUMOReal seen = 0; + int sign = 1; + for (const_iterator i = begin(); i != end() - 1; i++) { + const SUMOReal pos = + GeomHelper::nearest_offset_on_line_to_point2D(*i, *(i + 1), p, true); + const SUMOReal dist = pos < 0 ? minDist : p.distanceTo2D(Line(*i, *(i + 1)).getPositionAtDistance(pos)); + if (dist < minDist) { + nearestPos = pos + seen; + minDist = dist; + sign = isLeft(*i, *(i + 1), p) >= 0 ? -1 : 1; + } + if (i != begin() && pos == GeomHelper::INVALID_OFFSET) { + // even if perpendicular is set we still need to check the distance to the inner points + const SUMOReal cornerDist = p.distanceTo2D(*i); + if (cornerDist < minDist) { + const SUMOReal pos1 = + GeomHelper::nearest_offset_on_line_to_point2D(*(i - 1), *i, p, false); + const SUMOReal pos2 = + GeomHelper::nearest_offset_on_line_to_point2D(*i, *(i + 1), p, false); + if (pos1 == (*(i - 1)).distanceTo2D(*i) && pos2 == 0.) { + nearestPos = seen; + minDist = cornerDist; + sign = isLeft(*(i - 1), *i, p) >= 0 ? -1 : 1; + } + } + } + seen += (*i).distanceTo2D(*(i + 1)); + } + if (nearestPos != -1) { + return Position(nearestPos, sign * minDist); + } else { + return Position::INVALID; + } +} + + int PositionVector::indexOfClosest(const Position& p) const { assert(size() > 0); @@ -873,7 +928,7 @@ SUMOReal dist; int insertionIndex = 1; for (int i = 0; i < (int)size() - 1; i++) { - dist = GeomHelper::closestDistancePointLine(p, (*this)[i], (*this)[i + 1], outIntersection); + dist = GeomHelper::closestDistancePointLine2D(p, (*this)[i], (*this)[i + 1], outIntersection); if (dist < minDist) { insertionIndex = i + 1; minDist = dist; @@ -884,21 +939,6 @@ } -SUMOReal -PositionVector::distance(const Position& p) const { - if (size() == 1) { - return front().distanceTo(p); - } - Position outIntersection; - SUMOReal minDist = std::numeric_limits::max(); - for (const_iterator i = begin(); i != end() - 1; i++) { - minDist = MIN2(minDist, GeomHelper::closestDistancePointLine( - p, *i, *(i + 1), outIntersection)); - } - return minDist; -} - - std::vector PositionVector::intersectsAtLengths2D(const PositionVector& other) const { std::vector ret; @@ -978,16 +1018,23 @@ Position from = (*this)[i - 1]; Position me = (*this)[i]; Position to = (*this)[i + 1]; - const double sinAngle = sin(GeomHelper::Angle2D(from.x() - me.x(), from.y() - me.y(), - me.x() - to.x(), me.y() - to.y()) / 2); - const double maxDev = 2 * (from.distanceTo2D(me) + me.distanceTo2D(to)) * sinAngle; - if (fabs(maxDev) < POSITION_EPS) { + Line fromMe(from, me); + fromMe.extrapolateBy2D(me.distanceTo2D(to)); + const double extrapolateDev = fromMe.p2().distanceTo2D(to); + if (fabs(extrapolateDev) < POSITION_EPS) { // parallel case, just shift the middle point std::pair off = GeomHelper::getNormal90D_CW(from, to, amount); shape.push_back(Position(me.x() - off.first, me.y() - off.second, me.z())); continue; } + if (fabs(extrapolateDev - 2 * me.distanceTo2D(to)) < POSITION_EPS) { + // counterparallel case, just shift the middle point + Line fromMe(from, me); + fromMe.extrapolateBy2D(amount); + shape.push_back(fromMe.p2()); + continue; + } std::pair offsets = GeomHelper::getNormal90D_CW(from, me, amount); std::pair offsets2 = @@ -995,11 +1042,11 @@ Line l1( Position(from.x() - offsets.first, from.y() - offsets.second), Position(me.x() - offsets.first, me.y() - offsets.second)); - l1.extrapolateBy(100); + l1.extrapolateBy2D(100); Line l2( Position(me.x() - offsets2.first, me.y() - offsets2.second), Position(to.x() - offsets2.first, to.y() - offsets2.second)); - l2.extrapolateBy(100); + l2.extrapolateBy2D(100); if (l1.intersects(l2)) { shape.push_back(l1.intersectsAt(l2)); } else { @@ -1067,19 +1114,41 @@ std::vector -PositionVector::distances(const PositionVector& s) const { +PositionVector::distances(const PositionVector& s, bool perpendicular) const { std::vector ret; const_iterator i; for (i = begin(); i != end(); i++) { - ret.push_back(s.distance(*i)); + const SUMOReal dist = s.distance(*i, perpendicular); + if (dist != GeomHelper::INVALID_OFFSET) { + ret.push_back(dist); + } } for (i = s.begin(); i != s.end(); i++) { - ret.push_back(distance(*i)); + const SUMOReal dist = distance(*i, perpendicular); + if (dist != GeomHelper::INVALID_OFFSET) { + ret.push_back(dist); + } } return ret; } +SUMOReal +PositionVector::distance(const Position& p, bool perpendicular) const { + if (size() == 0) { + return std::numeric_limits::max(); + } else if (size() == 1) { + return front().distanceTo(p); + } + const SUMOReal nearestOffset = nearest_offset_to_point2D(p, perpendicular); + if (nearestOffset == GeomHelper::INVALID_OFFSET) { + return GeomHelper::INVALID_OFFSET; + } else { + return p.distanceTo2D(positionAtOffset2D(nearestOffset)); + } +} + + void PositionVector::insertAt(int index, const Position& p) { if (index >= 0) { diff -Nru sumo-0.21.0+dfsg/src/utils/geom/PositionVector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/PositionVector.h --- sumo-0.21.0+dfsg/src/utils/geom/PositionVector.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/geom/PositionVector.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: PositionVector.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: PositionVector.h 18096 2015-03-17 09:50:59Z behrisch $ /// // A list of positions /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -217,7 +217,7 @@ int appendWithCrossingPoint(const PositionVector& v); // @brief append the given vector to this one - void append(const PositionVector& v); + void append(const PositionVector& v, SUMOReal sameThreshold = 2.0); PositionVector getSubpart(SUMOReal beginOffset, SUMOReal endOffset) const; @@ -280,14 +280,29 @@ SUMOReal nearest_offset_to_point2D(const Position& p, bool perpendicular = true) const; + /** @brief return position p within the length-wise coordinate system + * defined by this position vector. The x value is the same as that returned + * by nearest_offset_to_point2D(p) and the y value is the perpendicular distance to this + * vector with the sign indicating the side (right is postive). + * if extend is true, the vector is extended on both sides and the + * x-coordinate of the result may be below 0 or above the length of the original vector + */ + Position transformToVectorCoordinates(const Position& p, bool extend = false) const; + /* @brief index of the closest position to p * @note: may only be called for a non-empty vector */ int indexOfClosest(const Position& p) const; - // distances of all my points to s and all of s points to myself - std::vector distances(const PositionVector& s) const; + /* @brief distances of all my points to s and all of s points to myself + * if perpenciualr is set to true, only the perpendicular distances are + * returned + */ + std::vector distances(const PositionVector& s, bool perpendicular = false) const; - SUMOReal distance(const Position& p) const; + /* @brief closest distance to point p + * (or -1 if perpendicular is true and the point is beyond this vector) + */ + SUMOReal distance(const Position& p, bool perpendicular = false) const; void push_back_noDoublePos(const Position& p); void push_front_noDoublePos(const Position& p); diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GLHelper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GLHelper.cpp --- sumo-0.21.0+dfsg/src/utils/gui/div/GLHelper.cpp 2014-05-22 22:02:15.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GLHelper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GLHelper.cpp 16411 2014-05-22 11:10:13Z namdre $ +/// @version $Id: GLHelper.cpp 18119 2015-03-20 10:14:31Z behrisch $ /// // Some methods which help to draw certain geometrical objects in openGL /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -30,17 +30,22 @@ #include #endif -#include "GLHelper.h" +#include #include #include +#include +#include #include #include +#include "GLHelper.h" #ifdef CHECK_MEMORY_LEAKS #include #endif // CHECK_MEMORY_LEAKS +#define CIRCLE_RESOLUTION (SUMOReal)10 // inverse in degrees + // =========================================================================== // static member definitions // =========================================================================== @@ -117,20 +122,21 @@ gluTessEndContour(tobj); gluTessEndPolygon(tobj); gluDeleteTess(tobj); + delete[] points; } void GLHelper::drawBoxLine(const Position& beg, SUMOReal rot, SUMOReal visLength, - SUMOReal width) { + SUMOReal width, SUMOReal offset) { glPushMatrix(); glTranslated(beg.x(), beg.y(), 0); glRotated(rot, 0, 0, 1); glBegin(GL_QUADS); - glVertex2d(-width, 0); - glVertex2d(-width, -visLength); - glVertex2d(width, -visLength); - glVertex2d(width, 0); + glVertex2d(-width - offset, 0); + glVertex2d(-width - offset, -visLength); + glVertex2d(width - offset, -visLength); + glVertex2d(width - offset, 0); glEnd(); glPopMatrix(); } @@ -153,18 +159,76 @@ } +bool +GLHelper::rightTurn(SUMOReal angle1, SUMOReal angle2) { + SUMOReal delta = angle2 - angle1; + while (delta > 180) { + delta -= 360; + } + while (delta < -180) { + delta += 360; + } + return delta <= 0; +} + + void GLHelper::drawBoxLines(const PositionVector& geom, const std::vector& rots, const std::vector& lengths, - SUMOReal width, int cornerDetail) { + SUMOReal width, int cornerDetail, SUMOReal offset) { + // draw the lane int e = (int) geom.size() - 1; for (int i = 0; i < e; i++) { - drawBoxLine(geom[i], rots[i], lengths[i], width); + drawBoxLine(geom[i], rots[i], lengths[i], width, offset); } + // draw the corner details if (cornerDetail > 0) { for (int i = 1; i < e; i++) { glPushMatrix(); + glTranslated(geom[i].x(), geom[i].y(), 0.1); + if (rightTurn(rots[i - 1], rots[i])) { + // inside corner + drawFilledCircle(width - offset, cornerDetail); + } else { + // outside corner, make sure to only draw a segment of the circle + SUMOReal angleBeg = -rots[i - 1]; + SUMOReal angleEnd = 180 - rots[i]; + // avoid drawing more than 360 degrees + if (angleEnd - angleBeg > 360) { + angleBeg += 360; + } + if (angleEnd - angleBeg < -360) { + angleEnd += 360; + } + // for a left tur, draw the right way around + if (angleEnd > angleBeg) { + angleEnd -= 360; + } + drawFilledCircle(width + offset, cornerDetail, angleBeg, angleEnd); + } + glEnd(); + glPopMatrix(); + } + } +} + + +void +GLHelper::drawBoxLines(const PositionVector& geom, + const std::vector& rots, + const std::vector& lengths, + const std::vector& cols, + SUMOReal width, int cornerDetail, SUMOReal offset) { + int e = (int) geom.size() - 1; + for (int i = 0; i < e; i++) { + setColor(cols[i]); + drawBoxLine(geom[i], rots[i], lengths[i], width, offset); + } + if (cornerDetail > 0) { + for (int i = 1; i < e; i++) { + glPushMatrix(); + setColor(cols[i]); glTranslated(geom[i].x(), geom[i].y(), 0); drawFilledCircle(width, cornerDetail); glEnd(); @@ -241,6 +305,19 @@ } +void +GLHelper::drawLine(const PositionVector& v, const std::vector& cols) { + glBegin(GL_LINES); + int e = (int) v.size() - 1; + for (int i = 0; i < e; ++i) { + setColor(cols[i]); + glVertex2d(v[i].x(), v[i].y()); + glVertex2d(v[i + 1].x(), v[i + 1].y()); + } + glEnd(); +} + + void GLHelper::drawLine(const Position& beg, const Position& end) { @@ -251,6 +328,17 @@ } +size_t +GLHelper::angleLookup(SUMOReal angleDeg) { + const int numCoords = (int)myCircleCoords.size() - 1; + int index = ((int)(floor(angleDeg * CIRCLE_RESOLUTION + 0.5))) % numCoords; + if (index < 0) { + index += numCoords; + } + assert(index >= 0); + return (size_t)index; +} + void GLHelper::drawFilledCircle(SUMOReal width, int steps) { @@ -261,18 +349,18 @@ void GLHelper::drawFilledCircle(SUMOReal width, int steps, SUMOReal beg, SUMOReal end) { if (myCircleCoords.size() == 0) { - for (int i = 0; i < 360; i += 10) { - const SUMOReal x = (SUMOReal) sin(DEG2RAD(i)); - const SUMOReal y = (SUMOReal) cos(DEG2RAD(i)); + for (int i = 0; i <= (int)(360 * CIRCLE_RESOLUTION); ++i) { + const SUMOReal x = (SUMOReal) sin(DEG2RAD(i / CIRCLE_RESOLUTION)); + const SUMOReal y = (SUMOReal) cos(DEG2RAD(i / CIRCLE_RESOLUTION)); myCircleCoords.push_back(std::pair(x, y)); } } + const SUMOReal inc = (end - beg) / (SUMOReal)steps; glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - 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 = - myCircleCoords[(size_t)(36.0 / (SUMOReal) steps * (SUMOReal) i)]; + std::pair p1 = myCircleCoords[angleLookup(beg)]; + + for (int i = 0; i <= steps; ++i) { + const std::pair& p2 = myCircleCoords[angleLookup(beg + i * inc)]; glBegin(GL_TRIANGLES); glVertex2d(p1.first * width, p1.second * width); glVertex2d(p2.first * width, p2.second * width); @@ -280,13 +368,6 @@ glEnd(); p1 = p2; } - const std::pair& p2 = - end == 360 ? myCircleCoords[0] : myCircleCoords[((int) end / 10) % 36]; - glBegin(GL_TRIANGLES); - glVertex2d(p1.first * width, p1.second * width); - glVertex2d(p2.first * width, p2.second * width); - glVertex2d(0, 0); - glEnd(); } @@ -431,5 +512,13 @@ glPopMatrix(); } + +void +GLHelper::debugVertices(const PositionVector& shape, SUMOReal size, SUMOReal layer) { + RGBColor color = RGBColor::fromHSV(RandHelper::rand(360), 1, 1); + for (int i = 0; i < (int)shape.size(); ++i) { + GLHelper::drawText(toString(i), shape[i], layer, size, color, 0); + } +} /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GLHelper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GLHelper.h --- sumo-0.21.0+dfsg/src/utils/gui/div/GLHelper.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GLHelper.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GLHelper.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: GLHelper.h 18096 2015-03-17 09:50:59Z behrisch $ /// // Some methods which help to draw certain geometrical objects in openGL /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -77,9 +77,10 @@ * @param[in] rot The direction the line shall be drawn to (in radiants) * @param[in] visLength The length of the line * @param[in] width The width of the line + * @param[in] offset The orthogonal offset */ static void drawBoxLine(const Position& beg, SUMOReal rot, - SUMOReal visLength, SUMOReal width); + SUMOReal visLength, SUMOReal width, SUMOReal offset = 0); /** @brief Draws a thick line using the mean of both given points as begin position @@ -105,11 +106,30 @@ * @param[in] lengths The lengths of the lines * @param[in] width The width of the lines * @param[in] cornerDetail Detail level for filling the corners between angled segments + * @param[in] the orthogonal offset * @see drawBoxLine */ static void drawBoxLines(const PositionVector& geom, const std::vector& rots, const std::vector& lengths, - SUMOReal width, int cornerDetail = 0); + SUMOReal width, int cornerDetail = 0, SUMOReal offset = 0); + + /** @brief Draws thick lines with varying color + * + * Each line is drawn using drawBoxLine. + * + * @param[in] geom The list of begin positions of the lines + * @param[in] rots The directions the lines shall be drawn to (in radiants) + * @param[in] lengths The lengths of the lines + * @param[in] cols The colors of the lines + * @param[in] width The width of the lines + * @param[in] cornerDetail Detail level for filling the corners between angled segments + * @param[in] the orthogonal offset + * @see drawBoxLine + */ + static void drawBoxLines(const PositionVector& geom, + const std::vector& rots, const std::vector& lengths, + const std::vector& cols, + SUMOReal width, int cornerDetail = 0, SUMOReal offset = 0); /** @brief Draws thick lines using the mean of the points given in the point lists as begin positions @@ -175,6 +195,15 @@ static void drawLine(const PositionVector& v); + /** @brief Draws a thin line along the given position vector with variable color + * + * The line is drawn as a GL_LINES. + * + * @param[in] v The positions vector to use + */ + static void drawLine(const PositionVector& v, const std::vector& cols); + + /** @brief Draws a thin line between the two points * * The line is drawn as a GL_LINES. @@ -262,6 +291,16 @@ const RGBColor& borderColor = RGBColor::BLACK, const SUMOReal angle = 0); + /// @brief draw vertex numbers for the given shape (in a random color) + static void debugVertices(const PositionVector& shape, SUMOReal size, SUMOReal layer = 256); + +private: + /// @brief normalize angle for lookup in myCircleCoords + static size_t angleLookup(SUMOReal angleDeg); + + /// @brief whether the road makes a right turn (or goes straight) + static bool rightTurn(SUMOReal angle1, SUMOReal angle2); + private: /// @brief Storage for precomputed sin/cos-values describing a circle static std::vector > myCircleCoords; diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GLObjectValuePassConnector.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GLObjectValuePassConnector.h --- sumo-0.21.0+dfsg/src/utils/gui/div/GLObjectValuePassConnector.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GLObjectValuePassConnector.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: GLObjectValuePassConnector.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GLObjectValuePassConnector.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Class passing values from a GUIGlObject to another object /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Thu, 11.03.2004 -/// @version $Id: GUIDialog_GLChosenEditor.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDialog_GLChosenEditor.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Editor for the list of chosen objects /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIDialog_GLChosenEditor.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIDialog_GLChosenEditor.h --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIDialog_GLChosenEditor.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIDialog_GLChosenEditor.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Thu, 11.03.2004 -/// @version $Id: GUIDialog_GLChosenEditor.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDialog_GLChosenEditor.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Editor for the list of chosen objects /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIGlobalSelection.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIGlobalSelection.cpp --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIGlobalSelection.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIGlobalSelection.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file GUIGlobalSelection.cpp /// @author Daniel Krajzewicz /// @date 2004 -/// @version $Id: GUIGlobalSelection.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGlobalSelection.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A global holder of selected objects /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIGlobalSelection.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIGlobalSelection.h --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIGlobalSelection.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIGlobalSelection.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file GUIGlobalSelection.h /// @author Daniel Krajzewicz /// @date Jun 2004 -/// @version $Id: GUIGlobalSelection.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGlobalSelection.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A global holder of selected objects /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIIOGlobals.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIIOGlobals.cpp --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIIOGlobals.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIIOGlobals.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-11-23 -/// @version $Id: GUIIOGlobals.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIIOGlobals.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The folder used as last /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIIOGlobals.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIIOGlobals.h --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIIOGlobals.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIIOGlobals.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-11-23 -/// @version $Id: GUIIOGlobals.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIIOGlobals.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The folder used as last /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIMessageWindow.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIMessageWindow.cpp --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIMessageWindow.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIMessageWindow.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Tue, 25 Nov 2003 -/// @version $Id: GUIMessageWindow.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUIMessageWindow.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A logging window for the gui /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -101,7 +101,7 @@ void -GUIMessageWindow::appendText(GUIEventType eType, const std::string& msg) { +GUIMessageWindow::appendMsg(GUIEventType eType, const std::string& msg) { if (!isEnabled()) { show(); } diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIMessageWindow.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIMessageWindow.h --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIMessageWindow.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIMessageWindow.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Tue, 25 Nov 2003 -/// @version $Id: GUIMessageWindow.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUIMessageWindow.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A logging window for the gui /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2003-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2003-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -77,7 +77,7 @@ * @param[in] msg The message * @see GUIEventType */ - void appendText(GUIEventType eType, const std::string& msg); + void appendMsg(GUIEventType eType, const std::string& msg); /// @brief Clears the window @@ -102,7 +102,7 @@ return myStream; } void postWriteHook() { - myMsgWindow->appendText(myType, myStream.str()); + myMsgWindow->appendMsg(myType, myStream.str()); myStream.str(""); } diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIParameterTableItem.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIParameterTableItem.h --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIParameterTableItem.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIParameterTableItem.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date -/// @version $Id: GUIParameterTableItem.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIParameterTableItem.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A single line in a parameter window /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIParameterTableWindow.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIParameterTableWindow.cpp --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIParameterTableWindow.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIParameterTableWindow.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: GUIParameterTableWindow.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUIParameterTableWindow.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The window that holds the table of an object's parameter /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -61,6 +61,12 @@ // =========================================================================== +// static value definitions +// =========================================================================== +MFXMutex GUIParameterTableWindow::myGlobalContainerLock; +std::vector GUIParameterTableWindow::myContainer; + +// =========================================================================== // method definitions // =========================================================================== GUIParameterTableWindow::GUIParameterTableWindow(GUIMainWindow& app, @@ -89,6 +95,8 @@ myLock.lock(); myObject->addParameterTable(this); myLock.unlock(); + AbstractMutex::ScopedLocker locker(myGlobalContainerLock); + myContainer.push_back(this); } @@ -102,6 +110,11 @@ myObject->removeParameterTable(this); } myLock.unlock(); + AbstractMutex::ScopedLocker locker(myGlobalContainerLock); + std::vector::iterator i = std::find(myContainer.begin(), myContainer.end(), this); + if (i != myContainer.end()) { + myContainer.erase(i); + } } @@ -114,6 +127,7 @@ long GUIParameterTableWindow::onSimStep(FXObject*, FXSelector, void*) { + // table values are updated in GUINet::guiSimulationStep() updateTable(); update(); return 1; diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIParameterTableWindow.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIParameterTableWindow.h --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIParameterTableWindow.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIParameterTableWindow.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: GUIParameterTableWindow.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUIParameterTableWindow.h 18096 2015-03-17 09:50:59Z behrisch $ /// // The window that holds the table of an object's parameter /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -34,6 +34,8 @@ #include #include +#include +#include #include #include #include @@ -201,6 +203,12 @@ long onRightButtonPress(FXObject*, FXSelector, void*); /// @} + /** @brief Updates all instances + */ + static void updateAll() { + AbstractMutex::ScopedLocker locker(myGlobalContainerLock); + std::for_each(myContainer.begin(), myContainer.end(), std::mem_fun(&GUIParameterTableWindow::updateTable)); + } protected: /** @brief Updates the table @@ -211,6 +219,11 @@ */ void updateTable(); + /// @brief The mutex used to avoid concurrent updates of the instance container + static MFXMutex myGlobalContainerLock; + + /// @brief The container of items that shall be updated + static std::vector myContainer; private: /// @brief The object to get the information from @@ -228,7 +241,7 @@ /// @brief The index of the next row to add - used while building unsigned myCurrentPos; - /// @brief A lock assuring save updates in cse of object deletion + /// @brief A lock assuring save updates in case of object deletion mutable MFXMutex myLock; protected: diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIParam_PopupMenu.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIParam_PopupMenu.cpp --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIParam_PopupMenu.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIParam_PopupMenu.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mai 2003 -/// @version $Id: GUIParam_PopupMenu.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIParam_PopupMenu.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A popup-menu for dynamic patameter table entries /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIParam_PopupMenu.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIParam_PopupMenu.h --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIParam_PopupMenu.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIParam_PopupMenu.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file GUIParam_PopupMenu.h /// @author Daniel Krajzewicz /// @date Mai 2003 -/// @version $Id: GUIParam_PopupMenu.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIParam_PopupMenu.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A popup-menu for dynamic patameter table entries /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUISelectedStorage.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUISelectedStorage.cpp --- sumo-0.21.0+dfsg/src/utils/gui/div/GUISelectedStorage.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUISelectedStorage.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Jun 2004 -/// @version $Id: GUISelectedStorage.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUISelectedStorage.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Storage for "selected" objects /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUISelectedStorage.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUISelectedStorage.h --- sumo-0.21.0+dfsg/src/utils/gui/div/GUISelectedStorage.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUISelectedStorage.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Jun 2004 -/// @version $Id: GUISelectedStorage.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUISelectedStorage.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Storage for "selected" objects /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIUserIO.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIUserIO.cpp --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIUserIO.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIUserIO.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2006-10-12 -/// @version $Id: GUIUserIO.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIUserIO.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Some OS-dependant functions to ease cliboard manipulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/GUIUserIO.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIUserIO.h --- sumo-0.21.0+dfsg/src/utils/gui/div/GUIUserIO.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/GUIUserIO.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2006 -/// @version $Id: GUIUserIO.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIUserIO.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Some OS-dependant functions to ease cliboard manipulation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/div/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/Makefile.in --- sumo-0.21.0+dfsg/src/utils/gui/div/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/div/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -224,6 +224,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -234,7 +236,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/events/GUIEvent.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/events/GUIEvent.h --- sumo-0.21.0+dfsg/src/utils/gui/events/GUIEvent.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/events/GUIEvent.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file GUIEvent.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: GUIEvent.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIEvent.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Definition of an own event class /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/events/GUIEvent_Message.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/events/GUIEvent_Message.h --- sumo-0.21.0+dfsg/src/utils/gui/events/GUIEvent_Message.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/events/GUIEvent_Message.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file GUIEvent_Message.h /// @author Daniel Krajzewicz /// @date Wed 18 Jun 2003 -/// @version $Id: GUIEvent_Message.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIEvent_Message.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Event send when a message (message, warning, error) has to besubmitted /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/events/GUIEvent_SimulationStep.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/events/GUIEvent_SimulationStep.h --- sumo-0.21.0+dfsg/src/utils/gui/events/GUIEvent_SimulationStep.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/events/GUIEvent_SimulationStep.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file GUIEvent_SimulationStep.h /// @author Daniel Krajzewicz /// @date Sept 2002 -/// @version $Id: GUIEvent_SimulationStep.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIEvent_SimulationStep.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Event send when the a simulation step has been performed by GUIRunThread /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/events/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/events/Makefile.in --- sumo-0.21.0+dfsg/src/utils/gui/events/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/events/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -146,6 +146,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -156,7 +158,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GLIncludes.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GLIncludes.h --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GLIncludes.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GLIncludes.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2012 -/// @version $Id: GLIncludes.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GLIncludes.h 18095 2015-03-17 09:39:00Z behrisch $ /// // collection of includes for GL usage /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2004 -/// @version $Id: GUIGlObject_AbstractAdd.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGlObject_AbstractAdd.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Base class for additional objects (detectors etc.) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2004 -/// @version $Id: GUIGlObject_AbstractAdd.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGlObject_AbstractAdd.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Base class for additional objects (detectors etc.) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObject.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObject.cpp --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObject.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObject.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: GUIGlObject.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGlObject.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Base class for all objects that may be displayed within the openGL-gui /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -67,6 +67,7 @@ {"poi", GLO_POI}, {"vehicle", GLO_VEHICLE}, {"person", GLO_PERSON}, + {"container", GLO_CONTAINER}, {"undefined", GLO_MAX} }; diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObject.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObject.h --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObject.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObject.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Oct 2002 -/// @version $Id: GUIGlObject.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGlObject.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Base class for all objects that may be displayed within the openGL-gui /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIGLObjectPopupMenu.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGLObjectPopupMenu.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The popup menu of a globject /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGLObjectPopupMenu.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGLObjectPopupMenu.h --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGLObjectPopupMenu.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGLObjectPopupMenu.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIGLObjectPopupMenu.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGLObjectPopupMenu.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The popup menu of a globject /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObjectStorage.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObjectStorage.cpp --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObjectStorage.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObjectStorage.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIGlObjectStorage.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGlObjectStorage.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A storage for displayed objects via their numerical id /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObjectStorage.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObjectStorage.h --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObjectStorage.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObjectStorage.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Oct 2002 -/// @version $Id: GUIGlObjectStorage.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGlObjectStorage.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A storage for displayed objects via their numerical id /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObjectTypes.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObjectTypes.h --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIGlObjectTypes.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIGlObjectTypes.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,14 +4,14 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIGlObjectTypes.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGlObjectTypes.h 18095 2015-03-17 09:39:00Z 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 // when constructing the full name /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -69,8 +69,10 @@ GLO_VEHICLE = 512, /// @brief a person GLO_PERSON = 1024, + /// @brief a container + GLO_CONTAINER = 2048, /// @brief empty max - GLO_MAX = 2048 + GLO_MAX = 4096 }; diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIPointOfInterest.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIPointOfInterest.cpp --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIPointOfInterest.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIPointOfInterest.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date June 2006 -/// @version $Id: GUIPointOfInterest.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIPointOfInterest.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The GUI-version of a point of interest /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -99,7 +99,8 @@ void GUIPointOfInterest::drawGL(const GUIVisualizationSettings& s) const { - if (s.scale * (1.3 / 3.0) < s.minPOISize) { + const SUMOReal exaggeration = s.poiSize.getExaggeration(s); + if (s.scale * (1.3 / 3.0) *exaggeration < s.poiSize.minSize) { return; } glPushName(getGlID()); @@ -112,15 +113,15 @@ int textureID = GUITexturesHelper::getTextureID(myImgFile); if (textureID > 0) { GUITexturesHelper::drawTexturedBox(textureID, - -myHalfImgWidth * s.poiExaggeration, -myHalfImgHeight * s.poiExaggeration, - myHalfImgWidth * s.poiExaggeration, myHalfImgHeight * s.poiExaggeration); + -myHalfImgWidth * exaggeration, -myHalfImgHeight * exaggeration, + myHalfImgWidth * exaggeration, myHalfImgHeight * exaggeration); } } else { // fallback if no image is defined - GLHelper::drawFilledCircle((SUMOReal) 1.3 * s.poiExaggeration, 16); + GLHelper::drawFilledCircle((SUMOReal) 1.3 * exaggeration, 16); } glPopMatrix(); - drawName(Position(x() + 1.32 * s.poiExaggeration, y() + 1.32 * s.poiExaggeration), + drawName(Position(x() + 1.32 * exaggeration, y() + 1.32 * exaggeration), s.scale, s.poiName); glPopName(); } diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIPointOfInterest.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIPointOfInterest.h --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIPointOfInterest.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIPointOfInterest.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date June 2006 -/// @version $Id: GUIPointOfInterest.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIPointOfInterest.h 18095 2015-03-17 09:39:00Z behrisch $ /// // missing_desc /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,6 +35,7 @@ #include #include #include +#include // =========================================================================== diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIPolygon.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIPolygon.cpp --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIPolygon.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIPolygon.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date June 2006 -/// @version $Id: GUIPolygon.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIPolygon.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The GUI-version of a polygon /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -44,6 +44,7 @@ #include #endif // CHECK_MEMORY_LEAKS +//#define GUIPolygon_DEBUG_DRAW_VERTICES // =========================================================================== // method definitions @@ -138,7 +139,7 @@ void GUIPolygon::drawGL(const GUIVisualizationSettings& s) const { Boundary boundary = myShape.getBoxBoundary(); - if (s.scale * MAX2(boundary.getWidth(), boundary.getHeight()) < s.minPolySize) { + if (s.scale * MAX2(boundary.getWidth(), boundary.getHeight()) < s.polySize.minSize) { return; } if (getFill()) { @@ -151,8 +152,8 @@ } } AbstractMutex::ScopedLocker locker(myLock); - //if (myDisplayList == 0 || (!getFill() && myLineWidth != s.polyExaggeration)) { - // storeTesselation(s.polyExaggeration); + //if (myDisplayList == 0 || (!getFill() && myLineWidth != s.polySize.getExaggeration(s))) { + // storeTesselation(s.polySize.getExaggeration(s)); //} glPushName(getGlID()); glPushMatrix(); @@ -193,7 +194,7 @@ } // recall tesselation //glCallList(myDisplayList); - performTesselation(s.polyExaggeration); + performTesselation(s.polySize.getExaggeration(s)); // de-init generation of texture coordinates if (textureID >= 0) { glEnable(GL_DEPTH_TEST); @@ -202,6 +203,9 @@ glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); } +#ifdef GUIPolygon_DEBUG_DRAW_VERTICES + GLHelper::debugVertices(myShape, 80 / s.scale); +#endif glPopMatrix(); drawName(myShape.getPolygonCenter(), s.scale, s.polyName); glPopName(); diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIPolygon.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIPolygon.h --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIPolygon.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIPolygon.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date June 2006 -/// @version $Id: GUIPolygon.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIPolygon.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The GUI-version of a polygon /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -37,6 +37,7 @@ #include #include #include +#include using namespace SUMO; // =========================================================================== diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIShapeContainer.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIShapeContainer.cpp --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIShapeContainer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIShapeContainer.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,161 @@ +/****************************************************************************/ +/// @file GUIShapeContainer.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date 08.10.2009 +/// @version $Id: GUIShapeContainer.cpp 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Storage for geometrical objects extended by mutexes +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "GUIShapeContainer.h" +#include +#include +#include +#include +#include + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +GUIShapeContainer::GUIShapeContainer(SUMORTree& vis) + : myVis(vis) {} + + +GUIShapeContainer::~GUIShapeContainer() {} + + +bool +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; + } +} + + +bool +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; + } +} + + +bool +GUIShapeContainer::removePolygon(const std::string& id) { + AbstractMutex::ScopedLocker locker(myLock); + GUIPolygon* p = dynamic_cast(myPolygons.get(id)); + if (p == 0) { + return false; + } + myVis.removeAdditionalGLObject(p); + return myPolygons.remove(id); +} + + +bool +GUIShapeContainer::removePOI(const std::string& id) { + AbstractMutex::ScopedLocker locker(myLock); + GUIPointOfInterest* p = dynamic_cast(myPOIs.get(id)); + if (p == 0) { + return false; + } + myVis.removeAdditionalGLObject(p); + return myPOIs.remove(id); +} + + +void +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); + } +} + + +void +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); + } +} + + + +std::vector +GUIShapeContainer::getPOIIds() const { + AbstractMutex::ScopedLocker locker(myLock); + std::vector ret; + 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.21.0+dfsg/src/utils/gui/globjects/GUIShapeContainer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIShapeContainer.h --- sumo-0.21.0+dfsg/src/utils/gui/globjects/GUIShapeContainer.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/GUIShapeContainer.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,148 @@ +/****************************************************************************/ +/// @file GUIShapeContainer.h +/// @author Daniel Krajzewicz +/// @author Michael Behrisch +/// @author Jakob Erdmann +/// @date 08.10.2009 +/// @version $Id: GUIShapeContainer.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Storage for geometrical objects extended by mutexes +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 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 GUIShapeContainer_h +#define GUIShapeContainer_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class SUMORTree; +class Position; +class MFXMutex; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GUIShapeContainer + * @brief Storage for geometrical objects extended by mutexes + * @see ShapeContainer + */ +class GUIShapeContainer : public ShapeContainer { +public: + /// @brief Constructor + GUIShapeContainer(SUMORTree& vis); + + + /// @brief Destructor + virtual ~GUIShapeContainer(); + + /** @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] id The id of the polygon + * @return Whether the polygon could be removed + */ + virtual bool removePolygon(const std::string& id); + + + /** @brief Removes a PoI from the container + * @param[in] id The id of the PoI + * @return Whether the poi could be removed + */ + virtual bool removePOI(const std::string& id); + + + + /** @brief Assigns a new position to the named PoI + * @param[in] id The id of the PoI to move + * @param[in] pos The PoI's new position + */ + virtual void movePOI(const std::string& id, const Position& pos); + + + /** @brief Assigns a shape to the named polygon + * @param[in] id The id of the polygon to reshape + * @param[in] shape The polygon's new shape + */ + virtual void reshapePolygon(const std::string& id, const PositionVector& shape); + + + + /// 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 + mutable MFXMutex myLock; + + /// @brief The RTree structure to add and remove visualization elements + SUMORTree& myVis; + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/Makefile.am --- sumo-0.21.0+dfsg/src/utils/gui/globjects/Makefile.am 2013-05-03 20:25:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -6,5 +6,6 @@ GUIGlObjectStorage.cpp GUIGlObjectStorage.h \ GUIGlObjectTypes.h \ GUIGlObject_AbstractAdd.cpp GUIGlObject_AbstractAdd.h \ +GUIShapeContainer.cpp GUIShapeContainer.h \ GUIPointOfInterest.cpp GUIPointOfInterest.h \ GUIPolygon.cpp GUIPolygon.h diff -Nru sumo-0.21.0+dfsg/src/utils/gui/globjects/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/Makefile.in --- sumo-0.21.0+dfsg/src/utils/gui/globjects/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/globjects/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -100,8 +100,8 @@ libguiutilsglobjects_a_LIBADD = am_libguiutilsglobjects_a_OBJECTS = GUIGLObjectPopupMenu.$(OBJEXT) \ GUIGlObject.$(OBJEXT) GUIGlObjectStorage.$(OBJEXT) \ - GUIGlObject_AbstractAdd.$(OBJEXT) GUIPointOfInterest.$(OBJEXT) \ - GUIPolygon.$(OBJEXT) + GUIGlObject_AbstractAdd.$(OBJEXT) GUIShapeContainer.$(OBJEXT) \ + GUIPointOfInterest.$(OBJEXT) GUIPolygon.$(OBJEXT) libguiutilsglobjects_a_OBJECTS = $(am_libguiutilsglobjects_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -223,6 +223,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -233,7 +235,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -334,6 +335,7 @@ GUIGlObjectStorage.cpp GUIGlObjectStorage.h \ GUIGlObjectTypes.h \ GUIGlObject_AbstractAdd.cpp GUIGlObject_AbstractAdd.h \ +GUIShapeContainer.cpp GUIShapeContainer.h \ GUIPointOfInterest.cpp GUIPointOfInterest.h \ GUIPolygon.cpp GUIPolygon.h @@ -392,6 +394,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIGlObject_AbstractAdd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIPointOfInterest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIPolygon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GUIShapeContainer.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/flag.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/flag.cpp --- sumo-0.21.0+dfsg/src/utils/gui/images/flag.cpp 2014-03-17 23:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/flag.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,13 +3,13 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-11-23 -/// @version $Id: flag.cpp 15959 2014-03-17 16:58:35Z cschmidt87 $ +/// @version $Id: flag.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Generated by reswrap version 3.0.0 // created by reswrap from file flag.gif /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/flag_minus.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/flag_minus.cpp --- sumo-0.21.0+dfsg/src/utils/gui/images/flag_minus.cpp 2014-03-17 23:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/flag_minus.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,13 +3,13 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-11-23 -/// @version $Id: flag_minus.cpp 15959 2014-03-17 16:58:35Z cschmidt87 $ +/// @version $Id: flag_minus.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Generated by reswrap version 3.0.0 // created by reswrap from file flag_minus.gif /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/flag_plus.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/flag_plus.cpp --- sumo-0.21.0+dfsg/src/utils/gui/images/flag_plus.cpp 2014-03-17 23:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/flag_plus.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,13 +3,13 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-11-23 -/// @version $Id: flag_plus.cpp 15959 2014-03-17 16:58:35Z cschmidt87 $ +/// @version $Id: flag_plus.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Generated by reswrap version 3.0.0 // created by reswrap from file flag_plus.gif /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/GUIIcons.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/GUIIcons.h --- sumo-0.21.0+dfsg/src/utils/gui/images/GUIIcons.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/GUIIcons.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Andreas Gaubatz /// @date 2004 -/// @version $Id: GUIIcons.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIIcons.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An enumeration of icons used by the gui applications /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -45,6 +45,7 @@ ICON_EMPTY, ICON_OPEN_CONFIG, ICON_OPEN_NET, + ICON_OPEN_SHAPES, ICON_RELOAD, ICON_SAVE, ICON_CLOSE, @@ -63,6 +64,7 @@ ICON_LOCATEJUNCTION, ICON_LOCATEEDGE, ICON_LOCATEVEHICLE, + ICON_LOCATEPERSON, ICON_LOCATETLS, ICON_LOCATEADD, ICON_LOCATEPOI, diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/GUIIconSubSys.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/GUIIconSubSys.cpp --- sumo-0.21.0+dfsg/src/utils/gui/images/GUIIconSubSys.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/GUIIconSubSys.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Andreas Gaubatz /// @date Mon, 08.03.2004 -/// @version $Id: GUIIconSubSys.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIIconSubSys.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Helper for icons loading and usage /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -38,6 +38,7 @@ #include "filesave.xpm" #include "fileopen.xpm" #include "netopen.xpm" +#include "shapeopen.xpm" #include "play.xpm" #include "stop.xpm" #include "step.xpm" @@ -55,6 +56,7 @@ #include "locate_junction.xpm" #include "locate_edge.xpm" #include "locate_vehicle.xpm" +#include "locate_person.xpm" #include "locate_tls.xpm" #include "locate_add.xpm" #include "locate_poi.xpm" @@ -141,6 +143,7 @@ myIcons[ICON_EMPTY] = new FXXPMIcon(a, empty_xpm); myIcons[ICON_OPEN_CONFIG] = new FXXPMIcon(a, fileopen_xpm); myIcons[ICON_OPEN_NET] = new FXXPMIcon(a, netopen_xpm); + myIcons[ICON_OPEN_SHAPES] = new FXXPMIcon(a, shapeopen_xpm); myIcons[ICON_RELOAD] = new FXXPMIcon(a, reload_xpm); myIcons[ICON_SAVE] = new FXXPMIcon(a, filesave_xpm); myIcons[ICON_CLOSE] = 0;//new FXXPMIcon(a, close); @@ -165,6 +168,7 @@ myIcons[ICON_LOCATEJUNCTION] = new FXXPMIcon(a, locate_junction_xpm); myIcons[ICON_LOCATEEDGE] = new FXXPMIcon(a, locate_edge_xpm); myIcons[ICON_LOCATEVEHICLE] = new FXXPMIcon(a, locate_vehicle_xpm); + myIcons[ICON_LOCATEPERSON] = new FXXPMIcon(a, locate_person_xpm); myIcons[ICON_LOCATETLS] = new FXXPMIcon(a, locate_tls_xpm); myIcons[ICON_LOCATEADD] = new FXXPMIcon(a, locate_add_xpm); myIcons[ICON_LOCATEPOI] = new FXXPMIcon(a, locate_poi_xpm); diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/GUIIconSubSys.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/GUIIconSubSys.h --- sumo-0.21.0+dfsg/src/utils/gui/images/GUIIconSubSys.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/GUIIconSubSys.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file GUIIconSubSys.h /// @author Daniel Krajzewicz /// @date Jul 2003 -/// @version $Id: GUIIconSubSys.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIIconSubSys.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A class dividing the network in rectangular cells /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/GUITexturesHelper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/GUITexturesHelper.cpp --- sumo-0.21.0+dfsg/src/utils/gui/images/GUITexturesHelper.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/GUITexturesHelper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 08.03.2004 -/// @version $Id: GUITexturesHelper.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUITexturesHelper.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Global storage for textures; manages and draws them /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/GUITexturesHelper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/GUITexturesHelper.h --- sumo-0.21.0+dfsg/src/utils/gui/images/GUITexturesHelper.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/GUITexturesHelper.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2006 -/// @version $Id: GUITexturesHelper.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUITexturesHelper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Global storage for textures; manages and draws them /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/locate_person.xpm sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/locate_person.xpm --- sumo-0.21.0+dfsg/src/utils/gui/images/locate_person.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/locate_person.xpm 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,23 @@ +/* XPM */ +static const char * locate_person_xpm[] = { +"16 16 4 1", +" c None", +". c Black", +"X c Red", +"o c #851d1d", +" ... ", +" .. . . ", +" ..XX.. . ", +" .XXXXXX. . ", +" .XX.X. . ", +" .XXX. ", +" .X.. .. ", +" .XXXX...o. ", +" . XXXXXX. ", +" .XXX.. . ", +" .XXXXX...X. ", +" .XX...XXXX. ", +" .XX. .XX. ", +" .XXX. .. ", +" ... ", +" "}; diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/Makefile.am --- sumo-0.21.0+dfsg/src/utils/gui/images/Makefile.am 2014-01-14 23:02:22.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -11,9 +11,9 @@ fileopen.xpm fileprint.xpm filesave.xpm \ flag.cpp flag_minus.cpp flag_plus.cpp halt.xpm locate.xpm \ locate_add.xpm locate_edge.xpm locate_junction.xpm \ -locate_poi.xpm locate_poly.xpm \ +locate_person.xpm locate_poi.xpm locate_poly.xpm \ locate_tls.xpm locate_vehicle.xpm \ -magnify.xpm zoomstyle.xpm manip.cpp netopen.xpm new_window.xpm no.xpm \ +magnify.xpm zoomstyle.xpm manip.cpp netopen.xpm shapeopen.xpm new_window.xpm no.xpm \ open_bmp_dialog.xpm opening.xpm \ paintbrush1x.xpm paintbrush2x.xpm paintbrush3x.xpm paintbrush4x.xpm \ paintbrush5x.xpm play.xpm \ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/Makefile.in --- sumo-0.21.0+dfsg/src/utils/gui/images/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -221,6 +221,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -231,7 +233,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -337,9 +338,9 @@ fileopen.xpm fileprint.xpm filesave.xpm \ flag.cpp flag_minus.cpp flag_plus.cpp halt.xpm locate.xpm \ locate_add.xpm locate_edge.xpm locate_junction.xpm \ -locate_poi.xpm locate_poly.xpm \ +locate_person.xpm locate_poi.xpm locate_poly.xpm \ locate_tls.xpm locate_vehicle.xpm \ -magnify.xpm zoomstyle.xpm manip.cpp netopen.xpm new_window.xpm no.xpm \ +magnify.xpm zoomstyle.xpm manip.cpp netopen.xpm shapeopen.xpm new_window.xpm no.xpm \ open_bmp_dialog.xpm opening.xpm \ paintbrush1x.xpm paintbrush2x.xpm paintbrush3x.xpm paintbrush4x.xpm \ paintbrush5x.xpm play.xpm \ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/manip.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/manip.cpp --- sumo-0.21.0+dfsg/src/utils/gui/images/manip.cpp 2014-03-17 23:02:27.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/manip.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,13 +3,13 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004-11-23 -/// @version $Id: manip.cpp 15959 2014-03-17 16:58:35Z cschmidt87 $ +/// @version $Id: manip.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Generated by reswrap version 3.0.0 // created by reswrap from file manip.gif /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/images/shapeopen.xpm sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/shapeopen.xpm --- sumo-0.21.0+dfsg/src/utils/gui/images/shapeopen.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/images/shapeopen.xpm 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +/* XPM */ +static const char *shapeopen_xpm[] = { +"16 15 7 1", +" c None", +". c #040404", +"X c #f3f704", +"o c #f3f7f3", +"O c Black", +"+ c #ff0000", +"@ c #808304", +" ... ", +" . . . ", +" .. ", +" ... ... ", +".XoX....... ", +".oXoXoXoXo. ", +".XoXoXoXoX. ", +".oXoXo@OOOOOOO ", +".XoXo@OO+++++OO ", +".oX.@OO+++++++OO", +".X.@@O+++++++++O", +"..@@@O+++++++++O", +".....OO+++++++OO", +" OO+++++OO ", +" OOOOOOO "}; diff -Nru sumo-0.21.0+dfsg/src/utils/gui/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/Makefile.in --- sumo-0.21.0+dfsg/src/utils/gui/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -206,6 +206,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -216,7 +218,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/settings/GUIColorer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUIColorer.h --- sumo-0.21.0+dfsg/src/utils/gui/settings/GUIColorer.h 2014-02-22 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUIColorer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,118 +0,0 @@ -/****************************************************************************/ -/// @file GUIColorer.h -/// @author Michael Behrisch -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Laura Bieker -/// @date Mon, 20.07.2009 -/// @version $Id: GUIColorer.h 15692 2014-02-22 09:17:02Z behrisch $ -/// -// -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 GUIColorer_h -#define GUIColorer_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include "GUIColorScheme.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GUIColorer - * @brief Base class for coloring. Allows changing the used colors and sets - * the used color in dependence to a value - */ -class GUIColorer { -public: - /// @brief Constructor - GUIColorer() : myActiveScheme(0) { } - - /// @brief Destructor - virtual ~GUIColorer() { } - - /// @brief Fills the given combobox with the names of available colorings - void fill(FXComboBox& cb) { - for (std::vector::iterator i = mySchemes.begin(); i != mySchemes.end(); ++i) { - cb.appendItem((*i).getName().c_str()); - } - cb.setCurrentItem((FXint)myActiveScheme); - } - - void setActive(size_t scheme) { - if (scheme < mySchemes.size()) { - myActiveScheme = scheme; - } - } - - size_t getActive() const { - return myActiveScheme; - } - - GUIColorScheme& getScheme() { - return mySchemes[myActiveScheme]; - } - - const GUIColorScheme& getScheme() const { - return mySchemes[myActiveScheme]; - } - - GUIColorScheme* getSchemeByName(std::string name) { - for (std::vector::iterator i = mySchemes.begin(); i != mySchemes.end(); ++i) { - if ((*i).getName() == name) { - return &(*i); - } - } - return 0; - } - - void save(OutputDevice& dev) const { - for (std::vector::const_iterator i = mySchemes.begin(); i != mySchemes.end(); ++i) { - i->save(dev); - } - } - - bool operator==(const GUIColorer& c) const { - return myActiveScheme == c.myActiveScheme && mySchemes == c.mySchemes; - } - - - void addScheme(GUIColorScheme scheme) { - mySchemes.push_back(scheme); - } - - -protected: - size_t myActiveScheme; - std::vector mySchemes; - -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/settings/GUIColorScheme.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUIColorScheme.h --- sumo-0.21.0+dfsg/src/utils/gui/settings/GUIColorScheme.h 2014-02-22 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUIColorScheme.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,207 +0,0 @@ -/****************************************************************************/ -/// @file GUIColorScheme.h -/// @author Michael Behrisch -/// @author Daniel Krajzewicz -/// @date Mon, 20.07.2009 -/// @version $Id: GUIColorScheme.h 15692 2014-02-22 09:17:02Z behrisch $ -/// -// -/****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 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 GUIColorScheme_h -#define GUIColorScheme_h - - -// =========================================================================== -// included modules -// =========================================================================== -#ifdef _MSC_VER -#include -#else -#include -#endif - -#include -#include -#include -#include - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GUIColorScheme - * @brief - */ -class GUIColorScheme { -public: - /// Constructor - GUIColorScheme(const std::string& name, const RGBColor& baseColor, - const std::string& colName = "", const bool isFixed = false) - : myName(name), myIsInterpolated(!isFixed), myIsFixed(isFixed) { - addColor(baseColor, 0, colName); - } - - void setThreshold(const size_t pos, const SUMOReal threshold) { - myThresholds[pos] = threshold; - } - - void setColor(const size_t pos, const RGBColor& color) { - myColors[pos] = color; - } - - bool setColor(const std::string& name, const RGBColor& color) { - std::vector::iterator nameIt = myNames.begin(); - std::vector::iterator colIt = myColors.begin(); - for (; nameIt != myNames.end(); ++nameIt, ++colIt) { - if (*nameIt == name) { - (*colIt) = color; - return true; - } - } - return false; - } - - unsigned int addColor(const RGBColor& color, const SUMOReal threshold, const std::string& name = "") { - std::vector::iterator colIt = myColors.begin(); - std::vector::iterator threshIt = myThresholds.begin(); - std::vector::iterator nameIt = myNames.begin(); - unsigned int pos = 0; - while (threshIt != myThresholds.end() && (*threshIt) < threshold) { - ++threshIt; - ++colIt; - ++nameIt; - pos++; - } - myColors.insert(colIt, color); - myThresholds.insert(threshIt, threshold); - myNames.insert(nameIt, name); - return pos; - } - - void removeColor(const size_t pos) { - assert(pos < myColors.size()); - myColors.erase(myColors.begin() + pos); - myThresholds.erase(myThresholds.begin() + pos); - myNames.erase(myNames.begin() + pos); - } - - void clear() { - myColors.clear(); - myThresholds.clear(); - myNames.clear(); - } - - const RGBColor getColor(const SUMOReal value) const { - if (myColors.size() == 1 || value < myThresholds.front()) { - return myColors.front(); - } - std::vector::const_iterator colIt = myColors.begin() + 1; - std::vector::const_iterator threshIt = myThresholds.begin() + 1; - while (threshIt != myThresholds.end() && (*threshIt) <= value) { - ++threshIt; - ++colIt; - } - if (threshIt == myThresholds.end()) { - return myColors.back(); - } - if (!myIsInterpolated) { - return *(colIt - 1); - } - SUMOReal lowVal = *(threshIt - 1); - return RGBColor::interpolate(*(colIt - 1), *colIt, (value - lowVal) / ((*threshIt) - lowVal)); - } - - void setInterpolated(const bool interpolate, SUMOReal interpolationStart = 0.f) { - myIsInterpolated = interpolate; - if (interpolate) { - myThresholds[0] = interpolationStart; - } - } - - const std::string& getName() const { - return myName; - } - - const std::vector& getColors() const { - return myColors; - } - - const std::vector& getThresholds() const { - return myThresholds; - } - - bool isInterpolated() const { - return myIsInterpolated; - } - - const std::vector& getNames() const { - return myNames; - } - - bool isFixed() const { - return myIsFixed; - } - - bool allowsNegativeValues() const { - return myAllowNegativeValues; - } - - void setAllowsNegativeValues(bool value) { - myAllowNegativeValues = value; - } - - void save(OutputDevice& dev) const { - dev << " \n"; - std::vector::const_iterator colIt = myColors.begin(); - std::vector::const_iterator threshIt = myThresholds.begin(); - std::vector::const_iterator nameIt = myNames.begin(); - while (threshIt != myThresholds.end()) { - dev << " \n"; - ++threshIt; - ++colIt; - ++nameIt; - } - dev << " \n"; - } - - bool operator==(const GUIColorScheme& c) const { - return myName == c.myName && myColors == c.myColors && myThresholds == c.myThresholds && myIsInterpolated == c.myIsInterpolated; - } - -private: - std::string myName; - std::vector myColors; - std::vector myThresholds; - bool myIsInterpolated; - std::vector myNames; - bool myIsFixed; - bool myAllowNegativeValues; - -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/settings/GUICompleteSchemeStorage.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUICompleteSchemeStorage.cpp --- sumo-0.21.0+dfsg/src/utils/gui/settings/GUICompleteSchemeStorage.cpp 2014-05-19 22:02:39.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUICompleteSchemeStorage.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date 2006-01-09 -/// @version $Id: GUICompleteSchemeStorage.cpp 16392 2014-05-19 10:24:44Z namdre $ +/// @version $Id: GUICompleteSchemeStorage.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Storage for available visualization settings /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -140,8 +140,9 @@ vs.backgroundColor = RGBColor(51, 128, 51, 255); vs.laneShowBorders = true; vs.hideConnectors = true; - vs.minVehicleSize = 0; + vs.vehicleSize.minSize = 0; vs.personQuality = 2; + vs.containerQuality = 2; gSchemeStorage.add(vs); } myNumInitialSettings = (unsigned int) mySortedSchemeNames.size(); diff -Nru sumo-0.21.0+dfsg/src/utils/gui/settings/GUICompleteSchemeStorage.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUICompleteSchemeStorage.h --- sumo-0.21.0+dfsg/src/utils/gui/settings/GUICompleteSchemeStorage.h 2014-02-22 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUICompleteSchemeStorage.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date :find(mySortedSchemeNames.begin(), mySortedSchemeNames.end(), name)==mySortedSchemeNames.end()) { -/// @version $Id: GUICompleteSchemeStorage.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUICompleteSchemeStorage.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Storage for available visualization settings /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/settings/GUIPropertyScheme.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUIPropertyScheme.h --- sumo-0.21.0+dfsg/src/utils/gui/settings/GUIPropertyScheme.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUIPropertyScheme.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,241 @@ +/****************************************************************************/ +/// @file GUIPropertyScheme.h +/// @author Michael Behrisch +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @date Mon, 20.07.2009 +/// @version $Id: GUIPropertyScheme.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 GUIPropertyScheme_h +#define GUIPropertyScheme_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GUIPropertyScheme + * This class provides a mapping from real values to properties (mainly colors). + * Each color is stored along with a threshold value. + * Color values between thresholds are obtained by interpolation + */ + +template +class GUIPropertyScheme { +public: + /// Constructor + GUIPropertyScheme(const std::string& name, const T& baseColor, + const std::string& colName = "", const bool isFixed = false, SUMOReal baseValue = 0) : + myName(name), myIsInterpolated(!isFixed), + myIsFixed(isFixed), + myAllowNegativeValues(false) { + addColor(baseColor, baseValue, colName); + } + + void setThreshold(const size_t pos, const SUMOReal threshold) { + myThresholds[pos] = threshold; + } + + void setColor(const size_t pos, const T& color) { + myColors[pos] = color; + } + + bool setColor(const std::string& name, const T& color) { + std::vector::iterator nameIt = myNames.begin(); + typename std::vector::iterator colIt = myColors.begin(); + for (; nameIt != myNames.end(); ++nameIt, ++colIt) { + if (*nameIt == name) { + (*colIt) = color; + return true; + } + } + return false; + } + + unsigned int addColor(const T& color, const SUMOReal threshold, const std::string& name = "") { + typename std::vector::iterator colIt = myColors.begin(); + std::vector::iterator threshIt = myThresholds.begin(); + std::vector::iterator nameIt = myNames.begin(); + unsigned int pos = 0; + while (threshIt != myThresholds.end() && (*threshIt) < threshold) { + ++threshIt; + ++colIt; + ++nameIt; + pos++; + } + myColors.insert(colIt, color); + myThresholds.insert(threshIt, threshold); + myNames.insert(nameIt, name); + return pos; + } + + void removeColor(const size_t pos) { + assert(pos < myColors.size()); + myColors.erase(myColors.begin() + pos); + myThresholds.erase(myThresholds.begin() + pos); + myNames.erase(myNames.begin() + pos); + } + + void clear() { + myColors.clear(); + myThresholds.clear(); + myNames.clear(); + } + + const T getColor(const SUMOReal value) const { + if (myColors.size() == 1 || value < myThresholds.front()) { + return myColors.front(); + } + typename std::vector::const_iterator colIt = myColors.begin() + 1; + std::vector::const_iterator threshIt = myThresholds.begin() + 1; + while (threshIt != myThresholds.end() && (*threshIt) <= value) { + ++threshIt; + ++colIt; + } + if (threshIt == myThresholds.end()) { + return myColors.back(); + } + if (!myIsInterpolated) { + return *(colIt - 1); + } + SUMOReal lowVal = *(threshIt - 1); + return interpolate(*(colIt - 1), *colIt, (value - lowVal) / ((*threshIt) - lowVal)); + } + + void setInterpolated(const bool interpolate, SUMOReal interpolationStart = 0.f) { + myIsInterpolated = interpolate; + if (interpolate) { + myThresholds[0] = interpolationStart; + } + } + + const std::string& getName() const { + return myName; + } + + const std::vector& getColors() const { + return myColors; + } + + const std::vector& getThresholds() const { + return myThresholds; + } + + bool isInterpolated() const { + return myIsInterpolated; + } + + const std::vector& getNames() const { + return myNames; + } + + bool isFixed() const { + return myIsFixed; + } + + bool allowsNegativeValues() const { + return myAllowNegativeValues; + } + + void setAllowsNegativeValues(bool value) { + myAllowNegativeValues = value; + } + + void save(OutputDevice& dev) const { + const std::string tag = getTagName(myColors); + + dev.openTag(tag); + dev.writeAttr(SUMO_ATTR_NAME, myName); + if (!myIsFixed) { + dev.writeAttr(SUMO_ATTR_INTERPOLATED, myIsInterpolated); + } + typename std::vector::const_iterator colIt = myColors.begin(); + std::vector::const_iterator threshIt = myThresholds.begin(); + std::vector::const_iterator nameIt = myNames.begin(); + while (threshIt != myThresholds.end()) { + dev.openTag(SUMO_TAG_ENTRY); + dev.writeAttr(SUMO_ATTR_COLOR, *colIt); + if (!myIsFixed) { + dev.writeAttr(SUMO_ATTR_THRESHOLD, *threshIt); + } + if ((*nameIt) != "") { + dev.writeAttr(SUMO_ATTR_NAME, *nameIt); + } + dev.closeTag(); + ++threshIt; + ++colIt; + ++nameIt; + } + dev.closeTag(); + } + + bool operator==(const GUIPropertyScheme& c) const { + return myName == c.myName && myColors == c.myColors && myThresholds == c.myThresholds && myIsInterpolated == c.myIsInterpolated; + } + + + /// @brief specializations for GUIColorScheme + RGBColor interpolate(const RGBColor& min, const RGBColor& max, SUMOReal weight) const { + return RGBColor::interpolate(min, max, weight); + } + + std::string getTagName(std::vector) const { + return toString(SUMO_TAG_COLORSCHEME); + } + + + /// @brief specializations for GUIScaleScheme + SUMOReal interpolate(const SUMOReal& min, const SUMOReal& max, SUMOReal weight) const { + return min + (max - min) * weight; + } + + std::string getTagName(std::vector) const { + return toString(SUMO_TAG_SCALINGSCHEME); + } + + +private: + std::string myName; + std::vector myColors; + std::vector myThresholds; + bool myIsInterpolated; + std::vector myNames; + bool myIsFixed; + bool myAllowNegativeValues; + +}; + +typedef GUIPropertyScheme GUIColorScheme; +typedef GUIPropertyScheme GUIScaleScheme; + +#endif + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/settings/GUIPropertySchemeStorage.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUIPropertySchemeStorage.h --- sumo-0.21.0+dfsg/src/utils/gui/settings/GUIPropertySchemeStorage.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUIPropertySchemeStorage.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,130 @@ +/****************************************************************************/ +/// @file GUIPropertySchemeStorage.h +/// @author Michael Behrisch +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Laura Bieker +/// @date Mon, 20.07.2009 +/// @version $Id: GUIPropertySchemeStorage.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 GUIPropertySchemeStorage_h +#define GUIPropertySchemeStorage_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include "GUIPropertyScheme.h" + + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GUIPropertySchemeStorage + * @brief Base class for coloring. Allows changing the used colors and sets + * the used color in dependence to a value + */ +template +class GUIPropertySchemeStorage { +public: + /// @brief Constructor + GUIPropertySchemeStorage() : myActiveScheme(0) { } + + /// @brief Destructor + virtual ~GUIPropertySchemeStorage() { } + + /// @brief Fills the given combobox with the names of available colorings + void fill(FXComboBox& cb) { + for (typename std::vector::iterator i = mySchemes.begin(); i != mySchemes.end(); ++i) { + cb.appendItem((*i).getName().c_str()); + } + cb.setCurrentItem((FXint)myActiveScheme); + } + + void setActive(size_t scheme) { + if (scheme < mySchemes.size()) { + myActiveScheme = scheme; + } + } + + size_t getActive() const { + return myActiveScheme; + } + + T& getScheme() { + return mySchemes[myActiveScheme]; + } + + const T& getScheme() const { + return mySchemes[myActiveScheme]; + } + + T* getSchemeByName(std::string name) { + for (typename std::vector::iterator i = mySchemes.begin(); i != mySchemes.end(); ++i) { + if ((*i).getName() == name) { + return &(*i); + } + } + return 0; + } + + void save(OutputDevice& dev) const { + for (typename std::vector::const_iterator i = mySchemes.begin(); i != mySchemes.end(); ++i) { + i->save(dev); + } + } + + bool operator==(const GUIPropertySchemeStorage& c) const { + return myActiveScheme == c.myActiveScheme && mySchemes == c.mySchemes; + } + + + void addScheme(T scheme) { + mySchemes.push_back(scheme); + } + + size_t size() const { + return mySchemes.size(); + } + + +protected: + size_t myActiveScheme; + std::vector mySchemes; + +}; + +typedef GUIPropertySchemeStorage GUIColorer; +typedef GUIPropertySchemeStorage GUIScaler; + +#endif + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/settings/GUISettingsHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUISettingsHandler.cpp --- sumo-0.21.0+dfsg/src/utils/gui/settings/GUISettingsHandler.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUISettingsHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Laura Bieker /// @date Fri, 24. Apr 2009 -/// @version $Id: GUISettingsHandler.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: GUISettingsHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // The dialog to change the view (gui) settings. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -129,6 +129,7 @@ break; case SUMO_TAG_VIEWSETTINGS_EDGES: { int laneEdgeMode = TplConvert::_2int(attrs.getStringSecure("laneEdgeMode", "0").c_str()); + int laneEdgeScaleMode = TplConvert::_2int(attrs.getStringSecure("scaleMode", "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()); @@ -137,15 +138,19 @@ mySettings.cwaEdgeName = parseTextSettings("cwaEdgeName", attrs, mySettings.cwaEdgeName); mySettings.streetName = parseTextSettings("streetName", attrs, mySettings.streetName); mySettings.hideConnectors = TplConvert::_2bool(attrs.getStringSecure("hideConnectors", toString(mySettings.hideConnectors)).c_str()); + mySettings.laneWidthExaggeration = TplConvert::_2SUMOReal(attrs.getStringSecure("widthExaggeration", toString(mySettings.laneWidthExaggeration)).c_str()); myCurrentColorer = element; #ifdef HAVE_INTERNAL mySettings.edgeColorer.setActive(laneEdgeMode); + mySettings.edgeScaler.setActive(laneEdgeScaleMode); #endif mySettings.laneColorer.setActive(laneEdgeMode); + mySettings.laneScaler.setActive(laneEdgeScaleMode); } break; case SUMO_TAG_COLORSCHEME: myCurrentScheme = 0; + myCurrentScaleScheme = 0; if (myCurrentColorer == SUMO_TAG_VIEWSETTINGS_EDGES) { myCurrentScheme = mySettings.laneColorer.getSchemeByName(attrs.getStringSecure(SUMO_ATTR_NAME, "")); #ifdef HAVE_INTERNAL @@ -157,6 +162,9 @@ if (myCurrentColorer == SUMO_TAG_VIEWSETTINGS_VEHICLES) { myCurrentScheme = mySettings.vehicleColorer.getSchemeByName(attrs.getStringSecure(SUMO_ATTR_NAME, "")); } + if (myCurrentColorer == SUMO_TAG_VIEWSETTINGS_PERSONS) { + myCurrentScheme = mySettings.personColorer.getSchemeByName(attrs.getStringSecure(SUMO_ATTR_NAME, "")); + } if (myCurrentColorer == SUMO_TAG_VIEWSETTINGS_JUNCTIONS) { myCurrentScheme = mySettings.junctionColorer.getSchemeByName(attrs.getStringSecure(SUMO_ATTR_NAME, "")); } @@ -166,8 +174,26 @@ myCurrentScheme->clear(); } break; + case SUMO_TAG_SCALINGSCHEME: + myCurrentScheme = 0; + myCurrentScaleScheme = 0; + if (myCurrentColorer == SUMO_TAG_VIEWSETTINGS_EDGES) { + myCurrentScaleScheme = mySettings.laneScaler.getSchemeByName(attrs.getStringSecure(SUMO_ATTR_NAME, "")); +#ifdef HAVE_INTERNAL + if (myCurrentScaleScheme == 0) { + myCurrentScaleScheme = mySettings.edgeScaler.getSchemeByName(attrs.getStringSecure(SUMO_ATTR_NAME, "")); + } +#endif + } + if (myCurrentScaleScheme && !myCurrentScaleScheme->isFixed()) { + bool ok = true; + myCurrentScaleScheme->setInterpolated(attrs.getOpt(SUMO_ATTR_INTERPOLATED, 0, ok, false)); + myCurrentScaleScheme->clear(); + } + break; + case SUMO_TAG_ENTRY: - if (myCurrentScheme) { + if (myCurrentScheme != 0) { bool ok = true; RGBColor color = attrs.get(SUMO_ATTR_COLOR, 0, ok); if (myCurrentScheme->isFixed()) { @@ -175,25 +201,38 @@ } else { myCurrentScheme->addColor(color, attrs.getOpt(SUMO_ATTR_THRESHOLD, 0, ok, 0)); } + } else if (myCurrentScaleScheme != 0) { + bool ok = true; + SUMOReal scale = attrs.get(SUMO_ATTR_COLOR, 0, ok); + if (myCurrentScaleScheme->isFixed()) { + myCurrentScaleScheme->setColor(attrs.getStringSecure(SUMO_ATTR_NAME, ""), scale); + } else { + myCurrentScaleScheme->addColor(scale, attrs.getOpt(SUMO_ATTR_THRESHOLD, 0, ok, 0)); + } } 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.vehicleSize = parseSizeSettings("vehicle", attrs, mySettings.vehicleSize); mySettings.vehicleName = parseTextSettings("vehicleName", attrs, mySettings.vehicleName); myCurrentColorer = element; break; case SUMO_TAG_VIEWSETTINGS_PERSONS: mySettings.personColorer.setActive(TplConvert::_2int(attrs.getStringSecure("personMode", "0").c_str())); mySettings.personQuality = TplConvert::_2int(attrs.getStringSecure("personQuality", toString(mySettings.personQuality)).c_str()); - mySettings.minPersonSize = TplConvert::_2SUMOReal(attrs.getStringSecure("minPersonSize", toString(mySettings.minPersonSize)).c_str()); - mySettings.personExaggeration = TplConvert::_2SUMOReal(attrs.getStringSecure("personExaggeration", toString(mySettings.personExaggeration)).c_str()); + mySettings.personSize = parseSizeSettings("person", attrs, mySettings.personSize); mySettings.personName = parseTextSettings("personName", attrs, mySettings.personName); myCurrentColorer = element; break; + case SUMO_TAG_VIEWSETTINGS_CONTAINERS: + mySettings.containerColorer.setActive(TplConvert::_2int(attrs.getStringSecure("containerMode", "0").c_str())); + mySettings.containerQuality = TplConvert::_2int(attrs.getStringSecure("containerQuality", toString(mySettings.containerQuality)).c_str()); + mySettings.containerSize = parseSizeSettings("container", attrs, mySettings.containerSize); + mySettings.containerName = parseTextSettings("containerName", attrs, mySettings.containerName); + myCurrentColorer = element; + break; case SUMO_TAG_VIEWSETTINGS_JUNCTIONS: mySettings.junctionColorer.setActive(TplConvert::_2int(attrs.getStringSecure("junctionMode", "0").c_str())); mySettings.drawLinkTLIndex = TplConvert::_2bool(attrs.getStringSecure("drawLinkTLIndex", toString(mySettings.drawLinkTLIndex)).c_str()); @@ -206,18 +245,15 @@ 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.addSize = parseSizeSettings("add", attrs, mySettings.addSize); 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.poiSize = parseSizeSettings("poi", attrs, mySettings.poiSize); mySettings.poiName = parseTextSettings("poiName", attrs, mySettings.poiName); break; case SUMO_TAG_VIEWSETTINGS_POLYS: - mySettings.polyExaggeration = TplConvert::_2SUMOReal(attrs.getStringSecure("polyExaggeration", toString(mySettings.polyExaggeration)).c_str()); - mySettings.minPolySize = TplConvert::_2SUMOReal(attrs.getStringSecure("minPolySize", toString(mySettings.minPolySize)).c_str()); + mySettings.polySize = parseSizeSettings("poly", attrs, mySettings.polySize); mySettings.polyName = parseTextSettings("polyName", attrs, mySettings.polyName); break; case SUMO_TAG_VIEWSETTINGS_LEGEND: @@ -288,6 +324,17 @@ } +GUIVisualizationSizeSettings +GUISettingsHandler::parseSizeSettings( + const std::string& prefix, const SUMOSAXAttributes& attrs, + GUIVisualizationSizeSettings defaults) { + return GUIVisualizationSizeSettings( + TplConvert::_2SUMOReal(attrs.getStringSecure(prefix + "_minSize", toString(defaults.minSize)).c_str()), + TplConvert::_2SUMOReal(attrs.getStringSecure(prefix + "_exaggeration", toString(defaults.exaggeration)).c_str()), + TplConvert::_2bool(attrs.getStringSecure(prefix + "_constantSize", toString(defaults.constantSize)).c_str())); +} + + std::string GUISettingsHandler::addSettings(GUISUMOAbstractView* view) const { if (mySettings.name != "") { diff -Nru sumo-0.21.0+dfsg/src/utils/gui/settings/GUISettingsHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUISettingsHandler.h --- sumo-0.21.0+dfsg/src/utils/gui/settings/GUISettingsHandler.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUISettingsHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Jakob Erdmann /// @date Fri, 24. Apr 2009 -/// @version $Id: GUISettingsHandler.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: GUISettingsHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // The handler for parsing gui settings from xml. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -173,6 +173,9 @@ /// @brief The current color scheme GUIColorScheme* myCurrentScheme; + /// @brief The current scaling scheme + GUIScaleScheme* myCurrentScaleScheme; + /// @brief The parsed breakpoints std::vector myBreakpoints; @@ -182,11 +185,16 @@ private: - /// @brief parse combined settings of bool, size and color + /// @brief parse attributes for textSettings GUIVisualizationTextSettings parseTextSettings( const std::string& prefix, const SUMOSAXAttributes& attrs, GUIVisualizationTextSettings defaults); + /// @brief parse attributes for sizeSettings + GUIVisualizationSizeSettings parseSizeSettings( + const std::string& prefix, const SUMOSAXAttributes& attrs, + GUIVisualizationSizeSettings defaults); + }; #endif diff -Nru sumo-0.21.0+dfsg/src/utils/gui/settings/GUIVisualizationSettings.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUIVisualizationSettings.cpp --- sumo-0.21.0+dfsg/src/utils/gui/settings/GUIVisualizationSettings.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUIVisualizationSettings.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIVisualizationSettings.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: GUIVisualizationSettings.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Stores the information about how to visualize structures /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -32,9 +32,8 @@ #include #include -#include #include "GUIVisualizationSettings.h" -#include "GUIColorScheme.h" +#include "GUIPropertyScheme.h" #ifdef CHECK_MEMORY_LEAKS #include @@ -60,29 +59,37 @@ cwaEdgeName(false, 50, RGBColor::MAGENTA), streetName(false, 55, RGBColor::YELLOW), hideConnectors(false), laneWidthExaggeration(1), - vehicleQuality(0), minVehicleSize(1), vehicleExaggeration(1), showBlinker(true), + vehicleQuality(0), showBlinker(true), drawLaneChangePreference(false), drawMinGap(false), + showBTRange(false), vehicleSize(1), vehicleName(false, 50, RGBColor(204, 153, 0, 255)), - personQuality(0), minPersonSize(1), personExaggeration(1), + personQuality(0), + personSize(1), personName(false, 50, RGBColor(0, 153, 204, 255)), + containerQuality(0), + containerSize(1), + containerName(false, 50, RGBColor(0, 153, 204, 255)), drawLinkTLIndex(false), drawLinkJunctionIndex(false), junctionName(false, 50, RGBColor(0, 255, 128, 255)), internalJunctionName(false, 50, RGBColor(0, 204, 128, 255)), - showLane2Lane(false), drawJunctionShape(true), addMode(0), minAddSize(1), addExaggeration(1), + showLane2Lane(false), drawJunctionShape(true), addMode(0), + addSize(1), addName(false, 50, RGBColor(255, 0, 128, 255)), - minPOISize(0), poiExaggeration(1), poiName(false, 50, RGBColor(255, 0, 128, 255)), - minPolySize(0), polyExaggeration(1), polyName(false, 50, RGBColor(255, 0, 128, 255)), + poiSize(0), poiName(false, 50, RGBColor(255, 0, 128, 255)), + polySize(0), polyName(false, 50, RGBColor(255, 0, 128, 255)), showSizeLegend(true), gaming(false), - selectionScale(1) { + selectionScale(1), + drawForSelecting(false) { /// add lane coloring schemes GUIColorScheme scheme = GUIColorScheme("uniform", RGBColor::BLACK, "road", true); scheme.addColor(RGBColor::GREY, 1, "sidewalk"); scheme.addColor(RGBColor(192, 66, 44), 2, "bike lane"); scheme.addColor(RGBColor(0, 0, 0, 0), 3, "green verge"); + scheme.addColor(RGBColor(150, 200, 200), 4, "waterway"); laneColorer.addScheme(scheme); - scheme = GUIColorScheme("by selection (lane-/streetwise)", RGBColor(179, 179, 179, 255), "unselected", true); - scheme.addColor(RGBColor(0, 102, 204, 255), 1, "selected"); + scheme = GUIColorScheme("by selection (lane-/streetwise)", RGBColor(128, 128, 128, 255), "unselected", true); + scheme.addColor(RGBColor(0, 80, 180, 255), 1, "selected"); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by permission code", RGBColor(240, 240, 240), "nobody"); scheme.addColor(RGBColor(10, 10, 10), (SUMOReal)SVC_PASSENGER, "passenger"); @@ -93,11 +100,16 @@ scheme.addColor(RGBColor(166, 147, 26), (SUMOReal)SVC_TAXI, "taxi"); scheme.addColor(RGBColor::BLACK, (SUMOReal)(SVCAll & ~SVC_PEDESTRIAN), "disallow_pedestrian"); scheme.addColor(RGBColor(64, 0, 86), (SUMOReal)(SVCAll & ~(SVC_PEDESTRIAN | SVC_BICYCLE | SVC_MOPED)), "disallow_apedestrian_bicycle"); + scheme.addColor(RGBColor(150, 200, 200), (SUMOReal)SVC_SHIP, "waterway"); scheme.addColor(RGBColor::GREEN, (SUMOReal)SVCAll, "all"); laneColorer.addScheme(scheme); // ... traffic states ... scheme = GUIColorScheme("by allowed speed (lanewise)", RGBColor::RED); - scheme.addColor(RGBColor::BLUE, (SUMOReal)(150.0 / 3.6)); + scheme.addColor(RGBColor::YELLOW, (SUMOReal)(30 / 3.6)); + scheme.addColor(RGBColor::GREEN, (SUMOReal)(55 / 3.6)); + scheme.addColor(RGBColor::CYAN, (SUMOReal)(80 / 3.6)); + scheme.addColor(RGBColor::BLUE, (SUMOReal)(120 / 3.6)); + scheme.addColor(RGBColor::MAGENTA, (SUMOReal)(150 / 3.6)); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by current occupancy (lanewise, brutto)", RGBColor::BLUE); scheme.addColor(RGBColor::RED, (SUMOReal)0.95); @@ -154,6 +166,57 @@ scheme.addColor(RGBColor::BLUE, (SUMOReal)4.0); laneColorer.addScheme(scheme); laneColorer.addScheme(GUIColorScheme("by angle", RGBColor::YELLOW, "", true)); + scheme = GUIColorScheme("by loaded weight", RGBColor::GREEN); + scheme.addColor(RGBColor::RED, (SUMOReal)100); + scheme.setAllowsNegativeValues(true); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by priority", RGBColor::YELLOW); + scheme.addColor(RGBColor::RED, (SUMOReal) - 20); + scheme.addColor(RGBColor::GREEN, (SUMOReal)20); + scheme.setAllowsNegativeValues(true); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by height at start", RGBColor::RED); + scheme.addColor(RGBColor::BLUE, (SUMOReal) - 10); + scheme.addColor(RGBColor::YELLOW, (SUMOReal)50); + scheme.addColor(RGBColor::GREEN, (SUMOReal)100); + scheme.addColor(RGBColor::MAGENTA, (SUMOReal)200); + scheme.setAllowsNegativeValues(true); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by height at segment start", RGBColor::RED); + scheme.addColor(RGBColor::BLUE, (SUMOReal) - 10); + scheme.addColor(RGBColor::YELLOW, (SUMOReal)50); + scheme.addColor(RGBColor::GREEN, (SUMOReal)100); + scheme.addColor(RGBColor::MAGENTA, (SUMOReal)200); + scheme.setAllowsNegativeValues(true); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by inclination", RGBColor::GREY); + scheme.addColor(RGBColor::YELLOW, (SUMOReal) .1); + scheme.addColor(RGBColor::RED, (SUMOReal) .3); + scheme.addColor(RGBColor::GREEN, (SUMOReal) - .1); + scheme.addColor(RGBColor::BLUE, (SUMOReal) - .3); + scheme.setAllowsNegativeValues(true); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by inclination at segment start", RGBColor::GREY); + scheme.addColor(RGBColor::YELLOW, (SUMOReal) .1); + scheme.addColor(RGBColor::RED, (SUMOReal) .3); + scheme.addColor(RGBColor::GREEN, (SUMOReal) - .1); + scheme.addColor(RGBColor::BLUE, (SUMOReal) - .3); + scheme.setAllowsNegativeValues(true); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by average speed", RGBColor::RED); + scheme.addColor(RGBColor::YELLOW, (SUMOReal)(30 / 3.6)); + scheme.addColor(RGBColor::GREEN, (SUMOReal)(55 / 3.6)); + scheme.addColor(RGBColor::CYAN, (SUMOReal)(80 / 3.6)); + scheme.addColor(RGBColor::BLUE, (SUMOReal)(120 / 3.6)); + scheme.addColor(RGBColor::MAGENTA, (SUMOReal)(150 / 3.6)); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by average relative speed ", RGBColor::RED); + scheme.addColor(RGBColor::YELLOW, (SUMOReal)(0.25)); + scheme.addColor(RGBColor::GREEN, (SUMOReal)(0.5)); + scheme.addColor(RGBColor::CYAN, (SUMOReal)(0.75)); + scheme.addColor(RGBColor::BLUE, (SUMOReal)(1)); + scheme.addColor(RGBColor::MAGENTA, (SUMOReal)(1.25)); + laneColorer.addScheme(scheme); /// add vehicle coloring schemes @@ -178,8 +241,14 @@ scheme.addColor(RGBColor::YELLOW, (SUMOReal)200); scheme.addColor(RGBColor::RED, (SUMOReal)300); vehicleColorer.addScheme(scheme); - scheme = GUIColorScheme("by time since last lanechange", RGBColor::WHITE); - scheme.addColor(RGBColor::GREY, (SUMOReal)(5 * 60)); + scheme = GUIColorScheme("by time since lane change", RGBColor(179, 179, 179, 255), "0"); + scheme.addColor(RGBColor(189, 189, 179, 255), -180); + scheme.addColor(RGBColor(255, 255, 0, 255), -20); + scheme.addColor(RGBColor(255, 0, 0, 255), -1); + scheme.addColor(RGBColor(0, 0, 255, 255), 1); + scheme.addColor(RGBColor(0, 255, 255, 255), 20); + scheme.addColor(RGBColor(179, 189, 189, 255), 180); + scheme.setAllowsNegativeValues(true); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by max speed", RGBColor::RED); scheme.addColor(RGBColor::YELLOW, (SUMOReal)(30 / 3.6)); @@ -222,18 +291,22 @@ scheme.addColor(RGBColor(255, 255, 0, 255), -1, "-1"); scheme.addColor(RGBColor(0, 255, 255, 255), 1, "1"); scheme.addColor(RGBColor(0, 0, 255, 255), 3, "3"); + scheme.setAllowsNegativeValues(true); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by acceleration", RGBColor(179, 179, 179, 255), "0"); - scheme.addColor(RGBColor(255, 0, 0, 255), -SUMOVTypeParameter::getDefaultDecel()); + scheme.addColor(RGBColor(255, 0, 0, 255), -4.5 /* -SUMOVTypeParameter::getDefaultDecel() */); scheme.addColor(RGBColor(255, 255, 0, 255), -0.1); scheme.addColor(RGBColor(0, 255, 255, 255), 0.1); - scheme.addColor(RGBColor(0, 0, 255, 255), SUMOVTypeParameter::getDefaultAccel()); + scheme.addColor(RGBColor(0, 0, 255, 255), 2.6 /* SUMOVTypeParameter::getDefaultAccel() */); + scheme.setAllowsNegativeValues(true); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by time gap", RGBColor(255, 255, 0, 255), "0"); scheme.addColor(RGBColor(179, 179, 179, 255), -1); scheme.addColor(RGBColor(0, 255, 255, 255), 1); scheme.addColor(RGBColor(0, 0, 255, 255), 2); + scheme.setAllowsNegativeValues(true); vehicleColorer.addScheme(scheme); + vehicleColorer.addScheme(GUIColorScheme("random", RGBColor::YELLOW, "", true)); /// add person coloring schemes personColorer.addScheme(GUIColorScheme("given person/type color", RGBColor::YELLOW, "", true)); @@ -260,20 +333,148 @@ scheme.addColor(RGBColor(0, 102, 204, 255), 1, "selected"); personColorer.addScheme(scheme); personColorer.addScheme(GUIColorScheme("by angle", RGBColor::YELLOW, "", true)); + personColorer.addScheme(GUIColorScheme("random", RGBColor::YELLOW, "", true)); + + /// add container coloring schemes + containerColorer.addScheme(GUIColorScheme("given container/type color", RGBColor::YELLOW, "", true)); + containerColorer.addScheme(GUIColorScheme("uniform", RGBColor::YELLOW, "", true)); + containerColorer.addScheme(GUIColorScheme("given/assigned container color", RGBColor::YELLOW, "", true)); + containerColorer.addScheme(GUIColorScheme("given/assigned type color", RGBColor::YELLOW, "", true)); + scheme = GUIColorScheme("by speed", RGBColor::RED); + scheme.addColor(RGBColor::YELLOW, (SUMOReal)(2.5 / 3.6)); + scheme.addColor(RGBColor::GREEN, (SUMOReal)(5 / 3.6)); + scheme.addColor(RGBColor::BLUE, (SUMOReal)(10 / 3.6)); + containerColorer.addScheme(scheme); + scheme = GUIColorScheme("by mode", RGBColor::YELLOW); // walking + scheme.addColor(RGBColor::BLUE, (SUMOReal)(1)); // riding + scheme.addColor(RGBColor::RED, (SUMOReal)(2)); // stopped + scheme.addColor(RGBColor::GREEN, (SUMOReal)(3)); // waiting for ride + containerColorer.addScheme(scheme); + scheme = GUIColorScheme("by waiting time", RGBColor::BLUE); + scheme.addColor(RGBColor::CYAN, (SUMOReal)30); + scheme.addColor(RGBColor::GREEN, (SUMOReal)100); + scheme.addColor(RGBColor::YELLOW, (SUMOReal)200); + scheme.addColor(RGBColor::RED, (SUMOReal)300); + containerColorer.addScheme(scheme); + scheme = GUIColorScheme("by selection", RGBColor(179, 179, 179, 255), "unselected", true); + scheme.addColor(RGBColor(0, 102, 204, 255), 1, "selected"); + containerColorer.addScheme(scheme); + containerColorer.addScheme(GUIColorScheme("by angle", RGBColor::YELLOW, "", true)); + + /// add junction coloring schemes + scheme = GUIColorScheme("uniform", RGBColor::BLACK, "", true); + scheme.addColor(RGBColor(150, 200, 200), 1, "waterway"); + junctionColorer.addScheme(scheme); + scheme = GUIColorScheme("by selection", RGBColor(128, 128, 128, 255), "unselected", true); + scheme.addColor(RGBColor(0, 80, 180, 255), 1, "selected"); + junctionColorer.addScheme(scheme); + scheme = GUIColorScheme("by type", RGBColor::GREEN, "traffic_light", true); + scheme.addColor(RGBColor(0, 128, 0), 1, "traffic_light_unregulated"); + scheme.addColor(RGBColor::YELLOW, 2, "priority"); + scheme.addColor(RGBColor::RED, 3, "priority_stop"); + scheme.addColor(RGBColor::BLUE, 4, "right_before_left"); + scheme.addColor(RGBColor::CYAN, 5, "allway_stop"); + scheme.addColor(RGBColor::GREY, 6, "district"); + scheme.addColor(RGBColor::MAGENTA, 7, "unregulated"); + scheme.addColor(RGBColor::BLACK, 8, "dead_end"); + scheme.addColor(RGBColor::ORANGE, 9, "rail_signal"); + junctionColorer.addScheme(scheme); + + + /// add lane scaling schemes + { + GUIScaleScheme scheme = GUIScaleScheme("default", 1, "uniform", true); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by selection (lane-/streetwise)", 0.5, "unselected", true); + scheme.addColor(5, 1, "selected"); + laneScaler.addScheme(scheme); + // ... traffic states ... + scheme = GUIScaleScheme("by allowed speed (lanewise)", 0); + scheme.addColor(10, (SUMOReal)(150.0 / 3.6)); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by current occupancy (lanewise, brutto)", 0); + scheme.addColor(10, (SUMOReal)0.95); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by current occupancy (lanewise, netto)", 0); + scheme.addColor(10, (SUMOReal)0.95); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by first vehicle waiting time (lanewise)", 0); + scheme.addColor(10, (SUMOReal)300); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by lane number (streetwise)", 1); + scheme.addColor(10, (SUMOReal)5); + laneScaler.addScheme(scheme); + // ... emissions ... + scheme = GUIScaleScheme("by CO2 emissions", 0); + scheme.addColor(10, (SUMOReal)(10. / 7.5 / 5.)); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by CO emissions", 0); + scheme.addColor(10, (SUMOReal)(0.05 / 7.5 / 2.)); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by PMx emissions", 0); + scheme.addColor(10, (SUMOReal)(.005 / 7.5 / 5.)); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by NOx emissions", 0); + scheme.addColor(10, (SUMOReal)(.125 / 7.5 / 5.)); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by HC emissions", 0); + scheme.addColor(10, (SUMOReal)(.02 / 7.5 / 4.)); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by fuel consumption", 0); + scheme.addColor(10, (SUMOReal)(.005 / 7.5 * 100.)); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by noise emissions (Harmonoise)", 0); + scheme.addColor(10, (SUMOReal)100); + laneScaler.addScheme(scheme); + // ... weights (experimental) ... + scheme = GUIScaleScheme("by global travel time", 0); + scheme.addColor(10, (SUMOReal)100); + scheme.setAllowsNegativeValues(true); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by global speed percentage", 0); + scheme.addColor(10, (SUMOReal)100); + scheme.setAllowsNegativeValues(true); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by given length/geometrical length", 0); + scheme.addColor(10, (SUMOReal)10.0); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by loaded weight", 0); + scheme.addColor(-1000, (SUMOReal) - 1000); + scheme.addColor(1000, (SUMOReal)1000); + scheme.setAllowsNegativeValues(true); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by priority", 1); + scheme.addColor(0.5, (SUMOReal) - 20); + scheme.addColor(5, (SUMOReal)20); + scheme.setAllowsNegativeValues(true); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by average speed", 0); + scheme.addColor(10, (SUMOReal)(150.0 / 3.6)); + laneScaler.addScheme(scheme); + scheme = GUIScaleScheme("by average relative speed", 0); + scheme.addColor(0.5, (SUMOReal)(0.5)); + scheme.addColor(2, (SUMOReal)(1)); + scheme.addColor(10, (SUMOReal)(2)); + laneScaler.addScheme(scheme); + } #ifdef HAVE_INTERNAL /// add edge coloring schemes edgeColorer.addScheme(GUIColorScheme("uniform (streetwise)", RGBColor::BLACK, "", true)); - scheme = GUIColorScheme("by selection (streetwise)", RGBColor(179, 179, 179, 255), "unselected", true); - scheme.addColor(RGBColor(0, 102, 204, 255), 1, "selected"); + scheme = GUIColorScheme("by selection (streetwise)", RGBColor(128, 128, 128, 255), "unselected", true); + scheme.addColor(RGBColor(0, 80, 180, 255), 1, "selected"); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by purpose (streetwise)", RGBColor(), "normal", true); scheme.addColor(RGBColor(128, 0, 128, 255), 1, "connector"); // see MSEdge::EdgeBasicFunction::EDGEFUNCTION_CONNECTOR scheme.addColor(RGBColor::BLUE, 2, "internal"); // see MSEdge::EdgeBasicFunction::EDGEFUNCTION_INTERNAL edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by allowed speed (streetwise)", RGBColor::RED); - scheme.addColor(RGBColor::BLUE, (SUMOReal)(150.0 / 3.6)); + scheme.addColor(RGBColor::YELLOW, (SUMOReal)(30 / 3.6)); + scheme.addColor(RGBColor::GREEN, (SUMOReal)(55 / 3.6)); + scheme.addColor(RGBColor::CYAN, (SUMOReal)(80 / 3.6)); + scheme.addColor(RGBColor::BLUE, (SUMOReal)(120 / 3.6)); + scheme.addColor(RGBColor::MAGENTA, (SUMOReal)(150 / 3.6)); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by current occupancy (streetwise)", RGBColor::BLUE); scheme.addColor(RGBColor::RED, (SUMOReal)0.95); @@ -287,12 +488,31 @@ scheme = GUIColorScheme("by relative speed (streetwise)", RGBColor::RED); scheme.addColor(RGBColor::BLUE, (SUMOReal)1); edgeColorer.addScheme(scheme); + + /// add edge scaling schemes + { + edgeScaler.addScheme(GUIScaleScheme("uniform", 1, "", true)); + GUIScaleScheme scheme = GUIScaleScheme("by selection (streetwise)", 0.5, "unselected", true); + scheme.addColor(5, 1, "selected"); + edgeScaler.addScheme(scheme); + scheme = GUIScaleScheme("by allowed speed (streetwise)", 0); + scheme.addColor(10, (SUMOReal)(150.0 / 3.6)); + edgeScaler.addScheme(scheme); + scheme = GUIScaleScheme("by current occupancy (streetwise)", 0); + scheme.addColor(10, (SUMOReal)0.95); + edgeScaler.addScheme(scheme); + scheme = GUIScaleScheme("by current speed (streetwise)", 0); + scheme.addColor(10, (SUMOReal)(150.0 / 3.6)); + edgeScaler.addScheme(scheme); + scheme = GUIScaleScheme("by current flow (streetwise)", 0); + scheme.addColor(20, (SUMOReal)5000); + edgeScaler.addScheme(scheme); + scheme = GUIScaleScheme("by relative speed (streetwise)", 0); + scheme.addColor(20, (SUMOReal)1); + edgeScaler.addScheme(scheme); + } #endif - junctionColorer.addScheme(GUIColorScheme("uniform", RGBColor::BLACK, "", true)); - scheme = GUIColorScheme("by selection", RGBColor(179, 179, 179, 255), "unselected", true); - scheme.addColor(RGBColor(0, 102, 204, 255), 1, "selected"); - junctionColorer.addScheme(scheme); } @@ -307,6 +527,17 @@ } +size_t +GUIVisualizationSettings::getLaneEdgeScaleMode() const { +#ifdef HAVE_INTERNAL + if (UseMesoSim) { + return edgeScaler.getActive(); + } +#endif + return laneScaler.getActive(); +} + + GUIColorScheme& GUIVisualizationSettings::getLaneEdgeScheme() { #ifdef HAVE_INTERNAL @@ -318,76 +549,128 @@ } +GUIScaleScheme& +GUIVisualizationSettings::getLaneEdgeScaleScheme() { +#ifdef HAVE_INTERNAL + if (UseMesoSim) { + return edgeScaler.getScheme(); + } +#endif + return laneScaler.getScheme(); +} + void GUIVisualizationSettings::save(OutputDevice& dev) const { - dev << "\n"; - dev << " \n"; - dev << " \n"; - dev << " \n"; - dev << " \n"; + dev.openTag(SUMO_TAG_VIEWSETTINGS_SCHEME); + dev.writeAttr(SUMO_ATTR_NAME, name); + dev.openTag(SUMO_TAG_VIEWSETTINGS_OPENGL); + dev.writeAttr("antialiase", antialiase); + dev.writeAttr("dither", dither); + dev.closeTag(); + dev.openTag(SUMO_TAG_VIEWSETTINGS_BACKGROUND); + dev.writeAttr("backgroundColor", backgroundColor); + dev.writeAttr("showGrid", showGrid); + dev.writeAttr("gridXSize", gridXSize); + dev.writeAttr("gridYSize", gridYSize); + dev.closeTag(); + // edges + dev.openTag(SUMO_TAG_VIEWSETTINGS_EDGES); + dev.writeAttr("laneEdgeMode", getLaneEdgeMode()); + dev.writeAttr("scaleMode", getLaneEdgeScaleMode()); + dev.writeAttr("laneShowBorders", laneShowBorders); + dev.writeAttr("showLinkDecals", showLinkDecals); + dev.writeAttr("showRails", showRails); + dev.writeAttr("hideConnectors", hideConnectors); + dev.writeAttr("widthExaggeration", laneWidthExaggeration); + dev.lf(); + dev << " "; + edgeName.print(dev, "edgeName"); + dev.lf(); + dev << " "; + internalEdgeName.print(dev, "internalEdgeName"); + dev.lf(); + dev << " "; + cwaEdgeName.print(dev, "cwaEdgeName"); + dev.lf(); + dev << " "; + streetName.print(dev, "streetName"); laneColorer.save(dev); + laneScaler.save(dev); #ifdef HAVE_INTERNAL edgeColorer.save(dev); + edgeScaler.save(dev); #endif - dev << " \n"; - - dev << " \n"; + dev.closeTag(); + // vehicles + dev.openTag(SUMO_TAG_VIEWSETTINGS_VEHICLES); + dev.writeAttr("vehicleMode", vehicleColorer.getActive()); + dev.writeAttr("vehicleQuality", vehicleQuality); + vehicleSize.print(dev, "vehicle"); + dev.writeAttr("showBlinker", showBlinker); + dev.lf(); + dev << " "; + vehicleName.print(dev, "vehicleName"); vehicleColorer.save(dev); - dev << " \n"; - dev << " \n"; + dev.closeTag(); + // persons + dev.openTag(SUMO_TAG_VIEWSETTINGS_PERSONS); + dev.writeAttr("personMode", personColorer.getActive()); + dev.writeAttr("personQuality", personQuality); + personSize.print(dev, "person"); + dev.lf(); + dev << " "; + personName.print(dev, "personName"); personColorer.save(dev); - dev << " \n"; - - dev << " \n"; + dev.closeTag(); + // persons + dev.openTag(SUMO_TAG_VIEWSETTINGS_CONTAINERS); + dev.writeAttr("containerMode", containerColorer.getActive()); + dev.writeAttr("containerQuality", containerQuality); + personSize.print(dev, "container"); + dev.lf(); + dev << " "; + personName.print(dev, "containerName"); + personColorer.save(dev); + dev.closeTag(); + // junctions + dev.openTag(SUMO_TAG_VIEWSETTINGS_JUNCTIONS); + dev.writeAttr("junctionMode", junctionColorer.getActive()); + dev.writeAttr("drawLinkTLIndex", drawLinkTLIndex); + dev.writeAttr("drawLinkJunctionIndex", drawLinkJunctionIndex); + dev.lf(); + dev << " "; + junctionName.print(dev, "junctionName"); + dev.lf(); + dev << " "; + internalJunctionName.print(dev, "internalJunctionName"); + dev.lf(); + dev << " "; + dev.writeAttr("showLane2Lane", showLane2Lane); + dev.writeAttr("drawShape", drawJunctionShape); junctionColorer.save(dev); - dev << " \n"; + dev.closeTag(); + // additionals + dev.openTag(SUMO_TAG_VIEWSETTINGS_ADDITIONALS); + dev.writeAttr("addMode", addMode); + addSize.print(dev, "add"); + addName.print(dev, "addName"); + dev.closeTag(); + // pois + dev.openTag(SUMO_TAG_VIEWSETTINGS_POIS); + poiSize.print(dev, "poi"); + poiName.print(dev, "poiName"); + dev.closeTag(); + // polys + dev.openTag(SUMO_TAG_VIEWSETTINGS_POLYS); + polySize.print(dev, "poly"); + polyName.print(dev, "polyName"); + dev.closeTag(); + // legend + dev.openTag(SUMO_TAG_VIEWSETTINGS_LEGEND); + dev.writeAttr("showSizeLegend", showSizeLegend); + dev.closeTag(); - dev << " \n"; - - dev << " \n"; - - dev << " \n"; - - dev << " \n"; - dev << " \n"; - dev << "\n"; + dev.closeTag(); } @@ -416,10 +699,16 @@ if (!(edgeColorer == v2.edgeColorer)) { return false; } + if (!(edgeScaler == v2.edgeScaler)) { + return false; + } #endif if (!(laneColorer == v2.laneColorer)) { return false; } + if (!(laneScaler == v2.laneScaler)) { + return false; + } if (laneShowBorders != v2.laneShowBorders) { return false; } @@ -453,10 +742,7 @@ if (vehicleQuality != v2.vehicleQuality) { return false; } - if (minVehicleSize != v2.minVehicleSize) { - return false; - } - if (vehicleExaggeration != v2.vehicleExaggeration) { + if (vehicleSize != v2.vehicleSize) { return false; } if (showBlinker != v2.showBlinker) { @@ -468,6 +754,9 @@ if (drawMinGap != v2.drawMinGap) { return false; } + if (showBTRange != v2.showBTRange) { + return false; + } if (vehicleName != v2.vehicleName) { return false; } @@ -477,13 +766,22 @@ if (personQuality != v2.personQuality) { return false; } - if (minPersonSize != v2.minPersonSize) { + if (personSize != v2.personSize) { return false; } - if (personExaggeration != v2.personExaggeration) { + if (personName != v2.personName) { return false; } - if (personName != v2.personName) { + if (!(containerColorer == v2.containerColorer)) { + return false; + } + if (containerQuality != v2.containerQuality) { + return false; + } + if (containerSize != v2.containerSize) { + return false; + } + if (containerName != v2.containerName) { return false; } if (!(junctionColorer == v2.junctionColorer)) { @@ -513,30 +811,19 @@ if (addMode != v2.addMode) { return false; } - if (minAddSize != v2.minAddSize) { - return false; - } - if (addExaggeration != v2.addExaggeration) { + if (addSize != v2.addSize) { return false; } if (addName != v2.addName) { return false; } - - if (minPOISize != v2.minPOISize) { - return false; - } - if (poiExaggeration != v2.poiExaggeration) { + if (poiSize != v2.poiSize) { return false; } if (poiName != v2.poiName) { return false; } - - if (minPolySize != v2.minPolySize) { - return false; - } - if (polyExaggeration != v2.polyExaggeration) { + if (polySize != v2.polySize) { return false; } if (polyName != v2.polyName) { @@ -551,6 +838,12 @@ } +SUMOReal +GUIVisualizationSizeSettings::getExaggeration(const GUIVisualizationSettings& s) const { + /// @note should look normal-sized at zoom 1000 + return (constantSize && !s.drawForSelecting) ? MAX2((SUMOReal)exaggeration, exaggeration * 20 / s.scale) : exaggeration; +} /****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/gui/settings/GUIVisualizationSettings.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUIVisualizationSettings.h --- sumo-0.21.0+dfsg/src/utils/gui/settings/GUIVisualizationSettings.h 2014-05-05 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/GUIVisualizationSettings.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIVisualizationSettings.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: GUIVisualizationSettings.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Stores the information about how to visualize structures /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -37,7 +37,7 @@ #include #include #include -#include "GUIColorer.h" +#include "GUIPropertySchemeStorage.h" // =========================================================================== @@ -45,6 +45,7 @@ // =========================================================================== class BaseSchemeInfoSource; class OutputDevice; +class GUIVisualizationSettings; // =========================================================================== @@ -70,13 +71,45 @@ return !((*this) == other); } - std::string print(const std::string& name) const { - return name + "_show=\"" + toString(show) + "\" " + - name + "_size=\"" + toString(size) + "\" " + - name + "_color=\"" + toString(color) + "\" "; + void print(OutputDevice& dev, const std::string& name) const { + dev.writeAttr(name + "_show", show); + dev.writeAttr(name + "_size", size); + dev.writeAttr(name + "_color", color); } }; + +struct GUIVisualizationSizeSettings { + GUIVisualizationSizeSettings(float _minSize, float _exaggeration = 1.0, bool _constantSize = false) : + minSize(_minSize), exaggeration(_exaggeration), constantSize(_constantSize) {} + + /// @brief The minimum size to draw this object + float minSize; + /// @brief The size exaggeration (upscale) + float exaggeration; + // @brief whether the object shall be drawn with constant size regardless of zoom + bool constantSize; + + bool operator==(const GUIVisualizationSizeSettings& other) { + return constantSize == other.constantSize && + minSize == other.minSize && + exaggeration == other.exaggeration; + } + bool operator!=(const GUIVisualizationSizeSettings& other) { + return !((*this) == other); + } + + void print(OutputDevice& dev, const std::string& name) const { + dev.writeAttr(name + "_minSize", minSize); + dev.writeAttr(name + "_exaggeration", exaggeration); + dev.writeAttr(name + "_constantSize", constantSize); + } + + /// @brief return the drawing size including exaggeration and constantSize values + SUMOReal getExaggeration(const GUIVisualizationSettings& s) const; +}; + + /** * @class GUIVisualizationSettings * @brief Stores the information about how to visualize structures @@ -113,12 +146,16 @@ #ifdef HAVE_INTERNAL /// @brief The mesoscopic edge colorer GUIColorer edgeColorer; + /// @brief The mesoscopic edge scaler + GUIScaler edgeScaler; /// @brief this should be set at the same time as MSGlobals::gUseMesoSim static bool UseMesoSim; #endif /// @brief The lane colorer GUIColorer laneColorer; + /// @brief The lane scaler + GUIScaler laneScaler; /// @brief Information whether lane borders shall be drawn bool laneShowBorders; /// @brief Information whether link textures (arrows) shall be drawn @@ -141,16 +178,16 @@ GUIColorer vehicleColorer; /// @brief The quality of vehicle drawing int vehicleQuality; - /// @brief The minimum size of vehicles to let them be drawn - float minVehicleSize; - /// @brief The vehicle exaggeration (upscale) - float vehicleExaggeration; /// @brief Information whether vehicle blinkers shall be drawn bool showBlinker; /// @brief Information whether the lane change preference shall be drawn bool drawLaneChangePreference; /// @brief Information whether the minimum gap shall be drawn bool drawMinGap; + /// @brief Information whether the communication range shall be drawn + bool showBTRange; + // Setting bundles for controling the size of the drawn vehicles + GUIVisualizationSizeSettings vehicleSize; // Setting bundles for optional drawing vehicle names GUIVisualizationTextSettings vehicleName; //@} @@ -163,15 +200,27 @@ GUIColorer personColorer; /// @brief The quality of person drawing int personQuality; - /// @brief The minimum size of persons to let them be drawn - float minPersonSize; - /// @brief The person exaggeration (upscale) - float personExaggeration; + // Setting bundles for controling the size of the drawn persons + GUIVisualizationSizeSettings personSize; // Setting bundles for optional drawing person names GUIVisualizationTextSettings personName; //@} + /// @name container visualization settings + //@{ + + /// @brief The container colorer + GUIColorer containerColorer; + /// @brief The quality of container drawing + int containerQuality; + // Setting bundles for controling the size of the drawn containers + GUIVisualizationSizeSettings containerSize; + // Setting bundles for optional drawing person names + GUIVisualizationTextSettings containerName; + //@} + + /// @name junction visualization settings //@{ @@ -196,10 +245,8 @@ /// @brief The additional structures visualization scheme // @todo decouple addExageration for POIs, Polygons, Triggers etc int addMode; - /// @brief The minimum size of additional structures to let them be drawn - float minAddSize; - /// @brief The additional structures exaggeration (upscale) - float addExaggeration; + // Setting bundles for controling the size of additional items + GUIVisualizationSizeSettings addSize; // Setting bundles for optional drawing additional names GUIVisualizationTextSettings addName; //@} @@ -208,18 +255,14 @@ /// @name shapes visualization settings //@{ - /// @brief The minimum size of shapes to let them be drawn - float minPOISize; - /// @brief The additional shapes (upscale) - float poiExaggeration; + // Setting bundles for controling the size of the drawn POIs + GUIVisualizationSizeSettings poiSize; // Setting bundles for optional drawing poi names GUIVisualizationTextSettings poiName; - /// @brief The minimum size of shapes to let them be drawn - float minPolySize; - /// @brief The additional shapes (upscale) - float polyExaggeration; - // Setting bundles for optional drawing poi names + // Setting bundles for controling the size of the drawn polygons + GUIVisualizationSizeSettings polySize; + // Setting bundles for optional drawing polygon names GUIVisualizationTextSettings polyName; //@} @@ -238,6 +281,9 @@ /// @brief the current selection scaling in NETEDIT (temporary) SUMOReal selectionScale; + /// @brief whether drawing is performed for the purpose of selecting objects + bool drawForSelecting; + /** @brief Writes the settings into an output device * @param[in] dev The device to write the settings into */ @@ -248,12 +294,22 @@ */ size_t getLaneEdgeMode() const; + /** @brief Returns the number of the active lane (edge) scaling schme + * @return number of the active scheme + */ + size_t getLaneEdgeScaleMode() const; + /** @brief Returns the current lane (edge) coloring schme * @return current scheme */ GUIColorScheme& getLaneEdgeScheme(); - /** @brief Assignment operator */ + /** @brief Returns the current lane (edge) scaling schme + * @return current scheme + */ + GUIScaleScheme& getLaneEdgeScaleScheme(); + + /** @brief Comparison operator */ bool operator==(const GUIVisualizationSettings& vs2); }; diff -Nru sumo-0.21.0+dfsg/src/utils/gui/settings/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/Makefile.am --- sumo-0.21.0+dfsg/src/utils/gui/settings/Makefile.am 2013-05-03 20:25:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -1,6 +1,6 @@ noinst_LIBRARIES = libguiutilssettings.a -libguiutilssettings_a_SOURCES = GUIColorer.h GUIColorScheme.h \ -GUICompleteSchemeStorage.cpp GUICompleteSchemeStorage.h \ +libguiutilssettings_a_SOURCES = GUICompleteSchemeStorage.cpp GUICompleteSchemeStorage.h \ +GUIPropertyScheme.h GUIPropertySchemeStorage.h \ GUISettingsHandler.cpp GUISettingsHandler.h \ GUIVisualizationSettings.cpp GUIVisualizationSettings.h diff -Nru sumo-0.21.0+dfsg/src/utils/gui/settings/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/Makefile.in --- sumo-0.21.0+dfsg/src/utils/gui/settings/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/settings/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -222,6 +222,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -232,7 +234,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -327,8 +328,8 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libguiutilssettings.a -libguiutilssettings_a_SOURCES = GUIColorer.h GUIColorScheme.h \ -GUICompleteSchemeStorage.cpp GUICompleteSchemeStorage.h \ +libguiutilssettings_a_SOURCES = GUICompleteSchemeStorage.cpp GUICompleteSchemeStorage.h \ +GUIPropertyScheme.h GUIPropertySchemeStorage.h \ GUISettingsHandler.cpp GUISettingsHandler.h \ GUIVisualizationSettings.cpp GUIVisualizationSettings.h diff -Nru sumo-0.21.0+dfsg/src/utils/gui/tracker/GUIParameterTracker.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/tracker/GUIParameterTracker.cpp --- sumo-0.21.0+dfsg/src/utils/gui/tracker/GUIParameterTracker.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/tracker/GUIParameterTracker.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIParameterTracker.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIParameterTracker.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A window which displays the time line of one (or more) value(s) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/tracker/GUIParameterTracker.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/tracker/GUIParameterTracker.h --- sumo-0.21.0+dfsg/src/utils/gui/tracker/GUIParameterTracker.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/tracker/GUIParameterTracker.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIParameterTracker.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIParameterTracker.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A window which displays the time line of one (or more) value(s) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/tracker/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/tracker/Makefile.in --- sumo-0.21.0+dfsg/src/utils/gui/tracker/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/tracker/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -221,6 +221,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -231,7 +233,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/tracker/TrackerValueDesc.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/tracker/TrackerValueDesc.cpp --- sumo-0.21.0+dfsg/src/utils/gui/tracker/TrackerValueDesc.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/tracker/TrackerValueDesc.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: TrackerValueDesc.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TrackerValueDesc.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Storage for a tracked value /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/tracker/TrackerValueDesc.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/tracker/TrackerValueDesc.h --- sumo-0.21.0+dfsg/src/utils/gui/tracker/TrackerValueDesc.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/tracker/TrackerValueDesc.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: TrackerValueDesc.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: TrackerValueDesc.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Representation of a timeline of floats with their names and moments /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIAppEnum.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIAppEnum.h --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIAppEnum.h 2014-06-10 22:02:21.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIAppEnum.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Andreas Gaubatz /// @date Mon, 08.03.2004 -/// @version $Id: GUIAppEnum.h 16564 2014-06-10 06:34:18Z namdre $ +/// @version $Id: GUIAppEnum.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Message and object IDs used by the FOX-version of the gui /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -73,6 +73,8 @@ MID_OPEN_CONFIG, /// Open network - ID MID_OPEN_NETWORK, + /// Load additional file with poi and polygons + MID_OPEN_SHAPES, /// Reload the previously loaded simulation MID_RELOAD, /// Loads a file previously loaded @@ -135,6 +137,8 @@ MID_APPSETTINGS, /// Gaming mode - menu entry MID_GAMING, + /// Fullscreen mode - menu entry + MID_FULLSCREEN, /// Locator configuration - menu entry MID_LISTINTERNAL, /// The Simulation delay control @@ -159,6 +163,8 @@ MID_LOCATEEDGE, /// Locate vehicle - button MID_LOCATEVEHICLE, + /// Locate person - button + MID_LOCATEPERSON, /// Locate TLS - button MID_LOCATETLS, /// Locate addtional structure - button @@ -251,6 +257,10 @@ MID_SHOW_FOES, MID_SHOW_LFLINKITEMS, MID_HIDE_LFLINKITEMS, + /// Show persons's path on walkingarea + MID_SHOW_WALKINGAREA_PATH, + /// Hide persons's path on walkingarea + MID_HIDE_WALKINGAREA_PATH, //@} @@ -417,6 +427,8 @@ MID_GNE_SPLIT_EDGE_BIDI, /** reverse an edge */ MID_GNE_REVERSE_EDGE, + /** add reverse edge */ + MID_GNE_ADD_REVERSE_EDGE, /** edit junction shape */ MID_GNE_NODE_SHAPE, /** set non-default geometry endpoint */ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp 2014-03-21 23:02:07.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIDanielPerspectiveChanger.cpp 15990 2014-03-21 20:58:19Z behrisch $ +/// @version $Id: GUIDanielPerspectiveChanger.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A class that allows to steer the visual output in dependence to /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDanielPerspectiveChanger.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDanielPerspectiveChanger.h --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDanielPerspectiveChanger.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDanielPerspectiveChanger.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIDanielPerspectiveChanger.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDanielPerspectiveChanger.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A class that allows to steer the visual output in dependence to /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDialog_EditViewport.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDialog_EditViewport.cpp --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDialog_EditViewport.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDialog_EditViewport.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date Mon, 25.04.2005 -/// @version $Id: GUIDialog_EditViewport.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GUIDialog_EditViewport.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // A dialog to change the viewport /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -80,43 +80,21 @@ ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT); } FXMatrix* m1 = new FXMatrix(f1, 2, MATRIX_BY_COLUMNS); - { - new FXLabel(m1, "Zoom:", 0, LAYOUT_CENTER_Y); - myZoom = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myZoom->setRange(0.0001, 100000); - myZoom->setNumberFormat(4); - } - { - new FXLabel(m1, "X:", 0, LAYOUT_CENTER_Y); - myXOff = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myXOff->setRange(-1000000, 1000000); - myXOff->setNumberFormat(4); - } - { - new FXLabel(m1, "Y:", 0, LAYOUT_CENTER_Y); - myYOff = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myYOff->setRange(-1000000, 1000000); - myYOff->setNumberFormat(4); - } + new FXLabel(m1, "Zoom:", 0, LAYOUT_CENTER_Y); + myZoom = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); + myZoom->setRange(0.0001, 100000); + myZoom->setNumberFormat(4); + new FXLabel(m1, "X:", 0, LAYOUT_CENTER_Y); + myXOff = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMIN | SPINDIAL_NOMAX); + new FXLabel(m1, "Y:", 0, LAYOUT_CENTER_Y); + myYOff = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMIN | SPINDIAL_NOMAX); #ifdef HAVE_OSG - { - new FXLabel(m1, "LookAtX:", 0, LAYOUT_CENTER_Y); - myLookAtX = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myLookAtX->setRange(-1000000, 100000); - myLookAtX->setNumberFormat(4); - } - { - new FXLabel(m1, "LookAtY:", 0, LAYOUT_CENTER_Y); - myLookAtY = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myLookAtY->setRange(-1000000, 1000000); - myLookAtY->setNumberFormat(4); - } - { - new FXLabel(m1, "LookAtZ:", 0, LAYOUT_CENTER_Y); - myLookAtZ = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myLookAtZ->setRange(-1000000, 1000000); - myLookAtZ->setNumberFormat(4); - } + new FXLabel(m1, "LookAtX:", 0, LAYOUT_CENTER_Y); + myLookAtX = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMIN | SPINDIAL_NOMAX); + new FXLabel(m1, "LookAtY:", 0, LAYOUT_CENTER_Y); + myLookAtY = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMIN | SPINDIAL_NOMAX); + new FXLabel(m1, "LookAtZ:", 0, LAYOUT_CENTER_Y); + myLookAtZ = new FXRealSpinDial(m1, 16, this, MID_CHANGED, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMIN | SPINDIAL_NOMAX); #endif // ok/cancel new FXHorizontalSeparator(f1, SEPARATOR_GROOVE | LAYOUT_FILL_X); @@ -196,24 +174,15 @@ long GUIDialog_EditViewport::onCmdSave(FXObject*, FXSelector, void* /*data*/) { - FXFileDialog opendialog(this, "Save Viewport"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); - opendialog.setSelectMode(SELECTFILE_ANY); - opendialog.setPatternList("*.xml"); - if (gCurrentFolder.length() != 0) { - opendialog.setDirectory(gCurrentFolder); - } - if (!opendialog.execute() || !MFXUtils::userPermitsOverwritingWhenFileExists(this, opendialog.getFilename())) { + FXString file = MFXUtils::getFilename2Write(this, "Save Viewport", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder); + if (file == "") { return 1; } try { - OutputDevice& dev = OutputDevice::getDevice(opendialog.getFilename().text()); - dev << "\n"; - dev << " getValue() << "\" x=\"" << myXOff->getValue() << "\" y=\"" << myYOff->getValue(); -#ifdef HAVE_OSG - dev << "\" centerX=\"" << myLookAtX->getValue() << "\" centerY=\"" << myLookAtY->getValue() << "\" centerZ=\"" << myLookAtZ->getValue(); -#endif - dev << "\"/>\n\n"; + OutputDevice& dev = OutputDevice::getDevice(file.text()); + dev.openTag(SUMO_TAG_VIEWSETTINGS); + writeXML(dev); + dev.closeTag(); dev.close(); } catch (IOError& e) { FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what()); @@ -223,6 +192,20 @@ void +GUIDialog_EditViewport::writeXML(OutputDevice& dev) { + dev.openTag(SUMO_TAG_VIEWPORT); + dev.writeAttr(SUMO_ATTR_ZOOM, myZoom->getValue()); + dev.writeAttr(SUMO_ATTR_X, myXOff->getValue()); + dev.writeAttr(SUMO_ATTR_Y, myYOff->getValue()); +#ifdef HAVE_OSG + dev.writeAttr(SUMO_ATTR_CENTER_X, myLookAtX->getValue()); + dev.writeAttr(SUMO_ATTR_CENTER_Y, myLookAtY->getValue()); + dev.writeAttr(SUMO_ATTR_CENTER_Z, myLookAtZ->getValue()); +#endif + dev.closeTag(); +} + +void GUIDialog_EditViewport::setValues(SUMOReal zoom, SUMOReal xoff, SUMOReal yoff) { myZoom->setValue(zoom); myXOff->setValue(xoff); diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDialog_EditViewport.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDialog_EditViewport.h --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDialog_EditViewport.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDialog_EditViewport.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2005-05-04 -/// @version $Id: GUIDialog_EditViewport.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDialog_EditViewport.h 18096 2015-03-17 09:50:59Z behrisch $ /// // A dialog to change the viewport /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -97,7 +97,8 @@ long onCmdSave(FXObject*, FXSelector, void*); /// @} - + /// write the settings to the given device + void writeXML(OutputDevice& dev); /** @brief Sets the given values into the dialog * @param[in] zoom Current view's zoom diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIDialog_GLObjChooser.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDialog_GLObjChooser.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Class for the window that allows to choose a street, junction or vehicle /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -70,11 +70,9 @@ GUIGlChildWindow* parent, FXIcon* icon, const FXString& title, - GUIGlObjectType type, const std::vector& ids, GUIGlObjectStorage& glStorage): FXMainWindow(parent->getApp(), title, icon, NULL, DECOR_ALL, 20, 20, 300, 300), - myObjectType(type), myParent(parent) { FXHorizontalFrame* hbox = new FXHorizontalFrame(this, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0); // build the list diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDialog_GLObjChooser.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDialog_GLObjChooser.h --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDialog_GLObjChooser.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDialog_GLObjChooser.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIDialog_GLObjChooser.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIDialog_GLObjChooser.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Class for the window that allows to choose a street, junction or vehicle /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -65,11 +65,9 @@ * @param[in] parent The calling view * @param[in] icon The icon to use * @param[in] title The title to use - * @param[in] type The type of gl-objects to show instances of * @param[in] glStorage The storage to retrieve ids from */ GUIDialog_GLObjChooser(GUIGlChildWindow* parent, FXIcon* icon, const FXString& title, - GUIGlObjectType type, const std::vector& ids, GUIGlObjectStorage& glStorage); @@ -119,9 +117,6 @@ /// @brief The button that triggers centering on the select object FXButton* myCenterButton; - /// @brief The artifact to choose - GUIGlObjectType myObjectType; - /// @brief The parent window GUIGlChildWindow* myParent; diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDialog_ViewSettings.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDialog_ViewSettings.cpp --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDialog_ViewSettings.cpp 2014-05-05 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDialog_ViewSettings.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Wed, 21. Dec 2005 -/// @version $Id: GUIDialog_ViewSettings.cpp 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: GUIDialog_ViewSettings.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // The dialog to change the view (gui) settings. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -46,6 +46,7 @@ #include #include #include +#include "GUIDialog_EditViewport.h" #include "GUIDialog_ViewSettings.h" #ifdef CHECK_MEMORY_LEAKS @@ -89,9 +90,10 @@ 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), + FXDialogBox(parent, "View Settings", DECOR_TITLE | DECOR_BORDER | DECOR_RESIZE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), myParent(parent), mySettings(settings), - myDecals(decals), myDecalsLock(decalsLock), myDecalsTable(0) { + myDecals(decals), myDecalsLock(decalsLock), + myDecalsTable(0) { myBackup = (*mySettings); FXVerticalFrame* contentFrame = @@ -124,6 +126,12 @@ GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, MID_SIMPLE_VIEW_IMPORT, ICON_ABOVE_TEXT | BUTTON_TOOLBAR | FRAME_RAISED | LAYOUT_TOP | LAYOUT_LEFT); + new FXVerticalSeparator(frame0); + new FXLabel(frame0, "Export includes:", 0, LAYOUT_CENTER_Y); + mySaveViewPort = new FXCheckButton(frame0, "Viewport"); + mySaveDelay = new FXCheckButton(frame0, "Delay"); + mySaveDecals = new FXCheckButton(frame0, "Decals"); + } // FXTabBook* tabbook = @@ -132,8 +140,9 @@ { // tab for the background new FXTabItem(tabbook, "Background", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4); + FXScrollWindow* genScroll = new FXScrollWindow(tabbook); FXVerticalFrame* frame1 = - new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); FXMatrix* m11 = new FXMatrix(frame1, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, @@ -185,26 +194,44 @@ { // tab for the streets new FXTabItem(tabbook, "Streets", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4); - + FXScrollWindow* genScroll = new FXScrollWindow(tabbook); FXVerticalFrame* frame2 = - new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + // ... color settings + FXVerticalFrame* frame22 = + new FXVerticalFrame(frame2, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); FXMatrix* m21 = - new FXMatrix(frame2, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, + new FXMatrix(frame22, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, 0, 0, 0, 0, 10, 10, 10, 2, 5, 5); new FXLabel(m21, "Color", 0, LAYOUT_CENTER_Y); myLaneEdgeColorMode = new FXComboBox(m21, 30, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC); - myLaneEdgeColorMode->setNumVisible(10); myLaneColorInterpolation = new FXCheckButton(m21, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL); - FXScrollWindow* genScroll = new FXScrollWindow(frame2, LAYOUT_FILL_X | LAYOUT_SIDE_TOP | FRAME_RAISED | FRAME_THICK | LAYOUT_FIX_HEIGHT, 0, 0, 0, 80); - 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 + myLaneColorSettingFrame = new FXVerticalFrame(frame22, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2); + + new FXHorizontalSeparator(frame2, SEPARATOR_GROOVE | LAYOUT_FILL_X); + // ... scale settings + FXVerticalFrame* frame23 = + new FXVerticalFrame(frame2, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + FXMatrix* m23 = + new FXMatrix(frame23, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, + 0, 0, 0, 0, 10, 10, 10, 2, 5, 5); + new FXLabel(m23, "Scale width", 0, LAYOUT_CENTER_Y); + myLaneEdgeScaleMode = new FXComboBox(m23, 30, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC); + myLaneScaleInterpolation = new FXCheckButton(m23, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL); + myLaneScaleSettingFrame = new FXVerticalFrame(frame23, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2); + #ifdef HAVE_INTERNAL if (GUIVisualizationSettings::UseMesoSim) { mySettings->edgeColorer.fill(*myLaneEdgeColorMode); + mySettings->edgeScaler.fill(*myLaneEdgeScaleMode); + myLaneEdgeColorMode->setNumVisible((int)mySettings->edgeColorer.size()); + myLaneEdgeScaleMode->setNumVisible((int)mySettings->edgeScaler.size()); } else { #endif mySettings->laneColorer.fill(*myLaneEdgeColorMode); + mySettings->laneScaler.fill(*myLaneEdgeScaleMode); + myLaneEdgeColorMode->setNumVisible((int)mySettings->laneColorer.size()); + myLaneEdgeScaleMode->setNumVisible((int)mySettings->laneScaler.size()); #ifdef HAVE_INTERNAL } #endif @@ -241,8 +268,9 @@ { // vehicles new FXTabItem(tabbook, "Vehicles", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4); + FXScrollWindow* genScroll = new FXScrollWindow(tabbook); FXVerticalFrame* frame3 = - new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); FXMatrix* m31 = new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, @@ -264,12 +292,11 @@ new FXLabel(m32, "Color", 0, LAYOUT_CENTER_Y); myVehicleColorMode = new FXComboBox(m32, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC); mySettings->vehicleColorer.fill(*myVehicleColorMode); - myVehicleColorMode->setNumVisible(10); + myVehicleColorMode->setNumVisible((int)mySettings->vehicleColorer.size()); myVehicleColorInterpolation = new FXCheckButton(m32, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL); - FXScrollWindow* genScroll = new FXScrollWindow(frame3, LAYOUT_FILL_X | LAYOUT_SIDE_TOP | FRAME_RAISED | FRAME_THICK | LAYOUT_FIX_HEIGHT, 0, 0, 0, 80); myVehicleColorSettingFrame = - new FXVerticalFrame(genScroll, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2); + new FXVerticalFrame(frame3, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2); new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X); @@ -282,6 +309,9 @@ myShowMinGap = new FXCheckButton(m33, "Show minimum gap", this, MID_SIMPLE_VIEW_COLORCHANGE); myShowMinGap->setCheck(mySettings->drawMinGap); new FXLabel(m33, " ", 0, LAYOUT_CENTER_Y); + myShowBTRange = new FXCheckButton(m33, "Show Bluetooth range", this, MID_SIMPLE_VIEW_COLORCHANGE); + myShowBTRange->setCheck(mySettings->showBTRange); + new FXLabel(m33, " ", 0, LAYOUT_CENTER_Y); /* myShowLaneChangePreference = new FXCheckButton(m33, "Show lane change preference", this, MID_SIMPLE_VIEW_COLORCHANGE); myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference); @@ -300,30 +330,15 @@ FXMatrix* m34 = new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS, 0, 0, 0, 0, 10, 10, 10, 10, 5, 5); - FXMatrix* m341 = - new FXMatrix(m34, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS, - 0, 0, 0, 0, 10, 10, 0, 0, 5, 5); - new FXLabel(m341, "Minimum size", 0, LAYOUT_CENTER_Y); - myVehicleMinSizeDialer = - new FXRealSpinDial(m341, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, - LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myVehicleMinSizeDialer->setValue(mySettings->minVehicleSize); - FXMatrix* m342 = - new FXMatrix(m34, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS, - 0, 0, 0, 0, 10, 10, 0, 0, 5, 5); - new FXLabel(m342, "Exaggerate by", 0, LAYOUT_CENTER_Y); - myVehicleUpscaleDialer = - new FXRealSpinDial(m342, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, - LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myVehicleUpscaleDialer->setRange(0, 10000); - myVehicleUpscaleDialer->setValue(mySettings->vehicleExaggeration); + myVehicleSizePanel = new SizePanel(m34, this, mySettings->vehicleSize); } { // persons new FXTabItem(tabbook, "Persons", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4); + FXScrollWindow* genScroll = new FXScrollWindow(tabbook); FXVerticalFrame* frame3 = - new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); FXMatrix* m101 = new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, @@ -348,9 +363,8 @@ myPersonColorMode->setNumVisible(10); myPersonColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL); - FXScrollWindow* genScroll = new FXScrollWindow(frame3, LAYOUT_FILL_X | LAYOUT_SIDE_TOP | FRAME_RAISED | FRAME_THICK | LAYOUT_FIX_HEIGHT, 0, 0, 0, 80); myPersonColorSettingFrame = - new FXVerticalFrame(genScroll, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2); + new FXVerticalFrame(frame3, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2); new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X); @@ -364,41 +378,73 @@ FXMatrix* m104 = new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS, 0, 0, 0, 0, 10, 10, 10, 10, 5, 5); - FXMatrix* m1041 = - new FXMatrix(m104, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS, - 0, 0, 0, 0, 10, 10, 0, 0, 5, 5); - new FXLabel(m1041, "Minimum size", 0, LAYOUT_CENTER_Y); - myPersonMinSizeDialer = - new FXRealSpinDial(m1041, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, - LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myPersonMinSizeDialer->setValue(mySettings->minPersonSize); - FXMatrix* m1042 = - new FXMatrix(m104, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS, - 0, 0, 0, 0, 10, 10, 0, 0, 5, 5); - new FXLabel(m1042, "Exaggerate by", 0, LAYOUT_CENTER_Y); - myPersonUpscaleDialer = - new FXRealSpinDial(m1042, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, - LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myPersonUpscaleDialer->setRange(0, 10000); - myPersonUpscaleDialer->setValue(mySettings->personExaggeration); + myPersonSizePanel = new SizePanel(m104, this, mySettings->personSize); + } + + { + // containers + new FXTabItem(tabbook, "Containers", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4); + FXScrollWindow* genScroll = new FXScrollWindow(tabbook); + FXVerticalFrame* frame3 = + new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + + FXMatrix* m101 = + new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, + 0, 0, 0, 0, 10, 10, 10, 2, 5, 5); + new FXLabel(m101, "Show As", 0, LAYOUT_CENTER_Y); + myContainerShapeDetail = new FXComboBox(m101, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC); + myContainerShapeDetail->appendItem("'triangles'"); + myContainerShapeDetail->appendItem("'boxes'"); + myContainerShapeDetail->appendItem("'simple shapes'"); + myContainerShapeDetail->appendItem("'raster images'"); + myContainerShapeDetail->setNumVisible(4); + myContainerShapeDetail->setCurrentItem(settings->containerQuality); + + new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X); + + FXMatrix* m102 = + new FXMatrix(frame3, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, + 0, 0, 0, 0, 10, 10, 10, 2, 5, 5); + new FXLabel(m102, "Color", 0, LAYOUT_CENTER_Y); + myContainerColorMode = new FXComboBox(m102, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC); + mySettings->containerColorer.fill(*myContainerColorMode); + myContainerColorMode->setNumVisible(9); + myContainerColorInterpolation = new FXCheckButton(m102, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL); + + myContainerColorSettingFrame = + new FXVerticalFrame(frame3, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2); + + new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X); + + FXMatrix* m103 = + new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, + 0, 0, 0, 0, 10, 10, 10, 10, 5, 5); + myContainerNamePanel = new NamePanel(m103, this, "Show container name", mySettings->containerName); + + new FXHorizontalSeparator(frame3, SEPARATOR_GROOVE | LAYOUT_FILL_X); + + FXMatrix* m104 = + new FXMatrix(frame3, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS, + 0, 0, 0, 0, 10, 10, 10, 10, 5, 5); + myContainerSizePanel = new SizePanel(m104, this, mySettings->containerSize); } { // nodes new FXTabItem(tabbook, "Junctions", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4); + FXScrollWindow* genScroll = new FXScrollWindow(tabbook); FXVerticalFrame* frame4 = - new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); FXMatrix* m41 = new FXMatrix(frame4, 3, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, 0, 0, 0, 0, 10, 10, 10, 2, 5, 5); new FXLabel(m41, "Color", 0, LAYOUT_CENTER_Y); myJunctionColorMode = new FXComboBox(m41, 20, this, MID_SIMPLE_VIEW_COLORCHANGE, FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | COMBOBOX_STATIC); mySettings->junctionColorer.fill(*myJunctionColorMode); - myJunctionColorMode->setNumVisible(2); + myJunctionColorMode->setNumVisible(3); myJunctionColorInterpolation = new FXCheckButton(m41, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL); - FXScrollWindow* genScroll = new FXScrollWindow(frame4, LAYOUT_FILL_X | LAYOUT_SIDE_TOP | FRAME_RAISED | FRAME_THICK | LAYOUT_FIX_HEIGHT, 0, 0, 0, 80); myJunctionColorSettingFrame = - new FXVerticalFrame(genScroll, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2); + new FXVerticalFrame(frame4, LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 10, 10, 2, 8, 5, 2); new FXHorizontalSeparator(frame4, SEPARATOR_GROOVE | LAYOUT_FILL_X); FXMatrix* m42 = @@ -418,9 +464,11 @@ myDrawJunctionShape = new FXCheckButton(m42, "Draw junction shape", this, MID_SIMPLE_VIEW_COLORCHANGE); myDrawJunctionShape->setCheck(mySettings->drawJunctionShape); } { + // detectors / triggers new FXTabItem(tabbook, "Detectors/Trigger", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4); + FXScrollWindow* genScroll = new FXScrollWindow(tabbook); FXVerticalFrame* frame5 = - new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); FXMatrix* m51 = new FXMatrix(frame5, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, @@ -431,24 +479,7 @@ FXMatrix* m52 = new FXMatrix(frame5, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, 0, 0, 0, 0, 10, 10, 10, 10, 5, 5); - FXMatrix* m521 = - new FXMatrix(m52, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, - 0, 0, 0, 0, 10, 10, 0, 0, 5, 5); - new FXLabel(m521, "Minimum size", 0, LAYOUT_CENTER_Y); - myDetectorMinSizeDialer = - new FXRealSpinDial(m521, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, - LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - FXMatrix* m522 = - new FXMatrix(m52, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, - 0, 0, 0, 0, 10, 10, 0, 0, 5, 5); - myDetectorMinSizeDialer->setValue(mySettings->minAddSize); - new FXLabel(m522, "Exaggerate by", 0, LAYOUT_CENTER_Y); - myDetectorUpscaleDialer = - new FXRealSpinDial(m522, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, - LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myDetectorUpscaleDialer->setRange(0, 10000); - myDetectorUpscaleDialer->setValue(mySettings->addExaggeration); - + myAddSizePanel = new SizePanel(m52, this, mySettings->addSize); /* new FXLabel(m522, "Color", 0, LAYOUT_CENTER_Y); @@ -458,9 +489,11 @@ 0, 0, 100, 0, 0, 0, 0, 0); */ } { + // POIs new FXTabItem(tabbook, "POIs", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4); + FXScrollWindow* genScroll = new FXScrollWindow(tabbook); FXVerticalFrame* frame6 = - new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); FXMatrix* m61 = new FXMatrix(frame6, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, @@ -471,29 +504,14 @@ FXMatrix* m62 = new FXMatrix(frame6, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, 0, 0, 0, 0, 10, 10, 10, 10, 5, 5); - FXMatrix* m621 = - new FXMatrix(m62, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, - 0, 0, 0, 0, 10, 10, 0, 0, 5, 5); - new FXLabel(m621, "Minimum size to show", 0, LAYOUT_CENTER_Y); - myPOIMinSizeDialer = - new FXRealSpinDial(m621, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, - LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - FXMatrix* m622 = - new FXMatrix(m62, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, - 0, 0, 0, 0, 10, 10, 0, 0, 5, 5); - myPOIMinSizeDialer->setValue(mySettings->minPOISize); - new FXLabel(m622, "Exaggerate by", 0, LAYOUT_CENTER_Y); - myPOIUpscaleDialer = - new FXRealSpinDial(m622, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, - LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myPOIUpscaleDialer->setRange(0, 10000); - myPOIUpscaleDialer->setValue(mySettings->addExaggeration); - + myPOISizePanel = new SizePanel(m62, this, mySettings->poiSize); } { + // Polygons new FXTabItem(tabbook, "Polygons", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4); + FXScrollWindow* genScroll = new FXScrollWindow(tabbook); FXVerticalFrame* frame9 = - new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); FXMatrix* m91 = new FXMatrix(frame9, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, @@ -501,32 +519,14 @@ myPolyNamePanel = new NamePanel(m91, this, "Show polygon names", mySettings->polyName); new FXHorizontalSeparator(frame9 , SEPARATOR_GROOVE | LAYOUT_FILL_X); - FXMatrix* m92 = - new FXMatrix(frame9, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, - 0, 0, 0, 0, 10, 10, 10, 10, 5, 5); - FXMatrix* m921 = - new FXMatrix(m92, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, - 0, 0, 0, 0, 10, 10, 0, 0, 5, 5); - new FXLabel(m921, "Minimum size to show", 0, LAYOUT_CENTER_Y); - myPolyMinSizeDialer = - new FXRealSpinDial(m921, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, - LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - FXMatrix* m922 = - new FXMatrix(m92, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, - 0, 0, 0, 0, 10, 10, 0, 0, 5, 5); - myPolyMinSizeDialer->setValue(mySettings->minPolySize); - new FXLabel(m922, "Exaggerate by", 0, LAYOUT_CENTER_Y); - myPolyUpscaleDialer = - new FXRealSpinDial(m922, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, - LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - myPolyUpscaleDialer->setRange(0, 10000); - myPolyUpscaleDialer->setValue(mySettings->addExaggeration); - + myPolySizePanel = new SizePanel(m91, this, mySettings->polySize); }{ + // Legend new FXTabItem(tabbook, "Legend", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4); + FXScrollWindow* genScroll = new FXScrollWindow(tabbook); FXVerticalFrame* frame7 = - new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); FXMatrix* m72 = new FXMatrix(frame7, 2, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, @@ -535,9 +535,11 @@ myShowSizeLegend->setCheck(mySettings->showSizeLegend); new FXLabel(m72, ""); } { + // openGL new FXTabItem(tabbook, "openGL", NULL, TAB_LEFT_NORMAL, 0, 0, 0, 0, 4, 8, 4, 4); + FXScrollWindow* genScroll = new FXScrollWindow(tabbook); FXVerticalFrame* frame8 = - new FXVerticalFrame(tabbook, FRAME_THICK | FRAME_RAISED, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); + new FXVerticalFrame(genScroll, FRAME_THICK | FRAME_RAISED | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2); FXMatrix* m82 = new FXMatrix(frame8, 1, LAYOUT_FILL_X | LAYOUT_TOP | LAYOUT_LEFT | MATRIX_BY_COLUMNS, @@ -554,21 +556,34 @@ rebuildColorMatrices(false); setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + + const FXint minSize = 400; + setX(MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "x", 150), getApp()->getRootWindow()->getWidth() - minSize)); + setY(MIN2(getApp()->reg().readIntEntry("VIEWSETTINGS", "y", 150), getApp()->getRootWindow()->getHeight() - minSize)); + setWidth(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "width", 700), minSize)); + setHeight(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "height", 500), minSize)); } GUIDialog_ViewSettings::~GUIDialog_ViewSettings() { myParent->remove(this); - delete myEdgeNamePanel; + // delete name panels + delete myInternalJunctionNamePanel; delete myInternalEdgeNamePanel; delete myCwaEdgeNamePanel; delete myStreetNamePanel; delete myJunctionNamePanel; - delete myInternalJunctionNamePanel; delete myVehicleNamePanel; delete myAddNamePanel; delete myPOINamePanel; delete myPolyNamePanel; + delete myEdgeNamePanel; + // delete size panels + delete myVehicleSizePanel; + delete myPersonSizePanel; + delete myPOISizePanel; + delete myPolySizePanel; + delete myAddSizePanel; } @@ -582,6 +597,7 @@ long GUIDialog_ViewSettings::onCmdOk(FXObject*, FXSelector, void*) { + saveWindowSize(); hide(); return 1; } @@ -589,6 +605,7 @@ long GUIDialog_ViewSettings::onCmdCancel(FXObject*, FXSelector, void*) { + saveWindowSize(); hide(); (*mySettings) = myBackup; return 1; @@ -615,6 +632,7 @@ myBackgroundColor->setRGBA(MFXUtils::getFXColor(mySettings->backgroundColor)); myLaneEdgeColorMode->setCurrentItem((FXint) mySettings->getLaneEdgeMode()); + myLaneEdgeScaleMode->setCurrentItem((FXint) mySettings->getLaneEdgeScaleMode()); myShowLaneBorders->setCheck(mySettings->laneShowBorders); myShowLaneDecals->setCheck(mySettings->showLinkDecals); myShowRails->setCheck(mySettings->showRails); @@ -627,20 +645,24 @@ myVehicleColorMode->setCurrentItem((FXint) mySettings->vehicleColorer.getActive()); myVehicleShapeDetail->setCurrentItem(mySettings->vehicleQuality); - myVehicleUpscaleDialer->setValue(mySettings->vehicleExaggeration); - myVehicleMinSizeDialer->setValue(mySettings->minVehicleSize); myShowBlinker->setCheck(mySettings->showBlinker); myShowMinGap->setCheck(mySettings->drawMinGap); + myShowBTRange->setCheck(mySettings->showBTRange); /* myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference); */ myVehicleNamePanel->update(mySettings->vehicleName); + myVehicleSizePanel->update(mySettings->vehicleSize); myPersonColorMode->setCurrentItem((FXint) mySettings->personColorer.getActive()); myPersonShapeDetail->setCurrentItem(mySettings->personQuality); - myPersonUpscaleDialer->setValue(mySettings->personExaggeration); - myPersonMinSizeDialer->setValue(mySettings->minPersonSize); myPersonNamePanel->update(mySettings->personName); + myPersonSizePanel->update(mySettings->personSize); + + myContainerColorMode->setCurrentItem((FXint) mySettings->containerColorer.getActive()); + myContainerShapeDetail->setCurrentItem(mySettings->containerQuality); + myContainerNamePanel->update(mySettings->containerName); + myContainerSizePanel->update(mySettings->containerSize); myJunctionColorMode->setCurrentItem((FXint) mySettings->junctionColorer.getActive()); myShowTLIndex->setCheck(mySettings->drawLinkTLIndex); @@ -648,17 +670,14 @@ myJunctionNamePanel->update(mySettings->junctionName); myInternalJunctionNamePanel->update(mySettings->internalJunctionName); - myDetectorUpscaleDialer->setValue(mySettings->addExaggeration); - myDetectorMinSizeDialer->setValue(mySettings->minAddSize); myAddNamePanel->update(mySettings->addName); + myAddSizePanel->update(mySettings->addSize); - myPOIUpscaleDialer->setValue(mySettings->poiExaggeration); - myPOIMinSizeDialer->setValue(mySettings->minPOISize); myPOINamePanel->update(mySettings->poiName); + myPOISizePanel->update(mySettings->poiSize); - myPolyUpscaleDialer->setValue(mySettings->polyExaggeration); - myPolyMinSizeDialer->setValue(mySettings->minPolySize); myPolyNamePanel->update(mySettings->polyName); + myPolySizePanel->update(mySettings->polySize); myShowLane2Lane->setCheck(mySettings->showLane2Lane); myDrawJunctionShape->setCheck(mySettings->drawJunctionShape); @@ -726,12 +745,67 @@ } +bool +GUIDialog_ViewSettings::updateScaleRanges(FXObject* sender, std::vector::const_iterator scaleIt, + std::vector::const_iterator scaleEnd, + std::vector::const_iterator threshIt, + std::vector::const_iterator threshEnd, + std::vector::const_iterator buttonIt, + GUIScaleScheme& scheme) { + size_t pos = 0; + while (scaleIt != scaleEnd) { + if (scheme.isFixed()) { + if (sender == *scaleIt) { + scheme.setColor(pos, (*scaleIt)->getValue()); + } + } else { + if (sender == *threshIt) { + const SUMOReal val = (*threshIt)->getValue(); + double lo, hi; + if (pos != 0) { + threshIt--; + (*threshIt)->getRange(lo, hi); + (*threshIt)->setRange(lo, val); + threshIt++; + } + threshIt++; + if (threshIt != threshEnd) { + (*threshIt)->getRange(lo, hi); + (*threshIt)->setRange(val, hi); + } + scheme.setThreshold(pos, val); + return false; + } + if (sender == *scaleIt) { + scheme.setColor(pos, (*scaleIt)->getValue()); + return false; + } + if (sender == *buttonIt) { + if (pos == 0) { + scheme.addColor((*scaleIt)->getValue(), (*threshIt)->getValue()); + } else { + scheme.removeColor(pos); + } + return true; + } + ++threshIt; + ++buttonIt; + } + ++scaleIt; + pos++; + } + return false; +} + + long GUIDialog_ViewSettings::onCmdColorChange(FXObject* sender, FXSelector, void* /*val*/) { GUIVisualizationSettings tmpSettings = *mySettings; size_t prevLaneMode = mySettings->getLaneEdgeMode(); + size_t prevLaneScaleMode = mySettings->getLaneEdgeScaleMode(); size_t prevVehicleMode = mySettings->vehicleColorer.getActive(); size_t prevPersonMode = mySettings->personColorer.getActive(); + size_t prevContainerMode = mySettings->containerColorer.getActive(); size_t prevJunctionMode = mySettings->junctionColorer.getActive(); bool doRebuildColorMatrices = false; @@ -744,9 +818,11 @@ #ifdef HAVE_INTERNAL if (GUIVisualizationSettings::UseMesoSim) { tmpSettings.edgeColorer.setActive(myLaneEdgeColorMode->getCurrentItem()); + tmpSettings.edgeScaler.setActive(myLaneEdgeScaleMode->getCurrentItem()); } else { #endif tmpSettings.laneColorer.setActive(myLaneEdgeColorMode->getCurrentItem()); + tmpSettings.laneScaler.setActive(myLaneEdgeScaleMode->getCurrentItem()); #ifdef HAVE_INTERNAL } #endif @@ -762,20 +838,24 @@ tmpSettings.vehicleColorer.setActive(myVehicleColorMode->getCurrentItem()); tmpSettings.vehicleQuality = myVehicleShapeDetail->getCurrentItem(); - tmpSettings.vehicleExaggeration = (SUMOReal) myVehicleUpscaleDialer->getValue(); - tmpSettings.minVehicleSize = (SUMOReal) myVehicleMinSizeDialer->getValue(); tmpSettings.showBlinker = (myShowBlinker->getCheck() != FALSE); tmpSettings.drawMinGap = (myShowMinGap->getCheck() != FALSE); + tmpSettings.showBTRange = (myShowBTRange->getCheck() != FALSE); /* tmpSettings.drawLaneChangePreference = (myShowLaneChangePreference->getCheck() != FALSE); */ tmpSettings.vehicleName = myVehicleNamePanel->getSettings(); + tmpSettings.vehicleSize = myVehicleSizePanel->getSettings(); tmpSettings.personColorer.setActive(myPersonColorMode->getCurrentItem()); tmpSettings.personQuality = myPersonShapeDetail->getCurrentItem(); - tmpSettings.personExaggeration = (SUMOReal) myPersonUpscaleDialer->getValue(); - tmpSettings.minPersonSize = (SUMOReal) myPersonMinSizeDialer->getValue(); tmpSettings.personName = myPersonNamePanel->getSettings(); + tmpSettings.personSize = myPersonSizePanel->getSettings(); + + tmpSettings.containerColorer.setActive(myContainerColorMode->getCurrentItem()); + tmpSettings.containerQuality = myContainerShapeDetail->getCurrentItem(); + tmpSettings.containerName = myContainerNamePanel->getSettings(); + tmpSettings.containerSize = myContainerSizePanel->getSettings(); tmpSettings.junctionColorer.setActive(myJunctionColorMode->getCurrentItem()); tmpSettings.drawLinkTLIndex = (myShowTLIndex->getCheck() != FALSE); @@ -783,17 +863,14 @@ tmpSettings.junctionName = myJunctionNamePanel->getSettings(); tmpSettings.internalJunctionName = myInternalJunctionNamePanel->getSettings(); - tmpSettings.addExaggeration = (SUMOReal) myDetectorUpscaleDialer->getValue(); - tmpSettings.minAddSize = (SUMOReal) myDetectorMinSizeDialer->getValue(); tmpSettings.addName = myAddNamePanel->getSettings(); + tmpSettings.addSize = myAddSizePanel->getSettings(); - tmpSettings.poiExaggeration = (SUMOReal) myPOIUpscaleDialer->getValue(); - tmpSettings.minPOISize = (SUMOReal) myPOIMinSizeDialer->getValue(); tmpSettings.poiName = myPOINamePanel->getSettings(); + tmpSettings.poiSize = myPOISizePanel->getSettings(); - tmpSettings.polyExaggeration = (SUMOReal) myPolyUpscaleDialer->getValue(); - tmpSettings.minPolySize = (SUMOReal) myPolyMinSizeDialer->getValue(); tmpSettings.polyName = myPolyNamePanel->getSettings(); + tmpSettings.polySize = myPolySizePanel->getSettings(); tmpSettings.showLane2Lane = (myShowLane2Lane->getCheck() != FALSE); tmpSettings.drawJunctionShape = (myDrawJunctionShape->getCheck() != FALSE); @@ -801,7 +878,7 @@ tmpSettings.dither = (myDither->getCheck() != FALSE); tmpSettings.showSizeLegend = (myShowSizeLegend->getCheck() != FALSE); - // lanes + // lanes (colors) if (tmpSettings.getLaneEdgeMode() == prevLaneMode) { if (updateColorRanges(sender, myLaneColors.begin(), myLaneColors.end(), myLaneThresholds.begin(), myLaneThresholds.end(), myLaneButtons.begin(), @@ -815,6 +892,20 @@ } else { doRebuildColorMatrices = true; } + // lanes (scaling) + if (tmpSettings.getLaneEdgeScaleMode() == prevLaneScaleMode) { + if (updateScaleRanges(sender, myLaneScales.begin(), myLaneScales.end(), + myLaneScaleThresholds.begin(), myLaneScaleThresholds.end(), myLaneScaleButtons.begin(), + tmpSettings.getLaneEdgeScaleScheme())) { + doRebuildColorMatrices = true; + } + if (sender == myLaneScaleInterpolation) { + tmpSettings.getLaneEdgeScaleScheme().setInterpolated(myLaneScaleInterpolation->getCheck() != FALSE); + doRebuildColorMatrices = true; + } + } else { + doRebuildColorMatrices = true; + } // vehicles if (tmpSettings.vehicleColorer.getActive() == prevVehicleMode) { if (updateColorRanges(sender, myVehicleColors.begin(), myVehicleColors.end(), @@ -843,6 +934,20 @@ } else { doRebuildColorMatrices = true; } + // containers + if (tmpSettings.containerColorer.getActive() == prevContainerMode) { + if (updateColorRanges(sender, myContainerColors.begin(), myContainerColors.end(), + myContainerThresholds.begin(), myContainerThresholds.end(), myContainerButtons.begin(), + tmpSettings.containerColorer.getScheme())) { + doRebuildColorMatrices = true; + } + if (sender == myContainerColorInterpolation) { + tmpSettings.containerColorer.getScheme().setInterpolated(myContainerColorInterpolation->getCheck() != FALSE); + doRebuildColorMatrices = true; + } + } else { + doRebuildColorMatrices = true; + } // junctions if (tmpSettings.junctionColorer.getActive() == prevJunctionMode) { if (updateColorRanges(sender, myJunctionColors.begin(), myJunctionColors.end(), @@ -903,34 +1008,40 @@ mySchemeName->setCurrentItem(index); mySettings = &gSchemeStorage.get(settingsName); } + if (handler.hasDecals()) { + myDecalsLock->lock(); + (*myDecals) = handler.getDecals(); + rebuildList(); + myParent->update(); + myDecalsLock->unlock(); + } + Position lookFrom, lookAt; + handler.setViewport(lookFrom, lookAt); + if (lookFrom.z() > 0) { + myParent->setViewport(lookFrom, lookAt); + } + rebuildColorMatrices(true); } void -GUIDialog_ViewSettings::saveDecals(const std::string& file) const { - try { - OutputDevice& dev = OutputDevice::getDevice(file); - dev << "\n"; - std::vector::iterator j; - for (j = myDecals->begin(); j != myDecals->end(); ++j) { - GUISUMOAbstractView::Decal& d = *j; - dev << " \n"; - } - dev << "\n"; - dev.close(); - } catch (IOError& e) { - FXMessageBox::error(myParent, MBOX_OK, "Storing failed!", "%s", e.what()); +GUIDialog_ViewSettings::saveDecals(OutputDevice& dev) const { + std::vector::iterator j; + for (j = myDecals->begin(); j != myDecals->end(); ++j) { + GUISUMOAbstractView::Decal& d = *j; + dev.openTag(SUMO_TAG_VIEWSETTINGS_DECAL); + dev.writeAttr("filename", d.filename); + dev.writeAttr(SUMO_ATTR_CENTER_X, d.centerX); + dev.writeAttr(SUMO_ATTR_CENTER_Y, d.centerY); + dev.writeAttr(SUMO_ATTR_CENTER_Z, d.centerZ); + dev.writeAttr(SUMO_ATTR_WIDTH, d.width); + dev.writeAttr(SUMO_ATTR_HEIGHT, d.height); + dev.writeAttr("altitude", d.altitude); + dev.writeAttr("rotation", d.rot); + dev.writeAttr("tilt", d.tilt); + dev.writeAttr("roll", d.roll); + dev.writeAttr(SUMO_ATTR_LAYER, d.layer); + dev.closeTag(); } } @@ -1029,19 +1140,26 @@ long GUIDialog_ViewSettings::onCmdExportSetting(FXObject*, FXSelector, void* /*data*/) { - FXFileDialog opendialog(this, "Export view settings"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); - opendialog.setSelectMode(SELECTFILE_ANY); - opendialog.setPatternList("*.xml"); - if (gCurrentFolder.length() != 0) { - opendialog.setDirectory(gCurrentFolder); - } - if (!opendialog.execute() || !MFXUtils::userPermitsOverwritingWhenFileExists(this, opendialog.getFilename())) { + FXString file = MFXUtils::getFilename2Write(this, "Export view settings", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder); + if (file == "") { return 1; } try { - OutputDevice& dev = OutputDevice::getDevice(opendialog.getFilename().text()); + OutputDevice& dev = OutputDevice::getDevice(file.text()); + dev.openTag(SUMO_TAG_VIEWSETTINGS); mySettings->save(dev); + if (mySaveViewPort->getCheck()) { + myParent->getViewportEditor()->writeXML(dev); + } + if (mySaveDelay->getCheck()) { + dev.openTag(SUMO_TAG_DELAY); + dev.writeAttr(SUMO_ATTR_VALUE, myParent->getDelay()); + dev.closeTag(); + } + if (mySaveDecals->getCheck()) { + saveDecals(dev); + } + dev.closeTag(); dev.close(); } catch (IOError& e) { FXMessageBox::error(this, MBOX_OK, "Storing failed!", "%s", e.what()); @@ -1053,8 +1171,9 @@ long GUIDialog_ViewSettings::onUpdExportSetting(FXObject* sender, FXSelector, void* ptr) { sender->handle(this, - mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings() - ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), + (mySchemeName->getCurrentItem() < (int) gSchemeStorage.getNumInitialSettings() + && !mySaveViewPort->getCheck() && !mySaveDelay->getCheck() && !mySaveDecals->getCheck()) ? + FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), ptr); return 1; } @@ -1096,17 +1215,19 @@ long GUIDialog_ViewSettings::onCmdSaveDecals(FXObject*, FXSelector, void* /*data*/) { - FXFileDialog opendialog(this, "Save Decals"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); - opendialog.setSelectMode(SELECTFILE_ANY); - opendialog.setPatternList("*.xml"); - if (gCurrentFolder.length() != 0) { - opendialog.setDirectory(gCurrentFolder); - } - if (!opendialog.execute() || !MFXUtils::userPermitsOverwritingWhenFileExists(this, opendialog.getFilename())) { + FXString file = MFXUtils::getFilename2Write(this, "Save Decals", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder); + if (file == "") { return 1; } - saveDecals(opendialog.getFilename().text()); + try { + OutputDevice& dev = OutputDevice::getDevice(file.text()); + dev.openTag("decals"); + saveDecals(dev); + dev.closeTag(); + dev.close(); + } catch (IOError& e) { + FXMessageBox::error(myParent, MBOX_OK, "Storing failed!", "%s", e.what()); + } return 1; } @@ -1220,6 +1341,64 @@ } +FXMatrix* +GUIDialog_ViewSettings::rebuildScaleMatrix(FXVerticalFrame* frame, + std::vector& scales, + std::vector& thresholds, + std::vector& buttons, + FXCheckButton* interpolation, + GUIScaleScheme& scheme) { + MFXUtils::deleteChildren(frame); + FXMatrix* m = new FXMatrix(frame, 3, + LAYOUT_FILL_X | MATRIX_BY_COLUMNS, + 0, 0, 0, 0, 10, 10, 0, 0, 5, 3); + scales.clear(); + thresholds.clear(); + buttons.clear(); + const bool fixed = scheme.isFixed(); + std::vector::const_iterator scaleIt = scheme.getColors().begin(); + std::vector::const_iterator threshIt = scheme.getThresholds().begin(); + std::vector::const_iterator nameIt = scheme.getNames().begin(); + FX::FXString buttonText = "Add"; + while (scaleIt != scheme.getColors().end()) { + FXRealSpinDial* scaleDialer = new FXRealSpinDial(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMAX); + scaleDialer->setValue(*scaleIt); + scales.push_back(scaleDialer); + if (fixed) { + new FXLabel(m, nameIt->c_str()); + new FXLabel(m, ""); + } else { + const int dialerOptions = scheme.allowsNegativeValues() ? SPINDIAL_NOMIN : 0; + FXRealSpinDial* threshDialer = new FXRealSpinDial(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK | SPINDIAL_NOMAX | dialerOptions); + threshDialer->setValue(*threshIt); + thresholds.push_back(threshDialer); + buttons.push_back(new FXButton(m, buttonText, NULL, this, MID_SIMPLE_VIEW_COLORCHANGE, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 20, 20, 4, 4)); + buttonText = "Remove"; + } + scaleIt++; + threshIt++; + nameIt++; + } + interpolation->setCheck(scheme.isInterpolated()); + if (fixed) { + interpolation->disable(); + } else { + if (scales.size() > 1) { + interpolation->enable(); + if (interpolation->getCheck() != FALSE) { + thresholds.front()->enable(); + } else { + thresholds.front()->disable(); + } + } else { + interpolation->disable(); + thresholds.front()->disable(); + } + } + return m; +} + + void GUIDialog_ViewSettings::rebuildColorMatrices(bool doCreate) { // decals @@ -1244,21 +1423,35 @@ m->create(); } myLaneColorSettingFrame->getParent()->recalc(); + + m = rebuildScaleMatrix(myLaneScaleSettingFrame, myLaneScales, myLaneScaleThresholds, myLaneScaleButtons, myLaneScaleInterpolation, mySettings->getLaneEdgeScaleScheme()); + if (doCreate) { + m->create(); + } + myLaneScaleSettingFrame->getParent()->recalc(); + m = rebuildColorMatrix(myVehicleColorSettingFrame, myVehicleColors, myVehicleThresholds, myVehicleButtons, myVehicleColorInterpolation, mySettings->vehicleColorer.getScheme()); if (doCreate) { m->create(); } - myPersonColorSettingFrame->getParent()->recalc(); + myVehicleColorSettingFrame->getParent()->recalc(); + m = rebuildColorMatrix(myPersonColorSettingFrame, myPersonColors, myPersonThresholds, myPersonButtons, myPersonColorInterpolation, mySettings->personColorer.getScheme()); if (doCreate) { m->create(); } myPersonColorSettingFrame->getParent()->recalc(); + m = rebuildColorMatrix(myContainerColorSettingFrame, myContainerColors, myContainerThresholds, myContainerButtons, myContainerColorInterpolation, mySettings->containerColorer.getScheme()); + if (doCreate) { + m->create(); + } + myContainerColorSettingFrame->getParent()->recalc(); m = rebuildColorMatrix(myJunctionColorSettingFrame, myJunctionColors, myJunctionThresholds, myJunctionButtons, myJunctionColorInterpolation, mySettings->junctionColorer.getScheme()); if (doCreate) { m->create(); } myJunctionColorSettingFrame->getParent()->recalc(); + layout(); update(); } @@ -1405,6 +1598,7 @@ 0, 0, 100, 0, 0, 0, 0, 0); } + GUIVisualizationTextSettings GUIDialog_ViewSettings::NamePanel::getSettings() { return GUIVisualizationTextSettings(myCheck->getCheck() != FALSE, @@ -1418,5 +1612,53 @@ mySizeDial->setValue(settings.size); myColorWell->setRGBA(MFXUtils::getFXColor(settings.color)); } + + +GUIDialog_ViewSettings::SizePanel::SizePanel( + FXMatrix* parent, + GUIDialog_ViewSettings* target, + const GUIVisualizationSizeSettings& settings) { + myCheck = new FXCheckButton(parent, "Draw with constant size when zoomed out", target, MID_SIMPLE_VIEW_COLORCHANGE, LAYOUT_CENTER_Y | CHECKBUTTON_NORMAL); + myCheck->setCheck(settings.constantSize); + new FXLabel(parent, ""); + FXMatrix* m1 = new FXMatrix(parent, 2, LAYOUT_FILL_X | LAYOUT_BOTTOM | LAYOUT_LEFT | MATRIX_BY_COLUMNS, + 0, 0, 0, 0, 10, 10, 0, 0, 5, 5); + new FXLabel(m1, "Minimum Size", 0, LAYOUT_CENTER_Y); + myMinSizeDial = new FXRealSpinDial(m1, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, + LAYOUT_CENTER_Y | LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); + myMinSizeDial->setValue(settings.minSize); + 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); + new FXLabel(m2, "Exaggerate by", 0, LAYOUT_CENTER_Y); + myExaggerateDial = new FXRealSpinDial(m2, 10, target, MID_SIMPLE_VIEW_COLORCHANGE, + LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); + myExaggerateDial->setRange(0, 10000); + myExaggerateDial->setValue(settings.exaggeration); +} + + +GUIVisualizationSizeSettings +GUIDialog_ViewSettings::SizePanel::getSettings() { + return GUIVisualizationSizeSettings( + myMinSizeDial->getValue(), myExaggerateDial->getValue(), myCheck->getCheck() != FALSE); +} + + +void +GUIDialog_ViewSettings::SizePanel::update(const GUIVisualizationSizeSettings& settings) { + myCheck->setCheck(settings.constantSize); + myMinSizeDial->setValue(settings.minSize); + myExaggerateDial->setValue(settings.exaggeration); +} + + +void +GUIDialog_ViewSettings::saveWindowSize() { + getApp()->reg().writeIntEntry("VIEWSETTINGS", "x", getX()); + getApp()->reg().writeIntEntry("VIEWSETTINGS", "y", getY()); + getApp()->reg().writeIntEntry("VIEWSETTINGS", "width", getWidth()); + getApp()->reg().writeIntEntry("VIEWSETTINGS", "height", getHeight()); +} + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDialog_ViewSettings.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDialog_ViewSettings.h --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIDialog_ViewSettings.h 2014-05-05 22:02:31.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIDialog_ViewSettings.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Wed, 21. Dec 2005 -/// @version $Id: GUIDialog_ViewSettings.h 16290 2014-05-05 12:38:38Z namdre $ +/// @version $Id: GUIDialog_ViewSettings.h 18096 2015-03-17 09:50:59Z behrisch $ /// // The dialog to change the view (gui) settings. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -72,6 +72,19 @@ FXColorWell* myColorWell; }; + class SizePanel { + public: + SizePanel(FXMatrix* parent, GUIDialog_ViewSettings* target, + const GUIVisualizationSizeSettings& settings); + + GUIVisualizationSizeSettings getSettings(); + void update(const GUIVisualizationSizeSettings& settings); + + FXRealSpinDial* myMinSizeDial; + FXRealSpinDial* myExaggerateDial; + FXCheckButton* myCheck; + }; + /** @brief Constructor * @param[in] parent The view to report changed settings to * @param[in, out] settings The current settings that can be changed @@ -163,8 +176,14 @@ std::vector::const_iterator buttonIt, GUIColorScheme& scheme); - /** @brief Rebuilds color changing dialogs after choosing another coloring scheme - * @param[in] doCreate Whether "create" shall be called (only if built the first time) + bool updateScaleRanges(FXObject* sender, std::vector::const_iterator colIt, + std::vector::const_iterator colEnd, + std::vector::const_iterator threshIt, + std::vector::const_iterator threshEnd, + std::vector::const_iterator buttonIt, + GUIScaleScheme& scheme); + + /** @brief Rebuilds manipulators for the current coloring scheme */ FXMatrix* rebuildColorMatrix(FXVerticalFrame* frame, std::vector& colors, @@ -173,6 +192,15 @@ FXCheckButton* interpolation, GUIColorScheme& scheme); + /** @brief Rebuilds manipulators for the current scaling scheme + */ + FXMatrix* rebuildScaleMatrix(FXVerticalFrame* frame, + std::vector& scales, + std::vector& thresholds, + std::vector& buttons, + FXCheckButton* interpolation, + GUIScaleScheme& scheme); + /** @brief Rebuilds color changing dialogs after choosing another coloring scheme * @param[in] doCreate Whether "create" shall be called (only if built the first time) @@ -193,7 +221,7 @@ /** @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(OutputDevice& dev) const; /** @brief Loads decals from a file @@ -201,6 +229,8 @@ */ void loadDecals(const std::string& file); + /// @brief save window position and size to the registry + void saveWindowSize(); private: /// @brief The parent view (which settings are changed) @@ -228,6 +258,7 @@ FXVerticalFrame* myDecalsFrame; MFXAddEditTypedTable* myDecalsTable; + /// ... lane colorer FXComboBox* myLaneEdgeColorMode; FXVerticalFrame* myLaneColorSettingFrame; std::vector myLaneColors; @@ -235,6 +266,14 @@ std::vector myLaneButtons; FXCheckButton* myLaneColorInterpolation; + /// ... lane scaler + FXComboBox* myLaneEdgeScaleMode; + FXVerticalFrame* myLaneScaleSettingFrame; + std::vector myLaneScales; + std::vector myLaneScaleThresholds; + std::vector myLaneScaleButtons; + FXCheckButton* myLaneScaleInterpolation; + FXCheckButton* myShowLaneBorders, *myShowLaneDecals, *myShowRails, *myHideMacroConnectors; FXRealSpinDial* myLaneWidthUpscaleDialer; @@ -245,8 +284,7 @@ std::vector myVehicleThresholds; std::vector myVehicleButtons; FXCheckButton* myVehicleColorInterpolation; - FXRealSpinDial* myVehicleMinSizeDialer, *myVehicleUpscaleDialer; - FXCheckButton* myShowBlinker, *myShowMinGap; /* *myShowLaneChangePreference,*/ + FXCheckButton* myShowBlinker, *myShowMinGap, *myShowBTRange; /* *myShowLaneChangePreference,*/ FXComboBox* myPersonColorMode, *myPersonShapeDetail; FXVerticalFrame* myPersonColorSettingFrame; @@ -254,7 +292,14 @@ std::vector myPersonThresholds; std::vector myPersonButtons; FXCheckButton* myPersonColorInterpolation; - FXRealSpinDial* myPersonMinSizeDialer, *myPersonUpscaleDialer; + + FXComboBox* myContainerColorMode, *myContainerShapeDetail; + FXVerticalFrame* myContainerColorSettingFrame; + std::vector myContainerColors; + std::vector myContainerThresholds; + std::vector myContainerButtons; + FXCheckButton* myContainerColorInterpolation; + FXRealSpinDial* myContainerMinSizeDialer, *myContainerUpscaleDialer; FXComboBox* myJunctionColorMode; FXVerticalFrame* myJunctionColorSettingFrame; @@ -264,10 +309,6 @@ FXCheckButton* myJunctionColorInterpolation; FXCheckButton* myShowTLIndex, *myShowJunctionIndex; - FXRealSpinDial* myDetectorMinSizeDialer, *myDetectorUpscaleDialer; - FXRealSpinDial* myPOIMinSizeDialer, *myPOIUpscaleDialer; - FXRealSpinDial* myPolyMinSizeDialer, *myPolyUpscaleDialer; - FXCheckButton* myShowLane2Lane; FXCheckButton* myDrawJunctionShape; FXCheckButton* myAntialiase; @@ -276,8 +317,14 @@ NamePanel* myEdgeNamePanel, *myInternalEdgeNamePanel, *myCwaEdgeNamePanel, *myStreetNamePanel, *myJunctionNamePanel, *myInternalJunctionNamePanel, - *myVehicleNamePanel, *myPersonNamePanel, + *myVehicleNamePanel, *myPersonNamePanel, *myContainerNamePanel, *myAddNamePanel, *myPOINamePanel, *myPolyNamePanel; + + SizePanel* myVehicleSizePanel, *myPersonSizePanel, *myContainerSizePanel, *myPOISizePanel, *myPolySizePanel, *myAddSizePanel; + + + // load/save-menu + FXCheckButton* mySaveViewPort, *mySaveDelay, *mySaveDecals; /// @} diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIGlChildWindow.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIGlChildWindow.cpp --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIGlChildWindow.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIGlChildWindow.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 29.05.2005 -/// @version $Id: GUIGlChildWindow.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGlChildWindow.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIGlChildWindow.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIGlChildWindow.h --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIGlChildWindow.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIGlChildWindow.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: GUIGlChildWindow.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIGlChildWindow.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIMainWindow.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIMainWindow.cpp --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIMainWindow.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIMainWindow.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Tue, 29.05.2005 -/// @version $Id: GUIMainWindow.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIMainWindow.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -72,6 +72,7 @@ throw ProcessError("MainWindow initialized twice"); } myInstance = this; + //myGLVisual->setStencilSize(8); // enable stencil buffer } diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIMainWindow.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIMainWindow.h --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIMainWindow.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIMainWindow.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 29.04.2005 -/// @version $Id: GUIMainWindow.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIMainWindow.h 18095 2015-03-17 09:39:00Z behrisch $ /// // /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -85,6 +85,13 @@ static GUIMainWindow* getInstance(); + /** @brief Returns the delay (should be overwritten by subclasses if applicable) + * @return parsed delay in milliseconds + */ + virtual SUMOReal getDelay() const { + return 0; + } + protected: std::vector mySubWindows; std::vector myTrackerWindows; diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIPerspectiveChanger.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIPerspectiveChanger.cpp --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIPerspectiveChanger.cpp 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIPerspectiveChanger.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIPerspectiveChanger.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIPerspectiveChanger.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A class that allows to steer the visual output in dependence to user /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUIPerspectiveChanger.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIPerspectiveChanger.h --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUIPerspectiveChanger.h 2014-02-22 23:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUIPerspectiveChanger.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GUIPerspectiveChanger.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: GUIPerspectiveChanger.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A virtual class that allows to steer the visual output in dependence to /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUISUMOAbstractView.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUISUMOAbstractView.cpp --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUISUMOAbstractView.cpp 2014-03-21 23:02:07.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUISUMOAbstractView.cpp 2015-04-17 05:44:23.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Laura Bieker /// @author Andreas Gaubatz /// @date Sept 2002 -/// @version $Id: GUISUMOAbstractView.cpp 15990 2014-03-21 20:58:19Z behrisch $ +/// @version $Id: GUISUMOAbstractView.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // The base class for a view /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include @@ -284,6 +284,12 @@ if (type == GLO_POI || type == GLO_POLYGON) { layer = dynamic_cast(o)->getLayer(); } +#ifdef HAVE_INTERNAL + if (type == GLO_LANE && GUIVisualizationSettings::UseMesoSim) { + // do not select lanes in meso mode + continue; + } +#endif // check whether the current object is above a previous one if (layer > maxLayer) { idMax = id; @@ -338,16 +344,24 @@ applyGLTransform(false); // paint in select mode + myVisualizationSettings->drawForSelecting = true; int hits2 = doPaintGL(GL_SELECT, bound); + myVisualizationSettings->drawForSelecting = false; // Get the results nb_hits = glRenderMode(GL_RENDER); if (nb_hits == -1) { myApp->setStatusBarText("Selection in boundary failed. Try to select fewer than " + toString(hits2) + " items"); } std::vector result; + GLuint numNames; + GLuint* ptr = hits; for (int i = 0; i < nb_hits; ++i) { - assert(i * 4 + 3 < NB_HITS_MAX); - result.push_back(hits[i * 4 + 3]); + numNames = *ptr; + ptr += 3; + for (int j = 0; j < (int)numNames; j++) { + result.push_back(*ptr); + ptr++; + } } // switch viewport back to normal myChanger->setViewport(oldViewPort); @@ -494,7 +508,9 @@ if (o != 0 && dynamic_cast(o) != 0) { if (applyZoom && zoomDist < 0) { myChanger->setViewport(o->getCenteringBoundary()); + update(); // only update when centering onto an object once } else { + // called during tracking. update is triggered somewhere else myChanger->centerTo(o->getCenteringBoundary().getCenter(), zoomDist, applyZoom); } } @@ -641,11 +657,7 @@ if (myViewportChooser == 0 || !myViewportChooser->haveGrabbed()) { myChanger->onMouseMove(data); } - const SUMOReal xpos = myChanger->getXPos(); - const SUMOReal ypos = myChanger->getYPos(); - const SUMOReal zoom = myChanger->getZoom(); - if (myViewportChooser != 0 && - (xpos != myChanger->getXPos() || ypos != myChanger->getYPos() || zoom != myChanger->getZoom())) { + if (myViewportChooser != 0) { myViewportChooser->setValues(myChanger->getZoom(), myChanger->getXPos(), myChanger->getYPos()); } updatePositionInformation(); @@ -799,7 +811,7 @@ glGetIntegerv(GL_VIEWPORT, viewport); while (state == GL2PS_OVERFLOW) { buffsize += 1024 * 1024; - gl2psBeginPage(destFile.c_str(), "sumo-gui; http://sumo-sim.org", viewport, format, GL2PS_SIMPLE_SORT, + gl2psBeginPage(destFile.c_str(), "sumo-gui; http://sumo.dlr.de", viewport, format, GL2PS_SIMPLE_SORT, GL2PS_DRAW_BACKGROUND | GL2PS_USE_CURRENT_VIEWPORT, GL_RGBA, 0, NULL, 0, 0, 0, buffsize, fp, "out.eps"); glMatrixMode(GL_MODELVIEW); @@ -907,14 +919,21 @@ myVisualizationChanger->show(); } - -void -GUISUMOAbstractView::showViewportEditor() { +GUIDialog_EditViewport* +GUISUMOAbstractView::getViewportEditor() { if (myViewportChooser == 0) { myViewportChooser = new GUIDialog_EditViewport(this, "Edit Viewport...", 0, 0); myViewportChooser->create(); } + myViewportChooser->setValues(myChanger->getZoom(), myChanger->getXPos(), myChanger->getYPos()); + return myViewportChooser; +} + + +void +GUISUMOAbstractView::showViewportEditor() { + getViewportEditor(); // make sure it exists; Position p(myChanger->getXPos(), myChanger->getYPos(), myChanger->getZoom()); myViewportChooser->setOldValues(p, Position::INVALID); myViewportChooser->show(); @@ -1121,5 +1140,11 @@ glTranslated(-bound.xmin(), -bound.ymin(), 0); } + +SUMOReal +GUISUMOAbstractView::getDelay() const { + return myApp->getDelay(); +} + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/GUISUMOAbstractView.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUISUMOAbstractView.h --- sumo-0.21.0+dfsg/src/utils/gui/windows/GUISUMOAbstractView.h 2014-02-26 23:02:08.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/GUISUMOAbstractView.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Andreas Gaubatz /// @date Sept 2002 -/// @version $Id: GUISUMOAbstractView.h 15748 2014-02-26 11:52:24Z namdre $ +/// @version $Id: GUISUMOAbstractView.h 18096 2015-03-17 09:50:59Z behrisch $ /// // The base class for a view /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -189,8 +189,11 @@ /// @} + /// @brief get the viewport and create it on first access + GUIDialog_EditViewport* getViewportEditor(); virtual void showViewportEditor(); + void showViewschemeEditor(); void showToolTips(bool val); virtual bool setColorScheme(const std::string&) { @@ -306,6 +309,10 @@ return myVisualizationSettings; } + /** @brief Returns the delay of the parent application + * @return delay in milliseconds + */ + SUMOReal getDelay() const; protected: /// performs the painting of the simulation diff -Nru sumo-0.21.0+dfsg/src/utils/gui/windows/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/Makefile.in --- sumo-0.21.0+dfsg/src/utils/gui/windows/Makefile.in 2014-06-11 22:03:58.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/gui/windows/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -225,6 +225,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -235,7 +237,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/utils/importio/LineHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/importio/LineHandler.h --- sumo-0.21.0+dfsg/src/utils/importio/LineHandler.h 2014-02-22 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/importio/LineHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 19 Jul 2002 -/// @version $Id: LineHandler.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: LineHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Interface definition for a class which retrieves lines from a LineHandler /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/importio/LineReader.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/importio/LineReader.cpp --- sumo-0.21.0+dfsg/src/utils/importio/LineReader.cpp 2014-02-22 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/importio/LineReader.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Laura Bieker /// @author Michael Behrisch /// @date Fri, 19 Jul 2002 -/// @version $Id: LineReader.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: LineReader.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Retrieves a file linewise and reports the lines to a handler. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/importio/LineReader.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/importio/LineReader.h --- sumo-0.21.0+dfsg/src/utils/importio/LineReader.h 2014-02-22 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/importio/LineReader.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 19 Jul 2002 -/// @version $Id: LineReader.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: LineReader.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Retrieves a file linewise and reports the lines to a handler. /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/importio/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/importio/Makefile.in --- sumo-0.21.0+dfsg/src/utils/importio/Makefile.in 2014-06-11 22:03:58.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/importio/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -221,6 +221,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -231,7 +233,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/utils/importio/NamedColumnsParser.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/importio/NamedColumnsParser.cpp --- sumo-0.21.0+dfsg/src/utils/importio/NamedColumnsParser.cpp 2014-02-22 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/importio/NamedColumnsParser.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 19 Jul 2002 -/// @version $Id: NamedColumnsParser.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NamedColumnsParser.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A parser to retrieve information from a table with known column /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/importio/NamedColumnsParser.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/importio/NamedColumnsParser.h --- sumo-0.21.0+dfsg/src/utils/importio/NamedColumnsParser.h 2014-02-22 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/importio/NamedColumnsParser.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Fri, 19 Jul 2002 -/// @version $Id: NamedColumnsParser.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: NamedColumnsParser.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A parser to retrieve information from a table with known columns /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/BinaryFormatter.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/BinaryFormatter.cpp --- sumo-0.21.0+dfsg/src/utils/iodevices/BinaryFormatter.cpp 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/BinaryFormatter.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2012 -/// @version $Id: BinaryFormatter.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: BinaryFormatter.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Static storage of an output device and its base (abstract) implementation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -55,6 +55,19 @@ void +BinaryFormatter::writeStaticHeader(std::ostream& into) { + 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()); +} + + +void BinaryFormatter::writeStringList(std::ostream& into, const std::vector& list) { FileHelpers::writeByte(into, BF_LIST); FileHelpers::writeInt(into, (int)list.size()); @@ -64,6 +77,7 @@ } } + bool BinaryFormatter::writeXMLHeader(std::ostream& into, const std::string& rootElement, diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/BinaryFormatter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/BinaryFormatter.h --- sumo-0.21.0+dfsg/src/utils/iodevices/BinaryFormatter.h 2014-03-27 23:02:10.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/BinaryFormatter.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2012 -/// @version $Id: BinaryFormatter.h 16071 2014-03-27 14:55:11Z namdre $ +/// @version $Id: BinaryFormatter.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Output formatter for plain XML output /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -32,10 +32,6 @@ #include #endif -#ifdef HAVE_VERSION_H -#include -#endif - #include #include #include @@ -231,6 +227,15 @@ } + /** @brief writes the part of the header which is always unchanged. + * + * This method exists only to reduce include dependencies of BinaryFormatter.h (which promote to OutputDevice.h, ...) + * + * @param[in] into The output stream to use + */ + static void writeStaticHeader(std::ostream& into); + + /** @brief writes a list of strings * * @param[in] into The output stream to use @@ -258,15 +263,7 @@ 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()); - + writeStaticHeader(into); const unsigned int numEdges = (const unsigned int)E::dictSize(); FileHelpers::writeByte(into, BF_LIST); FileHelpers::writeInt(into, numEdges); @@ -279,10 +276,10 @@ 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::writeInt(into, e->getNumSuccessors()); + for (unsigned int j = 0; j < e->getNumSuccessors(); j++) { FileHelpers::writeByte(into, BF_INTEGER); - FileHelpers::writeInt(into, e->getFollower(j)->getNumericalID()); + FileHelpers::writeInt(into, e->getSuccessors()[j]->getNumericalID()); } } openTag(into, rootElement); diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/BinaryInputDevice.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/BinaryInputDevice.cpp --- sumo-0.21.0+dfsg/src/utils/iodevices/BinaryInputDevice.cpp 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/BinaryInputDevice.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2005-09-15 -/// @version $Id: BinaryInputDevice.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: BinaryInputDevice.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Encapsulates binary reading operations on a file /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/BinaryInputDevice.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/BinaryInputDevice.h --- sumo-0.21.0+dfsg/src/utils/iodevices/BinaryInputDevice.h 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/BinaryInputDevice.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2005-09-15 -/// @version $Id: BinaryInputDevice.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: BinaryInputDevice.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Encapsulates binary reading operations on a file /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/Makefile.in --- sumo-0.21.0+dfsg/src/utils/iodevices/Makefile.in 2014-06-11 22:03:58.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -224,6 +224,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -234,7 +236,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_CERR.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_CERR.cpp --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_CERR.cpp 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_CERR.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004 -/// @version $Id: OutputDevice_CERR.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: OutputDevice_CERR.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An output device that encapsulates cout /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_CERR.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_CERR.h --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_CERR.h 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_CERR.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004 -/// @version $Id: OutputDevice_CERR.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: OutputDevice_CERR.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An output device that encapsulates cerr /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_COUT.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_COUT.cpp --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_COUT.cpp 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_COUT.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004 -/// @version $Id: OutputDevice_COUT.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: OutputDevice_COUT.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An output device that encapsulates cout /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_COUT.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_COUT.h --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_COUT.h 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_COUT.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004 -/// @version $Id: OutputDevice_COUT.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: OutputDevice_COUT.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An output device that encapsulates cout /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice.cpp --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice.cpp 2014-04-04 22:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 2004 -/// @version $Id: OutputDevice.cpp 16118 2014-04-04 09:27:44Z behrisch $ +/// @version $Id: OutputDevice.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Static storage of an output device and its base (abstract) implementation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -86,7 +86,20 @@ } } else { const size_t len = name.length(); - dev = new OutputDevice_File(name, len > 4 && name.substr(len - 4) == ".sbx"); + std::string name2 = name; + if (OptionsCont::getOptions().isSet("output-prefix")) { + std::string prefix = OptionsCont::getOptions().getString("output-prefix"); + size_t metaTimeIndex = prefix.find("TIME"); + if (metaTimeIndex != std::string::npos) { + time_t rawtime; + char buffer [80]; + time(&rawtime); + strftime(buffer, 80, "%F-%H-%M-%S", localtime(&rawtime)); + prefix.replace(metaTimeIndex, 4, std::string(buffer)); + } + name2 = FileHelpers::prependToLastPathComponent(prefix, name); + } + dev = new OutputDevice_File(name2, len > 4 && name.substr(len - 4) == ".sbx"); } dev->setPrecision(); dev->getOStream() << std::setiosflags(std::ios::fixed); @@ -105,7 +118,7 @@ OutputDevice& dev = OutputDevice::getDevice(OptionsCont::getOptions().getString(optionName)); if (rootElement != "") { if (schemaFile != "") { - dev.writeXMLHeader(rootElement, "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/" + schemaFile + "\""); + dev.writeXMLHeader(rootElement, "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.dlr.de/xsd/" + schemaFile + "\""); } else { dev.writeXMLHeader(rootElement); } diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_File.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_File.cpp --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_File.cpp 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_File.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2004 -/// @version $Id: OutputDevice_File.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: OutputDevice_File.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An output device that encapsulates an ofstream /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_File.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_File.h --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_File.h 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_File.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2004 -/// @version $Id: OutputDevice_File.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: OutputDevice_File.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An output device that encapsulates an ofstream /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice.h --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice.h 2014-03-27 23:02:10.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Mario Krumnow /// @date 2004 -/// @version $Id: OutputDevice.h 16071 2014-03-27 14:55:11Z namdre $ +/// @version $Id: OutputDevice.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Static storage of an output device and its base (abstract) implementation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_Network.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_Network.cpp --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_Network.cpp 2014-04-04 22:02:26.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_Network.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Felix Brack /// @date 2006 -/// @version $Id: OutputDevice_Network.cpp 16118 2014-04-04 09:27:44Z behrisch $ +/// @version $Id: OutputDevice_Network.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An output device for TCP/IP Network connections /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -30,6 +30,11 @@ #include #endif // #ifdef _MSC_VER +#ifdef WIN32 +#include +#else +#include +#endif #include #include "OutputDevice_Network.h" #include "foreign/tcpip/socket.h" @@ -46,10 +51,20 @@ OutputDevice_Network::OutputDevice_Network(const std::string& host, const int port) { mySocket = new tcpip::Socket(host, port); - try { - mySocket->connect(); - } catch (tcpip::SocketException& e) { - throw IOError(toString(e.what()) + " (host: " + host + ", port: " + toString(port) + ")"); + for (int wait = 1000; true; wait += 1000) { + try { + mySocket->connect(); + break; + } catch (tcpip::SocketException& e) { + if (wait == 9000) { + throw IOError(toString(e.what()) + " (host: " + host + ", port: " + toString(port) + ")"); + } +#ifdef WIN32 + Sleep(wait); +#else + usleep(wait * 1000); +#endif + } } } diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_Network.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_Network.h --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_Network.h 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_Network.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Daniel Krajzewicz /// @author Felix Brack /// @date 2006 -/// @version $Id: OutputDevice_Network.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: OutputDevice_Network.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An output device for TCP/IP Network connections /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2006-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_String.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_String.cpp --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_String.cpp 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_String.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file OutputDevice_String.cpp /// @author Michael Behrisch /// @date 2009 -/// @version $Id: OutputDevice_String.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: OutputDevice_String.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An output device that encapsulates a stringstream /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_String.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_String.h --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputDevice_String.h 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputDevice_String.h 2015-04-17 05:44:20.000000000 +0000 @@ -2,12 +2,12 @@ /// @file OutputDevice_String.h /// @author Michael Behrisch /// @date 2009 -/// @version $Id: OutputDevice_String.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: OutputDevice_String.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An output device that encapsulates a stringstream /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/OutputFormatter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputFormatter.h --- sumo-0.21.0+dfsg/src/utils/iodevices/OutputFormatter.h 2014-03-27 23:02:10.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/OutputFormatter.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2012 -/// @version $Id: OutputFormatter.h 16071 2014-03-27 14:55:11Z namdre $ +/// @version $Id: OutputFormatter.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Abstract base class for output formatters /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/PlainXMLFormatter.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/PlainXMLFormatter.cpp --- sumo-0.21.0+dfsg/src/utils/iodevices/PlainXMLFormatter.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/PlainXMLFormatter.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2012 -/// @version $Id: PlainXMLFormatter.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: PlainXMLFormatter.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Static storage of an output device and its base (abstract) implementation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/iodevices/PlainXMLFormatter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/PlainXMLFormatter.h --- sumo-0.21.0+dfsg/src/utils/iodevices/PlainXMLFormatter.h 2014-03-27 23:02:10.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/iodevices/PlainXMLFormatter.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date 2012 -/// @version $Id: PlainXMLFormatter.h 16071 2014-03-27 14:55:11Z namdre $ +/// @version $Id: PlainXMLFormatter.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Output formatter for plain XML output /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/Makefile.am --- sumo-0.21.0+dfsg/src/utils/Makefile.am 2014-02-24 23:02:20.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -8,4 +8,4 @@ SUBDIRS = common distribution emissions \ geom importio iodevices options shapes \ -xml $(GUI_DIRS) $(TRACI_DIRS) +vehicle xml $(GUI_DIRS) $(TRACI_DIRS) diff -Nru sumo-0.21.0+dfsg/src/utils/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/Makefile.in --- sumo-0.21.0+dfsg/src/utils/Makefile.in 2014-06-11 22:03:57.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -143,7 +143,7 @@ ETAGS = etags CTAGS = ctags DIST_SUBDIRS = common distribution emissions geom importio iodevices \ - options shapes xml foxtools gui traci + options shapes vehicle xml foxtools gui traci DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -207,6 +207,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -217,7 +219,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -315,7 +316,7 @@ @TRACI_TRUE@TRACI_DIRS = traci SUBDIRS = common distribution emissions \ geom importio iodevices options shapes \ -xml $(GUI_DIRS) $(TRACI_DIRS) +vehicle xml $(GUI_DIRS) $(TRACI_DIRS) all: all-recursive diff -Nru sumo-0.21.0+dfsg/src/utils/options/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/Makefile.in --- sumo-0.21.0+dfsg/src/utils/options/Makefile.in 2014-06-11 22:03:58.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -222,6 +222,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -232,7 +234,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/utils/options/Option.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/Option.cpp --- sumo-0.21.0+dfsg/src/utils/options/Option.cpp 2014-02-22 23:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/Option.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: Option.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: Option.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A class representing a single program option /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/options/Option.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/Option.h --- sumo-0.21.0+dfsg/src/utils/options/Option.h 2014-03-24 23:02:13.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/Option.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Mon, 17 Dec 2001 -/// @version $Id: Option.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: Option.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Classes representing a single program option (with different types) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/options/OptionsCont.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsCont.cpp --- sumo-0.21.0+dfsg/src/utils/options/OptionsCont.cpp 2014-04-29 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsCont.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsCont.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: OptionsCont.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A storage for options (typed value containers) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -71,7 +71,7 @@ OptionsCont::OptionsCont() : myAddresses(), myValues(), myDeprecatedSynonymes(), myHaveInformedAboutDeprecatedDivider(false) { - myCopyrightNotices.push_back("Copyright (C) 2001-2014 DLR and contributors; http://sumo-sim.org"); + myCopyrightNotices.push_back("Copyright (C) 2001-2015 DLR and contributors; http://sumo.dlr.de"); } @@ -318,7 +318,9 @@ } conv += tmp; } - (*i)->set(conv); + if (conv != (*i)->getString()) { + (*i)->set(conv); + } } } } @@ -713,8 +715,8 @@ } } os << std::endl; - os << "Report bugs at ." << std::endl; - os << "Get in contact via ." << std::endl; + os << "Report bugs at ." << std::endl; + os << "Get in contact via ." << std::endl; } @@ -722,7 +724,7 @@ OptionsCont::writeConfiguration(std::ostream& os, bool filled, bool complete, bool addComments) const { os << "\n\n"; - os << "" << std::endl << std::endl; + os << "" << std::endl << std::endl; for (std::vector::const_iterator i = mySubTopics.begin(); i != mySubTopics.end(); ++i) { std::string subtopic = *i; if (subtopic == "Configuration" && !complete) { diff -Nru sumo-0.21.0+dfsg/src/utils/options/OptionsCont.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsCont.h --- sumo-0.21.0+dfsg/src/utils/options/OptionsCont.h 2014-02-22 23:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsCont.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsCont.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: OptionsCont.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A storage for options (typed value containers) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -103,7 +103,7 @@ * done using addDescription(, , ). * @see addDescription * - * @see http://sumo-sim.org/wiki/index.php/OptionsSubSystem + * @see http://sumo.dlr.de/wiki/index.php/OptionsSubSystem */ class OptionsCont { public: diff -Nru sumo-0.21.0+dfsg/src/utils/options/OptionsIO.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsIO.cpp --- sumo-0.21.0+dfsg/src/utils/options/OptionsIO.cpp 2014-04-29 22:02:44.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsIO.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsIO.cpp 16275 2014-04-29 11:43:40Z behrisch $ +/// @version $Id: OptionsIO.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Helper for parsing command line arguments and reading configuration files /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/options/OptionsIO.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsIO.h --- sumo-0.21.0+dfsg/src/utils/options/OptionsIO.h 2014-02-22 23:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsIO.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsIO.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: OptionsIO.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Helper for parsing command line arguments and reading configuration files /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/options/OptionsLoader.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsLoader.cpp --- sumo-0.21.0+dfsg/src/utils/options/OptionsLoader.cpp 2014-02-22 23:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsLoader.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsLoader.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: OptionsLoader.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A SAX-Handler for loading options /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/options/OptionsLoader.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsLoader.h --- sumo-0.21.0+dfsg/src/utils/options/OptionsLoader.h 2014-02-22 23:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsLoader.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsLoader.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: OptionsLoader.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A SAX-Handler for loading options /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/options/OptionsParser.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsParser.cpp --- sumo-0.21.0+dfsg/src/utils/options/OptionsParser.cpp 2014-02-22 23:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsParser.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsParser.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: OptionsParser.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Parses the command line arguments /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/options/OptionsParser.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsParser.h --- sumo-0.21.0+dfsg/src/utils/options/OptionsParser.h 2014-02-22 23:02:34.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/options/OptionsParser.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 17 Dec 2001 -/// @version $Id: OptionsParser.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: OptionsParser.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Parses command line arguments /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/shapes/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/Makefile.am --- sumo-0.21.0+dfsg/src/utils/shapes/Makefile.am 2013-05-03 20:25:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -3,4 +3,5 @@ libshapes_a_SOURCES = PointOfInterest.h \ Shape.cpp Shape.h \ Polygon.cpp Polygon.h \ +ShapeHandler.cpp ShapeHandler.h \ ShapeContainer.cpp ShapeContainer.h diff -Nru sumo-0.21.0+dfsg/src/utils/shapes/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/Makefile.in --- sumo-0.21.0+dfsg/src/utils/shapes/Makefile.in 2014-06-11 22:03:58.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -99,7 +99,7 @@ libshapes_a_AR = $(AR) $(ARFLAGS) libshapes_a_LIBADD = am_libshapes_a_OBJECTS = Shape.$(OBJEXT) Polygon.$(OBJEXT) \ - ShapeContainer.$(OBJEXT) + ShapeHandler.$(OBJEXT) ShapeContainer.$(OBJEXT) libshapes_a_OBJECTS = $(am_libshapes_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -221,6 +221,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -231,7 +233,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -329,6 +330,7 @@ libshapes_a_SOURCES = PointOfInterest.h \ Shape.cpp Shape.h \ Polygon.cpp Polygon.h \ +ShapeHandler.cpp ShapeHandler.h \ ShapeContainer.cpp ShapeContainer.h all: all-am @@ -383,6 +385,7 @@ @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@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShapeHandler.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff -Nru sumo-0.21.0+dfsg/src/utils/shapes/PointOfInterest.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/PointOfInterest.h --- sumo-0.21.0+dfsg/src/utils/shapes/PointOfInterest.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/PointOfInterest.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Melanie Knocke /// @date 2005-09-15 -/// @version $Id: PointOfInterest.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: PointOfInterest.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A point-of-interest (2D) /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/shapes/Polygon.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/Polygon.cpp --- sumo-0.21.0+dfsg/src/utils/shapes/Polygon.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/Polygon.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Jun 2004 -/// @version $Id: Polygon.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: Polygon.cpp 18137 2015-03-24 15:12:38Z behrisch $ /// // A 2D-polygon /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -30,6 +30,9 @@ #include #endif +#include +#include +#include #include "Polygon.h" using namespace SUMO; @@ -53,6 +56,36 @@ Polygon::~Polygon() {} +void +Polygon::writeXML(OutputDevice& out, bool geo) { + out.openTag(SUMO_TAG_POLY); + out.writeAttr(SUMO_ATTR_ID, StringUtils::escapeXML(getID())); + out.writeAttr(SUMO_ATTR_TYPE, StringUtils::escapeXML(getType())); + out.writeAttr(SUMO_ATTR_COLOR, getColor()); + out.writeAttr(SUMO_ATTR_FILL, getFill()); + out.writeAttr(SUMO_ATTR_LAYER, getLayer()); + PositionVector shape = getShape(); + if (geo) { + out.writeAttr(SUMO_ATTR_GEO, true); + for (int i = 0; i < (int) shape.size(); i++) { + GeoConvHelper::getFinal().cartesian2geo(shape[i]); + } + } + out.writeAttr(SUMO_ATTR_SHAPE, shape); + if (getAngle() != Shape::DEFAULT_ANGLE) { + out.writeAttr(SUMO_ATTR_ANGLE, getAngle()); + } + if (getImgFile() != Shape::DEFAULT_IMG_FILE) { + out.writeAttr(SUMO_ATTR_IMGFILE, getImgFile()); + } + for (std::map::const_iterator j = getMap().begin(); j != getMap().end(); ++j) { + out.openTag(SUMO_TAG_PARAM); + out.writeAttr(SUMO_ATTR_KEY, (*j).first); + out.writeAttr(SUMO_ATTR_VALUE, (*j).second); + out.closeTag(); + } + out.closeTag(); +} /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/shapes/Polygon.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/Polygon.h --- sumo-0.21.0+dfsg/src/utils/shapes/Polygon.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/Polygon.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Melanie Knocke /// @date Jun 2004 -/// @version $Id: Polygon.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: Polygon.h 18096 2015-03-17 09:50:59Z behrisch $ /// // A 2D- or 3D-polygon /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2004-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2004-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -37,6 +37,8 @@ #include #include "Shape.h" +class OutputDevice; + // we need to put this into a namespace to avoid clashing with wingdi.h::Polygon function namespace SUMO { @@ -111,6 +113,10 @@ } /// @} + /* @brief polygon definition to the given device + * @param[in] geo Whether to write the output in geo-coordinates + */ + void writeXML(OutputDevice& out, bool geo = false); protected: /// @brief The positions of the polygon diff -Nru sumo-0.21.0+dfsg/src/utils/shapes/ShapeContainer.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/ShapeContainer.cpp --- sumo-0.21.0+dfsg/src/utils/shapes/ShapeContainer.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/ShapeContainer.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Sept 2002 -/// @version $Id: ShapeContainer.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: ShapeContainer.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Storage for geometrical objects, sorted by the layers they are in /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/shapes/ShapeContainer.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/ShapeContainer.h --- sumo-0.21.0+dfsg/src/utils/shapes/ShapeContainer.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/ShapeContainer.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date 2005-09-15 -/// @version $Id: ShapeContainer.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: ShapeContainer.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Storage for geometrical objects, sorted by the layers they are in /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2005-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -62,7 +62,7 @@ /// @brief Destructor virtual ~ShapeContainer(); - typedef NamedObjectCont Polygons; + typedef NamedObjectCont< SUMO::Polygon* > Polygons; typedef NamedObjectCont< PointOfInterest*> POIs; /** @brief Builds a polygon using the given values and adds it to the container diff -Nru sumo-0.21.0+dfsg/src/utils/shapes/Shape.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/Shape.cpp --- sumo-0.21.0+dfsg/src/utils/shapes/Shape.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/Shape.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Oct 2012 -/// @version $Id: Shape.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: Shape.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A 2D- or 3D-Shape /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/shapes/Shape.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/Shape.h --- sumo-0.21.0+dfsg/src/utils/shapes/Shape.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/Shape.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Oct 2012 -/// @version $Id: Shape.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: Shape.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A 2D- or 3D-Shape /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/shapes/ShapeHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/ShapeHandler.cpp --- sumo-0.21.0+dfsg/src/utils/shapes/ShapeHandler.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/ShapeHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,175 @@ + +/****************************************************************************/ +/// @file ShapeHandler.cpp +/// @author Jakob Erdmann +/// @date Feb 2015 +/// @version $Id: ShapeHandler.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// The XML-Handler for network loading +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "Shape.h" +#include "ShapeContainer.h" +#include "ShapeHandler.h" + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// method definitions +// =========================================================================== +ShapeHandler::ShapeHandler(const std::string& file, ShapeContainer& sc) : + SUMOSAXHandler(file), + myShapeContainer(sc) {} + + +ShapeHandler::~ShapeHandler() {} + + +void +ShapeHandler::myStartElement(int element, + const SUMOSAXAttributes& attrs) { + try { + switch (element) { + case SUMO_TAG_POLY: + addPoly(attrs); + break; + case SUMO_TAG_POI: + addPOI(attrs); + break; + default: + break; + } + } catch (InvalidArgument& e) { + WRITE_ERROR(e.what()); + } +} + + + +void +ShapeHandler::addPOI(const SUMOSAXAttributes& attrs) { + bool ok = true; + const SUMOReal INVALID_POSITION(-1000000); + std::string id = attrs.get(SUMO_ATTR_ID, 0, ok); + SUMOReal x = attrs.getOpt(SUMO_ATTR_X, id.c_str(), ok, INVALID_POSITION); + SUMOReal y = attrs.getOpt(SUMO_ATTR_Y, id.c_str(), ok, INVALID_POSITION); + SUMOReal lon = attrs.getOpt(SUMO_ATTR_LON, id.c_str(), ok, INVALID_POSITION); + SUMOReal lat = attrs.getOpt(SUMO_ATTR_LAT, id.c_str(), ok, INVALID_POSITION); + SUMOReal lanePos = attrs.getOpt(SUMO_ATTR_POSITION, id.c_str(), ok, INVALID_POSITION); + SUMOReal layer = attrs.getOpt(SUMO_ATTR_LAYER, id.c_str(), ok, (SUMOReal)GLO_POI); + std::string type = attrs.getOpt(SUMO_ATTR_TYPE, id.c_str(), ok, ""); + std::string laneID = attrs.getOpt(SUMO_ATTR_LANE, id.c_str(), ok, ""); + RGBColor color = attrs.hasAttribute(SUMO_ATTR_COLOR) ? attrs.get(SUMO_ATTR_COLOR, id.c_str(), ok) : RGBColor::RED; + SUMOReal angle = attrs.getOpt(SUMO_ATTR_ANGLE, id.c_str(), ok, Shape::DEFAULT_ANGLE); + std::string imgFile = attrs.getOpt(SUMO_ATTR_IMGFILE, id.c_str(), ok, Shape::DEFAULT_IMG_FILE); + if (imgFile != "" && !FileHelpers::isAbsolute(imgFile)) { + imgFile = FileHelpers::getConfigurationRelative(getFileName(), imgFile); + } + SUMOReal width = attrs.getOpt(SUMO_ATTR_WIDTH, id.c_str(), ok, Shape::DEFAULT_IMG_WIDTH); + SUMOReal height = attrs.getOpt(SUMO_ATTR_HEIGHT, id.c_str(), ok, Shape::DEFAULT_IMG_HEIGHT); + if (!ok) { + return; + } + Position pos(x, y); + if (x == INVALID_POSITION || y == INVALID_POSITION) { + // try computing x,y from lane,pos + if (laneID != "") { + pos = getLanePos(id, laneID, lanePos); + } else { + // try computing x,y from lon,lat + if (lat == INVALID_POSITION || lon == INVALID_POSITION) { + WRITE_ERROR("Either (x,y), (lon,lat) or (lane,pos) must be specified for poi '" + id + "'."); + return; + } else if (!GeoConvHelper::getFinal().usingGeoProjection()) { + WRITE_ERROR("(lon, lat) is specified for poi '" + id + "' but no geo-conversion is specified for the network."); + return; + } + pos.set(lon, lat); + GeoConvHelper::getFinal().x2cartesian_const(pos); + } + } + if (!myShapeContainer.addPOI(id, type, color, layer, angle, imgFile, pos, width, height)) { + WRITE_ERROR("PoI '" + id + "' already exists."); + } +} + + +void +ShapeHandler::addPoly(const SUMOSAXAttributes& attrs) { + bool ok = true; + std::string id = attrs.get(SUMO_ATTR_ID, 0, ok); + // get the id, report an error if not given or empty... + if (!ok) { + return; + } + SUMOReal layer = attrs.getOpt(SUMO_ATTR_LAYER, id.c_str(), ok, Shape::DEFAULT_LAYER); + bool fill = attrs.getOpt(SUMO_ATTR_FILL, id.c_str(), ok, false); + std::string type = attrs.getOpt(SUMO_ATTR_TYPE, id.c_str(), ok, Shape::DEFAULT_TYPE); + std::string colorStr = attrs.get(SUMO_ATTR_COLOR, id.c_str(), ok); + RGBColor color = attrs.get(SUMO_ATTR_COLOR, id.c_str(), ok); + PositionVector shape = attrs.get(SUMO_ATTR_SHAPE, id.c_str(), ok); + if (attrs.getOpt(SUMO_ATTR_GEO, id.c_str(), ok, false)) { + for (int i = 0; i < (int) shape.size(); i++) { + GeoConvHelper::getFinal().x2cartesian_const(shape[i]); + } + } + SUMOReal angle = attrs.getOpt(SUMO_ATTR_ANGLE, id.c_str(), ok, Shape::DEFAULT_ANGLE); + std::string imgFile = attrs.getOpt(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 (!myShapeContainer.addPolygon(id, type, color, layer, angle, imgFile, shape, fill)) { + WRITE_WARNING("Skipping redefinition of polygon '" + id + "'."); + } + } +} + + + +bool +ShapeHandler::loadFiles(const std::vector& files, ShapeHandler& sh) { + for (std::vector::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) { + if (!XMLSubSys::runParser(sh, *fileIt, false)) { + WRITE_MESSAGE("Loading of shapes from " + *fileIt + " failed."); + return false; + } + } + return true; +} +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/shapes/ShapeHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/ShapeHandler.h --- sumo-0.21.0+dfsg/src/utils/shapes/ShapeHandler.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/shapes/ShapeHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,124 @@ + +/****************************************************************************/ +/// @file ShapeHandler.h +/// @author Jakob Erdmann +/// @date Feb 2015 +/// @version $Id: ShapeHandler.h 17945 2015-02-23 09:36:21Z behrisch $ +/// +// The XML-Handler for network loading +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 ShapeHandler_h +#define ShapeHandler_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class ShapeContainer; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ShapeHandler + * @brief The XML-Handler for network loading + * + * The SAX2-handler responsible for parsing networks and routes to load. + * This is an extension of the MSRouteHandler as routes and vehicles may also + * be loaded from network descriptions. + */ +class ShapeHandler : public SUMOSAXHandler { +public: + +public: + /** @brief Constructor + * + * @param[in] file Name of the parsed file + * @param[in, out] net The network to fill + * @param[in] detBuilder The detector builder to use + * @param[in] triggerBuilder The trigger builder to use + * @param[in] edgeBuilder The builder of edges to use + * @param[in] junctionBuilder The builder of junctions to use + */ + ShapeHandler(const std::string& file, ShapeContainer& sc); + + /// @brief Destructor + virtual ~ShapeHandler(); + + /// @brief loads all of the given files + static bool loadFiles(const std::vector& files, ShapeHandler& sh); + + +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 + * @todo Refactor/describe + */ + virtual void myStartElement(int element, + const SUMOSAXAttributes& attrs); + + + //@} + + + /// @brief get position for a given laneID + virtual Position getLanePos(const std::string& poiID, const std::string& laneID, SUMOReal lanePos) = 0; + + +private: + + /// adds a polygon + void addPOI(const SUMOSAXAttributes& attrs); + + /// adds a polygon + void addPoly(const SUMOSAXAttributes& attrs); + + ShapeContainer& myShapeContainer; + + +private: + /** invalid copy constructor */ + ShapeHandler(const ShapeHandler& s); + + /** invalid assignment operator */ + ShapeHandler& operator=(const ShapeHandler& s); + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/traci/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/traci/Makefile.in --- sumo-0.21.0+dfsg/src/utils/traci/Makefile.in 2014-06-11 22:03:58.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/traci/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -220,6 +220,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -230,7 +232,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/utils/traci/TraCIAPI.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/traci/TraCIAPI.cpp --- sumo-0.21.0+dfsg/src/utils/traci/TraCIAPI.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/traci/TraCIAPI.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date 30.05.2012 -/// @version $Id: TraCIAPI.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: TraCIAPI.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // C++ TraCI client API implementation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/traci/TraCIAPI.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/traci/TraCIAPI.h --- sumo-0.21.0+dfsg/src/utils/traci/TraCIAPI.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/traci/TraCIAPI.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Mario Krumnow /// @author Michael Behrisch /// @date 30.05.2012 -/// @version $Id: TraCIAPI.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: TraCIAPI.h 18095 2015-03-17 09:39:00Z behrisch $ /// // C++ TraCI client API implementation /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/AStarRouter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/AStarRouter.h --- sumo-0.21.0+dfsg/src/utils/vehicle/AStarRouter.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/AStarRouter.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,295 @@ +/****************************************************************************/ +/// @file AStarRouter.h +/// @author Jakob Erdmann +/// @author Daniel Krajzewicz +/// @author Michael Behrisch +/// @date January 2012 +/// @version $Id: AStarRouter.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// 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.dlr.de/ +// Copyright (C) 2012-2015 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 AStarRouter_h +#define AStarRouter_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SUMOAbstractRouter.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class AStarRouter + * @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) + * @param V The vehicle class to use (MSVehicle/ROVehicle) + * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions) + * @param EC The class to retrieve the effort for an edge from + * + * The router is edge-based. It must know the number of edges for internal reasons + * and whether a missing connection between two given edges (unbuild route) shall + * be reported as an error or as a warning. + * + */ +template +class AStarRouter : public SUMOAbstractRouter, public PF { + +public: + typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); + typedef std::vector > LookupTable; + /// Constructor + AStarRouter(size_t noE, bool unbuildIsWarning, Operation operation, const LookupTable* const lookup = 0): + SUMOAbstractRouter(operation, "AStarRouter"), + myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()), + myLookupTable(lookup) { + for (size_t i = 0; i < noE; i++) { + myEdgeInfos.push_back(EdgeInfo(i)); + } + } + + /// Destructor + virtual ~AStarRouter() {} + + virtual SUMOAbstractRouter* clone() const { + return new AStarRouter(myEdgeInfos.size(), myErrorMsgHandler == MsgHandler::getWarningInstance(), this->myOperation, myLookupTable); + } + + static LookupTable* createLookupTable(const std::string& filename, const int size) { + LookupTable* const result = new LookupTable(); + BinaryInputDevice dev(filename); + for (int i = 0; i < size; i++) { + for (int j = 0; j < size; j++) { + SUMOReal val; + dev >> val; + (*result)[i].push_back(val); + } + } + return result; + } + + /** + * @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(size_t id) : + edge(E::dictionary(id)), + traveltime(std::numeric_limits::max()), + heuristicTime(std::numeric_limits::max()), + prev(0), + visited(false) + {} + + /// The current edge + const E* edge; + + /// Effort to reach the edge + SUMOReal traveltime; + + /// Estimated time to reach the edge (traveltime + lower bound on remaining time) + SUMOReal heuristicTime; + + /// The previous edge + EdgeInfo* prev; + + /// The previous edge + bool visited; + + inline void reset() { + // heuristicTime is set before adding to the frontier, thus no reset is needed + traveltime = std::numeric_limits::max(); + visited = false; + } + + }; + + /** + * @class EdgeInfoComparator + * Class to compare (and so sort) nodes by their effort + */ + class EdgeInfoComparator { + public: + /// Comparing method + bool operator()(const EdgeInfo* nod1, const EdgeInfo* nod2) const { + if (nod1->heuristicTime == nod2->heuristicTime) { + return nod1->edge->getNumericalID() > nod2->edge->getNumericalID(); + } + return nod1->heuristicTime > nod2->heuristicTime; + } + }; + + void init() { + // all EdgeInfos touched in the previous query are either in myFrontierList or myFound: clean those up + for (typename std::vector::iterator i = myFrontierList.begin(); i != myFrontierList.end(); i++) { + (*i)->reset(); + } + myFrontierList.clear(); + for (typename std::vector::iterator i = myFound.begin(); i != myFound.end(); i++) { + (*i)->reset(); + } + myFound.clear(); + } + + + /** @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) { + assert(from != 0 && to != 0); + this->startQuery(); + const SUMOVehicleClass vClass = vehicle == 0 ? SVC_IGNORING : vehicle->getVClass(); + const SUMOReal time = STEPS2TIME(msTime); + init(); + // add begin node + EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]); + fromInfo->traveltime = 0; + fromInfo->prev = 0; + myFrontierList.push_back(fromInfo); + // loop + int num_visited = 0; + while (!myFrontierList.empty()) { + num_visited += 1; + // use the node with the minimal length + EdgeInfo* const minimumInfo = myFrontierList.front(); + const E* const minEdge = minimumInfo->edge; + pop_heap(myFrontierList.begin(), myFrontierList.end(), myComparator); + myFrontierList.pop_back(); + myFound.push_back(minimumInfo); + // check whether the destination node was already reached + if (minEdge == to) { + buildPathFrom(minimumInfo, into); + this->endQuery(num_visited); + // DEBUG + //std::cout << "visited " + toString(num_visited) + " edges (final path length: " + toString(into.size()) + ")\n"; + return; + } + minimumInfo->visited = true; + const SUMOReal traveltime = minimumInfo->traveltime + this->getEffort(minEdge, vehicle, time + minimumInfo->traveltime); + // admissible A* heuristic: straight line distance at maximum speed + const SUMOReal heuristic_remaining = myLookupTable == 0 ? minEdge->getDistanceTo(to) / vehicle->getMaxSpeed() : (*myLookupTable)[minEdge->getNumericalID()][to->getNumericalID()] / vehicle->getChosenSpeedFactor(); + // check all ways from the node with the minimal length + const std::vector& successors = minEdge->getSuccessors(vClass); + for (typename std::vector::const_iterator it = successors.begin(); it != successors.end(); ++it) { + const E* const follower = *it; + EdgeInfo* const followerInfo = &(myEdgeInfos[follower->getNumericalID()]); + // check whether it can be used + if (PF::operator()(follower, vehicle)) { + continue; + } + const SUMOReal oldEffort = followerInfo->traveltime; + if (!followerInfo->visited && traveltime < oldEffort) { + followerInfo->traveltime = traveltime; + followerInfo->heuristicTime = traveltime + heuristic_remaining; + /* the code below results in fewer edges being looked up but is more costly due to the effort + calculations. Overall it resulted in a slowdown in the Berlin tests but could be made configurable someday. + followerInfo->heuristicTime = traveltime; + if (follower != to) { + if (myLookupTable == 0) { + // admissible A* heuristic: straight line distance at maximum speed + followerInfo->heuristicTime += this->getEffort(follower, vehicle, time + traveltime) + follower->getDistanceTo(to) / vehicle->getMaxSpeed(); + } else { + followerInfo->heuristicTime += this->getEffort(follower, vehicle, time + traveltime) + (*myLookupTable)[follower->getNumericalID()][to->getNumericalID()] / vehicle->getChosenSpeedFactor(); + } + }*/ + followerInfo->prev = minimumInfo; + if (oldEffort == std::numeric_limits::max()) { + myFrontierList.push_back(followerInfo); + push_heap(myFrontierList.begin(), myFrontierList.end(), myComparator); + } else { + push_heap(myFrontierList.begin(), + find(myFrontierList.begin(), myFrontierList.end(), followerInfo) + 1, + myComparator); + } + } + } + } + this->endQuery(num_visited); + myErrorMsgHandler->inform("No connection between '" + from->getID() + "' and '" + to->getID() + "' found."); + } + + + 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) { + if (PF::operator()(*i, v)) { + return -1; + } + costs += this->getEffort(*i, v, time + costs); + } + return costs; + } + +public: + /// Builds the path from marked edges + void buildPathFrom(EdgeInfo* rbegin, std::vector& edges) { + std::deque tmp; + while (rbegin != 0) { + tmp.push_front((E*) rbegin->edge); // !!! + rbegin = rbegin->prev; + } + std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges)); + } + +protected: + /// The container of edge information + std::vector myEdgeInfos; + + /// A container for reusage of the min edge heap + std::vector myFrontierList; + /// @brief list of visited Edges (for resetting) + std::vector myFound; + + EdgeInfoComparator myComparator; + + /// @brief the handler for routing errors + MsgHandler* const myErrorMsgHandler; + + /// @brief the lookup table for travel time heuristics + const LookupTable* const myLookupTable; + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/BulkStarRouter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/BulkStarRouter.h --- sumo-0.21.0+dfsg/src/utils/vehicle/BulkStarRouter.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/BulkStarRouter.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,383 @@ +/****************************************************************************/ +/// @file BulkStarRouter.h +/// @author Jakob Erdmann +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date February 2012 +/// @version $Id: BulkStarRouter.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// A* Algorithm using shortest-path-in-fast-graph-heuristic for bulk routing +// This router is made for routing multiple sources (at different times) to the same destination +// In the reverse graph (using maximum edge speed) a lower-bound shortest path tree from the target is built. +// These optimistic distances are then used as admissable heuristc +// when routing forward in the time-dependent graph from multiple sources. +// @note: this heuristic does not perform well if the actual vehicles are much slower than the maximum edge speeds +// @note: this heuristic also does not perform well if the actual vehicles have usage restrictions +// @todo: add option for setting maximum speed +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 BulkStarRouter_h +#define BulkStarRouter_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class BulkStarRouterTT + * @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) + * @param V The vehicle class to use (MSVehicle/ROVehicle) + * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions) + * @param EC The class to retrieve the effort for an edge from + * + * The router is edge-based. It must know the number of edges for internal reasons + * and whether a missing connection between two given edges (unbuild route) shall + * be reported as an error or as a warning. + * + */ +template +class BulkStarRouter: public SUMOAbstractRouter, public PF { + +public: + /// Type of the function that is used to retrieve the edge effort. + typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); + typedef SUMOReal(E::* MinTTOperation)(const V* const) const; + + + /// Constructor + BulkStarRouter(size_t noE, bool unbuildIsWarning, Operation operation, MinTTOperation minTTOperation) : + SUMOAbstractRouter(operation, "BulkStarRouter"), + myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()), + myMinTTOperation(minTTOperation), + myPreparedDestination(0) { + for (size_t i = 0; i < noE; i++) { + myEdgeInfos.push_back(EdgeInfo(i)); + } + } + + /// Destructor + virtual ~BulkStarRouter() {} + + virtual SUMOAbstractRouter* clone() const { + return new BulkStarRouter(myEdgeInfos.size(), myErrorMsgHandler == MsgHandler::getWarningInstance(), this->myOperation, myMinTTOperation); + } + + /** + * @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(size_t id) : + edge(E::dictionary(id)), + traveltime(std::numeric_limits::max()), + heuristicTime(std::numeric_limits::max()), + minRemaining(0), + prev(0), + visited(false) {} + + /// The current edge + const E* edge; + + /// Effort to reach the edge + SUMOReal traveltime; + + /// Estimated time to reach the edge (traveltime + lower bound on remaining time) + SUMOReal heuristicTime; + + /// minimum time to destination + SUMOReal minRemaining; + + /// The previous edge + EdgeInfo* prev; + + /// The previous edge + bool visited; + + inline void reset() { + // heuristicTime is set before adding to the frontier, thus no reset is needed + traveltime = std::numeric_limits::max(); + visited = false; + } + }; + + /** + * @class EdgeInfoComparator + * Class to compare (and so sort) nodes by their effort + */ + class EdgeInfoComparator { + public: + /// Comparing method + bool operator()(const EdgeInfo* nod1, const EdgeInfo* nod2) const { + if (nod1->heuristicTime == nod2->heuristicTime) { + return nod1->edge->getNumericalID() > nod2->edge->getNumericalID(); + } + return nod1->heuristicTime > nod2->heuristicTime; + } + }; + + inline SUMOReal getMinEffort(const E* const e, const V* const v) const { + return (e->*myMinTTOperation)(v); + } + + + /** @brief Builds a complete shorteset path tree in the (static) reverse + * graph from destination (Dijkstra until all EdgeInfos are visited) + * @param[in] destination The common destination for the following routes + * @param[in] fastestVehicle An optimistic vehicle (fastest, least restriction) for the following routes + * @param[in] skip Whether to shortcut the preparation (query uses euclidean heuristic) + * */ + void prepare(const E* destination, const V* fastestVehicle, bool skip) { + if (skip) { + myPreparedDestination = 0; + return; + } + myPreparedDestination = destination; + for (typename std::vector::iterator i = myEdgeInfos.begin(); i != myEdgeInfos.end(); i++) { + (*i).reset(); + (*i).minRemaining = 0; + } + myFrontier.clear(); + myFound.clear(); + // add begin node + EdgeInfo* const fromInfo = &(myEdgeInfos[destination->getNumericalID()]); + fromInfo->traveltime = 0; + fromInfo->prev = 0; + myFrontier.push_back(fromInfo); + // loop + int num_visited = 0; + while (!myFrontier.empty()) { + num_visited += 1; + // use the node with the minimal length + EdgeInfo* const minimumInfo = myFrontier.front(); + const E* const minEdge = minimumInfo->edge; + pop_heap(myFrontier.begin(), myFrontier.end(), myComparator); + myFrontier.pop_back(); + myFound.push_back(minimumInfo); + minimumInfo->visited = true; + const SUMOReal traveltime = minimumInfo->traveltime + getMinEffort(minEdge, fastestVehicle); + // check all ways from the node with the minimal length + for (typename std::vector::const_iterator it = minEdge->getPredecessors().begin(); it != minEdge->getPredecessors().end(); it++) { + const E* const follower = *it; + EdgeInfo* const followerInfo = &(myEdgeInfos[follower->getNumericalID()]); + const SUMOReal oldEffort = followerInfo->traveltime; + if (!followerInfo->visited && traveltime < oldEffort) { + followerInfo->traveltime = traveltime; + followerInfo->minRemaining = traveltime; + followerInfo->heuristicTime = traveltime; // plain dijkstra + followerInfo->prev = minimumInfo; + if (oldEffort == std::numeric_limits::max()) { + myFrontier.push_back(followerInfo); + push_heap(myFrontier.begin(), myFrontier.end(), myComparator); + } else { + push_heap(myFrontier.begin(), + find(myFrontier.begin(), myFrontier.end(), followerInfo) + 1, + myComparator); + } + } + } + } + // DEBUG + //std::cout << "visited " + toString(num_visited) + " edges during pre-computation\n"; + + // DEBUG + //std::vector debugPath; + //for (typename std::vector::iterator it = myEdgeInfos.begin(); it != myEdgeInfos.end(); it++) { + // if (it->edge->getID() == "src") { + // buildPathFrom(&(*it), debugPath); + // std::cout << "shortest path in reverse graph:\n"; + // for (typename std::vector::iterator it_path = debugPath.begin(); it_path != debugPath.end(); it_path++) { + // std::cout << (*it_path)->getID() << " "; + // } + // std::cout << "\n"; + // } + //} + } + + + void init() { + // all EdgeInfos touched in the previous query are either in myFrontier or myFound: clean those up + for (typename std::vector::iterator i = myFrontier.begin(); i != myFrontier.end(); i++) { + (*i)->reset(); + } + myFrontier.clear(); + for (typename std::vector::iterator i = myFound.begin(); i != myFound.end(); i++) { + (*i)->reset(); + } + myFound.clear(); + } + + + /** @brief Builds the route between the given edges using the minimum travel time */ + void compute(const E* from, const E* to, const V* const vehicle, + SUMOTime msTime, std::vector& into) { + assert(from != 0 && to != 0); + this->startQuery(); + const SUMOVehicleClass vClass = vehicle == 0 ? SVC_IGNORING : vehicle->getVClass(); + init(); + const Prepared prepared = (myPreparedDestination == 0 ? + NO : (myPreparedDestination == to ? YES_EXACT : YES)); + const SUMOReal time = STEPS2TIME(msTime); + const EdgeInfo& toInfo = myEdgeInfos[to->getNumericalID()]; + EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]); + fromInfo->traveltime = 0; + fromInfo->prev = 0; + myFrontier.push_back(fromInfo); + // loop + int num_visited = 0; + while (!myFrontier.empty()) { + num_visited += 1; + // use the node with the minimal length + EdgeInfo* const minimumInfo = myFrontier.front(); + const E* const minEdge = minimumInfo->edge; + pop_heap(myFrontier.begin(), myFrontier.end(), myComparator); + myFrontier.pop_back(); + myFound.push_back(minimumInfo); + // check whether the destination node was already reached + if (minEdge == to) { + buildPathFrom(minimumInfo, into); + this->endQuery(num_visited); + // DEBUG + //std::cout << "visited " + toString(num_visited) + " edges (final path length: " + toString(into.size()) + ")\n"; + return; + } + minimumInfo->visited = true; + const SUMOReal traveltime = minimumInfo->traveltime + this->getEffort(minEdge, vehicle, time + minimumInfo->traveltime); + // check all ways from the node with the minimal length + const std::vector& successors = minEdge->getSuccessors(vClass); + for (typename std::vector::const_iterator it = successors.begin(); it != successors.end(); ++it) { + const E* const follower = *it; + EdgeInfo* const followerInfo = &(myEdgeInfos[follower->getNumericalID()]); + // check whether it can be used + if (PF::operator()(follower, vehicle)) { + continue; + } + const SUMOReal oldEffort = followerInfo->traveltime; + if (!followerInfo->visited && traveltime < oldEffort) { + followerInfo->traveltime = traveltime; + // admissible A* heuristic: + SUMOReal heuristic_remaining = 0; + switch (prepared) { + case NO: + // straight line distance at maximum speed + heuristic_remaining = minEdge->getDistanceTo(to) / vehicle->getMaxSpeed(); + break; + case YES_EXACT: + // shortest path for fastest vehicle in uncongested network + heuristic_remaining = minimumInfo->minRemaining; + break; + case YES: + // triangle inequality + heuristic_remaining = MAX2( + minimumInfo->minRemaining - toInfo.minRemaining, + minEdge->getDistanceTo(to) / vehicle->getMaxSpeed()); + break; + } + followerInfo->heuristicTime = traveltime + heuristic_remaining; + followerInfo->prev = minimumInfo; + if (oldEffort == std::numeric_limits::max()) { + myFrontier.push_back(followerInfo); + push_heap(myFrontier.begin(), myFrontier.end(), myComparator); + } else { + push_heap(myFrontier.begin(), + find(myFrontier.begin(), myFrontier.end(), followerInfo) + 1, + myComparator); + } + } + } + } + this->endQuery(num_visited); + myErrorMsgHandler->inform("No connection between '" + from->getID() + "' and '" + to->getID() + "' found."); + } + + + 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) { + if (PF::operator()(*i, v)) { + return -1; + } + costs += this->getEffort(*i, v, time + costs); + } + return costs; + } + +public: + /// Builds the path from marked edges + void buildPathFrom(EdgeInfo* rbegin, std::vector& edges) { + std::deque tmp; + while (rbegin != 0) { + tmp.push_front((E*) rbegin->edge); // !!! + rbegin = rbegin->prev; + } + std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges)); + } + +private: + enum Prepared { + NO, + YES, + YES_EXACT // optimistic shortest paths are computed for the current destination + }; + + /// The container of edge information + std::vector myEdgeInfos; + + /// A container for reusage of the min edge heap + std::vector myFrontier; + /// @brief list of visited Edges (for resetting) + std::vector myFound; + + EdgeInfoComparator myComparator; + + /// @brief the handler for routing errors + MsgHandler* const myErrorMsgHandler; + + MinTTOperation myMinTTOperation; + + const E* myPreparedDestination; +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/CHRouter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/CHRouter.h --- sumo-0.21.0+dfsg/src/utils/vehicle/CHRouter.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/CHRouter.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,870 @@ +/****************************************************************************/ +/// @file CHRouter.h +/// @author Jakob Erdmann +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date February 2012 +/// @version $Id: CHRouter.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Shortest Path search using a Contraction Hierarchy +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 CHRouter_h +#define CHRouter_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SPTree.h" + +//#define CHRouter_DEBUG_QUERY +//#define CHRouter_DEBUG_QUERY_PERF +//#define CHRouter_DEBUG_CONTRACTION +//#define CHRouter_DEBUG_CONTRACTION_WITNESSES +//#define CHRouter_DEBUG_CONTRACTION_QUEUE +//#define CHRouter_DEBUG_CONTRACTION_DEGREE +//#define CHRouter_DEBUG_WEIGHTS + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class CHRouter + * @brief Computes the shortest path through a contracted network + * + * The template parameters are: + * @param E The edge class to use (MSEdge/ROEdge) + * @param V The vehicle class to use (MSVehicle/ROVehicle) + * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions) + * + * The router is edge-based. It must know the number of edges for internal reasons + * and whether a missing connection between two given edges (unbuild route) shall + * be reported as an error or as a warning. + * + */ +template +class CHRouter: public SUMOAbstractRouter, public PF { + +public: + class EdgeInfo; + + /// Type of the function that is used to retrieve the edge effort. + typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); + + /// A meeting point of the two search scopes + typedef std::pair Meeting; + + /// A set of (found) Edges + typedef std::set EdgeSet; + + /// The found route (used as output parameter) + typedef std::vector Result; + + /// @brief Forward/backward connection with associated forward/backward cost + // forward connections are used only in forward search + // backward connections are used only in backwards search + class Connection { + public: + Connection(EdgeInfo* t, SUMOReal c, SVCPermissions p): target(t), cost(c), permissions(p) {} + EdgeInfo* target; + SUMOReal cost; + SVCPermissions permissions; + }; + + /** + * @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(size_t id) : + edge(E::dictionary(id)), + traveltime(std::numeric_limits::max()), + prev(0), + visited(false) + {} + + /// The current edge + const E* edge; + + /// Effort to reach the edge + SUMOReal traveltime; + + /// The previous edge + EdgeInfo* prev; + + /// Whether the shortest path to this edge is already found + bool visited; + + /// Connections to higher ranked nodes + std::vector upward; + + /// the contraction rank (higher means more important) + int rank; + + inline void reset() { + traveltime = std::numeric_limits::max(); + visited = false; + } + }; + + + /** + * @class Unidirectional + * class for searching in one direction + */ + class Unidirectional: public PF { + public: + /// @brief Constructor + Unidirectional(size_t numEdges, bool forward): + myAmForward(forward), + myVehicle(0) { + for (size_t i = 0; i < numEdges; i++) { + myEdgeInfos.push_back(EdgeInfo(i)); + } + } + + inline bool found(const E* edge) const { + return myFound.count(edge) > 0; + } + + inline EdgeInfo* getEdgeInfo(const E* const edge) { + return &(myEdgeInfos[edge->getNumericalID()]); + } + + inline const EdgeInfo* getEdgeInfo(const E* const edge) const { + return &(myEdgeInfos[edge->getNumericalID()]); + } + + /** + * @class EdgeInfoByEffortComparator + * Class to compare (and so sort) nodes by their effort + */ + class EdgeInfoByTTComparator { + public: + /// Comparing method + bool operator()(const EdgeInfo* nod1, const EdgeInfo* nod2) const { + if (nod1->traveltime == nod2->traveltime) { + return nod1->edge->getNumericalID() > nod2->edge->getNumericalID(); + } + return nod1->traveltime > nod2->traveltime; + } + }; + + + void init(const E* const start, const V* const vehicle) { + assert(vehicle != 0); + // all EdgeInfos touched in the previous query are either in myFrontier or myFound: clean those up + for (typename std::vector::iterator i = myFrontier.begin(); i != myFrontier.end(); i++) { + (*i)->reset(); + } + myFrontier.clear(); + for (typename EdgeSet::iterator i = myFound.begin(); i != myFound.end(); i++) { + getEdgeInfo(*i)->reset(); + } + myFound.clear(); + myVehicle = vehicle; + EdgeInfo* startInfo = getEdgeInfo(start); + startInfo->traveltime = 0; + startInfo->prev = 0; + myFrontier.push_back(startInfo); + } + + + /** @brief explore on element from the frontier,update minTTSeen and meeting + * if an EdgeInfo found by the otherSearch is encountered + * returns whether stepping should continue + */ + bool step(const Unidirectional& otherSearch, SUMOReal& minTTSeen, Meeting& meeting) { + // pop the node with the minimal length + EdgeInfo* const minimumInfo = myFrontier.front(); + pop_heap(myFrontier.begin(), myFrontier.end(), myComparator); + myFrontier.pop_back(); + // check for a meeting with the other search + const E* const minEdge = minimumInfo->edge; +#ifdef CHRouter_DEBUG_QUERY + std::cout << "DEBUG: " << (myAmForward ? "Forward" : "Backward") << " hit '" << minEdge->getID() << "' Q: "; + for (typename std::vector::iterator it = myFrontier.begin(); it != myFrontier.end(); it++) { + std::cout << (*it)->traveltime << "," << (*it)->edge->getID() << " "; + } + std::cout << "\n"; +#endif + if (otherSearch.found(minEdge)) { + const EdgeInfo* const otherInfo = otherSearch.getEdgeInfo(minEdge); + const SUMOReal ttSeen = minimumInfo->traveltime + otherInfo->traveltime; +#ifdef CHRouter_DEBUG_QUERY + std::cout << "DEBUG: " << (myAmForward ? "Forward" : "Backward") << "-Search hit other search at '" << minEdge->getID() << "', tt: " << ttSeen << " \n"; +#endif + if (ttSeen < minTTSeen) { + minTTSeen = ttSeen; + if (myAmForward) { + meeting.first = minimumInfo; + meeting.second = otherInfo; + } else { + meeting.first = otherInfo; + meeting.second = minimumInfo; + } + } + } + // prepare next steps + minimumInfo->visited = true; + // XXX we only need to keep found elements if they have a higher rank than the lowest rank in the other search queue + myFound.insert(minimumInfo->edge); + for (typename std::vector::iterator it = minimumInfo->upward.begin(); it != minimumInfo->upward.end(); it++) { + EdgeInfo* upwardInfo = it->target; + const SUMOReal traveltime = minimumInfo->traveltime + it->cost; + const SUMOVehicleClass svc = myVehicle->getVClass(); + // check whether it can be used + if ((it->permissions & svc) != svc) { + continue; + } + const SUMOReal oldTraveltime = upwardInfo->traveltime; + if (!upwardInfo->visited && traveltime < oldTraveltime) { + upwardInfo->traveltime = traveltime; + upwardInfo->prev = minimumInfo; + if (oldTraveltime == std::numeric_limits::max()) { + myFrontier.push_back(upwardInfo); + push_heap(myFrontier.begin(), myFrontier.end(), myComparator); + } else { + push_heap(myFrontier.begin(), + find(myFrontier.begin(), myFrontier.end(), upwardInfo) + 1, + myComparator); + } + } + } + // @note: this effectively does a full dijkstra search. + // the effort compared to the naive stopping criterion is thus + // quadrupled. We could implement a better stopping criterion (Holte) + // However since the search shall take place in a contracted graph + // it probably does not matter + return !myFrontier.empty() && myFrontier.front()->traveltime < minTTSeen; + } + + + // reset state before rebuilding the contraction hierarchy + void reset() { + for (typename std::vector::iterator it = myEdgeInfos.begin(); it != myEdgeInfos.end(); ++it) { + it->upward.clear(); + } + } + + private: + /// @brief the role of this search + bool myAmForward; + /// @brief the min edge heap + std::vector myFrontier; + /// @brief the set of visited (settled) Edges + EdgeSet myFound; + /// @brief The container of edge information + std::vector myEdgeInfos; + + EdgeInfoByTTComparator myComparator; + + const V* myVehicle; + + }; + + class CHInfo; + + /// @brief Forward/backward connection with associated FORWARD cost + class CHConnection { + public: + CHConnection(CHInfo* t, SUMOReal c, SVCPermissions p, int u): + target(t), cost(c), permissions(p), underlying(u) {} + CHInfo* target; + SUMOReal cost; + SVCPermissions permissions; + /// the number of connections underlying this connection + int underlying; + }; + + typedef std::vector CHConnections; + typedef std::pair CHConnectionPair; + typedef std::vector CHConnectionPairs; + + /** @brief Constructor + * @param[in] validatePermissions Whether a multi-permission hierarchy shall be built + * If set to false, the net is pruned in synchronize() and the + * hierarchy is tailored to the vClass of the defaultVehicle + * @note: defaultVehicle is not transient and must be kept after constructor finishes + */ + CHRouter(size_t numEdges, bool unbuildIsWarning, Operation operation, + const SUMOVehicleClass svc, + SUMOTime weightPeriod, + bool validatePermissions): + SUMOAbstractRouter(operation, "CHRouter"), + myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()), + myForwardSearch(numEdges, true), + myBackwardSearch(numEdges, false), + mySPTree(new SPTree(4, validatePermissions)), + myWeightPeriod(weightPeriod), + myValidUntil(0), + mySVC(svc), + myUpdateCount(0) { + for (size_t i = 0; i < numEdges; i++) { + myCHInfos.push_back(CHInfo(i)); + } + } + + /// Destructor + virtual ~CHRouter() { + delete mySPTree; + } + + + virtual SUMOAbstractRouter* clone() const { + return new CHRouter(myCHInfos.size(), myErrorMsgHandler == MsgHandler::getWarningInstance(), this->myOperation, + mySVC, myWeightPeriod, mySPTree->validatePermissions()); + } + + /** @brief Builds the route between the given edges using the minimum traveltime in the contracted graph + * @note: since the contracted graph is static (weights averaged over time) + * the computed routes only approximated shortest paths in the real graph + * */ + virtual void compute(const E* from, const E* to, const V* const vehicle, + SUMOTime msTime, Result& into) { + assert(from != 0 && to != 0); + assert(mySPTree->validatePermissions() || vehicle->getVClass() == mySVC || mySVC == SVC_IGNORING); + // do we need to rebuild the hierarchy? + if (msTime >= myValidUntil) { + while (msTime >= myValidUntil) { + myValidUntil += myWeightPeriod; + } + buildContractionHierarchy(myValidUntil - myWeightPeriod, vehicle); + } + // ready for routing + this->startQuery(); + myForwardSearch.init(from, vehicle); + myBackwardSearch.init(to, vehicle); + SUMOReal minTTSeen = std::numeric_limits::max(); + Meeting meeting(static_cast(0), static_cast(0)); + bool continueForward = true; + bool continueBackward = true; + int num_visited_fw = 0; + int num_visited_bw = 0; + while (continueForward || continueBackward) { + if (continueForward) { + continueForward = myForwardSearch.step(myBackwardSearch, minTTSeen, meeting); + num_visited_fw += 1; + } + if (continueBackward) { + continueBackward = myBackwardSearch.step(myForwardSearch, minTTSeen, meeting); + num_visited_bw += 1; + } + } + if (minTTSeen < std::numeric_limits::max()) { + buildPathFromMeeting(meeting, into); + } else { + myErrorMsgHandler->inform("No connection between '" + from->getID() + "' and '" + to->getID() + "' found."); + } +#ifdef CHRouter_DEBUG_QUERY_PERF + std::cout << "visited " << num_visited_fw + num_visited_bw << " edges (" << num_visited_fw << "," << num_visited_bw << ") ,final path length: " + toString(into.size()) + ")\n"; +#endif + this->endQuery(num_visited_bw + num_visited_fw); + } + + + 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) { + if (PF::operator()(*i, v)) { + return -1; + } + costs += this->getEffort(*i, v, time + costs); + } + return costs; + } + + /// normal routing methods + + /// Builds the path from marked edges + void buildPathFromMeeting(Meeting meeting, Result& into) { + std::deque tmp; + const EdgeInfo* backtrack = meeting.first; + while (backtrack != 0) { + tmp.push_front((E*) backtrack->edge); // !!! + backtrack = backtrack->prev; + } + backtrack = meeting.second->prev; // don't use central edge twice + while (backtrack != 0) { + tmp.push_back((E*) backtrack->edge); // !!! + backtrack = backtrack->prev; + } + // expand shortcuts + const E* prev = 0; + while (!tmp.empty()) { + const E* cur = tmp.front(); + tmp.pop_front(); + if (prev == 0) { + into.push_back(cur); + prev = cur; + } else { + const E* via = getVia(prev, cur); + if (via == 0) { + into.push_back(cur); + prev = cur; + } else { + tmp.push_front(cur); + tmp.push_front(via); + } + } + } + } + + /// contraction related members + typedef std::pair ConstEdgePair; + typedef std::pair EdgePair; + + struct Shortcut { + Shortcut(EdgePair e, SUMOReal c, int u, SVCPermissions p): + edgePair(e), cost(c), underlying(u), permissions(p) {} + EdgePair edgePair; + SUMOReal cost; + int underlying; + SVCPermissions permissions; + }; + + typedef std::vector Shortcuts; + typedef std::map ShortcutVia; + + /* @brief container class to use when building the contraction hierarchy. + * instances are reused every time the hierarchy is rebuilt (new time slice) + * but they must be synchronized first */ + class CHInfo { + public: + /// @brief Constructor + CHInfo(size_t id) : + edge(E::dictionary(id)), + contractedNeighbors(0), + rank(-1), + level(0), + underlyingTotal(0), + visited(false), + traveltime(std::numeric_limits::max()) + {} + + /// @brief recompute the contraction priority and report whether it changed + bool updatePriority(SPTree* spTree) { + if (spTree != 0) { + updateShortcuts(spTree); + updateLevel(); + } else { + contractedNeighbors += 1; // called when a connected edge was contracted + } + const SUMOReal oldPriority = priority; + // priority term as used by abraham [] + const int edge_difference = (int)followers.size() + (int)approaching.size() - 2 * (int)shortcuts.size(); + priority = (SUMOReal)(2 * edge_difference - contractedNeighbors - underlyingTotal - 5 * level); + return priority != oldPriority; + } + + /// compute needed shortcuts when contracting this edge + void updateShortcuts(SPTree* spTree) { + const bool validatePermissions = spTree->validatePermissions(); +#ifdef CHRouter_DEBUG_CONTRACTION_DEGREE + const int degree = approaching.size() + followers.size(); + std::cout << "computing shortcuts for '" + edge->getID() + "' with degree " + toString(degree) + "\n"; +#endif + shortcuts.clear(); + underlyingTotal = 0; + for (typename CHConnections::iterator it_a = approaching.begin(); it_a != approaching.end(); it_a++) { + CHConnection& aInfo = *it_a; + // build shortest path tree in a fixed neighborhood + spTree->rebuildFrom(aInfo.target, this); + for (typename CHConnections::iterator it_f = followers.begin(); it_f != followers.end(); it_f++) { + CHConnection& fInfo = *it_f; + const SUMOReal viaCost = aInfo.cost + fInfo.cost; + const SVCPermissions viaPermissions = (aInfo.permissions & fInfo.permissions); + if (fInfo.target->traveltime > viaCost) { + // found no faster path -> we need a shortcut via edge +#ifdef CHRouter_DEBUG_CONTRACTION_WITNESSES + debugNoWitness(aInfo, fInfo); +#endif + const int underlying = aInfo.underlying + fInfo.underlying; + underlyingTotal += underlying; + shortcuts.push_back(Shortcut(EdgePair(aInfo.target->edge, fInfo.target->edge), + viaCost, underlying, viaPermissions)); + + } else if (validatePermissions) { + if ((fInfo.target->permissions & viaPermissions) != viaPermissions) { + // witness has weaker restrictions. try to find another witness + spTree->registerForValidation(&aInfo, &fInfo); + } else { +#ifdef CHRouter_DEBUG_CONTRACTION_WITNESSES + debugNoWitness(aInfo, fInfo); +#endif + } + } else { +#ifdef CHRouter_DEBUG_CONTRACTION_WITNESSES + debugNoWitness(aInfo, fInfo); +#endif + } + } + } + // insert shortcuts needed due to unmet permissions + if (validatePermissions) { + const CHConnectionPairs& pairs = spTree->getNeededShortcuts(this); + for (typename CHConnectionPairs::const_iterator it = pairs.begin(); it != pairs.end(); ++it) { + const CHConnection* aInfo = it->first; + const CHConnection* fInfo = it->second; + const SUMOReal viaCost = aInfo->cost + fInfo->cost; + const SVCPermissions viaPermissions = (aInfo->permissions & fInfo->permissions); + const int underlying = aInfo->underlying + fInfo->underlying; + underlyingTotal += underlying; + shortcuts.push_back(Shortcut(EdgePair(aInfo->target->edge, fInfo->target->edge), + viaCost, underlying, viaPermissions)); + } + } + } + + + // update level as defined by Abraham + void updateLevel() { + int maxLower = std::numeric_limits::min(); + int otherRank; + for (typename CHConnections::iterator it = approaching.begin(); it != approaching.end(); it++) { + otherRank = it->target->rank; + if (otherRank < rank) { + maxLower = MAX2(rank, maxLower); + } + } + for (typename CHConnections::iterator it = followers.begin(); it != followers.end(); it++) { + otherRank = it->target->rank; + if (otherRank < rank) { + maxLower = MAX2(rank, maxLower); + } + } + if (maxLower == std::numeric_limits::min()) { + level = 0; + } else { + level = maxLower + 1; + } + } + + // resets state before rebuilding the hierarchy + void resetContractionState() { + contractedNeighbors = 0; + rank = -1; + level = 0; + underlyingTotal = 0; + shortcuts.clear(); + followers.clear(); + approaching.clear(); + } + + + /// @brief The current edge - not const since it may receive shortcut edges + E* edge; + /// @brief The contraction priority + SUMOReal priority; + /// @brief The needed shortcuts + Shortcuts shortcuts; + /// @brief priority subterms + int contractedNeighbors; + int rank; + int level; + int underlyingTotal; + + /// @brief connections (only valid after synchronization) + CHConnections followers; + CHConnections approaching; + + + /// members used in SPTree + bool visited; + /// Effort to reach the edge + SUMOReal traveltime; + /// number of edges from start + int depth; + /// the permissions when reaching this edge on the fastest path + // @note: we may miss some witness paths by making traveltime the only + // criteria durinng search + SVCPermissions permissions; + + inline void reset() { + traveltime = std::numeric_limits::max(); + visited = false; + } + + + /// debugging methods + inline void debugNoWitness(const CHConnection& aInfo, const CHConnection& fInfo) { + std::cout << "adding shortcut between " << aInfo.target->edge->getID() << ", " << fInfo.target->edge->getID() << " via " << edge->getID() << "\n"; + } + + inline void debugWitness(const CHConnection& aInfo, const CHConnection& fInfo) { + const SUMOReal viaCost = aInfo.cost + fInfo.cost; + std::cout << "found witness with lenght " << fInfo.target->traveltime << " against via " << edge->getID() << " (length " << viaCost << ") for " << aInfo.target->edge->getID() << ", " << fInfo.target->edge->getID() << "\n"; + } + + }; + +private: + + /** + * @class EdgeInfoByRankComparator + * Class to compare (and so sort) nodes by their contraction priority + */ + class CHInfoComparator { + public: + /// Comparing method + bool operator()(const CHInfo* a, const CHInfo* b) const { + if (a->priority == b->priority) { + return a->edge->getNumericalID() > b->edge->getNumericalID(); + } else { + return a->priority < b->priority; + }; + } + }; + + + inline CHInfo* getCHInfo(const E* const edge) { + return &(myCHInfos[edge->getNumericalID()]); + } + + + /// @brief copy connections from the original net (modified destructively during contraction) + void synchronize(CHInfo& info, SUMOReal time, const V* const vehicle) { + // forward and backward connections are used only in forward search, + // thus approaching costs are those of the approaching edge and not of the edge itself + const bool prune = !mySPTree->validatePermissions(); + const E* const edge = info.edge; + if (prune && ((edge->getPermissions() & mySVC) != mySVC)) { + return; + } + const SUMOReal cost = this->getEffort(edge, vehicle, time); + + const std::vector& successors = edge->getSuccessors(mySVC); + for (typename std::vector::const_iterator it = successors.begin(); it != successors.end(); ++it) { + const E* fEdge = *it; + if (prune && ((fEdge->getPermissions() & mySVC) != mySVC)) { + continue; + } + CHInfo* follower = getCHInfo(fEdge); + SVCPermissions permissions = (edge->getPermissions() & follower->edge->getPermissions()); + info.followers.push_back(CHConnection(follower, cost, permissions, 1)); + follower->approaching.push_back(CHConnection(&info, cost, permissions, 1)); + } +#ifdef CHRouter_DEBUG_WEIGHTS + std::cout << time << ": " << edge->getID() << " cost: " << cost << "\n"; +#endif + // @todo: check whether we even need to save approaching in ROEdge; + } + + + /// @brief remove all connections to/from the given edge (assume it exists only once) + void disconnect(CHConnections& connections, CHInfo* other) { + for (typename CHConnections::iterator it = connections.begin(); it != connections.end(); it++) { + if (it->target == other) { + connections.erase(it); + return; + } + } + assert(false); + } + + + void buildContractionHierarchy(SUMOTime time, const V* const vehicle) { + const size_t numEdges = myCHInfos.size(); + const std::string vClass = (mySPTree->validatePermissions() ? + "all vehicle classes " : "vClass='" + SumoVehicleClassStrings.getString(mySVC) + "' "); + PROGRESS_BEGIN_MESSAGE("Building Contraction Hierarchy for " + vClass + + "and time=" + time2string(time) + " (" + toString(numEdges) + " edges)\n"); + const long startMillis = SysUtils::getCurrentMillis(); + // init queue + std::vector queue; // max heap: edge to be contracted is front + myShortcuts.clear(); + // reset previous connections etc + myForwardSearch.reset(); + myBackwardSearch.reset(); + for (size_t i = 0; i < numEdges; i++) { + myCHInfos[i].resetContractionState(); + } + // copy connections from the original net + const SUMOReal time_seconds = STEPS2TIME(time); // timelines store seconds! + for (size_t i = 0; i < numEdges; i++) { + synchronize(myCHInfos[i], time_seconds, vehicle); + } + // synchronization is finished. now we can compute priorities for the first time + for (size_t i = 0; i < numEdges; i++) { + myCHInfos[i].updatePriority(mySPTree); + queue.push_back(&(myCHInfos[i])); + } + make_heap(queue.begin(), queue.end(), myCmp); + int contractionRank = 0; + // contraction loop + while (!queue.empty()) { + while (tryUpdateFront(queue)) {} + CHInfo* max = queue.front(); + max->rank = contractionRank; +#ifdef CHRouter_DEBUG_CONTRACTION + std::cout << "contracting '" << max->edge->getID() << "' with prio: " << max->priority << " (rank " << contractionRank << ")\n"; +#endif + E* edge = max->edge; + // add outgoing connections to the forward search + EdgeInfo* edgeInfoFW = myForwardSearch.getEdgeInfo(edge); + edgeInfoFW->rank = contractionRank; + for (typename CHConnections::iterator it = max->followers.begin(); it != max->followers.end(); it++) { + CHConnection& con = *it; + EdgeInfo* followerInfoFW = myForwardSearch.getEdgeInfo(con.target->edge); + edgeInfoFW->upward.push_back(Connection(followerInfoFW, con.cost, con.permissions)); + disconnect(con.target->approaching, max); + con.target->updatePriority(0); + } + // add incoming connections to the backward search + EdgeInfo* edgeInfoBW = myBackwardSearch.getEdgeInfo(edge); + edgeInfoBW->rank = contractionRank; + for (typename CHConnections::iterator it = max->approaching.begin(); it != max->approaching.end(); it++) { + CHConnection& con = *it; + EdgeInfo* approachingInfoBW = myBackwardSearch.getEdgeInfo(con.target->edge); + edgeInfoBW->upward.push_back(Connection(approachingInfoBW, con.cost, con.permissions)); + disconnect(con.target->followers, max); + con.target->updatePriority(0); + } + // add shortcuts to the net + for (typename Shortcuts::iterator it = max->shortcuts.begin(); it != max->shortcuts.end(); it++) { + EdgePair& edgePair = it->edgePair; + myShortcuts[edgePair] = edge; + CHInfo* from = getCHInfo(edgePair.first); + CHInfo* to = getCHInfo(edgePair.second); + from->followers.push_back(CHConnection(to, it->cost, it->permissions, it->underlying)); + to->approaching.push_back(CHConnection(from, it->cost, it->permissions, it->underlying)); + } + // remove from queue + pop_heap(queue.begin(), queue.end(), myCmp); + queue.pop_back(); + /* + if (contractionRank % 10000 == 0) { + // update all and rebuild queue + for (typename std::vector::iterator it = queue.begin(); it != queue.end(); ++it) { + (*it)->updatePriority(mySPTree); + } + make_heap(queue.begin(), queue.end(), myCmp); + } + */ + contractionRank++; + } + // reporting + const long duration = SysUtils::getCurrentMillis() - startMillis; + WRITE_MESSAGE("Created " + toString(myShortcuts.size()) + " shortcuts."); + WRITE_MESSAGE("Recomputed priority " + toString(myUpdateCount) + " times."); + MsgHandler::getMessageInstance()->endProcessMsg("done (" + toString(duration) + "ms)."); + PROGRESS_DONE_MESSAGE(); + // declare new validUntil (prevent overflow) + if (myWeightPeriod < std::numeric_limits::max()) { + myValidUntil = time + myWeightPeriod; + } else { + myValidUntil = myWeightPeriod; + } + myUpdateCount = 0; + } + + // retrieve the via edge for a shortcut + const E* getVia(const E* forwardFrom, const E* forwardTo) { + ConstEdgePair forward(forwardFrom, forwardTo); + typename ShortcutVia::iterator it = myShortcuts.find(forward); + if (it != myShortcuts.end()) { + return it->second; + } else { + return 0; + } + } + + + /** @brief tries to update the priority of the first edge + * @return wether updating changed the first edge + */ + bool tryUpdateFront(std::vector& queue) { + myUpdateCount++; + CHInfo* max = queue.front(); +#ifdef CHRouter_DEBUG_CONTRACTION_QUEUE + std::cout << "updating '" << max->edge->getID() << "'\n"; + debugPrintQueue(queue); +#endif + if (max->updatePriority(mySPTree)) { + pop_heap(queue.begin(), queue.end(), myCmp); + push_heap(queue.begin(), queue.end(), myCmp); + return true; + } else { + return false; + } + } + + // helper method for debugging + void debugPrintQueue(std::vector& queue) { + for (typename std::vector::iterator it = queue.begin(); it != queue.end(); it++) { + CHInfo* chInfo = *it; + std::cout << "(" << chInfo->edge->getID() << "," << chInfo->priority << ") "; + } + std::cout << "\n"; + } + +private: + /// @brief the handler for routing errors + MsgHandler* const myErrorMsgHandler; + + /// @brief the unidirectional search queues + Unidirectional myForwardSearch; + Unidirectional myBackwardSearch; + + /// @brief map from (forward) shortcut to via-Edge + ShortcutVia myShortcuts; + + /// @brief static vector for lookup + std::vector myCHInfos; + + /// @brief Comparator for contraction priority + CHInfoComparator myCmp; + + /// @brief the shortest path tree to use when searching for shortcuts + SPTree* mySPTree; + + /// @brief the validity duration of one weight interval + const SUMOTime myWeightPeriod; + + /// @brief the validity duration of the current hierarchy (exclusive) + SUMOTime myValidUntil; + + /// @brief the permissions for which the hierarchy was constructed + SUMOVehicleClass mySVC; + + /// @brief counters for performance logging + int myUpdateCount; +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/CHRouterWrapper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/CHRouterWrapper.h --- sumo-0.21.0+dfsg/src/utils/vehicle/CHRouterWrapper.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/CHRouterWrapper.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,142 @@ +/****************************************************************************/ +/// @file CHRouterWrapper.h +/// @author Jakob Erdmann +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date March 2012 +/// @version $Id: CHRouterWrapper.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Wraps multiple CHRouters for different vehicle types +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 CHRouterWrapper_h +#define CHRouterWrapper_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "CHRouter.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class CHRouterWrapper + * @brief Computes the shortest path through a contracted network + * + * The template parameters are: + * @param E The edge class to use (MSEdge/ROEdge) + * @param V The vehicle class to use (MSVehicle/ROVehicle) + * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions) + * + * The router is edge-based. It must know the number of edges for internal reasons + * and whether a missing connection between two given edges (unbuild route) shall + * be reported as an error or as a warning. + * + */ +template +class CHRouterWrapper: public SUMOAbstractRouter, public PF { + +public: + /// Type of the function that is used to retrieve the edge effort. + typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); + + /** @brief Constructor + */ + CHRouterWrapper(size_t dictSize, bool ignoreErrors, Operation operation, SUMOTime begin, SUMOTime weightPeriod): + SUMOAbstractRouter(operation, "CHRouterWrapper"), + myDictSize(dictSize), + myIgnoreErrors(ignoreErrors), + myBegin(begin), + myWeightPeriod(weightPeriod) + {} + + ~CHRouterWrapper() { + for (typename RouterMap::iterator i = myRouters.begin(); i != myRouters.end(); ++i) { + delete(*i).second; + } + } + + + virtual SUMOAbstractRouter* clone() const { + return new CHRouterWrapper(myDictSize, myIgnoreErrors, this->myOperation, myBegin, myWeightPeriod); + } + + void compute(const E* from, const E* to, const V* const vehicle, + SUMOTime msTime, std::vector& into) { + const std::pair svc = std::make_pair(vehicle->getVClass(), vehicle->getMaxSpeed()); + if (myRouters.count(svc) == 0) { + // create new router for the given permissions and maximum speed + // XXX a new router may also be needed if vehicles differ in speed factor + myRouters[svc] = new CHRouterType( + myDictSize, myIgnoreErrors, &E::getTravelTimeStatic, svc.first, myWeightPeriod, false); + } + myRouters[svc]->compute(from, to, vehicle, msTime, into); + } + + + 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) { + if (PF::operator()(*i, v)) { + WRITE_WARNING("Vehicle '" + v->getID() + "' is restricted from using its assigned route."); + return -1; + } + costs += this->getEffort(*i, v, time + costs); + } + return costs; + } + + +private: + typedef CHRouter > CHRouterType; + typedef std::map, CHRouterType*> RouterMap; + + RouterMap myRouters; + + /// @brief number of edges with numerical id + size_t myDictSize; + + bool myIgnoreErrors; + + SUMOTime myBegin; + SUMOTime myWeightPeriod; +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/DijkstraRouterEffort.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/DijkstraRouterEffort.h --- sumo-0.21.0+dfsg/src/utils/vehicle/DijkstraRouterEffort.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/DijkstraRouterEffort.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,260 @@ +/****************************************************************************/ +/// @file DijkstraRouterEffort.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date Mon, 25 July 2005 +/// @version $Id: DijkstraRouterEffort.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Dijkstra shortest path algorithm using other values +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 DijkstraRouterEffort_h +#define DijkstraRouterEffort_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SUMOAbstractRouter.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class DijkstraRouterEffort + * @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) + * @param V The vehicle class to use (MSVehicle/ROVehicle) + * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions) + * @param EC The class to retrieve the effort for an edge from + * + * The router is edge-based. It must know the number of edges for internal reasons + * and whether a missing connection between two given edges (unbuild route) shall + * be reported as an error or as a warning. + * + */ +template +class DijkstraRouterEffort : public SUMOAbstractRouter, public PF { + +public: + typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); + /// Constructor + DijkstraRouterEffort(size_t noE, bool unbuildIsWarning, Operation effortOperation, Operation ttOperation) : + SUMOAbstractRouter(effortOperation, "DijkstraRouterEffort"), myTTOperation(ttOperation), + myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) { + for (size_t i = 0; i < noE; i++) { + myEdgeInfos.push_back(EdgeInfo(i)); + } + } + + /// Destructor + virtual ~DijkstraRouterEffort() { } + + virtual SUMOAbstractRouter* clone() const { + return new DijkstraRouterEffort(myEdgeInfos.size(), myErrorMsgHandler == MsgHandler::getWarningInstance(), this->myOperation, myTTOperation); + } + + /** + * @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(size_t id) + : edge(E::dictionary(id)), effort(std::numeric_limits::max()), leaveTime(0), prev(0), visited(false) {} + + /// The current edge + const E* edge; + + /// Effort to reach the edge + SUMOReal effort; + + /// The time the vehicle leaves the edge + SUMOReal leaveTime; + + /// The previous edge + EdgeInfo* prev; + + /// The previous edge + bool visited; + + inline void reset() { + effort = std::numeric_limits::max(); + visited = false; + } + }; + + /** + * @class EdgeInfoByEffortComparator + * Class to compare (and so sort) nodes by their effort + */ + class EdgeInfoByEffortComparator { + public: + /// Comparing method + bool operator()(EdgeInfo* nod1, EdgeInfo* nod2) const { + if (nod1->effort == nod2->effort) { + return nod1->edge->getNumericalID() > nod2->edge->getNumericalID(); + } + return nod1->effort > nod2->effort; + } + }; + + inline SUMOReal getTravelTime(const E* const e, const V* const v, SUMOReal t) const { + return (*myTTOperation)(e, v, t); + } + + void init() { + // all EdgeInfos touched in the previous query are either in myFrontierList or myFound: clean those up + for (typename std::vector::iterator i = myFrontierList.begin(); i != myFrontierList.end(); i++) { + (*i)->reset(); + } + myFrontierList.clear(); + for (typename std::vector::iterator i = myFound.begin(); i != myFound.end(); i++) { + (*i)->reset(); + } + myFound.clear(); + } + + + /** @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) { + assert(from != 0 && to != 0); + this->startQuery(); + const SUMOVehicleClass vClass = vehicle == 0 ? SVC_IGNORING : vehicle->getVClass(); + init(); + // add begin node + EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]); + fromInfo->effort = 0; + fromInfo->prev = 0; + fromInfo->leaveTime = STEPS2TIME(msTime); + myFrontierList.push_back(fromInfo); + // loop + int num_visited = 0; + while (!myFrontierList.empty()) { + num_visited += 1; + // use the node with the minimal length + EdgeInfo* const minimumInfo = myFrontierList.front(); + const E* const minEdge = minimumInfo->edge; + pop_heap(myFrontierList.begin(), myFrontierList.end(), myComparator); + myFrontierList.pop_back(); + myFound.push_back(minimumInfo); + // check whether the destination node was already reached + if (minEdge == to) { + buildPathFrom(minimumInfo, into); + this->endQuery(num_visited); + return; + } + minimumInfo->visited = true; + const SUMOReal effort = minimumInfo->effort + this->getEffort(minEdge, vehicle, minimumInfo->leaveTime); + const SUMOReal leaveTime = minimumInfo->leaveTime + getTravelTime(minEdge, vehicle, minimumInfo->leaveTime); + // check all ways from the node with the minimal length + const std::vector& successors = minEdge->getSuccessors(vClass); + for (typename std::vector::const_iterator it = successors.begin(); it != successors.end(); ++it) { + const E* const follower = *it; + EdgeInfo* const followerInfo = &(myEdgeInfos[follower->getNumericalID()]); + // check whether it can be used + if (PF::operator()(follower, vehicle)) { + continue; + } + const SUMOReal oldEffort = followerInfo->effort; + if (!followerInfo->visited && effort < oldEffort) { + followerInfo->effort = effort; + followerInfo->leaveTime = leaveTime; + followerInfo->prev = minimumInfo; + if (oldEffort == std::numeric_limits::max()) { + myFrontierList.push_back(followerInfo); + push_heap(myFrontierList.begin(), myFrontierList.end(), myComparator); + } else { + push_heap(myFrontierList.begin(), + find(myFrontierList.begin(), myFrontierList.end(), followerInfo) + 1, + myComparator); + } + } + } + } + this->endQuery(num_visited); + myErrorMsgHandler->inform("No connection between '" + from->getID() + "' and '" + to->getID() + "' found."); + } + + + 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) { + if (PF::operator()(*i, v)) { + return -1; + } + costs += this->getEffort(*i, v, t); + t += getTravelTime(*i, v, t); + } + return costs; + } + +public: + /// Builds the path from marked edges + void buildPathFrom(EdgeInfo* rbegin, std::vector& edges) { + std::deque tmp; + while (rbegin != 0) { + tmp.push_front((E*) rbegin->edge); // !!! + rbegin = rbegin->prev; + } + std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges)); + } + +private: + /// @brief The object's operation to perform for travel times + Operation myTTOperation; + + /// The container of edge information + std::vector myEdgeInfos; + + /// A container for reusage of the min edge heap + std::vector myFrontierList; + /// @brief list of visited Edges (for resetting) + std::vector myFound; + + EdgeInfoByEffortComparator myComparator; + + /// @brief the handler for routing errors + MsgHandler* const myErrorMsgHandler; + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/DijkstraRouterTT.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/DijkstraRouterTT.h --- sumo-0.21.0+dfsg/src/utils/vehicle/DijkstraRouterTT.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/DijkstraRouterTT.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,270 @@ +/****************************************************************************/ +/// @file DijkstraRouterTT.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date Mon, 25 July 2005 +/// @version $Id: DijkstraRouterTT.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Dijkstra shortest path algorithm using travel time +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 DijkstraRouterTT_h +#define DijkstraRouterTT_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SUMOAbstractRouter.h" + +//#define DijkstraRouterTT_DEBUG_QUERY +//#define DijkstraRouterTT_DEBUG_QUERY_PERF + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class DijkstraRouterTT + * @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) + * @param V The vehicle class to use (MSVehicle/ROVehicle) + * @param PF The prohibition function to use (prohibited_withRestrictions/prohibited_noRestrictions) + * @param EC The class to retrieve the effort for an edge from + * + * The router is edge-based. It must know the number of edges for internal reasons + * and whether a missing connection between two given edges (unbuild route) shall + * be reported as an error or as a warning. + * + */ +template +class DijkstraRouterTT : public SUMOAbstractRouter, public PF { + +public: + typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); + /// Constructor + DijkstraRouterTT(size_t noE, bool unbuildIsWarning, Operation operation) : + SUMOAbstractRouter(operation, "DijkstraRouterTT"), + myErrorMsgHandler(unbuildIsWarning ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()) { + for (size_t i = 0; i < noE; i++) { + myEdgeInfos.push_back(EdgeInfo(i)); + } + } + + /// Destructor + virtual ~DijkstraRouterTT() { } + + virtual SUMOAbstractRouter* clone() const { + return new DijkstraRouterTT(myEdgeInfos.size(), myErrorMsgHandler == MsgHandler::getWarningInstance(), this->myOperation); + } + + /** + * @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(size_t id) + : edge(E::dictionary(id)), traveltime(std::numeric_limits::max()), prev(0), visited(false) {} + + /// The current edge + const E* edge; + + /// Effort to reach the edge + SUMOReal traveltime; + + /// The previous edge + EdgeInfo* prev; + + /// The previous edge + bool visited; + + inline void reset() { + traveltime = std::numeric_limits::max(); + visited = false; + } + }; + + /** + * @class EdgeInfoByEffortComparator + * Class to compare (and so sort) nodes by their effort + */ + class EdgeInfoByTTComparator { + public: + /// Comparing method + bool operator()(const EdgeInfo* nod1, const EdgeInfo* nod2) const { + if (nod1->traveltime == nod2->traveltime) { + return nod1->edge->getNumericalID() > nod2->edge->getNumericalID(); + } + return nod1->traveltime > nod2->traveltime; + } + }; + + void init() { + // all EdgeInfos touched in the previous query are either in myFrontierList or myFound: clean those up + for (typename std::vector::iterator i = myFrontierList.begin(); i != myFrontierList.end(); i++) { + (*i)->reset(); + } + myFrontierList.clear(); + for (typename std::vector::iterator i = myFound.begin(); i != myFound.end(); i++) { + (*i)->reset(); + } + myFound.clear(); + } + + + /** @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) { + assert(from != 0 && (vehicle == 0 || to != 0)); + this->startQuery(); + const SUMOVehicleClass vClass = vehicle == 0 ? SVC_IGNORING : vehicle->getVClass(); + const SUMOReal time = STEPS2TIME(msTime); + init(); + // add begin node + EdgeInfo* const fromInfo = &(myEdgeInfos[from->getNumericalID()]); + fromInfo->traveltime = 0; + fromInfo->prev = 0; + myFrontierList.push_back(fromInfo); + // loop + int num_visited = 0; + while (!myFrontierList.empty()) { + num_visited += 1; + // use the node with the minimal length + EdgeInfo* const minimumInfo = myFrontierList.front(); + const E* const minEdge = minimumInfo->edge; + pop_heap(myFrontierList.begin(), myFrontierList.end(), myComparator); + myFrontierList.pop_back(); + myFound.push_back(minimumInfo); +#ifdef DijkstraRouterTT_DEBUG_QUERY + std::cout << "DEBUG: hit '" << minEdge->getID() << "' TT: " << minimumInfo->traveltime << " Q: "; + for (typename std::vector::iterator it = myFrontierList.begin(); it != myFrontierList.end(); it++) { + std::cout << (*it)->traveltime << "," << (*it)->edge->getID() << " "; + } + std::cout << "\n"; +#endif + // check whether the destination node was already reached + if (minEdge == to) { + buildPathFrom(minimumInfo, into); + this->endQuery(num_visited); +#ifdef DijkstraRouterTT_DEBUG_QUERY_PERF + std::cout << "visited " + toString(num_visited) + " edges (final path length: " + toString(into.size()) + ")\n"; +#endif + return; + } + minimumInfo->visited = true; + const SUMOReal traveltime = minimumInfo->traveltime + this->getEffort(minEdge, vehicle, time + minimumInfo->traveltime); + // check all ways from the node with the minimal length + const std::vector& successors = minEdge->getSuccessors(vClass); + for (typename std::vector::const_iterator it = successors.begin(); it != successors.end(); ++it) { + const E* const follower = *it; + EdgeInfo* const followerInfo = &(myEdgeInfos[follower->getNumericalID()]); + // check whether it can be used + if (PF::operator()(follower, vehicle)) { + continue; + } + const SUMOReal oldEffort = followerInfo->traveltime; + if (!followerInfo->visited && traveltime < oldEffort) { + followerInfo->traveltime = traveltime; + followerInfo->prev = minimumInfo; + if (oldEffort == std::numeric_limits::max()) { + myFrontierList.push_back(followerInfo); + push_heap(myFrontierList.begin(), myFrontierList.end(), myComparator); + } else { + push_heap(myFrontierList.begin(), + find(myFrontierList.begin(), myFrontierList.end(), followerInfo) + 1, + myComparator); + } + } + } + } + this->endQuery(num_visited); +#ifdef DijkstraRouterTT_DEBUG_QUERY_PERF + std::cout << "visited " + toString(num_visited) + " edges (final path length: " + toString(into.size()) + ")\n"; +#endif + if (to != 0) { + myErrorMsgHandler->inform("No connection between '" + from->getID() + "' and '" + to->getID() + "' found."); + } + } + + + 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) { + if (PF::operator()(*i, v)) { + return -1; + } + costs += this->getEffort(*i, v, time + costs); + } + return costs; + } + +public: + /// Builds the path from marked edges + void buildPathFrom(EdgeInfo* rbegin, std::vector& edges) { + std::deque tmp; + while (rbegin != 0) { + tmp.push_front((E*) rbegin->edge); // !!! + rbegin = rbegin->prev; + } + std::copy(tmp.begin(), tmp.end(), std::back_inserter(edges)); + } + + const EdgeInfo& getEdgeInfo(size_t index) const { + return myEdgeInfos[index]; + } + +private: + /// The container of edge information + std::vector myEdgeInfos; + + /// A container for reusage of the min edge heap + std::vector myFrontierList; + /// @brief list of visited Edges (for resetting) + std::vector myFound; + + EdgeInfoByTTComparator myComparator; + + /// @brief the handler for routing errors + MsgHandler* const myErrorMsgHandler; +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/GawronCalculator.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/GawronCalculator.h --- sumo-0.21.0+dfsg/src/utils/vehicle/GawronCalculator.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/GawronCalculator.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,125 @@ +/****************************************************************************/ +/// @file GawronCalculator.h +/// @author Daniel Krajzewicz +/// @author Michael Behrisch +/// @author Jakob Erdmann +/// @date Sept 2002 +/// @version $Id: GawronCalculator.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Calculators for route costs and probabilities +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 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 GawronCalculator_h +#define GawronCalculator_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GawronCalculator + * @brief Cost calculation with Gawron's method. + */ +template +class GawronCalculator : public RouteCostCalculator { +public: + /// Constructor + GawronCalculator(const SUMOReal beta, const SUMOReal a) : myBeta(beta), myA(a) {} + + /// Destructor + virtual ~GawronCalculator() {} + + void setCosts(R* route, const SUMOReal costs, const bool isActive = false) const { + if (isActive) { + route->setCosts(costs); + } else { + route->setCosts(myBeta * costs + ((SUMOReal) 1.0 - myBeta) * route->getCosts()); + } + } + + /** @brief calculate the probabilities */ + void calculateProbabilities(std::vector alternatives, const V* const /* veh */, const SUMOTime /* time */) { + for (typename std::vector::iterator i = alternatives.begin(); i != alternatives.end() - 1; i++) { + R* pR = *i; + for (typename std::vector::iterator j = i + 1; j != alternatives.end(); j++) { + R* pS = *j; + // see [Gawron, 1998] (4.2) + const SUMOReal delta = + (pS->getCosts() - pR->getCosts()) / + (pS->getCosts() + pR->getCosts()); + // see [Gawron, 1998] (4.3a, 4.3b) + SUMOReal newPR = gawronF(pR->getProbability(), pS->getProbability(), delta); + SUMOReal newPS = pR->getProbability() + pS->getProbability() - newPR; + if (ISNAN(newPR) || ISNAN(newPS)) { + newPR = pS->getCosts() > pR->getCosts() + ? (SUMOReal) 1. : 0; + newPS = pS->getCosts() > pR->getCosts() + ? 0 : (SUMOReal) 1.; + } + newPR = MIN2((SUMOReal) MAX2(newPR, (SUMOReal) 0), (SUMOReal) 1); + newPS = MIN2((SUMOReal) MAX2(newPS, (SUMOReal) 0), (SUMOReal) 1); + pR->setProbability(newPR); + pS->setProbability(newPS); + } + } + } + +private: + /** @brief Performs the gawron - f() function + From "Dynamic User Equilibria..." */ + SUMOReal gawronF(const SUMOReal pdr, const SUMOReal pds, const SUMOReal x) const { + if (pdr * gawronG(myA, x) + pds == 0) { + return std::numeric_limits::max(); + } + return (pdr * (pdr + pds) * gawronG(myA, x)) / + (pdr * gawronG(myA, x) + pds); + } + + /** @brief Performs the gawron - g() function + From "Dynamic User Equilibria..." */ + SUMOReal gawronG(const SUMOReal a, const SUMOReal x) const { + if (((1.0 - (x * x)) == 0)) { + return std::numeric_limits::max(); + } + return (SUMOReal) exp((a * x) / (1.0 - (x * x))); + } + +private: + /// @brief gawron beta - value + const SUMOReal myBeta; + + /// @brief gawron a - value + const SUMOReal myA; + +private: + /** @brief invalidated assignment operator */ + GawronCalculator& operator=(const GawronCalculator& s); + +}; +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/LogitCalculator.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/LogitCalculator.h --- sumo-0.21.0+dfsg/src/utils/vehicle/LogitCalculator.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/LogitCalculator.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,165 @@ +/****************************************************************************/ +/// @file LogitCalculator.h +/// @author Daniel Krajzewicz +/// @author Michael Behrisch +/// @author Jakob Erdmann +/// @date Sept 2002 +/// @version $Id: LogitCalculator.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Calculators for route costs and probabilities +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 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 LogitCalculator_h +#define LogitCalculator_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class LogitCalculator + * @brief Cost calculation with c-logit or logit method. + */ +template +class LogitCalculator : public RouteCostCalculator { +public: + /// Constructor + LogitCalculator(const SUMOReal beta, const SUMOReal gamma, + const SUMOReal theta) : myBeta(beta), myGamma(gamma), myTheta(theta) {} + + /// Destructor + virtual ~LogitCalculator() {} + + void setCosts(R* route, const SUMOReal costs, const bool /* isActive */) const { + route->setCosts(costs); + } + + /** @brief calculate the probabilities in the logit model */ + void calculateProbabilities(std::vector alternatives, const V* const veh, const SUMOTime time) { + const SUMOReal theta = myTheta >= 0 ? myTheta : getThetaForCLogit(alternatives); + const SUMOReal beta = myBeta >= 0 ? myBeta : getBetaForCLogit(alternatives); + if (beta > 0) { + // calculate commonalities + for (typename std::vector::const_iterator i = alternatives.begin(); i != alternatives.end(); i++) { + const R* pR = *i; + SUMOReal lengthR = 0; + const std::vector& edgesR = pR->getEdgeVector(); + for (typename std::vector::const_iterator edge = edgesR.begin(); edge != edgesR.end(); ++edge) { + //@todo we should use costs here + lengthR += (*edge)->getTravelTime(veh, STEPS2TIME(time)); + } + SUMOReal overlapSum = 0; + for (typename std::vector::const_iterator j = alternatives.begin(); j != alternatives.end(); j++) { + const R* pS = *j; + SUMOReal overlapLength = 0.; + SUMOReal lengthS = 0; + const std::vector& edgesS = pS->getEdgeVector(); + for (typename std::vector::const_iterator edge = edgesS.begin(); edge != edgesS.end(); ++edge) { + lengthS += (*edge)->getTravelTime(veh, STEPS2TIME(time)); + if (std::find(edgesR.begin(), edgesR.end(), *edge) != edgesR.end()) { + overlapLength += (*edge)->getTravelTime(veh, STEPS2TIME(time)); + } + } + overlapSum += pow(overlapLength / sqrt(lengthR * lengthS), myGamma); + } + myCommonalities[pR] = beta * log(overlapSum); + } + } + for (typename std::vector::iterator i = alternatives.begin(); i != alternatives.end(); i++) { + R* pR = *i; + SUMOReal weightedSum = 0; + for (typename std::vector::iterator j = alternatives.begin(); j != alternatives.end(); j++) { + R* pS = *j; + weightedSum += exp(theta * (pR->getCosts() - pS->getCosts() + myCommonalities[pR] - myCommonalities[pS])); + } + pR->setProbability(1. / weightedSum); + } + } + + +private: + /** @brief calculate the scaling factor in the logit model */ + SUMOReal getBetaForCLogit(const std::vector alternatives) const { + SUMOReal min = std::numeric_limits::max(); + for (typename std::vector::const_iterator i = alternatives.begin(); i != alternatives.end(); i++) { + const SUMOReal cost = (*i)->getCosts() / 3600.; + if (cost < min) { + min = cost; + } + } + return min; + } + + /** @brief calculate the scaling factor in the logit model */ + SUMOReal getThetaForCLogit(const std::vector alternatives) const { + // @todo this calculation works for travel times only + SUMOReal sum = 0.; + SUMOReal diff = 0.; + SUMOReal min = std::numeric_limits::max(); + for (typename std::vector::const_iterator i = alternatives.begin(); i != alternatives.end(); i++) { + const SUMOReal cost = (*i)->getCosts() / 3600.; + sum += cost; + if (cost < min) { + min = cost; + } + } + const SUMOReal meanCost = sum / SUMOReal(alternatives.size()); + for (typename std::vector::const_iterator i = alternatives.begin(); i != alternatives.end(); i++) { + 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 3.1415926535897932384626433832795 / (sqrt(6.) * cvCost * (min + 1.1)) / 3600.; + // } + // return 1./3600.; + } + + +private: + /// @brief logit beta - value + const SUMOReal myBeta; + + /// @brief logit gamma - value + const SUMOReal myGamma; + + /// @brief logit theta - value + const SUMOReal myTheta; + + /// @brief The route commonality factors for c-logit + std::map myCommonalities; + +private: + /** @brief invalidated assignment operator */ + LogitCalculator& operator=(const LogitCalculator& s); + +}; + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/Makefile.am sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/Makefile.am --- sumo-0.21.0+dfsg/src/utils/vehicle/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/Makefile.am 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +noinst_LIBRARIES = libvehicle.a + +libvehicle_a_SOURCES = AStarRouter.h \ +BulkStarRouter.h \ +CHRouter.h CHRouterWrapper.h \ +DijkstraRouterTT.h DijkstraRouterEffort.h \ +GawronCalculator.h LogitCalculator.h RouteCostCalculator.h \ +PedestrianRouter.h SUMOAbstractRouter.h \ +SPTree.h SUMOVehicle.h \ +SUMOVehicleParameter.cpp SUMOVehicleParameter.h \ +SUMOVTypeParameter.cpp SUMOVTypeParameter.h diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/Makefile.in --- sumo-0.21.0+dfsg/src/utils/vehicle/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,625 @@ +# Makefile.in generated by automake 1.13.4 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +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/vehicle +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +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 +AM_V_AR = $(am__v_AR_@AM_V@) +am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) +am__v_AR_0 = @echo " AR " $@; +am__v_AR_1 = +libvehicle_a_AR = $(AR) $(ARFLAGS) +libvehicle_a_LIBADD = +am_libvehicle_a_OBJECTS = SUMOVehicleParameter.$(OBJEXT) \ + SUMOVTypeParameter.$(OBJEXT) +libvehicle_a_OBJECTS = $(am_libvehicle_a_OBJECTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +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) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libvehicle_a_SOURCES) +DIST_SOURCES = $(libvehicle_a_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +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@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +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_CONFIG = @FOX_CONFIG@ +FOX_LDFLAGS = @FOX_LDFLAGS@ +GDAL_CONFIG = @GDAL_CONFIG@ +GDAL_LDFLAGS = @GDAL_LDFLAGS@ +GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ +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_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 = libvehicle.a +libvehicle_a_SOURCES = AStarRouter.h \ +BulkStarRouter.h \ +CHRouter.h CHRouterWrapper.h \ +DijkstraRouterTT.h DijkstraRouterEffort.h \ +GawronCalculator.h LogitCalculator.h RouteCostCalculator.h \ +PedestrianRouter.h SUMOAbstractRouter.h \ +SPTree.h SUMOVehicle.h \ +SUMOVehicleParameter.cpp SUMOVehicleParameter.h \ +SUMOVTypeParameter.cpp SUMOVTypeParameter.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/vehicle/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/utils/vehicle/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) + +libvehicle.a: $(libvehicle_a_OBJECTS) $(libvehicle_a_DEPENDENCIES) $(EXTRA_libvehicle_a_DEPENDENCIES) + $(AM_V_at)-rm -f libvehicle.a + $(AM_V_AR)$(libvehicle_a_AR) libvehicle.a $(libvehicle_a_OBJECTS) $(libvehicle_a_LIBADD) + $(AM_V_at)$(RANLIB) libvehicle.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOVTypeParameter.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUMOVehicleParameter.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + 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-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + 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" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +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 TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \ + ctags-am 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 tags-am 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.21.0+dfsg/src/utils/vehicle/PedestrianRouter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/PedestrianRouter.h --- sumo-0.21.0+dfsg/src/utils/vehicle/PedestrianRouter.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/PedestrianRouter.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,565 @@ +/****************************************************************************/ +/// @file PedestrianRouter.h +/// @author Jakob Erdmann +/// @date Mon, 03 March 2014 +/// @version $Id: PedestrianRouter.h 18096 2015-03-17 09:50:59Z behrisch $ +/// +// The Pedestrian Router build a special network and (delegegates to a SUMOAbstractRouter) +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 PedestrianRouter_h +#define PedestrianRouter_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define TL_RED_PENALTY 20 + +//#define PedestrianRouter_DEBUG_NETWORK +//#define PedestrianRouter_DEBUG_ROUTES +//#define PedestrianRouter_DEBUG_EFFORTS + +template +inline const L* getSidewalk(const E* edge) { + if (edge == 0) { + return 0; + } + const std::vector& lanes = edge->getLanes(); + for (typename std::vector::const_iterator it = lanes.begin(); it != lanes.end(); ++it) { + if ((*it)->allowsVehicleClass(SVC_PEDESTRIAN)) { + return *it; + } + } + return 0; +} + +// =========================================================================== +// class definitions +// =========================================================================== + +/// @brief the "vehicle" type that is given to the internal router (SUMOAbstractRouter) +template +struct PedestrianTrip { + + PedestrianTrip(const E* _from, const E* _to, SUMOReal _departPos, SUMOReal _arrivalPos, SUMOReal _speed, SUMOReal _departTime, const N* _node) : + from(_from), + to(_to), + node(_node), + departPos(_departPos < 0 ? _from->getLength() + _departPos : _departPos), + arrivalPos(_arrivalPos < 0 ? _to->getLength() + _arrivalPos : _arrivalPos), + speed(_speed), + departTime(_departTime) + {} + + // exists just for debugging purposes + std::string getID() const { + return from->getID() + ":" + to->getID() + ":" + toString(departTime); + } + + + inline SUMOVehicleClass getVClass() const { + return SVC_PEDESTRIAN; + } + + const E* from; + const E* to; + const N* node; // indicates whether only routing across this node shall be performed + const SUMOReal departPos; + const SUMOReal arrivalPos; + const SUMOReal speed; + const SUMOReal departTime; +private: + /// @brief Invalidated assignment operator. + PedestrianTrip& operator=(const PedestrianTrip&); +}; + + +/// @brief the edge type that is given to the internal router (SUMOAbstractRouter) +template +class PedestrianEdge : public Named { + typedef std::pair EdgePair; + /* brief build the pedestrian network (once) + * @param noE The number of edges in the dictionary of E + */ + +public: + static size_t dictSize() { + return myEdgeDict.size(); + } + + static void cleanup() { + myFromToLookup.clear(); + myBidiLookup.clear(); + myEdgeDict.clear(); + } + + static void initPedestrianNetwork(size_t noE) { + if (myEdgeDict.size() > 0) { + return; + } +#ifdef PedestrianRouter_DEBUG_NETWORK + std::cout << "initPedestrianNetwork\n"; +#endif + // build the Pedestrian edges + bool haveSeenWalkingArea = false; + unsigned int numericalID = 0; + for (size_t i = 0; i < noE; i++) { + E* edge = E::dictionary(i); + const L* lane = getSidewalk(edge); + if (edge->isInternal() || lane == 0) { + continue; + } else if (edge->isWalkingArea()) { + // only a single edge + myEdgeDict.push_back(PedestrianEdge(numericalID++, edge, lane, true)); + haveSeenWalkingArea = true; + } else { // regular edge or crossing + // forward and backward edges + myEdgeDict.push_back(PedestrianEdge(numericalID++, edge, lane, true)); + myEdgeDict.push_back(PedestrianEdge(numericalID++, edge, lane, false)); + // depart and arrival edges for (the router can decide the initial direction to take and the direction to arrive from) + myEdgeDict.push_back(PedestrianEdge(numericalID++, edge, lane, true, true)); + myEdgeDict.push_back(PedestrianEdge(numericalID++, edge, lane, false, true)); + } + + } + // build the lookup tables after myEdgeDict is complete + numericalID = 0; + for (size_t i = 0; i < noE; i++) { + E* edge = E::dictionary(i); + const L* lane = getSidewalk(edge); + if (edge->isInternal() || lane == 0) { + continue; + } else if (edge->isWalkingArea()) { + // only a single edge. Connectors are used when routing across a single intersecton + myBidiLookup[edge] = std::make_pair(&myEdgeDict[numericalID], &myEdgeDict[numericalID]); + myFromToLookup[edge] = std::make_pair(&myEdgeDict[numericalID], &myEdgeDict[numericalID]); + numericalID += 1; + } else { // regular edge or crossing + myBidiLookup[edge] = std::make_pair(&myEdgeDict[numericalID], &myEdgeDict[numericalID + 1]); + myFromToLookup[edge] = std::make_pair(&myEdgeDict[numericalID + 2], &myEdgeDict[numericalID + 3]); + numericalID += 4; + } + } + + // build the connections + for (size_t i = 0; i < noE; i++) { + E* edge = E::dictionary(i); + const L* sidewalk = getSidewalk(edge); + if (edge->isInternal() || sidewalk == 0) { + continue; + } + // find all incoming and outgoing lanes for the sidewalk and + // connect the corresponding PedestrianEdges + const EdgePair& pair = getBothDirections(edge); +#ifdef PedestrianRouter_DEBUG_NETWORK + std::cout << " building connections from " << sidewalk->getID() << "\n"; +#endif + if (haveSeenWalkingArea) { + std::vector outgoing = sidewalk->getOutgoingLanes(); + // if one of the outgoing lanes is a walking area it must be used. + // All other connections shall be ignored + bool hasWalkingArea = false; + for (typename std::vector::iterator it = outgoing.begin(); it != outgoing.end(); ++it) { + const L* target = *it; + const E* targetEdge = &(target->getEdge()); + if (targetEdge->isWalkingArea()) { + hasWalkingArea = true; + break; + } + } + for (typename std::vector::iterator it = outgoing.begin(); it != outgoing.end(); ++it) { + const L* target = *it; + const E* targetEdge = &(target->getEdge()); + const bool used = (target == getSidewalk(targetEdge) + && (!hasWalkingArea || targetEdge->isWalkingArea())); +#ifdef PedestrianRouter_DEBUG_NETWORK + const L* potTarget = getSidewalk(targetEdge); + std::cout << " lane=" << (potTarget == 0 ? "NULL" : potTarget->getID()) << (used ? "(used)" : "") << "\n"; +#endif + if (used) { + const EdgePair& targetPair = getBothDirections(targetEdge); + pair.first->myFollowingEdges.push_back(targetPair.first); + targetPair.second->myFollowingEdges.push_back(pair.second); +#ifdef PedestrianRouter_DEBUG_NETWORK + std::cout << " " << pair.first->getID() << " -> " << targetPair.first->getID() << "\n"; + std::cout << " " << targetPair.second->getID() << " -> " << pair.second->getID() << "\n"; +#endif + } + } + } else { + // we have a network without pedestrian structures. Assume that + // all sidewalks at a crossing are interconnected + const N* toNode = edge->getToJunction(); + std::vector outgoing = toNode->getOutgoing(); + for (typename std::vector::iterator it = outgoing.begin(); it != outgoing.end(); ++it) { + // build forward and backward connections for all outgoing sidewalks + const E* targetEdge = *it; + const L* target = getSidewalk(targetEdge); + if (targetEdge->isInternal() || target == 0) { + continue; + } + const EdgePair& targetPair = getBothDirections(targetEdge); + pair.first->myFollowingEdges.push_back(targetPair.first); + targetPair.second->myFollowingEdges.push_back(pair.second); +#ifdef PedestrianRouter_DEBUG_NETWORK + std::cout << " " << pair.first->getID() << " -> " << targetPair.first->getID() << "\n"; + std::cout << " " << targetPair.second->getID() << " -> " << pair.second->getID() << "\n"; +#endif + } + std::vector incoming = toNode->getIncoming(); + for (typename std::vector::iterator it = incoming.begin(); it != incoming.end(); ++it) { + // build forward-to-backward connections for all incoming sidewalks + const E* targetEdge = *it; + const L* target = getSidewalk(targetEdge); + if (targetEdge->isInternal() || target == 0 || targetEdge == edge) { + continue; + } + const EdgePair& targetPair = getBothDirections(targetEdge); + pair.first->myFollowingEdges.push_back(targetPair.second); // change direction +#ifdef PedestrianRouter_DEBUG_NETWORK + std::cout << " " << pair.first->getID() << " -> " << targetPair.second->getID() << "\n"; +#endif + + } + const N* fromNode = edge->getFromJunction(); + outgoing = fromNode->getOutgoing(); + for (typename std::vector::iterator it = outgoing.begin(); it != outgoing.end(); ++it) { + // build backward-to-forward connections for all outgoing sidewalks at the fromNode + const E* targetEdge = *it; + const L* target = getSidewalk(targetEdge); + if (targetEdge->isInternal() || target == 0 || targetEdge == edge) { + continue; + } + const EdgePair& targetPair = getBothDirections(targetEdge); + pair.second->myFollowingEdges.push_back(targetPair.first); +#ifdef PedestrianRouter_DEBUG_NETWORK + std::cout << " " << pair.second->getID() << " -> " << targetPair.first->getID() << "\n"; +#endif + } + } + if (edge->isWalkingArea()) { + continue; + } + // build connections from depart connector + PedestrianEdge* startConnector = getDepartEdge(edge); + startConnector->myFollowingEdges.push_back(pair.first); + startConnector->myFollowingEdges.push_back(pair.second); + // build connections to arrival connector + PedestrianEdge* endConnector = getArrivalEdge(edge); + pair.first->myFollowingEdges.push_back(endConnector); + pair.second->myFollowingEdges.push_back(endConnector); +#ifdef PedestrianRouter_DEBUG_NETWORK + std::cout << " " << startConnector->getID() << " -> " << pair.first->getID() << "\n"; + std::cout << " " << startConnector->getID() << " -> " << pair.second->getID() << "\n"; + std::cout << " " << pair.first->getID() << " -> " << endConnector->getID() << "\n"; + std::cout << " " << pair.second->getID() << " -> " << endConnector->getID() << "\n"; +#endif + } + } + + bool includeInRoute(bool allEdges) const { + return !myAmConnector && (allEdges || (!myEdge->isCrossing() && !myEdge->isWalkingArea())); + } + + const E* getEdge() const { + return myEdge; + } + + /// @brief Returns the pair of forward and backward edge + static const EdgePair& getBothDirections(const E* e) { + typename std::map::const_iterator it = myBidiLookup.find(e); + if (it == myBidiLookup.end()) { + assert(false); + throw ProcessError("Edge '" + e->getID() + "' not found in pedestrian network '"); + } + return (*it).second; + } + + /// @brief Returns the departing Pedestrian edge + static PedestrianEdge* getDepartEdge(const E* e) { + typename std::map::const_iterator it = myFromToLookup.find(e); + if (it == myFromToLookup.end()) { + assert(false); + throw ProcessError("Edge '" + e->getID() + "' not found in pedestrian network '"); + } + return (*it).second.first; + } + + /// @brief Returns the arriving Pedestrian edge + static PedestrianEdge* getArrivalEdge(const E* e) { + typename std::map::const_iterator it = myFromToLookup.find(e); + if (it == myFromToLookup.end()) { + assert(false); + throw ProcessError("Edge '" + e->getID() + "' not found in pedestrian network '"); + } + return (*it).second.second; + } + + /// @name The interface as required by SUMOAbstractRouter routes + /// @{ + + unsigned int getNumericalID() const { + return myNumericalID; + } + + /// @brief Returns the PedstrianEdge with the given numericalID + static const PedestrianEdge* dictionary(size_t index) { + assert(index < myEdgeDict.size()); + return &myEdgeDict[index]; + } + + unsigned int getNumSuccessors() const { + return (unsigned int)myFollowingEdges.size(); + } + + const std::vector& getSuccessors() const { + return myFollowingEdges; + } + + const std::vector& getSuccessors(SUMOVehicleClass /*vClass*/) const { + // the network is already tailored for pedestrians. No need to check for permissions here + return myFollowingEdges; + } + + bool prohibits(const PedestrianTrip* const trip) const { + if (trip->node == 0) { + // network only includes PedestrianEdges + return false; + } else { + // limit routing to the surroundings of the specified node + return (myEdge->getFromJunction() != trip->node + && myEdge->getToJunction() != trip->node); + } + } + + /// @} + + /*@brief the function called by RouterTT_direct + * (distance is used as effort, effort is assumed to be independent of time + */ + static SUMOReal getEffort(const PedestrianEdge* const edge, const PedestrianTrip* const trip, SUMOReal time) { + if (edge->myAmConnector) { + return 0; + } + SUMOReal length = edge->myEdge->getLength(); + if (edge->myEdge == trip->from) { + if (edge->myForward) { + length -= trip->departPos; + } else { + length = trip->departPos; + } + } + if (edge->myEdge == trip->to) { + if (edge->myForward) { + length = trip->arrivalPos; + } else { + length -= trip->arrivalPos; + } + } + // ensure that 'normal' edges always have a higher weight than connector edges + length = MAX2(length, POSITION_EPS); + SUMOReal tlsDelay = 0; + // @note pedestrian traffic lights should never have LINKSTATE_TL_REDYELLOW + if (edge->myEdge->isCrossing() && edge->myLane->getIncomingLinkState() == LINKSTATE_TL_RED) { + // red traffic lights occurring later in the route may be green by the time we arive + tlsDelay += MAX2(SUMOReal(0), TL_RED_PENALTY - (time - trip->departTime)); + + } +#ifdef PedestrianRouter_DEBUG_EFFORTS + std::cout << " effort for " << trip->getID() << " at " << time << " edge=" << edge->getID() << " effort=" << length / trip->speed + tlsDelay << " l=" << length << " s=" << trip->speed << " tlsDelay=" << tlsDelay << "\n"; +#endif + return length / trip->speed + tlsDelay; + } + +private: + PedestrianEdge(unsigned int numericalID, const E* edge, const L* lane, bool forward, bool connector = false) : + Named(edge->getID() + (edge->isWalkingArea() ? "" : + ((forward ? "_fwd" : "_bwd") + std::string(connector ? "_connector" : "")))), + myNumericalID(numericalID), + myEdge(edge), + myLane(lane), + myForward(forward), + myAmConnector(connector) { } + + /// @brief the index in myEdgeDict + unsigned int myNumericalID; + + /// @brief the original edge + const E* myEdge; + + /// @brief the original edge + const L* myLane; + + /// @brief the direction of this edge + bool myForward; + + /// @brief the direction of this edge + bool myAmConnector; + + /// @brief List of edges that may be approached from this edge + std::vector myFollowingEdges; + + /// @brief the edge dictionary + static std::vector myEdgeDict; + + /// @brief retrieve the forward and backward edge for the given input edge E + static std::map myBidiLookup; + + /// @brief retrieve the depart and arrival edge for the given input edge E + static std::map myFromToLookup; + +}; + + +/** + * @class PedestrianRouter + * The router for pedestrians (on a bidirectional network of sidewalks and crossings + */ +template +class PedestrianRouter : public SUMOAbstractRouter > { +public: + + typedef PedestrianEdge _PedestrianEdge; + typedef PedestrianTrip _PedestrianTrip; + + /// Constructor + PedestrianRouter(): + SUMOAbstractRouter(0, "PedestrianRouter") { + _PedestrianEdge::initPedestrianNetwork(E::dictSize()); + myInternalRouter = new INTERNALROUTER(_PedestrianEdge::dictSize(), true, &_PedestrianEdge::getEffort); + } + + /// Destructor + virtual ~PedestrianRouter() { + delete myInternalRouter; + } + + virtual SUMOAbstractRouter >* clone() const { + return new PedestrianRouter(); + } + + /** @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 */ + void compute(const E* from, const E* to, SUMOReal departPos, SUMOReal arrivalPos, SUMOReal speed, + SUMOTime msTime, const N* onlyNode, std::vector& into, bool allEdges = false) { + //startQuery(); + if (getSidewalk(from) == 0) { + WRITE_WARNING("Departure edge '" + from->getID() + "' does not allow pedestrians."); + return; + } + if (getSidewalk(to) == 0) { + WRITE_WARNING("Destination edge '" + to->getID() + "' does not allow pedestrians."); + return; + } + _PedestrianTrip trip(from, to, departPos, arrivalPos, speed, msTime, onlyNode); + std::vector intoPed; + myInternalRouter->compute(_PedestrianEdge::getDepartEdge(from), + _PedestrianEdge::getArrivalEdge(to), &trip, msTime, intoPed); + for (size_t i = 0; i < intoPed.size(); ++i) { + if (intoPed[i]->includeInRoute(allEdges)) { + into.push_back(intoPed[i]->getEdge()); + } + } +#ifdef PedestrianRouter_DEBUG_ROUTES + SUMOReal time = msTime; + for (size_t i = 0; i < intoPed.size(); ++i) { + time += myInternalRouter->getEffort(intoPed[i], &trip, time); + } + std::cout << TIME2STEPS(msTime) << " trip from " << from->getID() << " to " << to->getID() + << " departPos=" << departPos + << " arrivalPos=" << arrivalPos + << " onlyNode=" << (onlyNode == 0 ? "NULL" : onlyNode->getID()) + << " edges=" << toString(intoPed) + << " resultEdges=" << toString(into) + << " time=" << time + << "\n"; +#endif + //endQuery(); + } + + /** @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 */ + void compute(const E*, const E*, const _PedestrianTrip* const, + SUMOTime, std::vector&) { + throw ProcessError("Do not use this method"); + } + + SUMOReal recomputeCosts(const std::vector&, const _PedestrianTrip* const, SUMOTime) const { + throw ProcessError("Do not use this method"); + } + + void prohibit(const std::vector& toProhibit) { + std::vector<_PedestrianEdge*> toProhibitPE; + for (typename std::vector::const_iterator it = toProhibit.begin(); it != toProhibit.end(); ++it) { + toProhibitPE.push_back(_PedestrianEdge::getBothDirections(*it).first); + toProhibitPE.push_back(_PedestrianEdge::getBothDirections(*it).second); + } + myInternalRouter->prohibit(toProhibitPE); + } + +private: + INTERNALROUTER* myInternalRouter; + + +private: + /// @brief Invalidated assignment operator + PedestrianRouter& operator=(const PedestrianRouter& s); + +private: + +}; + +// common specializations +template +class PedestrianRouterDijkstra : public PedestrianRouter < E, L, N, + DijkstraRouterTT, PedestrianTrip, prohibited_withRestrictions, PedestrianTrip > > > { }; + + +// =========================================================================== +// static member definitions (PedestrianEdge) +// =========================================================================== + +template +std::vector > PedestrianEdge::myEdgeDict; + +template +std::map::EdgePair> PedestrianEdge::myBidiLookup; + +template +std::map::EdgePair> PedestrianEdge::myFromToLookup; + +#endif + + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/RouteCostCalculator.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/RouteCostCalculator.h --- sumo-0.21.0+dfsg/src/utils/vehicle/RouteCostCalculator.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/RouteCostCalculator.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,125 @@ +/****************************************************************************/ +/// @file RouteCostCalculator.h +/// @author Daniel Krajzewicz +/// @author Michael Behrisch +/// @author Jakob Erdmann +/// @date Sept 2002 +/// @version $Id: RouteCostCalculator.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Calculators for route costs and probabilities +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 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 RouteCostCalculator_h +#define RouteCostCalculator_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class RouteCostCalculator + * @brief Abstract base class providing static factory method. + */ +template +class RouteCostCalculator { +public: + static RouteCostCalculator& getCalculator(); + + static void cleanup() { + delete myInstance; + myInstance = 0; + } + + virtual void setCosts(R* route, const SUMOReal costs, const bool isActive = false) const = 0; + + /** @brief calculate the probabilities in the logit model */ + virtual void calculateProbabilities(std::vector alternatives, const V* const veh, const SUMOTime time) = 0; + + unsigned int getMaxRouteNumber() const { + return myMaxRouteNumber; + } + + bool keepRoutes() const { + return myKeepRoutes; + } + + bool skipRouteCalculation() const { + return mySkipRouteCalculation; + } + +protected: + /// @brief Constructor + RouteCostCalculator() { + OptionsCont& oc = OptionsCont::getOptions(); + myMaxRouteNumber = oc.getInt("max-alternatives"); + myKeepRoutes = oc.getBool("keep-all-routes"); + mySkipRouteCalculation = oc.getBool("skip-new-routes"); + } + + /// @brief Destructor + virtual ~RouteCostCalculator() {} + +private: + static RouteCostCalculator* 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; + +}; + + +// =========================================================================== +// static member definitions +// =========================================================================== +template +RouteCostCalculator* RouteCostCalculator::myInstance = 0; + + +#include "GawronCalculator.h" +#include "LogitCalculator.h" + +template +RouteCostCalculator& RouteCostCalculator::getCalculator() { + if (myInstance == 0) { + OptionsCont& oc = OptionsCont::getOptions(); + if (oc.getString("route-choice-method") == "logit") { + myInstance = new LogitCalculator(oc.getFloat("logit.beta"), oc.getFloat("logit.gamma"), oc.getFloat("logit.theta")); + } else if (oc.getString("route-choice-method") == "gawron") { + myInstance = new GawronCalculator(oc.getFloat("gawron.beta"), oc.getFloat("gawron.a")); + } + } + return *myInstance; +} +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/SPTree.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SPTree.h --- sumo-0.21.0+dfsg/src/utils/vehicle/SPTree.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SPTree.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,250 @@ +/****************************************************************************/ +/// @file SPTree.h +/// @author Laura Bieker +/// @author Michael Behrisch +/// @date February 2012 +/// @version $Id: SPTree.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Shortest Path tree of limited depth using Dijkstras algorithm +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 SPTree_h +#define SPTree_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +template +class SPTree { + +public: + typedef std::vector CHConnections; + typedef std::pair CHConnectionPair; + typedef std::vector CHConnectionPairs; + + /** + * @class EdgeInfoByEffortComparator + * Class to compare (and so sort) nodes by their effort + */ + class EdgeByTTComparator { + public: + /// Comparing method + bool operator()(const E* a, const E* b) const { + if (a->traveltime == b->traveltime) { + return a->edge->getNumericalID() > b->edge->getNumericalID(); + } + return a->traveltime > b->traveltime; + } + }; + + + /** + * @brief Constructor + */ + SPTree(int maxDepth, bool validatePermissions) : + myMaxDepth(maxDepth), + myValidatePermissions(validatePermissions) + { } + + + void init() { + // all EdgeInfos touched in the previous query are either in myFrontier or myFound: clean those up + for (typename std::vector::iterator i = myFrontier.begin(); i != myFrontier.end(); i++) { + (*i)->reset(); + } + myFrontier.clear(); + for (typename std::vector::iterator i = myFound.begin(); i != myFound.end(); i++) { + (*i)->reset(); + } + myFound.clear(); + } + + + /** + * @brief build a shortest path tree from start to a depth of myMaxdepth. The given + * edge is excluded from this tree + */ + void rebuildFrom(E* start, const E* excluded) { + init(); + start->traveltime = 0; + start->depth = 0; + start->permissions = start->edge->getPermissions(); + myFrontier.push_back(start); + // build SPT + while (!myFrontier.empty()) { + E* min = myFrontier.front(); + pop_heap(myFrontier.begin(), myFrontier.end(), myCmp); + myFrontier.pop_back(); + myFound.push_back(min); + min->visited = true; + if (min->depth < myMaxDepth) { + for (typename CHConnections::iterator it = min->followers.begin(); it != min->followers.end(); it++) { + C& con = *it; + E* follower = con.target; + if (follower == excluded) { + continue; + } + const SUMOReal traveltime = min->traveltime + con.cost; + const SUMOReal oldTraveltime = follower->traveltime; + if (!follower->visited && traveltime < oldTraveltime) { + follower->traveltime = traveltime; + follower->depth = min->depth + 1; + follower->permissions = (min->permissions & con.permissions); + if (oldTraveltime == std::numeric_limits::max()) { + myFrontier.push_back(follower); + push_heap(myFrontier.begin(), myFrontier.end(), myCmp); + } else { + push_heap(myFrontier.begin(), + find(myFrontier.begin(), myFrontier.end(), follower) + 1, + myCmp); + } + } + } + } + } + } + + + /// @brief whether permissions should be validated; + inline bool validatePermissions() { + return myValidatePermissions; + } + + /// @brief save source/target pair for later validation + void registerForValidation(const C* aInfo, const C* fInfo) { + assert(myValidatePermissions); + myShortcutsToValidate.push_back(CHConnectionPair(aInfo, fInfo)); + } + + + /* @brief for each path source->excluded->target try to find a witness with a witness + * with equal permissions */ + const CHConnectionPairs& getNeededShortcuts(const E* excluded) { + assert(myValidatePermissions); + myNeededShortcuts.clear(); + for (typename CHConnectionPairs::iterator it = myShortcutsToValidate.begin(); it != myShortcutsToValidate.end(); ++it) { + const C* const aInfo = it->first; + const C* const fInfo = it->second; + const SUMOReal bestWitness = dijkstraTT( + aInfo->target, fInfo->target, excluded, (aInfo->permissions & fInfo->permissions)); + const SUMOReal viaCost = aInfo->cost + fInfo->cost; + if (viaCost < bestWitness) { + myNeededShortcuts.push_back(*it); + } + } + myShortcutsToValidate.clear(); + return myNeededShortcuts; + } + + +private: + // perform dijkstra search under permission constraints + SUMOReal dijkstraTT(E* start, E* dest, const E* excluded, SVCPermissions permissions) { + init(); + start->traveltime = 0; + start->depth = 0; + myFrontier.push_back(start); + // build SPT + while (!myFrontier.empty()) { + E* min = myFrontier.front(); + if (min == dest) { + return dest->traveltime; + } + pop_heap(myFrontier.begin(), myFrontier.end(), myCmp); + myFrontier.pop_back(); + myFound.push_back(min); + min->visited = true; + if (min->depth < myMaxDepth) { + for (typename CHConnections::iterator it = min->followers.begin(); it != min->followers.end(); it++) { + C& con = *it; + E* follower = con.target; + if (follower == excluded) { + continue; + } + if ((con.permissions & permissions) != permissions) { + continue; + } + const SUMOReal traveltime = min->traveltime + con.cost; + const SUMOReal oldTraveltime = follower->traveltime; + if (!follower->visited && traveltime < oldTraveltime) { + follower->traveltime = traveltime; + follower->depth = min->depth + 1; + follower->permissions = (min->permissions & con.permissions); + if (oldTraveltime == std::numeric_limits::max()) { + myFrontier.push_back(follower); + push_heap(myFrontier.begin(), myFrontier.end(), myCmp); + } else { + push_heap(myFrontier.begin(), + find(myFrontier.begin(), myFrontier.end(), follower) + 1, + myCmp); + } + } + } + } + } + return dest->traveltime; + } + + + // helper method for debugging + void debugPrintVector(std::vector& vec, E* start, const E* excluded) { + std::cout << "computed SPT from '" << start->edge->getID() << "' (excluding " << excluded->edge->getID() << ") with " << myFound.size() << " edges\n"; + for (typename std::vector::iterator it = vec.begin(); it != vec.end(); it++) { + E* e = *it; + std::cout << "(" << e->edge->getID() << "," << e->traveltime << ") "; + } + std::cout << "\n"; + } + + /// @brief the min edge heap + std::vector myFrontier; + /// @brief the list of visited edges (used when resetting) + std::vector myFound; + + /// @brief comparator for search queue + EdgeByTTComparator myCmp; + + /// @brief maximum search depth + int myMaxDepth; + + /// @brief whether permissions should be validated + bool myValidatePermissions; + + /// @brief vector of needed shortcuts after validation + CHConnectionPairs myShortcutsToValidate; + /// @brief vector of needed shortcuts after validation + CHConnectionPairs myNeededShortcuts; +}; + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/SUMOAbstractRouter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SUMOAbstractRouter.h --- sumo-0.21.0+dfsg/src/utils/vehicle/SUMOAbstractRouter.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SUMOAbstractRouter.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,158 @@ +/****************************************************************************/ +/// @file SUMOAbstractRouter.h +/// @author Daniel Krajzewicz +/// @author Michael Behrisch +/// @author Jakob Erdmann +/// @date 25.Jan 2006 +/// @version $Id: SUMOAbstractRouter.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// The dijkstra-router +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2006-2015 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 SUMOAbstractRouter_h +#define SUMOAbstractRouter_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class SUMOAbstractRouter + * The interface for routing the vehicles over the network. + */ +template +class SUMOAbstractRouter { +public: + /// Type of the function that is used to retrieve the edge effort. + typedef SUMOReal(* Operation)(const E* const, const V* const, SUMOReal); + + /// Constructor + SUMOAbstractRouter(Operation operation, const std::string& type): + myOperation(operation), + myType(type), + myQueryVisits(0), + myNumQueries(0), + myQueryStartTime(0), + myQueryTimeSum(0) + { } + + /// Destructor + 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)."); + } + } + + virtual SUMOAbstractRouter* clone() const = 0; + + /** @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; + + virtual SUMOReal recomputeCosts(const std::vector& edges, + const V* const v, SUMOTime msTime) const = 0; + + // interface extension for BulkStarRouter + virtual void prepare(const E*, const V*, bool) { + assert(false); + } + + inline SUMOReal getEffort(const E* const e, const V* const v, SUMOReal t) const { + return (*myOperation)(e, v, t); + } + + inline void startQuery() { + myNumQueries++; + myQueryStartTime = SysUtils::getCurrentMillis(); + } + + inline void endQuery(int visits) { + myQueryVisits += visits; + myQueryTimeSum += (SysUtils::getCurrentMillis() - myQueryStartTime); + } + +protected: + /// @brief The object's operation to perform. + Operation myOperation; + +private: + /// @brief the type of this router + const std::string myType; + + /// @brief counters for performance logging + SUMOLong myQueryVisits; + SUMOLong myNumQueries; + /// @brief the time spent querying in milliseconds + SUMOLong myQueryStartTime; + SUMOLong myQueryTimeSum; +private: + /// @brief Invalidated assignment operator + SUMOAbstractRouter& operator=(const SUMOAbstractRouter& s); +}; + + +template +struct prohibited_withRestrictions { +public: + inline bool operator()(const E* edge, const V* vehicle) const { + if (std::find(myProhibited.begin(), myProhibited.end(), edge) != myProhibited.end()) { + return true; + } + return edge->prohibits(vehicle); + } + + void prohibit(const std::vector& toProhibit) { + myProhibited = toProhibit; + } + +protected: + std::vector myProhibited; + +}; + +template +struct prohibited_noRestrictions { +public: + inline bool operator()(const E*, const V*) const { + return false; + } +}; + + + + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/SUMOVehicle.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SUMOVehicle.h --- sumo-0.21.0+dfsg/src/utils/vehicle/SUMOVehicle.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SUMOVehicle.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,274 @@ +/****************************************************************************/ +/// @file SUMOVehicle.h +/// @author Michael Behrisch +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @date Tue, 17 Feb 2009 +/// @version $Id: SUMOVehicle.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Abstract base class for vehicle representations +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 SUMOVehicle_h +#define SUMOVehicle_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSVehicleType; +class MSRoute; +class MSEdge; +class MSLane; +class MSDevice; +class MSPerson; +class MSContainer; +class SUMOSAXAttributes; + +typedef std::vector ConstMSEdgeVector; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class SUMOVehicle + * @brief Representation of a vehicle + */ +class SUMOVehicle { +public: + /// @brief Destructor + virtual ~SUMOVehicle() {} + + /** @brief Get the vehicle's ID + * @return The the ID of the vehicle + */ + virtual const std::string& getID() const = 0; + + /** @brief Get the vehicle's position along the lane + * @return The position of the vehicle (in m from the lane's begin) + */ + virtual SUMOReal getPositionOnLane() const = 0; + + /** @brief Get the vehicle's angle + * @return The angle of the vehicle (in degree) + */ + virtual SUMOReal getAngle() const = 0; + + /** @brief Return current position (x/y, cartesian) + * + * If the vehicle is not in the net, Position::INVALID. + * @param[in] offset optional offset in longitudinal direction + * @return The current position (in cartesian coordinates) + * @see myLane + */ + virtual Position getPosition(const SUMOReal offset = 0) const = 0; + + /** @brief Returns the vehicle's maximum speed + * @return The vehicle's maximum speed + */ + virtual SUMOReal getMaxSpeed() const = 0; + + /** @brief Returns the vehicle's current speed + * @return The vehicle's speed + */ + virtual SUMOReal getSpeed() const = 0; + + /** @brief Returns the vehicle's type + * @return The vehicle's type + */ + virtual const MSVehicleType& getVehicleType() const = 0; + + /** @brief Returns the vehicle's access class + * @return The vehicle's access class + */ + virtual SUMOVehicleClass getVClass() const = 0; + + /// Returns the current route + virtual const MSRoute& getRoute() const = 0; + + /** @brief Returns the nSuccs'th successor of edge the vehicle is currently at + * + * If the rest of the route (counted from the current edge) than nSuccs, + * 0 is returned. + * @param[in] nSuccs The number of edge to look forward + * @return The nSuccs'th following edge in the vehicle's route + */ + virtual const MSEdge* succEdge(unsigned int nSuccs) const = 0; + + /// Replaces the current route by the given edges + virtual bool replaceRouteEdges(ConstMSEdgeVector& edges, bool onInit = false) = 0; + + /// Replaces the current route by the given one + virtual bool replaceRoute(const MSRoute* route, bool onInit = false, int offset = 0) = 0; + + /** @brief Performs a rerouting using the given router + * + * Tries to find a new route between the current edge and the destination edge, first. + * Tries to replace the current route by the new one using replaceRoute. + * + * @param[in] t The time for which the route is computed + * @param[in] router The router to use + * @see replaceRoute + */ + virtual void reroute(SUMOTime t, SUMOAbstractRouter& router, const bool onInit = false, const bool withTaz = false) = 0; + + + /** @brief Returns an iterator pointing to the current edge in this vehicles route + * @return The current route pointer + */ + virtual const ConstMSEdgeVector::const_iterator& getCurrentRouteEdge() const = 0; + + /** @brief Returns the vehicle's acceleration + * @return The acceleration + */ + virtual SUMOReal getAcceleration() const = 0; + + /** @brief Returns the slope of the road at vehicle's position + * @return The slope + */ + virtual SUMOReal getSlope() const = 0; + + /** @brief Returns the edge the vehicle is currently at + * + * @return The current edge in the vehicle's route + */ + virtual const MSEdge* getEdge() const = 0; + + /** @brief Returns the vehicle's parameter (including departure definition) + * + * @return The vehicle's parameter + */ + virtual const SUMOVehicleParameter& getParameter() const = 0; + + /** @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. + */ + virtual void onDepart() = 0; + + /** @brief Returns the information whether the vehicle is on a road (is simulated) + * @return Whether the vehicle is simulated + */ + virtual bool isOnRoad() const = 0; + + /** @brief Returns this vehicle's real departure time + * @return This vehicle's real departure time + */ + virtual SUMOTime getDeparture() const = 0; + + /** @brief Returns this vehicle's desired arrivalPos for its current route + * (may change on reroute) + * @return This vehicle's real arrivalPos + */ + virtual SUMOReal getArrivalPos() 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 + */ + virtual unsigned int getNumberReroutes() const = 0; + + /** @brief Returns this vehicle's devices + * @return This vehicle's devices + */ + virtual const std::vector& getDevices() const = 0; + + /** @brief Adds a person to this vehicle + * + * May do nothing since persons are not supported by default + * + * @param[in] person The person to add + */ + virtual void addPerson(MSPerson* person) = 0; + + /** @brief Adds a container to this vehicle + * + * May do nothing since containers are not supported by default + * + * @param[in] container The container to add + */ + virtual void addContainer(MSContainer* container) = 0; + + /** @brief Adds a stop + * + * The stop is put into the sorted list. + * @param[in] stop The stop to add + * @return Whether the stop could be added + */ + virtual bool addStop(const SUMOVehicleParameter::Stop& stopPar, std::string& errorMsg, SUMOTime untilOffset = 0) = 0; + + /** @brief Returns whether the vehicle is at a stop + * @return Whether the has stopped + */ + virtual bool isStopped() const = 0; + + + /** @brief Returns whether the vehicle is at a stop and waiting for a person or container to continue + */ + virtual bool isStoppedTriggered() const = 0; + + /// @brief Returns a device of the given type if it exists or 0 + virtual MSDevice* getDevice(const std::type_info& type) const = 0; + + + virtual SUMOReal getChosenSpeedFactor() const = 0; + + virtual void setChosenSpeedFactor(const SUMOReal factor) = 0; + + virtual SUMOTime getWaitingTime() const = 0; + + /// @brief Returns this vehicles impatience + virtual SUMOReal getImpatience() const = 0; + + /// @name state io + //@{ + + /// Saves the states of a vehicle + virtual void saveState(OutputDevice& out) = 0; + + /** @brief Loads the state of this vehicle from the given description + */ + virtual void loadState(const SUMOSAXAttributes& attrs, const SUMOTime offset) = 0; + //@} +}; + + +#endif + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/SUMOVehicleParameter.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SUMOVehicleParameter.cpp --- sumo-0.21.0+dfsg/src/utils/vehicle/SUMOVehicleParameter.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SUMOVehicleParameter.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,504 @@ +/****************************************************************************/ +/// @file SUMOVehicleParameter.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date Tue, 31.03.2009 +/// @version $Id: SUMOVehicleParameter.cpp 18096 2015-03-17 09:50:59Z behrisch $ +/// +// Structure representing possible vehicle parameter +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 "SUMOVehicleParameter.h" +#include +#include +#include +#include +#include + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// member method definitions +// =========================================================================== +SUMOVehicleParameter::SUMOVehicleParameter() + : vtypeid(DEFAULT_VTYPE_ID), color(RGBColor::DEFAULT_COLOR), + depart(-1), departProcedure(DEPART_GIVEN), + departLane(0), departLaneProcedure(DEPART_LANE_DEFAULT), + departPos(0), departPosProcedure(DEPART_POS_DEFAULT), + departSpeed(-1), departSpeedProcedure(DEPART_SPEED_DEFAULT), + arrivalLane(0), arrivalLaneProcedure(ARRIVAL_LANE_DEFAULT), + arrivalPos(0), arrivalPosProcedure(ARRIVAL_POS_DEFAULT), + arrivalSpeed(-1), arrivalSpeedProcedure(ARRIVAL_SPEED_DEFAULT), + repetitionNumber(-1), repetitionsDone(-1), repetitionOffset(-1), repetitionProbability(-1), repetitionEnd(-1), + line(), fromTaz(), toTaz(), personCapacity(0), personNumber(0), containerNumber(0), setParameter(0) { +} + + +bool +SUMOVehicleParameter::defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const { + return oc.isSet(optionName) && oc.getBool("defaults-override"); +} + + +void +SUMOVehicleParameter::write(OutputDevice& dev, const OptionsCont& oc) const { + dev.openTag(SUMO_TAG_VEHICLE).writeAttr(SUMO_ATTR_ID, id); + if (wasSet(VEHPARS_VTYPE_SET)) { + dev.writeAttr(SUMO_ATTR_TYPE, vtypeid); + } + if (departProcedure == DEPART_TRIGGERED) { + dev.writeAttr(SUMO_ATTR_DEPART, "triggered"); + } else if (departProcedure == DEPART_CONTAINER_TRIGGERED) { + dev.writeAttr(SUMO_ATTR_DEPART, "containerTriggered"); + } else { + dev.writeAttr(SUMO_ATTR_DEPART, time2string(depart)); + } + + // optional parameter + // departlane + if (wasSet(VEHPARS_DEPARTLANE_SET) && !defaultOptionOverrides(oc, "departlane")) { + std::string val; + switch (departLaneProcedure) { + case DEPART_LANE_GIVEN: + val = toString(departLane); + break; + case DEPART_LANE_RANDOM: + val = "random"; + break; + case DEPART_LANE_FREE: + val = "free"; + break; + case DEPART_LANE_ALLOWED_FREE: + val = "allowed"; + break; + case DEPART_LANE_BEST_FREE: + val = "best"; + break; + case DEPART_LANE_FIRST_ALLOWED: + val = "first"; + break; + case DEPART_LANE_DEFAULT: + default: + break; + } + dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTLANE, val); + } else if (oc.isSet("departlane")) { + dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTLANE, oc.getString("departlane")); + } + // departpos + if (wasSet(VEHPARS_DEPARTPOS_SET) && !defaultOptionOverrides(oc, "departpos")) { + std::string val; + switch (departPosProcedure) { + case DEPART_POS_GIVEN: + val = toString(departPos); + break; + case DEPART_POS_RANDOM: + val = "random"; + break; + case DEPART_POS_RANDOM_FREE: + val = "random_free"; + break; + case DEPART_POS_FREE: + val = "free"; + break; + case DEPART_POS_PWAG_SIMPLE: + val = "pwagSimple"; + break; + case DEPART_POS_PWAG_GENERIC: + val = "pwagGeneric"; + break; + case DEPART_POS_MAX_SPEED_GAP: + val = "maxSpeedGap"; + break; + case DEPART_POS_BASE: + val = "base"; + break; + case DEPART_POS_DEFAULT: + default: + break; + } + dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTPOS, val); + } else if (oc.isSet("departpos")) { + dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTPOS, oc.getString("departpos")); + } + // departspeed + if (wasSet(VEHPARS_DEPARTSPEED_SET) && !defaultOptionOverrides(oc, "departspeed")) { + std::string val; + switch (departSpeedProcedure) { + case DEPART_SPEED_GIVEN: + val = toString(departSpeed); + break; + case DEPART_SPEED_RANDOM: + val = "random"; + break; + case DEPART_SPEED_MAX: + val = "max"; + break; + case DEPART_SPEED_DEFAULT: + default: + break; + } + dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTSPEED, val); + } else if (oc.isSet("departspeed")) { + dev.writeNonEmptyAttr(SUMO_ATTR_DEPARTSPEED, oc.getString("departspeed")); + } + + // arrivallane + if (wasSet(VEHPARS_ARRIVALLANE_SET) && !defaultOptionOverrides(oc, "arrivallane")) { + std::string val; + switch (arrivalLaneProcedure) { + case ARRIVAL_LANE_GIVEN: + val = toString(arrivalLane); + break; + case ARRIVAL_LANE_CURRENT: + val = "current"; + break; + case ARRIVAL_LANE_DEFAULT: + default: + break; + } + dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALLANE, val); + } else if (oc.isSet("arrivallane")) { + dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALLANE, oc.getString("arrivallane")); + } + // arrivalpos + if (wasSet(VEHPARS_ARRIVALPOS_SET) && !defaultOptionOverrides(oc, "arrivalpos")) { + std::string val; + switch (arrivalPosProcedure) { + case ARRIVAL_POS_GIVEN: + val = toString(arrivalPos); + break; + case ARRIVAL_POS_RANDOM: + val = "random"; + break; + case ARRIVAL_POS_MAX: + val = "max"; + break; + case ARRIVAL_POS_DEFAULT: + default: + break; + } + dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALPOS, val); + } else if (oc.isSet("arrivalpos")) { + dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALPOS, oc.getString("arrivalpos")); + } + // arrivalspeed + if (wasSet(VEHPARS_ARRIVALSPEED_SET) && !defaultOptionOverrides(oc, "arrivalspeed")) { + std::string val; + switch (arrivalSpeedProcedure) { + case ARRIVAL_SPEED_GIVEN: + val = toString(arrivalSpeed); + break; + case ARRIVAL_SPEED_CURRENT: + val = "current"; + break; + case ARRIVAL_SPEED_DEFAULT: + default: + break; + } + dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALSPEED, val); + } else if (oc.isSet("arrivalspeed")) { + dev.writeNonEmptyAttr(SUMO_ATTR_ARRIVALSPEED, oc.getString("arrivalspeed")); + } + + // color + if (wasSet(VEHPARS_COLOR_SET)) { + dev.writeAttr(SUMO_ATTR_COLOR, color); + } + if (wasSet(VEHPARS_LINE_SET)) { + dev.writeAttr(SUMO_ATTR_LINE, line); + } + if (wasSet(VEHPARS_FROM_TAZ_SET)) { + dev.writeAttr(SUMO_ATTR_FROM_TAZ, fromTaz); + } + if (wasSet(VEHPARS_TO_TAZ_SET)) { + dev.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); + } + if (wasSet(VEHPARS_CONTAINER_NUMBER_SET)) { + dev.writeAttr(SUMO_ATTR_CONTAINER_NUMBER, containerNumber); + } +} + + +void +SUMOVehicleParameter::writeStops(OutputDevice& dev) const { + for (std::vector::const_iterator stop = stops.begin(); stop != stops.end(); ++stop) { + dev.openTag(SUMO_TAG_STOP); + if (stop->busstop != "") { + dev.writeAttr(SUMO_ATTR_BUS_STOP, stop->busstop); + } + if (stop->containerstop != "") { + dev.writeAttr(SUMO_ATTR_CONTAINER_STOP, stop->containerstop); + } + if (stop->busstop == "" && stop->containerstop == "") { + dev.writeAttr(SUMO_ATTR_LANE, stop->lane); + if ((stop->setParameter & STOP_START_SET) != 0) { + dev.writeAttr(SUMO_ATTR_STARTPOS, stop->startPos); + } + if ((stop->setParameter & STOP_END_SET) != 0) { + dev.writeAttr(SUMO_ATTR_ENDPOS, stop->endPos); + } + } + if (stop->duration >= 0) { + dev.writeAttr(SUMO_ATTR_DURATION, STEPS2TIME(stop->duration)); + } + if (stop->until >= 0) { + dev.writeAttr(SUMO_ATTR_UNTIL, STEPS2TIME(stop->until)); + } + if ((stop->setParameter & STOP_TRIGGER_SET) != 0) { + dev.writeAttr(SUMO_ATTR_TRIGGERED, stop->triggered); + } + if ((stop->setParameter & STOP_CONTAINER_TRIGGER_SET) != 0) { + dev.writeAttr(SUMO_ATTR_CONTAINER_TRIGGERED, stop->containerTriggered); + } + if ((stop->setParameter & STOP_PARKING_SET) != 0) { + dev.writeAttr(SUMO_ATTR_PARKING, stop->parking); + } + // look, we are writing the set of expected persons in its current state... + // if this method is used somewhere in the simulation output, + // one should consider keeping the original values additionally, + // as the ones we write may hev changed. + if ((stop->setParameter & STOP_EXPECTED_SET) != 0) { + dev.writeAttr(SUMO_ATTR_EXPECTED, stop->awaitedPersons); + } + if ((stop->setParameter & STOP_EXPECTED_CONTAINERS_SET) != 0) { + dev.writeAttr(SUMO_ATTR_EXPECTED_CONTAINERS, stop->awaitedContainers); + } + dev.closeTag(); + } +} + + +bool +SUMOVehicleParameter::parseDepart(const std::string& val, const std::string& element, const std::string& id, + SUMOTime& depart, DepartDefinition& dd, std::string& error) { + if (val == "triggered") { + dd = DEPART_TRIGGERED; + } else if (val == "containerTriggered") { + dd = DEPART_CONTAINER_TRIGGERED; + } else if (val == "now") { + dd = DEPART_NOW; + } else { + try { + depart = string2time(val); + dd = DEPART_GIVEN; + if (depart < 0) { + error = "Negative departure time in the definition of '" + id + "'."; + return false; + } + } catch (...) { + error = "Invalid departure time for " + element + " '" + id + "';\n must be one of (\"triggered\", \"containerTriggered\", \"now\", or a float >= 0)"; + return false; + } + } + return true; +} + + +bool +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 if (val == "first") { + dld = DEPART_LANE_FIRST_ALLOWED; + } 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\", \"first\", or an int>=0)"; + } + return ok; +} + + +bool +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)"; + } + return ok; +} + + +bool +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)"; + } + return ok; +} + + +bool +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") { + ald = ARRIVAL_LANE_CURRENT; + } else { + try { + lane = TplConvert::_2int(val.c_str()); + ald = ARRIVAL_LANE_GIVEN; + if (lane < 0) { + ok = false; + } + } catch (...) { + ok = false; + } + } + if (!ok) { + error = "Invalid arrivalLane definition for " + element + " '" + id + "';\n must be one of (\"current\", or an int>=0)"; + } + return ok; +} + + +bool +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; + } + } + if (!ok) { + error = "Invalid arrivalPos definition for " + element + " '" + id + "';\n must be one of (\"random\", \"max\", or a float)"; + } + return ok; +} + + +bool +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") { + asd = ARRIVAL_SPEED_CURRENT; + } else { + try { + speed = TplConvert::_2SUMOReal(val.c_str()); + if (speed < 0) { + ok = false; + } + asd = ARRIVAL_SPEED_GIVEN; + } catch (...) { + ok = false; + } + } + if (!ok) { + error = "Invalid arrivalSpeed definition for " + element + " '" + id + "';\n must be one of (\"current\", or a float>=0)"; + } + 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.21.0+dfsg/src/utils/vehicle/SUMOVehicleParameter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SUMOVehicleParameter.h --- sumo-0.21.0+dfsg/src/utils/vehicle/SUMOVehicleParameter.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SUMOVehicleParameter.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,521 @@ +/****************************************************************************/ +/// @file SUMOVehicleParameter.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Axel Wegener +/// @author Michael Behrisch +/// @date 2006-01-24 +/// @version $Id: SUMOVehicleParameter.h 18095 2015-03-17 09:39:00Z behrisch $ +/// +// Structure representing possible vehicle parameter +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 SUMOVehicleParameter_h +#define SUMOVehicleParameter_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; +class OptionsCont; + + +// =========================================================================== +// value definitions +// =========================================================================== +const int VEHPARS_COLOR_SET = 1; +const int VEHPARS_VTYPE_SET = 2; +const int VEHPARS_DEPARTLANE_SET = 2 << 1; +const int VEHPARS_DEPARTPOS_SET = 2 << 2; +const int VEHPARS_DEPARTSPEED_SET = 2 << 3; +const int VEHPARS_PERIODNUM_SET = 2 << 4; +const int VEHPARS_PERIODFREQ_SET = 2 << 5; +const int VEHPARS_ROUTE_SET = 2 << 6; +const int VEHPARS_ARRIVALLANE_SET = 2 << 7; +const int VEHPARS_ARRIVALPOS_SET = 2 << 8; +const int VEHPARS_ARRIVALSPEED_SET = 2 << 9; +const int VEHPARS_LINE_SET = 2 << 10; +const int VEHPARS_FROM_TAZ_SET = 2 << 11; +const int VEHPARS_TO_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 VEHPARS_CONTAINER_NUMBER_SET = 2 << 15; + +const int STOP_INDEX_END = -1; +const int STOP_INDEX_FIT = -2; + +const int STOP_END_SET = 1; +const int STOP_START_SET = 2; +const int STOP_TRIGGER_SET = 2 << 1; +const int STOP_PARKING_SET = 2 << 2; +const int STOP_EXPECTED_SET = 2 << 3; +const int STOP_CONTAINER_TRIGGER_SET = 2 << 4; +const int STOP_EXPECTED_CONTAINERS_SET = 2 << 5; + + +// =========================================================================== +// enum definitions +// =========================================================================== +/** + * @enum DepartDefinition + * @brief Possible ways to depart + */ +enum DepartDefinition { + /// @brief The time is given + DEPART_GIVEN, + /// @brief The departure is person triggered + DEPART_TRIGGERED, + /// @brief The departure is container triggered + DEPART_CONTAINER_TRIGGERED, + /// @brief The vehicle is discarded if emission fails (not fully implemented yet) + DEPART_NOW, + /// @brief Tag for the last element in the enum for safe int casting + DEPART_DEF_MAX +}; + + +/** + * @enum DepartLaneDefinition + * @brief Possible ways to choose a lane on depart + */ +enum DepartLaneDefinition { + /// @brief No information given; use default + DEPART_LANE_DEFAULT, + /// @brief The lane is given + DEPART_LANE_GIVEN, + /// @brief The lane is chosen randomly + DEPART_LANE_RANDOM, + /// @brief The least occupied lane is used + DEPART_LANE_FREE, + /// @brief The least occupied lane from lanes which allow the continuation + DEPART_LANE_ALLOWED_FREE, + /// @brief The least occupied lane from best lanes + DEPART_LANE_BEST_FREE, + /// @brief The rightmost lane the vehicle may use + DEPART_LANE_FIRST_ALLOWED, + /// @brief Tag for the last element in the enum for safe int casting + DEPART_LANE_DEF_MAX +}; + + +/** + * @enum DepartPosDefinition + * @brief Possible ways to choose the departure position + */ +enum DepartPosDefinition { + /// @brief No information given; use default + DEPART_POS_DEFAULT, + /// @brief The position is given + DEPART_POS_GIVEN, + /// @brief The position is chosen randomly + DEPART_POS_RANDOM, + /// @brief A free position is chosen + DEPART_POS_FREE, + /// @brief Back-at-zero position + DEPART_POS_BASE, + /// @brief Simple max-flow insertion by P.Wagner + DEPART_POS_PWAG_SIMPLE, + /// @brief Generic max-flow insertion by P.Wagner + DEPART_POS_PWAG_GENERIC, + /// @brief A gap is chosen where the maximum speed may be achieved + DEPART_POS_MAX_SPEED_GAP, + /// @brief If a fixed number of random choices fails, a free position is chosen + DEPART_POS_RANDOM_FREE, + /// @brief Tag for the last element in the enum for safe int casting + DEPART_POS_DEF_MAX +}; + + +/** + * @enum DepartSpeedDefinition + * @brief Possible ways to choose the departure speed + */ +enum DepartSpeedDefinition { + /// @brief No information given; use default + DEPART_SPEED_DEFAULT, + /// @brief The speed is given + DEPART_SPEED_GIVEN, + /// @brief The speed is chosen randomly + DEPART_SPEED_RANDOM, + /// @brief The maximum speed is used + DEPART_SPEED_MAX, + /// @brief Tag for the last element in the enum for safe int casting + DEPART_SPEED_DEF_MAX +}; + + +/** + * @enum ArrivalLaneDefinition + * @brief Possible ways to choose the arrival lane + */ +enum ArrivalLaneDefinition { + /// @brief No information given; use default + ARRIVAL_LANE_DEFAULT, + /// @brief The arrival lane is given + ARRIVAL_LANE_GIVEN, + /// @brief The current lane shall be used + ARRIVAL_LANE_CURRENT, + /// @brief Tag for the last element in the enum for safe int casting + ARRIVAL_LANE_DEF_MAX +}; + + +/** + * @enum ArrivalPosDefinition + * @brief Possible ways to choose the arrival position + */ +enum ArrivalPosDefinition { + /// @brief No information given; use default + ARRIVAL_POS_DEFAULT, + /// @brief The arrival position is given + ARRIVAL_POS_GIVEN, + /// @brief The arrival position is chosen randomly + ARRIVAL_POS_RANDOM, + /// @brief The maximum arrival position is used + ARRIVAL_POS_MAX, + /// @brief Tag for the last element in the enum for safe int casting + ARRIVAL_POS_DEF_MAX +}; + + +/** + * @enum ArrivalSpeedDefinition + * @brief Possible ways to choose the arrival speed + */ +enum ArrivalSpeedDefinition { + /// @brief No information given; use default + ARRIVAL_SPEED_DEFAULT, + /// @brief The speed is given + ARRIVAL_SPEED_GIVEN, + /// @brief The current speed is used + ARRIVAL_SPEED_CURRENT, + /// @brief Tag for the last element in the enum for safe int casting + ARRIVAL_SPEED_DEF_MAX +}; + + +// =========================================================================== +// struct definitions +// =========================================================================== +/** + * @class SUMOVehicleParameter + * @brief Structure representing possible vehicle parameter + * + * The fields yielding with "Procedure" describe whether the according value + * shall be used or another procedure is used to choose the value. + * @see DepartLaneDefinition + * @see DepartPosDefinition + * @see DepartSpeedDefinition + */ +class SUMOVehicleParameter : public Parameterised { +public: + /** @brief Constructor + * + * Initialises the structure with default values + */ + SUMOVehicleParameter(); + + + /** @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 (setParameter & what) != 0; + } + + + /** @brief Writes the parameters as a beginning element + * + * @param[in, out] dev The device to write into + * @param[in] oc The options to get defaults from + * @exception IOError not yet implemented + */ + void write(OutputDevice& dev, const OptionsCont& oc) const; + + + /** @brief Writes the enclosed stops + * + * @param[in, out] dev The device to write into + * @exception IOError not yet implemented + */ + void writeStops(OutputDevice& dev) const; + + /** @brief Returns whether the defaults shall be used + * @param[in] oc The options to get the options from + * @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; + + + + /// @name Depart/arrival-attributes verification + /// @{ + + /** @brief Validates a given depart value + * @param[in] val The depart 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] depart The parsed depart time, if given + * @param[out] dd The parsed departProcedure definition + * @param[out] error Error message, if an error occures + * @return Whether the given value is a valid depart definition + */ + static bool parseDepart(const std::string& val, const std::string& element, const std::string& id, + SUMOTime& depart, DepartDefinition& dd, std::string& error); + + + /** @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 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; + + /// @brief The vehicle's route id + std::string routeid; + /// @brief The vehicle's type id + std::string vtypeid; + /// @brief The vehicle's color + mutable RGBColor color; + + + /// @name Departure definition + /// @{ + + /// @brief The vehicle's departure time + SUMOTime depart; + /// @brief Information how the vehicle shall choose the depart time + DepartDefinition departProcedure; + /// @brief (optional) The lane the vehicle shall depart from (index in edge) + int departLane; + /// @brief Information how the vehicle shall choose the lane to depart from + DepartLaneDefinition departLaneProcedure; + /// @brief (optional) The position the vehicle shall depart from + SUMOReal departPos; + /// @brief Information how the vehicle shall choose the departure position + DepartPosDefinition departPosProcedure; + /// @brief (optional) The initial speed of the vehicle + SUMOReal departSpeed; + /// @brief Information how the vehicle's initial speed shall be chosen + DepartSpeedDefinition departSpeedProcedure; + /// @} + + + /// @name Arrival definition + /// @{ + + /// @brief (optional) The lane the vehicle shall arrive on (not used yet) + int arrivalLane; + /// @brief Information how the vehicle shall choose the lane to arrive on + ArrivalLaneDefinition arrivalLaneProcedure; + /// @brief (optional) The position the vehicle shall arrive on + SUMOReal arrivalPos; + /// @brief Information how the vehicle shall choose the arrival position + ArrivalPosDefinition arrivalPosProcedure; + /// @brief (optional) The final speed of the vehicle (not used yet) + SUMOReal arrivalSpeed; + /// @brief Information how the vehicle's end speed shall be chosen + ArrivalSpeedDefinition arrivalSpeedProcedure; + /// @} + + + /// @name Repetition definition + /// @{ + + /// @brief The number of times the vehicle shall be repeatedly inserted + int repetitionNumber; + /// @brief The number of times the vehicle was already inserted + int repetitionsDone; + /// @brief The time offset between vehicle reinsertions +#ifdef HAVE_SUBSECOND_TIMESTEPS + SUMOTime repetitionOffset; +#else + SUMOReal repetitionOffset; +#endif + /// @brief The probability for emitting a vehicle per second + SUMOReal repetitionProbability; + /// @brief The time at which the flow ends (only needed when using repetitionProbability) + SUMOTime repetitionEnd; + /// @} + + + /// @brief The vehicle's line (mainly for public transport) + std::string line; + + /// @brief The vehicle's origin zone (district) + std::string fromTaz; + + /// @brief The vehicle's destination zone (district) + std::string toTaz; + + /** @struct Stop + * @brief Definition of vehicle stop (position and duration) + */ + struct Stop { + /// @brief The lane to stop at + std::string lane; + /// @brief (Optional) bus stop if one is assigned to the stop + std::string busstop; + /// @brief (Optional) container stop if one is assigned to the stop + std::string containerstop; + /// @brief The stopping position start + SUMOReal startPos; + /// @brief The stopping position end + SUMOReal endPos; + /// @brief The stopping duration + SUMOTime duration; + /// @brief The time at which the vehicle may continue its journey + SUMOTime until; + /// @brief whether an arriving person lets the vehicle continue + bool triggered; + /// @brief whether an arriving container lets the vehicle continue + bool containerTriggered; + /// @brief whether the vehicle is removed from the net while stopping + bool parking; + /// @brief IDs of persons the vehicle has to wait for until departing + std::set awaitedPersons; + /// @brief IDs of containers the vehicle has to wait for until departing + std::set awaitedContainers; + /// @brief at which position in the stops list + int index; + /// @brief Information for the output which parameter were set + int setParameter; + }; + + /// @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 The number of containers in the vehicle + unsigned int containerNumber; + + /// @brief Information for the router which parameter were set + mutable int setParameter; + + +}; + +#endif + +/****************************************************************************/ + + diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/SUMOVTypeParameter.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SUMOVTypeParameter.cpp --- sumo-0.21.0+dfsg/src/utils/vehicle/SUMOVTypeParameter.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SUMOVTypeParameter.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,388 @@ +/****************************************************************************/ +/// @file SUMOVTypeParameter.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date 10.09.2009 +/// @version $Id: SUMOVTypeParameter.cpp 18136 2015-03-24 15:10:45Z behrisch $ +/// +// Structure representing possible vehicle parameter +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 + +#ifdef CHECK_MEMORY_LEAKS +#include +#endif // CHECK_MEMORY_LEAKS + + +// =========================================================================== +// member method definitions +// =========================================================================== +SUMOVTypeParameter::SUMOVTypeParameter(const std::string& vtid, const SUMOVehicleClass vclass) + : id(vtid), length(5./*4.3*/), minGap(2.5), maxSpeed(200. / 3.6), + defaultProbability(DEFAULT_VEH_PROB), + speedFactor(1.0), speedDev(0.0), + emissionClass(PollutantsInterface::getClassByName("unknown", vclass)), color(RGBColor::DEFAULT_COLOR), + vehicleClass(vclass), impatience(0.0), personCapacity(4), containerCapacity(0), boardingDuration(500), + loadingDuration(90000), width(1.8), height(1.5), shape(SVS_UNKNOWN), + cfModel(SUMO_TAG_CF_KRAUSS), lcModel(LCM_LC2013), + setParameter(0), saved(false), onlyReferenced(false) { + switch (vclass) { + case SVC_PEDESTRIAN: + length = 0.215; + minGap = 0.25; + maxSpeed = DEFAULT_PEDESTRIAN_SPEED; + width = 0.478; + height = 1.719; + shape = SVS_PEDESTRIAN; + break; + case SVC_BICYCLE: + length = 1.6; + minGap = 0.5; + maxSpeed = 20. / 3.6; + width = 0.65; + height = 1.7; + shape = SVS_BICYCLE; + personCapacity = 1; + break; + case SVC_MOPED: + length = 2.1; + maxSpeed = 60. / 3.6; + width = 0.8; + height = 1.7; + shape = SVS_MOPED; + personCapacity = 1; + break; + case SVC_MOTORCYCLE: + length = 2.2; + width = 0.9; + height = 1.5; + shape = SVS_MOTORCYCLE; + personCapacity = 1; + break; + case SVC_TRUCK: + length = 7.1; + maxSpeed = 130. / 3.6; + width = 2.4; + height = 2.4; + shape = SVS_TRUCK; + personCapacity = 2; + containerCapacity = 1; + break; + case SVC_TRAILER: + length = 16.5; + maxSpeed = 130. / 3.6; + width = 2.55; + height = 4.; + shape = SVS_TRUCK_SEMITRAILER; + personCapacity = 2; + containerCapacity = 2; + break; + case SVC_BUS: + length = 12.; + maxSpeed = 100. / 3.6; + width = 2.5; + height = 3.4; + shape = SVS_BUS; + personCapacity = 85; + break; + case SVC_COACH: + length = 14.; + maxSpeed = 100. / 3.6; + width = 2.6; + height = 4.; + shape = SVS_BUS_COACH; + personCapacity = 70; + break; + case SVC_TRAM: + length = 22.; + maxSpeed = 80. / 3.6; + width = 2.4; + height = 3.2; + shape = SVS_RAIL_CAR; + personCapacity = 120; + break; + case SVC_RAIL_URBAN: + length = 36.5 * 3; + maxSpeed = 100. / 3.6; + width = 3.0; + height = 3.6; + shape = SVS_RAIL_CAR; + personCapacity = 300; + break; + case SVC_RAIL: + length = 67.5 * 2; + maxSpeed = 160. / 3.6; + width = 2.84; + height = 3.75; + shape = SVS_RAIL; + personCapacity = 434; + break; + case SVC_RAIL_ELECTRIC: + length = 25. * 8; + maxSpeed = 330. / 3.6; + width = 2.95; + height = 3.89; + shape = SVS_RAIL; + personCapacity = 425; + break; + case SVC_DELIVERY: + length = 6.5; + width = 2.16; + height = 2.86; + shape = SVS_DELIVERY; + personCapacity = 2; + break; + case SVC_EMERGENCY: + length = 6.5; + width = 2.16; + height = 2.86; + shape = SVS_DELIVERY; + personCapacity = 2; + break; + case SVC_PASSENGER: + shape = SVS_PASSENGER; + break; + case SVC_E_VEHICLE: + shape = SVS_E_VEHICLE; + break; + case SVC_SHIP: + length = 17; + width = 4; + maxSpeed = 8 / 1.94; // 8 knots + height = 4; + shape = SVS_SHIP; + break; + default: + break; + } +} + + +void +SUMOVTypeParameter::write(OutputDevice& dev) const { + if (onlyReferenced) { + return; + } + dev.openTag(SUMO_TAG_VTYPE); + dev.writeAttr(SUMO_ATTR_ID, id); + if (wasSet(VTYPEPARS_LENGTH_SET)) { + dev.writeAttr(SUMO_ATTR_LENGTH, length); + } + if (wasSet(VTYPEPARS_MINGAP_SET)) { + dev.writeAttr(SUMO_ATTR_MINGAP, minGap); + } + if (wasSet(VTYPEPARS_MAXSPEED_SET)) { + dev.writeAttr(SUMO_ATTR_MAXSPEED, maxSpeed); + } + if (wasSet(VTYPEPARS_PROBABILITY_SET)) { + dev.writeAttr(SUMO_ATTR_PROB, defaultProbability); + } + if (wasSet(VTYPEPARS_SPEEDFACTOR_SET)) { + dev.writeAttr(SUMO_ATTR_SPEEDFACTOR, speedFactor); + } + if (wasSet(VTYPEPARS_SPEEDDEVIATION_SET)) { + dev.writeAttr(SUMO_ATTR_SPEEDDEV, speedDev); + } + if (wasSet(VTYPEPARS_VEHICLECLASS_SET)) { + dev.writeAttr(SUMO_ATTR_VCLASS, toString(vehicleClass)); + } + if (wasSet(VTYPEPARS_EMISSIONCLASS_SET)) { + dev.writeAttr(SUMO_ATTR_EMISSIONCLASS, PollutantsInterface::getName(emissionClass)); + } + if (wasSet(VTYPEPARS_IMPATIENCE_SET)) { + if (impatience == -std::numeric_limits::max()) { + dev.writeAttr(SUMO_ATTR_IMPATIENCE, "off"); + } else { + dev.writeAttr(SUMO_ATTR_IMPATIENCE, impatience); + } + } + if (wasSet(VTYPEPARS_SHAPE_SET)) { + dev.writeAttr(SUMO_ATTR_GUISHAPE, getVehicleShapeName(shape)); + } + if (wasSet(VTYPEPARS_WIDTH_SET)) { + dev.writeAttr(SUMO_ATTR_WIDTH, width); + } + if (wasSet(VTYPEPARS_HEIGHT_SET)) { + dev.writeAttr(SUMO_ATTR_HEIGHT, height); + } + if (wasSet(VTYPEPARS_COLOR_SET)) { + dev.writeAttr(SUMO_ATTR_COLOR, color); + } + if (wasSet(VTYPEPARS_OSGFILE_SET)) { + dev.writeAttr(SUMO_ATTR_OSGFILE, osgFile); + } + if (wasSet(VTYPEPARS_IMGFILE_SET)) { + dev.writeAttr(SUMO_ATTR_IMGFILE, imgFile); + } + if (wasSet(VTYPEPARS_LANE_CHANGE_MODEL_SET)) { + dev.writeAttr(SUMO_ATTR_LANE_CHANGE_MODEL, lcModel); + } + if (wasSet(VTYPEPARS_PERSON_CAPACITY)) { + dev.writeAttr(SUMO_ATTR_PERSON_CAPACITY, personCapacity); + } + if (wasSet(VTYPEPARS_CONTAINER_CAPACITY)) { + dev.writeAttr(SUMO_ATTR_CONTAINER_CAPACITY, containerCapacity); + } + if (wasSet(VTYPEPARS_BOARDING_DURATION)) { + dev.writeAttr(SUMO_ATTR_BOARDING_DURATION, boardingDuration); + } + if (wasSet(VTYPEPARS_LOADING_DURATION)) { + dev.writeAttr(SUMO_ATTR_LOADING_DURATION, loadingDuration); + } + + if (cfParameter.size() != 0) { + dev.openTag(cfModel); + std::vector attrs; + for (CFParams::const_iterator i = cfParameter.begin(); i != cfParameter.end(); ++i) { + attrs.push_back(i->first); + } + std::sort(attrs.begin(), attrs.end()); + for (std::vector::const_iterator i = attrs.begin(); i != attrs.end(); ++i) { + dev.writeAttr(*i, cfParameter.find(*i)->second); + } + dev.closeTag(); + } + for (std::map::const_iterator j = getMap().begin(); j != getMap().end(); ++j) { + dev.openTag(SUMO_TAG_PARAM); + dev.writeAttr(SUMO_ATTR_KEY, (*j).first); + dev.writeAttr(SUMO_ATTR_VALUE, (*j).second); + dev.closeTag(); + } + dev.closeTag(); +} + + +SUMOReal +SUMOVTypeParameter::get(const SumoXMLAttr attr, const SUMOReal defaultValue) const { + if (cfParameter.count(attr)) { + return cfParameter.find(attr)->second; + } else { + return defaultValue; + } +} + + +SUMOReal +SUMOVTypeParameter::getDefaultAccel(const SUMOVehicleClass vc) { + switch (vc) { + case SVC_PEDESTRIAN: + return 1.5; + case SVC_BICYCLE: + return 1.2; + case SVC_MOTORCYCLE: + return 6.; + case SVC_MOPED: + return 1.1; + case SVC_TRUCK: + return 1.3; + case SVC_TRAILER: + return 1.1; + case SVC_BUS: + return 1.2; + case SVC_COACH: + return 2.; + case SVC_TRAM: + return 1.; + case SVC_RAIL_URBAN: + return 1.; + case SVC_RAIL: + return 0.25; + case SVC_RAIL_ELECTRIC: + return 0.5; + case SVC_SHIP: + return 0.1; + default: + return 2.6;//2.9; + } +} + + +SUMOReal +SUMOVTypeParameter::getDefaultDecel(const SUMOVehicleClass vc) { + switch (vc) { + case SVC_PEDESTRIAN: + return 2.; + case SVC_BICYCLE: + return 3.; + case SVC_MOPED: + return 7.; + case SVC_MOTORCYCLE: + return 10.; + case SVC_TRUCK: + return 4.; + case SVC_TRAILER: + return 4.; + case SVC_BUS: + return 4.; + case SVC_COACH: + return 4.; + case SVC_TRAM: + return 3.; + case SVC_RAIL_URBAN: + return 3.; + case SVC_RAIL: + return 1.3; + case SVC_RAIL_ELECTRIC: + return 1.3; + case SVC_SHIP: + return 0.15; + default: + return 4.5;//7.5; + } +} + + +SUMOReal +SUMOVTypeParameter::getDefaultImperfection(const SUMOVehicleClass vc) { + switch (vc) { + case SVC_TRAM: + case SVC_RAIL_URBAN: + case SVC_RAIL: + case SVC_RAIL_ELECTRIC: + case SVC_SHIP: + return 0.; + default: + return 0.5; + } +} + + +const SUMOVTypeParameter& +SUMOVTypeParameter::getDefault() { + static SUMOVTypeParameter defaultParams(""); + return defaultParams; +} + + +/****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/vehicle/SUMOVTypeParameter.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SUMOVTypeParameter.h --- sumo-0.21.0+dfsg/src/utils/vehicle/SUMOVTypeParameter.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/vehicle/SUMOVTypeParameter.h 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,222 @@ +/****************************************************************************/ +/// @file SUMOVTypeParameter.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date 10.09.2009 +/// @version $Id: SUMOVTypeParameter.h 18096 2015-03-17 09:50:59Z behrisch $ +/// +// Structure representing possible vehicle parameter +/****************************************************************************/ +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 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 SUMOVTypeParameter_h +#define SUMOVTypeParameter_h + + +// =========================================================================== +// included modules +// =========================================================================== +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class OutputDevice; +class OptionsCont; + + +// =========================================================================== +// value definitions +// =========================================================================== +const int VTYPEPARS_LENGTH_SET = 1; +const int VTYPEPARS_MINGAP_SET = 2; +const int VTYPEPARS_MAXSPEED_SET = 2 << 2; +const int VTYPEPARS_PROBABILITY_SET = 2 << 3; +const int VTYPEPARS_SPEEDFACTOR_SET = 2 << 4; +const int VTYPEPARS_SPEEDDEVIATION_SET = 2 << 5; +const int VTYPEPARS_EMISSIONCLASS_SET = 2 << 6; +const int VTYPEPARS_COLOR_SET = 2 << 7; +const int VTYPEPARS_VEHICLECLASS_SET = 2 << 8; +const int VTYPEPARS_WIDTH_SET = 2 << 9; +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; +const int VTYPEPARS_IMPATIENCE_SET = 2 << 14; +const int VTYPEPARS_LANE_CHANGE_MODEL_SET = 2 << 15; +const int VTYPEPARS_PERSON_CAPACITY = 2 << 16; +const int VTYPEPARS_BOARDING_DURATION = 2 << 17; +const int VTYPEPARS_CONTAINER_CAPACITY = 2 << 18; +const int VTYPEPARS_LOADING_DURATION = 2 << 19; + + +// =========================================================================== +// struct definitions +// =========================================================================== +/** + * @class SUMOVTypeParameter + * @brief Structure representing possible vehicle parameter + */ +class SUMOVTypeParameter : public Parameterised { +public: + /** @brief Constructor + * + * Initialises the structure with default values + */ + SUMOVTypeParameter(const std::string& vtid, const SUMOVehicleClass vc = SVC_IGNORING); + + + /** @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 (setParameter & what) != 0; + } + + + /** @brief Writes the vtype + * + * @param[in, out] dev The device to write into + * @exception IOError not yet implemented + */ + void write(OutputDevice& dev) const; + + /** @brief Validates stored car-following parameter + */ + void validateCFParameter() const; + + + /** @brief Returns the named value from the map, or the default if it is not contained there + * @param[in] attr The corresponding xml attribute + * @param[in] defaultValue The value to return if the given map does not contain the named variable + * @return The named value from the map or the default if it does not exist there + */ + SUMOReal get(const SumoXMLAttr attr, const SUMOReal defaultValue) const; + + + /// @brief The vehicle type's id + std::string id; + + /// @brief The physical vehicle length + SUMOReal length; + /// @brief This class' free space in front of the vehicle itself + SUMOReal minGap; + /// @brief The vehicle type's maximum speed [m/s] + SUMOReal maxSpeed; + /// @brief The probability when being added to a distribution without an explicit probability + SUMOReal defaultProbability; + /// @brief The factor by which the maximum speed may deviate from the allowed max speed on the street + SUMOReal speedFactor; + /// @brief The standard deviation for speed variations + SUMOReal speedDev; + /// @brief The emission class of this vehicle + SUMOEmissionClass emissionClass; + /// @brief The color + RGBColor color; + /// @brief The vehicle's class + SUMOVehicleClass vehicleClass; + /// @brief The vehicle's impatience (willingness to obstruct others) + SUMOReal impatience; + /// @brief The person capacity of the vehicle + unsigned int personCapacity; + /// @brief The container capacity of the vehicle + unsigned int containerCapacity; + /// @brief The time a person needs to board the vehicle + SUMOTime boardingDuration; + /// @brief The time a container needs to get loaded on the vehicle + SUMOTime loadingDuration; + + + + /// @name Values for drawing this class' vehicles + /// @{ + + /// @brief This class' width + SUMOReal width; + + /// @brief This class' height + SUMOReal height; + + /// @brief This class' shape + SUMOVehicleShape shape; + + /// @brief 3D model file for this class + std::string osgFile; + + /// @brief Image file for this class + std::string imgFile; + /// @} + + + /// @brief The enum-representation of the car-following model to use + SumoXMLTag cfModel; + + /// @brief Car-following parameter + typedef std::map CFParams; + CFParams cfParameter; + + /// @brief The lane-change model to use + LaneChangeModel lcModel; + + /// @brief Information for the router which parameter were set + int setParameter; + + + /// @brief Information whether this type was already saved (needed by routers) + mutable bool saved; + + /// @brief Information whether this is a type-stub, being only referenced but not defined (needed by routers) + mutable bool onlyReferenced; + + /** @brief Returns the default acceleration for the given vehicle class + * This needs to be a function because the actual value is stored in the car following model + * @param[in] vc the vehicle class + * @return the acceleration in m/s^2 + */ + static SUMOReal getDefaultAccel(const SUMOVehicleClass vc = SVC_IGNORING); + + /** @brief Returns the default deceleration for the given vehicle class + * This needs to be a function because the actual value is stored in the car following model + * @param[in] vc the vehicle class + * @return the deceleration in m/s^2 + */ + static SUMOReal getDefaultDecel(const SUMOVehicleClass vc = SVC_IGNORING); + + /** @brief Returns the default driver's imperfection (sigma or epsilon in Krauss' model) for the given vehicle class + * This needs to be a function because the actual value is stored in the car following model + * @param[in] vc the vehicle class + * @return the imperfection as a value between 0 and 1 + */ + static SUMOReal getDefaultImperfection(const SUMOVehicleClass vc = SVC_IGNORING); + + /// @brief return the default parameters, this is a function due to the http://www.parashift.com/c++-faq/static-init-order.html + static const SUMOVTypeParameter& getDefault(); + +}; + +#endif + +/****************************************************************************/ + diff -Nru sumo-0.21.0+dfsg/src/utils/xml/GenericSAXHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/GenericSAXHandler.cpp --- sumo-0.21.0+dfsg/src/utils/xml/GenericSAXHandler.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/GenericSAXHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Sept 2002 -/// @version $Id: GenericSAXHandler.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GenericSAXHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A handler which converts occuring elements and attributes into enums /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/GenericSAXHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/GenericSAXHandler.h --- sumo-0.21.0+dfsg/src/utils/xml/GenericSAXHandler.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/GenericSAXHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: GenericSAXHandler.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: GenericSAXHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A handler which converts occuring elements and attributes into enums /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/Makefile.in sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/Makefile.in --- sumo-0.21.0+dfsg/src/utils/xml/Makefile.in 2014-06-11 22:03:58.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/Makefile.in 2015-04-17 05:44:20.000000000 +0000 @@ -228,6 +228,8 @@ GDAL_CONFIG = @GDAL_CONFIG@ GDAL_LDFLAGS = @GDAL_LDFLAGS@ GREP = @GREP@ +GTEST_CONFIG = @GTEST_CONFIG@ +GTEST_LDFLAGS = @GTEST_LDFLAGS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -238,7 +240,6 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_GTEST = @LIB_GTEST@ LIB_XERCES = @LIB_XERCES@ LIPO = @LIPO@ LN_S = @LN_S@ diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SAXWeightsHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SAXWeightsHandler.cpp --- sumo-0.21.0+dfsg/src/utils/xml/SAXWeightsHandler.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SAXWeightsHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30 Mar 2007 -/// @version $Id: SAXWeightsHandler.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SAXWeightsHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // An XML-handler for network weights /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SAXWeightsHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SAXWeightsHandler.h --- sumo-0.21.0+dfsg/src/utils/xml/SAXWeightsHandler.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SAXWeightsHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30 Mar 2007 -/// @version $Id: SAXWeightsHandler.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SAXWeightsHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // An XML-handler for network weights /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMORouteHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMORouteHandler.cpp --- sumo-0.21.0+dfsg/src/utils/xml/SUMORouteHandler.cpp 2014-02-22 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMORouteHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Sascha Krieg /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: SUMORouteHandler.cpp 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: SUMORouteHandler.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Parser for routes during their loading /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -58,7 +58,8 @@ myActiveRouteColor(0), myCurrentVType(0), myBeginDefault(string2time(OptionsCont::getOptions().getString("begin"))), - myEndDefault(string2time(OptionsCont::getOptions().getString("end"))) { + myEndDefault(string2time(OptionsCont::getOptions().getString("end"))), + myFirstDepart(-1), myInsertStopEdgesAt(-1) { } @@ -88,6 +89,9 @@ SUMORouteHandler::registerLastDepart() { if (myVehicleParameter->departProcedure == DEPART_GIVEN) { myLastDepart = myVehicleParameter->depart; + if (myFirstDepart == -1) { + myFirstDepart = myLastDepart; + } } // else: we don't know when this vehicle will depart. keep the previous known depart time } @@ -103,6 +107,10 @@ break; case SUMO_TAG_PERSON: delete myVehicleParameter; + myVehicleParameter = SUMOVehicleParserHelper::parseVehicleAttributes(attrs, false, false, true); + break; + case SUMO_TAG_CONTAINER: + delete myVehicleParameter; myVehicleParameter = SUMOVehicleParserHelper::parseVehicleAttributes(attrs); break; case SUMO_TAG_FLOW: @@ -160,6 +168,11 @@ delete myVehicleParameter; myVehicleParameter = 0; break; + case SUMO_TAG_CONTAINER: + closeContainer(); + delete myVehicleParameter; + myVehicleParameter = 0; + break; case SUMO_TAG_VEHICLE: if (myVehicleParameter->repetitionNumber > 0) { myVehicleParameter->repetitionNumber++; // for backwards compatibility @@ -186,9 +199,6 @@ myBeginDefault = string2time(OptionsCont::getOptions().getString("begin")); myEndDefault = string2time(OptionsCont::getOptions().getString("end")); break; - case SUMO_TAG_TRIP: - delete myVehicleParameter; - myVehicleParameter = 0; default: break; } @@ -258,22 +268,37 @@ if (attrs.hasAttribute(SUMO_ATTR_TRIGGERED)) { stop.setParameter |= STOP_TRIGGER_SET; } + if (attrs.hasAttribute(SUMO_ATTR_CONTAINER_TRIGGERED)) { + stop.setParameter |= STOP_CONTAINER_TRIGGER_SET; + } if (attrs.hasAttribute(SUMO_ATTR_PARKING)) { stop.setParameter |= STOP_PARKING_SET; } if (attrs.hasAttribute(SUMO_ATTR_EXPECTED)) { stop.setParameter |= STOP_EXPECTED_SET; } + if (attrs.hasAttribute(SUMO_ATTR_EXPECTED_CONTAINERS)) { + stop.setParameter |= STOP_EXPECTED_CONTAINERS_SET; + } bool ok = true; stop.busstop = attrs.getOpt(SUMO_ATTR_BUS_STOP, 0, ok, ""); + stop.containerstop = attrs.getOpt(SUMO_ATTR_CONTAINER_STOP, 0, ok, ""); if (stop.busstop != "") { errorSuffix = " at '" + stop.busstop + "'" + errorSuffix; + } else if (stop.containerstop != "") { + errorSuffix = " at '" + stop.containerstop + "'" + errorSuffix; } else { - errorSuffix = " on lane '" + stop.busstop + "'" + errorSuffix; + errorSuffix = " on lane '" + stop.lane + "'" + errorSuffix; } // get the standing duration if (!attrs.hasAttribute(SUMO_ATTR_DURATION) && !attrs.hasAttribute(SUMO_ATTR_UNTIL)) { - stop.triggered = attrs.getOpt(SUMO_ATTR_TRIGGERED, 0, ok, true); + if (attrs.hasAttribute(SUMO_ATTR_CONTAINER_TRIGGERED)) { + stop.containerTriggered = attrs.getOpt(SUMO_ATTR_CONTAINER_TRIGGERED, 0, ok, true); + stop.triggered = attrs.getOpt(SUMO_ATTR_TRIGGERED, 0, ok, false); + } else { + stop.triggered = attrs.getOpt(SUMO_ATTR_TRIGGERED, 0, ok, true); + stop.containerTriggered = attrs.getOpt(SUMO_ATTR_CONTAINER_TRIGGERED, 0, ok, false); + } stop.duration = -1; stop.until = -1; } else { @@ -284,10 +309,11 @@ return false; } stop.triggered = attrs.getOpt(SUMO_ATTR_TRIGGERED, 0, ok, false); + stop.containerTriggered = attrs.getOpt(SUMO_ATTR_CONTAINER_TRIGGERED, 0, ok, false); } - stop.parking = attrs.getOpt(SUMO_ATTR_PARKING, 0, ok, stop.triggered); + stop.parking = attrs.getOpt(SUMO_ATTR_PARKING, 0, ok, stop.triggered || stop.containerTriggered); if (!ok) { - errorOutput->inform("Invalid bool for 'triggered' or 'parking' for stop" + errorSuffix); + errorOutput->inform("Invalid bool for 'triggered', 'containerTriggered' or 'parking' for stop" + errorSuffix); return false; } @@ -297,6 +323,12 @@ SUMOSAXAttributes::parseStringSet(expectedStr, personIDs); stop.awaitedPersons = personIDs; + // expected containers + std::string expectedContainersStr = attrs.getOpt(SUMO_ATTR_EXPECTED_CONTAINERS, 0, ok, ""); + std::set containerIDs; + SUMOSAXAttributes::parseStringSet(expectedContainersStr, containerIDs); + stop.awaitedContainers = containerIDs; + const std::string idx = attrs.getOpt(SUMO_ATTR_INDEX, 0, ok, "end"); if (idx == "end") { stop.index = STOP_INDEX_END; diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMORouteHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMORouteHandler.h --- sumo-0.21.0+dfsg/src/utils/xml/SUMORouteHandler.h 2014-02-22 23:02:29.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMORouteHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 9 Jul 2001 -/// @version $Id: SUMORouteHandler.h 15692 2014-02-22 09:17:02Z behrisch $ +/// @version $Id: SUMORouteHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Parser for routes during their loading /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -34,7 +34,7 @@ #include #include -#include +#include #include @@ -70,6 +70,11 @@ static bool checkStopPos(SUMOReal& startPos, SUMOReal& endPos, const SUMOReal laneLength, const SUMOReal minLength, const bool friendlyPos); + /// @brief returns the first departure time that was ever read + SUMOTime getFirstDepart() const { + return myFirstDepart; + } + protected: /// @name inherited from GenericSAXHandler //@{ @@ -123,6 +128,9 @@ /// Ends the processing of a person virtual void closePerson() = 0; + /// Ends the processing of a container + virtual void closeContainer() = 0; + /// Ends the processing of a flow virtual void closeFlow() = 0; @@ -142,7 +150,7 @@ bool parseStop(SUMOVehicleParameter::Stop& stop, const SUMOSAXAttributes& attrs, std::string errorSuffix, MsgHandler* const errorOutput); protected: - /// @brief Parameter of the current vehicle, trip, person, or flow + /// @brief Parameter of the current vehicle, trip, person, container or flow SUMOVehicleParameter* myVehicleParameter; /// @brief The insertion time of the vehicle read last @@ -154,12 +162,15 @@ /// @brief The id of the route the current route references to std::string myActiveRouteRefID; - /// @brief The id of the current route + /// @brief The probability of the current route SUMOReal myActiveRouteProbability; /// @brief The currently parsed route's color const RGBColor* myActiveRouteColor; + /// @brief The currently parsed route costs + SUMOReal myCurrentCosts; + /// @brief List of the stops on the parsed route std::vector myActiveRouteStops; @@ -175,6 +186,12 @@ /// @brief The default value for flow ends SUMOTime myEndDefault; + /// @brief the first read departure time + SUMOTime myFirstDepart; + + /// @brief where stop edges can be inserted into the current route (-1 means no insertion) + int myInsertStopEdgesAt; + private: /// @brief Invalidated copy constructor SUMORouteHandler(const SUMORouteHandler& s); diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMORouteLoaderControl.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMORouteLoaderControl.cpp --- sumo-0.21.0+dfsg/src/utils/xml/SUMORouteLoaderControl.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMORouteLoaderControl.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Wed, 06 Nov 2002 -/// @version $Id: SUMORouteLoaderControl.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMORouteLoaderControl.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Class responsible for loading of routes from some files /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -45,6 +45,7 @@ // =========================================================================== SUMORouteLoaderControl::SUMORouteLoaderControl(SUMOTime inAdvanceStepNo): myFirstLoadTime(SUMOTime_MAX), + myCurrentLoadTime(-SUMOTime_MAX), myInAdvanceStepNo(inAdvanceStepNo), myRouteLoaders(), myLoadAll(inAdvanceStepNo <= 0), @@ -73,12 +74,18 @@ if (myAllLoaded) { return; } - SUMOTime loadMaxTime = myLoadAll ? SUMOTime_MAX : step + myInAdvanceStepNo; - + if (myCurrentLoadTime > step) { + return; + } + const SUMOTime loadMaxTime = myLoadAll ? SUMOTime_MAX : MAX2(myCurrentLoadTime + myInAdvanceStepNo, step); + myCurrentLoadTime = SUMOTime_MAX; // load all routes for the specified time period bool furtherAvailable = false; for (std::vector::iterator i = myRouteLoaders.begin(); i != myRouteLoaders.end(); ++i) { - myFirstLoadTime = MIN2(myFirstLoadTime, (*i)->loadUntil(loadMaxTime)); + myCurrentLoadTime = MIN2(myCurrentLoadTime, (*i)->loadUntil(loadMaxTime)); + if ((*i)->getFirstDepart() != -1) { + myFirstLoadTime = MIN2(myFirstLoadTime, (*i)->getFirstDepart()); + } furtherAvailable |= (*i)->moreAvailable(); } myAllLoaded = !furtherAvailable; diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMORouteLoaderControl.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMORouteLoaderControl.h --- sumo-0.21.0+dfsg/src/utils/xml/SUMORouteLoaderControl.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMORouteLoaderControl.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Jakob Erdmann /// @date Wed, 06 Nov 2002 -/// @version $Id: SUMORouteLoaderControl.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMORouteLoaderControl.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Class responsible for loading of routes from some files /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -65,7 +65,7 @@ /// add another loader void add(SUMORouteLoader* loader); - /// loads the next routes + /// loads the next routes up to and including the given time step void loadNext(SUMOTime step); /// returns the timestamp of the first loaded vehicle or flow @@ -73,10 +73,18 @@ return myFirstLoadTime; } + /// returns whether loading is completed + bool haveAllLoaded() const { + return myAllLoaded; + } + private: /// the first time step for which vehicles were loaded SUMOTime myFirstLoadTime; + /// the time step up to which vehicles were loaded + SUMOTime myCurrentLoadTime; + /// the number of routes to read in forward SUMOTime myInAdvanceStepNo; diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMORouteLoader.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMORouteLoader.cpp --- sumo-0.21.0+dfsg/src/utils/xml/SUMORouteLoader.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMORouteLoader.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 6 Nov 2002 -/// @version $Id: SUMORouteLoader.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMORouteLoader.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // A class that performs the loading of routes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -58,29 +58,22 @@ SUMOTime SUMORouteLoader::loadUntil(SUMOTime time) { - SUMOTime firstDepart = SUMOTime_MAX; // read only when further data is available, no error occured // and vehicles may be found in the between the departure time of // the last read vehicle and the time to read until - if (!myMoreAvailable || time <= myHandler->getLastDepart()) { - return firstDepart; + if (!myMoreAvailable) { + return SUMOTime_MAX; } - // read vehicles until specified time or the period to read vehicles // until is reached - while (myParser->parseNext()) { - if (firstDepart == SUMOTime_MAX && myHandler->getLastDepart() >= 0) { - firstDepart = myHandler->getLastDepart(); - } - // return when the last read vehicle is beyond the period - if (time <= myHandler->getLastDepart()) { - return firstDepart; + while (myHandler->getLastDepart() <= time) { + if (!myParser->parseNext()) { + // no data available anymore + myMoreAvailable = false; + return SUMOTime_MAX; } } - - // no data available anymore - myMoreAvailable = false; - return firstDepart; + return myHandler->getLastDepart(); } @@ -90,4 +83,10 @@ } +SUMOTime +SUMORouteLoader::getFirstDepart() const { + return myHandler->getFirstDepart(); +} + + /****************************************************************************/ diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMORouteLoader.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMORouteLoader.h --- sumo-0.21.0+dfsg/src/utils/xml/SUMORouteLoader.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMORouteLoader.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 6 Nov 2002 -/// @version $Id: SUMORouteLoader.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMORouteLoader.h 18095 2015-03-17 09:39:00Z behrisch $ /// // A class that performs the loading of routes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -62,6 +62,9 @@ /// returns the information whether new data is available bool moreAvailable() const; + /// returns the first departure time that was ever read + SUMOTime getFirstDepart() const; + private: /// the used SAXReader SUMOSAXReader* myParser; diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXAttributes.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXAttributes.cpp --- sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXAttributes.cpp 2014-04-11 22:02:30.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXAttributes.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30 Mar 2007 -/// @version $Id: SUMOSAXAttributes.cpp 16170 2014-04-11 10:04:38Z behrisch $ +/// @version $Id: SUMOSAXAttributes.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Encapsulated SAX-Attributes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXAttributes.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXAttributes.h --- sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXAttributes.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXAttributes.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30 Mar 2007 -/// @version $Id: SUMOSAXAttributes.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMOSAXAttributes.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Encapsulated SAX-Attributes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp --- sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: SUMOSAXAttributesImpl_Binary.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMOSAXAttributesImpl_Binary.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Encapsulated Xerces-SAX-attributes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXAttributesImpl_Binary.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXAttributesImpl_Binary.h --- sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXAttributesImpl_Binary.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXAttributesImpl_Binary.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30 Mar 2007 -/// @version $Id: SUMOSAXAttributesImpl_Binary.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMOSAXAttributesImpl_Binary.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Encapsulated Xerces-SAX-attributes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp --- sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: SUMOSAXAttributesImpl_Xerces.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMOSAXAttributesImpl_Xerces.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Encapsulated Xerces-SAX-attributes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -105,8 +106,12 @@ // TranscodeToStr and debug_new interact badly in this case; return ""; } else { - XERCES_CPP_NAMESPACE::TranscodeToStr utf8(utf16, "UTF-8"); - return TplConvert::_2str(utf8.str(), (unsigned)utf8.length()); + try { + XERCES_CPP_NAMESPACE::TranscodeToStr utf8(utf16, "UTF-8"); + return TplConvert::_2str(utf8.str(), (unsigned)utf8.length()); + } catch (XERCES_CPP_NAMESPACE::TranscodingException e) { + return "?"; + } } #endif } @@ -126,8 +131,12 @@ // TranscodeToStr and debug_new interact badly in this case; return ""; } else { - XERCES_CPP_NAMESPACE::TranscodeToStr utf8(utf16, "UTF-8"); - return TplConvert::_2strSec(utf8.str(), (unsigned)utf8.length(), str); + try { + XERCES_CPP_NAMESPACE::TranscodeToStr utf8(utf16, "UTF-8"); + return TplConvert::_2strSec(utf8.str(), (unsigned)utf8.length(), str); + } catch (XERCES_CPP_NAMESPACE::TranscodingException e) { + return "?"; + } } #endif } diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h --- sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Fri, 30 Mar 2007 -/// @version $Id: SUMOSAXAttributesImpl_Xerces.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMOSAXAttributesImpl_Xerces.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Encapsulated Xerces-SAX-attributes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXHandler.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXHandler.cpp --- sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXHandler.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXHandler.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: SUMOSAXHandler.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMOSAXHandler.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // SAX-handler base for SUMO-files /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXHandler.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXHandler.h --- sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXHandler.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXHandler.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Sept 2002 -/// @version $Id: SUMOSAXHandler.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMOSAXHandler.h 18095 2015-03-17 09:39:00Z behrisch $ /// // SAX-handler base for SUMO-files /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXReader.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXReader.cpp --- sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXReader.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXReader.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Nov 2012 -/// @version $Id: SUMOSAXReader.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: SUMOSAXReader.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // SAX-reader encapsulation containing binary reader /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -219,7 +219,8 @@ const std::string::size_type pos = url.rfind("/"); if (pos != std::string::npos) { const std::string dir = url.substr(0, pos); - if (dir == "http://sumo-sim.org/xsd" || dir == "http://sumo.sf.net/xsd" || dir == "http://sumo-sim.org/xsd/amitran") { + if (dir == "http://sumo.sf.net/xsd" || dir == "http://sumo-sim.org/xsd" || dir == "http://sumo-sim.org/xsd/amitran" || + dir == "http://sumo.dlr.de/xsd" || dir == "http://sumo.dlr.de/xsd/amitran") { const char* sumoPath = std::getenv("SUMO_HOME"); if (sumoPath == 0) { WRITE_WARNING("Environment variable SUMO_HOME is not set, schema resolution will use slow website lookups."); diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXReader.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXReader.h --- sumo-0.21.0+dfsg/src/utils/xml/SUMOSAXReader.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOSAXReader.h 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Nov 2012 -/// @version $Id: SUMOSAXReader.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMOSAXReader.h 18095 2015-03-17 09:39:00Z behrisch $ /// // SAX-reader encapsulation containing binary reader /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOVehicleParserHelper.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOVehicleParserHelper.cpp --- sumo-0.21.0+dfsg/src/utils/xml/SUMOVehicleParserHelper.cpp 2014-05-14 22:02:37.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOVehicleParserHelper.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -6,12 +6,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 07.04.2008 -/// @version $Id: SUMOVehicleParserHelper.cpp 16381 2014-05-14 12:31:03Z namdre $ +/// @version $Id: SUMOVehicleParserHelper.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Helper methods for parsing vehicle attributes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -123,7 +123,7 @@ } if (attrs.hasAttribute(SUMO_ATTR_PROB)) { ret->repetitionProbability = attrs.get(SUMO_ATTR_PROB, id.c_str(), ok); - if (ok && (ret->repetitionProbability < 0 || ret->repetitionProbability > 1)) { + if (ok && (ret->repetitionProbability <= 0 || ret->repetitionProbability > 1)) { delete ret; throw ProcessError("Invalid repetition probability in the definition of flow '" + id + "'."); } @@ -164,8 +164,9 @@ } } else { // interpret repetitionNumber - if (ok && ret->repetitionProbability >= 0) { + if (ok && ret->repetitionProbability > 0) { ret->repetitionNumber = INT_MAX; + ret->repetitionEnd = end; } else { if (ok && ret->repetitionOffset <= 0) { delete ret; @@ -174,7 +175,7 @@ if (end == SUMOTime_MAX) { ret->repetitionNumber = INT_MAX; } else { - ret->repetitionNumber = static_cast(static_cast(end - ret->depart) / ret->repetitionOffset + 0.5); + ret->repetitionNumber = MAX2(1, (int)(((SUMOReal)(end - ret->depart)) / ret->repetitionOffset + 0.5)); } } } @@ -188,7 +189,7 @@ SUMOVehicleParameter* SUMOVehicleParserHelper::parseVehicleAttributes(const SUMOSAXAttributes& attrs, - bool optionalID, bool skipDepart) { + const bool optionalID, const bool skipDepart, const bool isPerson) { bool ok = true; std::string id, errorMsg; if (optionalID) { @@ -198,6 +199,9 @@ } SUMOVehicleParameter* ret = new SUMOVehicleParameter(); ret->id = id; + if (isPerson) { + ret->vtypeid = DEFAULT_PEDTYPE_ID; + } try { parseCommonAttributes(attrs, ret, "vehicle"); if (!skipDepart) { @@ -235,9 +239,12 @@ ret->line = attrs.get(SUMO_ATTR_LINE, ret->id.c_str(), ok); } // parse zone information - if (attrs.hasAttribute(SUMO_ATTR_FROM_TAZ) && attrs.hasAttribute(SUMO_ATTR_TO_TAZ)) { - ret->setParameter |= VEHPARS_TAZ_SET; + if (attrs.hasAttribute(SUMO_ATTR_FROM_TAZ)) { + ret->setParameter |= VEHPARS_FROM_TAZ_SET; ret->fromTaz = attrs.get(SUMO_ATTR_FROM_TAZ, ret->id.c_str(), ok); + } + if (attrs.hasAttribute(SUMO_ATTR_TO_TAZ)) { + ret->setParameter |= VEHPARS_TO_TAZ_SET; ret->toTaz = attrs.get(SUMO_ATTR_TO_TAZ, ret->id.c_str(), ok); } // parse reroute information @@ -303,16 +310,16 @@ } else { ret->color = RGBColor::DEFAULT_COLOR; } - // parse person capacity - if (attrs.hasAttribute(SUMO_ATTR_PERSON_CAPACITY)) { - ret->setParameter |= VEHPARS_PERSON_CAPACITY_SET; - ret->personCapacity = attrs.get(SUMO_ATTR_PERSON_CAPACITY, ret->id.c_str(), ok); - } // parse person number if (attrs.hasAttribute(SUMO_ATTR_PERSON_NUMBER)) { ret->setParameter |= VEHPARS_PERSON_NUMBER_SET; ret->personNumber = attrs.get(SUMO_ATTR_PERSON_NUMBER, ret->id.c_str(), ok); } + // parse container number + if (attrs.hasAttribute(SUMO_ATTR_CONTAINER_NUMBER)) { + ret->setParameter |= VEHPARS_CONTAINER_NUMBER_SET; + ret->containerNumber = attrs.get(SUMO_ATTR_CONTAINER_NUMBER, ret->id.c_str(), ok); + } } @@ -325,6 +332,9 @@ vClass = parseVehicleClass(attrs, id); } SUMOVTypeParameter* vtype = new SUMOVTypeParameter(id, vClass); + if (attrs.hasAttribute(SUMO_ATTR_VCLASS)) { + vtype->setParameter |= VTYPEPARS_VEHICLECLASS_SET; + } if (attrs.hasAttribute(SUMO_ATTR_LENGTH)) { vtype->length = attrs.get(SUMO_ATTR_LENGTH, vtype->id.c_str(), ok); vtype->setParameter |= VTYPEPARS_LENGTH_SET; @@ -357,9 +367,6 @@ } vtype->setParameter |= VTYPEPARS_IMPATIENCE_SET; } - if (attrs.hasAttribute(SUMO_ATTR_VCLASS)) { - vtype->setParameter |= VTYPEPARS_VEHICLECLASS_SET; - } if (attrs.hasAttribute(SUMO_ATTR_WIDTH)) { vtype->width = attrs.get(SUMO_ATTR_WIDTH, vtype->id.c_str(), ok); vtype->setParameter |= VTYPEPARS_WIDTH_SET; @@ -403,6 +410,22 @@ throw ProcessError(); } } + if (attrs.hasAttribute(SUMO_ATTR_PERSON_CAPACITY)) { + vtype->personCapacity = attrs.get(SUMO_ATTR_PERSON_CAPACITY, vtype->id.c_str(), ok); + vtype->setParameter |= VTYPEPARS_PERSON_CAPACITY; + } + if (attrs.hasAttribute(SUMO_ATTR_CONTAINER_CAPACITY)) { + vtype->containerCapacity = attrs.get(SUMO_ATTR_CONTAINER_CAPACITY, vtype->id.c_str(), ok); + vtype->setParameter |= VTYPEPARS_CONTAINER_CAPACITY; + } + if (attrs.hasAttribute(SUMO_ATTR_BOARDING_DURATION)) { + vtype->boardingDuration = attrs.getSUMOTimeReporting(SUMO_ATTR_BOARDING_DURATION, vtype->id.c_str(), ok); + vtype->setParameter |= VTYPEPARS_BOARDING_DURATION; + } + if (attrs.hasAttribute(SUMO_ATTR_LOADING_DURATION)) { + vtype->loadingDuration = attrs.getSUMOTimeReporting(SUMO_ATTR_LOADING_DURATION, vtype->id.c_str(), ok); + vtype->setParameter |= VTYPEPARS_LOADING_DURATION; + } try { parseVTypeEmbedded(*vtype, SUMO_TAG_CF_KRAUSS, attrs, true); } catch (ProcessError&) { @@ -467,6 +490,7 @@ allowedCFModelAttrs[SUMO_TAG_CF_KRAUSS] = krausParams; allowedCFModelAttrs[SUMO_TAG_CF_KRAUSS_ORIG1] = krausParams; allowedCFModelAttrs[SUMO_TAG_CF_KRAUSS_PLUS_SLOPE] = krausParams; + allowedCFModelAttrs[SUMO_TAG_CF_KRAUSS_ACCEL_BOUND] = krausParams; std::set smartSKParams; smartSKParams.insert(SUMO_ATTR_ACCEL); diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOVehicleParserHelper.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOVehicleParserHelper.h --- sumo-0.21.0+dfsg/src/utils/xml/SUMOVehicleParserHelper.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOVehicleParserHelper.h 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ /// @author Michael Behrisch /// @author Laura Bieker /// @date Mon, 07.04.2008 -/// @version $Id: SUMOVehicleParserHelper.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: SUMOVehicleParserHelper.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Helper methods for parsing vehicle attributes /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -38,8 +38,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -75,12 +75,13 @@ * @param[in] attr The SAX-attributes to get vehicle parameter from * @param[in] optionalID Whether the id shall be skipped * @param[in] skipDepart Whether parsing the departure time shall be skipped + * @param[in] isPerson Whether a person is parsed * @return The parsed attribute structure if no error occured, 0 otherwise * @exception ProcessError If an attribute's value is invalid * @note: the caller is responsible for deleting the returned pointer */ static SUMOVehicleParameter* parseVehicleAttributes(const SUMOSAXAttributes& attrs, - bool optionalID = false, bool skipDepart = false); + const bool optionalID = false, const bool skipDepart = false, const bool isPerson = false); /** @brief Starts to parse a vehicle type @@ -122,7 +123,7 @@ * When given, the vehicle class is parsed using getVehicleClassID. * Exceptions occuring within this process are catched and reported. * - * If no vehicle class is available in the attributes, the default class (SVC_UNKNOWN) + * If no vehicle class is available in the attributes, the default class (SVC_IGNORING) * is returned. * * @param[in] attrs The attributes to read the class from diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOXMLDefinitions.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOXMLDefinitions.cpp --- sumo-0.21.0+dfsg/src/utils/xml/SUMOXMLDefinitions.cpp 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOXMLDefinitions.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Sept 2002 -/// @version $Id: SUMOXMLDefinitions.cpp 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: SUMOXMLDefinitions.cpp 18096 2015-03-17 09:50:59Z behrisch $ /// // Definitions of elements and attributes known by SUMO /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -70,6 +70,7 @@ { "calibrator", SUMO_TAG_CALIBRATOR }, { "rerouter", SUMO_TAG_REROUTER }, { "busStop", SUMO_TAG_BUS_STOP }, + { "containerStop", SUMO_TAG_CONTAINER_STOP }, { "vTypeProbe", SUMO_TAG_VTYPEPROBE }, { "routeProbe", SUMO_TAG_ROUTEPROBE }, { "routes", SUMO_TAG_ROUTES }, @@ -91,13 +92,13 @@ { "fromEdge", SUMO_TAG_FROMEDGE }, { "toEdge", SUMO_TAG_TOEDGE }, { "sink", SUMO_TAG_SINK }, - { "param", SUMO_TAG_PARAM }, - { "WAUT", SUMO_TAG_WAUT }, + { "param", SUMO_TAG_PARAM }, + { "WAUT", SUMO_TAG_WAUT }, { "wautSwitch", SUMO_TAG_WAUT_SWITCH }, { "wautJunction", SUMO_TAG_WAUT_JUNCTION }, - { "segment", SUMO_TAG_SEGMENT }, - { "delete", SUMO_TAG_DELETE }, - { "stop", SUMO_TAG_STOP }, + { "segment", SUMO_TAG_SEGMENT }, + { "delete", SUMO_TAG_DELETE }, + { "stop", SUMO_TAG_STOP }, { "destProbReroute", SUMO_TAG_DEST_PROB_REROUTE }, { "closingReroute", SUMO_TAG_CLOSING_REROUTE }, { "routeProbReroute", SUMO_TAG_ROUTE_PROB_REROUTE }, @@ -115,6 +116,7 @@ { "join", SUMO_TAG_JOIN }, { "joinExclude", SUMO_TAG_JOINEXCLUDE }, { "crossing", SUMO_TAG_CROSSING }, + { "customShape", SUMO_TAG_CUSTOMSHAPE }, { "way", SUMO_TAG_WAY }, { "nd", SUMO_TAG_ND }, @@ -131,6 +133,7 @@ { "edges", SUMO_TAG_VIEWSETTINGS_EDGES }, { "vehicles", SUMO_TAG_VIEWSETTINGS_VEHICLES }, { "persons", SUMO_TAG_VIEWSETTINGS_PERSONS }, + { "containers", SUMO_TAG_VIEWSETTINGS_CONTAINERS }, { "junctions", SUMO_TAG_VIEWSETTINGS_JUNCTIONS }, { "additionals", SUMO_TAG_VIEWSETTINGS_ADDITIONALS }, { "pois", SUMO_TAG_VIEWSETTINGS_POIS }, @@ -145,12 +148,14 @@ { "breakpoints-file", SUMO_TAG_BREAKPOINTS_FILE }, { "location", SUMO_TAG_LOCATION }, { "colorScheme", SUMO_TAG_COLORSCHEME }, + { "scalingScheme", SUMO_TAG_SCALINGSCHEME }, { "entry", SUMO_TAG_ENTRY }, { "carFollowing-IDM", SUMO_TAG_CF_IDM }, { "carFollowing-IDMM", SUMO_TAG_CF_IDMM }, { "carFollowing-Krauss", SUMO_TAG_CF_KRAUSS }, { "carFollowing-KraussPS", SUMO_TAG_CF_KRAUSS_PLUS_SLOPE }, + { "carFollowing-KraussAB", SUMO_TAG_CF_KRAUSS_ACCEL_BOUND }, { "carFollowing-KraussOrig1", SUMO_TAG_CF_KRAUSS_ORIG1 }, { "carFollowing-SmartSK", SUMO_TAG_CF_SMART_SK }, { "carFollowing-Daniel1", SUMO_TAG_CF_DANIEL1 }, @@ -162,6 +167,11 @@ { "ride", SUMO_TAG_RIDE }, { "walk", SUMO_TAG_WALK }, + { "container", SUMO_TAG_CONTAINER }, + { "transport", SUMO_TAG_TRANSPORT }, + { "tranship", SUMO_TAG_TRANSHIP }, + + { "trajectories", SUMO_TAG_TRAJECTORIES }, { "timestep", SUMO_TAG_TIMESTEP }, { "timeSlice", SUMO_TAG_TIMESLICE }, { "actorConfig", SUMO_TAG_ACTORCONFIG }, @@ -246,6 +256,8 @@ { "speedDev", SUMO_ATTR_SPEEDDEV }, { "laneChangeModel", SUMO_ATTR_LANE_CHANGE_MODEL }, { "minGap", SUMO_ATTR_MINGAP }, + { "boardingDuration", SUMO_ATTR_BOARDING_DURATION }, + { "loadingDuration", SUMO_ATTR_LOADING_DURATION }, { "sigma", SUMO_ATTR_SIGMA }, { "tau", SUMO_ATTR_TAU }, @@ -271,7 +283,9 @@ { "toTaz", SUMO_ATTR_TO_TAZ }, { "reroute", SUMO_ATTR_REROUTE }, { "personCapacity", SUMO_ATTR_PERSON_CAPACITY }, + { "containerCapacity", SUMO_ATTR_CONTAINER_CAPACITY }, { "personNumber", SUMO_ATTR_PERSON_NUMBER }, + { "containerNumber", SUMO_ATTR_CONTAINER_NUMBER }, { "function", SUMO_ATTR_FUNCTION }, { "pos", SUMO_ATTR_POSITION }, @@ -293,6 +307,8 @@ { "linkIndex", SUMO_ATTR_TLLINKINDEX }, { "shape", SUMO_ATTR_SHAPE }, { "spreadType", SUMO_ATTR_SPREADTYPE }, + { "radius", SUMO_ATTR_RADIUS }, + { "customShape", SUMO_ATTR_CUSTOMSHAPE }, { "color", SUMO_ATTR_COLOR }, { "dir", SUMO_ATTR_DIR }, { "state", SUMO_ATTR_STATE }, @@ -329,6 +345,7 @@ { "uncontrolled", SUMO_ATTR_UNCONTROLLED }, { "pass", SUMO_ATTR_PASS }, { "busStop", SUMO_ATTR_BUS_STOP }, + { "containerStop", SUMO_ATTR_CONTAINER_STOP }, { "line", SUMO_ATTR_LINE }, { "lines", SUMO_ATTR_LINES }, { "value", SUMO_ATTR_VALUE }, @@ -350,8 +367,10 @@ { "startPos", SUMO_ATTR_STARTPOS }, { "endPos", SUMO_ATTR_ENDPOS }, { "triggered", SUMO_ATTR_TRIGGERED }, + { "containerTriggered", SUMO_ATTR_CONTAINER_TRIGGERED }, { "parking", SUMO_ATTR_PARKING }, { "expected", SUMO_ATTR_EXPECTED }, + { "expectedContainers", SUMO_ATTR_EXPECTED_CONTAINERS }, { "index", SUMO_ATTR_INDEX }, { "entering", SUMO_ATTR_ENTERING }, @@ -363,6 +382,7 @@ { "lon", SUMO_ATTR_LON }, { "lat", SUMO_ATTR_LAT }, + { "geo", SUMO_ATTR_GEO }, { "k", SUMO_ATTR_K }, { "v", SUMO_ATTR_V }, { "ref", SUMO_ATTR_REF }, @@ -449,6 +469,7 @@ StringBijection::Entry SUMOXMLDefinitions::sumoNodeTypeValues[] = { {"traffic_light", NODETYPE_TRAFFIC_LIGHT}, {"traffic_light_unregulated", NODETYPE_TRAFFIC_LIGHT_NOJUNCTION}, + {"rail_signal", NODETYPE_RAIL_SIGNAL}, {"priority", NODETYPE_PRIORITY}, {"priority_stop", NODETYPE_PRIORITY_STOP}, {"right_before_left", NODETYPE_RIGHT_BEFORE_LEFT}, @@ -485,6 +506,7 @@ { "G", LINKSTATE_TL_GREEN_MAJOR }, { "g", LINKSTATE_TL_GREEN_MINOR }, { "r", LINKSTATE_TL_RED }, + { "u", LINKSTATE_TL_REDYELLOW }, { "Y", LINKSTATE_TL_YELLOW_MAJOR }, { "y", LINKSTATE_TL_YELLOW_MINOR }, { "o", LINKSTATE_TL_OFF_BLINKING }, @@ -511,8 +533,8 @@ StringBijection::Entry SUMOXMLDefinitions::trafficLightTypesVales[] = { { "static", TLTYPE_STATIC }, + { "rail", TLTYPE_RAIL }, { "actuated", TLTYPE_ACTUATED }, - { "agentbased", TLTYPE_AGENT } }; @@ -544,7 +566,7 @@ SUMOXMLDefinitions::linkDirectionValues, LINKDIR_NODIR); StringBijection SUMOXMLDefinitions::TrafficLightTypes( - SUMOXMLDefinitions::trafficLightTypesVales, TLTYPE_AGENT); + SUMOXMLDefinitions::trafficLightTypesVales, TLTYPE_ACTUATED); StringBijection SUMOXMLDefinitions::LaneChangeModels( SUMOXMLDefinitions::laneChangeModelValues, LCM_JE2013); diff -Nru sumo-0.21.0+dfsg/src/utils/xml/SUMOXMLDefinitions.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOXMLDefinitions.h --- sumo-0.21.0+dfsg/src/utils/xml/SUMOXMLDefinitions.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/SUMOXMLDefinitions.h 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Michael Behrisch /// @author Walter Bamberger /// @date Sept 2002 -/// @version $Id: SUMOXMLDefinitions.h 16560 2014-06-09 20:54:15Z behrisch $ +/// @version $Id: SUMOXMLDefinitions.h 18096 2015-03-17 09:50:59Z behrisch $ /// // Definitions of elements and attributes known by SUMO /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -90,6 +90,8 @@ SUMO_TAG_REROUTER, /// @brief A bus stop SUMO_TAG_BUS_STOP, + /// @brief A container stop + SUMO_TAG_CONTAINER_STOP, /** a vtypeprobe detector */ SUMO_TAG_VTYPEPROBE, /** a routeprobe detector */ @@ -156,6 +158,7 @@ SUMO_TAG_JOIN, SUMO_TAG_JOINEXCLUDE, SUMO_TAG_CROSSING, + SUMO_TAG_CUSTOMSHAPE, SUMO_TAG_WAY, SUMO_TAG_ND, @@ -172,6 +175,7 @@ SUMO_TAG_VIEWSETTINGS_EDGES, SUMO_TAG_VIEWSETTINGS_VEHICLES, SUMO_TAG_VIEWSETTINGS_PERSONS, + SUMO_TAG_VIEWSETTINGS_CONTAINERS, SUMO_TAG_VIEWSETTINGS_JUNCTIONS, SUMO_TAG_VIEWSETTINGS_ADDITIONALS, SUMO_TAG_VIEWSETTINGS_POIS, @@ -186,10 +190,12 @@ SUMO_TAG_BREAKPOINTS_FILE, SUMO_TAG_LOCATION, SUMO_TAG_COLORSCHEME, + SUMO_TAG_SCALINGSCHEME, SUMO_TAG_ENTRY, SUMO_TAG_CF_KRAUSS, SUMO_TAG_CF_KRAUSS_PLUS_SLOPE, + SUMO_TAG_CF_KRAUSS_ACCEL_BOUND, SUMO_TAG_CF_KRAUSS_ORIG1, SUMO_TAG_CF_SMART_SK, SUMO_TAG_CF_DANIEL1, @@ -203,6 +209,10 @@ SUMO_TAG_RIDE, SUMO_TAG_WALK, + SUMO_TAG_CONTAINER, + SUMO_TAG_TRANSPORT, + SUMO_TAG_TRANSHIP, + SUMO_TAG_TRAJECTORIES, SUMO_TAG_TIMESTEP, SUMO_TAG_TIMESLICE, SUMO_TAG_ACTORCONFIG, @@ -310,6 +320,8 @@ SUMO_ATTR_SPEEDDEV, SUMO_ATTR_LANE_CHANGE_MODEL, SUMO_ATTR_MINGAP, + SUMO_ATTR_BOARDING_DURATION, + SUMO_ATTR_LOADING_DURATION, /* Car following model attributes */ SUMO_ATTR_SIGMA, // used by: Krauss SUMO_ATTR_TAU, // Krauss @@ -335,7 +347,9 @@ SUMO_ATTR_TO_TAZ, SUMO_ATTR_REROUTE, SUMO_ATTR_PERSON_CAPACITY, + SUMO_ATTR_CONTAINER_CAPACITY, SUMO_ATTR_PERSON_NUMBER, + SUMO_ATTR_CONTAINER_NUMBER, /* source definitions */ SUMO_ATTR_FUNCTION, SUMO_ATTR_POSITION, @@ -365,6 +379,10 @@ SUMO_ATTR_SHAPE, /// The information about how to spread the lanes from the given position SUMO_ATTR_SPREADTYPE, + /// The turning radius at an intersection in m + SUMO_ATTR_RADIUS, + /// whether a given shape is user-defined + SUMO_ATTR_CUSTOMSHAPE, /// A color information SUMO_ATTR_COLOR, /// The abstract direction of a link @@ -413,6 +431,7 @@ SUMO_ATTR_UNCONTROLLED, SUMO_ATTR_PASS, SUMO_ATTR_BUS_STOP, + SUMO_ATTR_CONTAINER_STOP, SUMO_ATTR_LINE, SUMO_ATTR_LINES, SUMO_ATTR_VALUE, @@ -434,8 +453,10 @@ SUMO_ATTR_STARTPOS, SUMO_ATTR_ENDPOS, SUMO_ATTR_TRIGGERED, + SUMO_ATTR_CONTAINER_TRIGGERED, SUMO_ATTR_PARKING, SUMO_ATTR_EXPECTED, + SUMO_ATTR_EXPECTED_CONTAINERS, SUMO_ATTR_INDEX, SUMO_ATTR_ENTERING, @@ -447,6 +468,7 @@ SUMO_ATTR_LON, SUMO_ATTR_LAT, + SUMO_ATTR_GEO, SUMO_ATTR_K, SUMO_ATTR_V, SUMO_ATTR_REF, @@ -564,7 +586,8 @@ enum SumoXMLNodeType { NODETYPE_UNKNOWN, // terminator NODETYPE_TRAFFIC_LIGHT, - NODETYPE_TRAFFIC_LIGHT_NOJUNCTION, // junction controlled only by traffic light but without other prohibitions + NODETYPE_TRAFFIC_LIGHT_NOJUNCTION, // junction controlled only by traffic light but without other prohibitions, + NODETYPE_RAIL_SIGNAL, NODETYPE_PRIORITY, NODETYPE_PRIORITY_STOP, // like priority but all minor links have stop signs NODETYPE_RIGHT_BEFORE_LEFT, @@ -626,6 +649,8 @@ LINKSTATE_TL_GREEN_MINOR = 'g', /// @brief The link has red light (must brake) LINKSTATE_TL_RED = 'r', + /// @brief The link has red light (must brake) but indicates upcoming green + LINKSTATE_TL_REDYELLOW = 'u', /// @brief The link has yellow light, may pass LINKSTATE_TL_YELLOW_MAJOR = 'Y', /// @brief The link has yellow light, has to brake anyway @@ -678,8 +703,8 @@ */ enum TrafficLightType { TLTYPE_STATIC, - TLTYPE_ACTUATED, - TLTYPE_AGENT + TLTYPE_RAIL, + TLTYPE_ACTUATED }; diff -Nru sumo-0.21.0+dfsg/src/utils/xml/XMLSubSys.cpp sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/XMLSubSys.cpp --- sumo-0.21.0+dfsg/src/utils/xml/XMLSubSys.cpp 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/XMLSubSys.cpp 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ /// @author Jakob Erdmann /// @author Michael Behrisch /// @date Mon, 1 Jul 2002 -/// @version $Id: XMLSubSys.cpp 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: XMLSubSys.cpp 18095 2015-03-17 09:39:00Z behrisch $ /// // Utility methods for initialising, closing and using the XML-subsystem /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/utils/xml/XMLSubSys.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/XMLSubSys.h --- sumo-0.21.0+dfsg/src/utils/xml/XMLSubSys.h 2014-03-24 23:02:12.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/utils/xml/XMLSubSys.h 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Mon, 1 Jul 2002 -/// @version $Id: XMLSubSys.h 16005 2014-03-24 12:46:02Z cschmidt87 $ +/// @version $Id: XMLSubSys.h 18095 2015-03-17 09:39:00Z behrisch $ /// // Utility methods for initialising, closing and using the XML-subsystem /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2002-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. diff -Nru sumo-0.21.0+dfsg/src/windows_config.h sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/windows_config.h --- sumo-0.21.0+dfsg/src/windows_config.h 2014-06-09 22:02:23.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/src/windows_config.h 2015-04-17 05:44:20.000000000 +0000 @@ -7,12 +7,12 @@ /// @author Felix Brack /// @author Jakob Erdmann /// @date Mon, 17 Dec 2001 -/// @version $Id: windows_config.h 16562 2014-06-09 21:09:39Z behrisch $ +/// @version $Id: windows_config.h 18177 2015-03-30 21:32:20Z behrisch $ /// // The general windows configuration file /****************************************************************************/ -// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -// Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors +// SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +// Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. @@ -46,6 +46,9 @@ /* Define for dynamic Fox linkage */ #define FOXDLL 1 +/* Define if FOX toolkit is present. */ +#define HAVE_FOX 1 + /* defines the precision of floats */ #define SUMOReal double @@ -69,7 +72,7 @@ /* Version number of package */ #ifndef HAVE_VERSION_H -#define VERSION_STRING "0.21.0" +#define VERSION_STRING "0.23.0" #endif /* Define if junction internal lanes should be used. */ diff -Nru sumo-0.21.0+dfsg/tools/10to11.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/10to11.py --- sumo-0.21.0+dfsg/tools/10to11.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/10to11.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -#!/usr/bin/env python -""" -@file 10to11.py -@author Michael Behrisch -@date 2009-06-09 -@version $Id: 10to11.py 15692 2014-02-22 09:17:02Z behrisch $ - -Transfers configuration files from character data to attribute style. - -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2009-2014 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. -""" -import os, sys, re - -from xml.sax import make_parser, handler -from optparse import OptionParser - -class ConfigReader(handler.ContentHandler): - - def __init__(self): - self._parent = None - self._parentWritten = "" - self._element = None - self._string = '' - - def startElement(self, name, attrs): - self._parent = self._element - self._element = name - self._string = '' - - def characters(self, content): - self._string += content - - def endElement(self, name): - if self._parent == name: - print ' ' % name - self._parentWritten = "" - elif self._element == name: - if not self._parentWritten: - print ' <%s>' % self._parent - self._parentWritten = self._parent - print ' <%s value="%s"/>' % (self._element, self._string) - self._element = self._parent - - def startDocument(self): - print '' - - def endDocument(self): - if self._parentWritten: - print ' ' % self._parentWritten - print '' - -optParser = OptionParser(usage="usage: %prog +") -(options, args) = optParser.parse_args() -if len(args) == 0: - optParser.print_help() - sys.exit() -for f in args: - parser = make_parser() - parser.setContentHandler(ConfigReader()) - parser.parse(f) diff -Nru sumo-0.21.0+dfsg/tools/assign/Assignment.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/Assignment.py --- sumo-0.21.0+dfsg/tools/assign/Assignment.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/Assignment.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,7 +5,7 @@ @author Yun-Pang Floetteroed @author Michael Behrisch @date 2008-03-28 -@version $Id: Assignment.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: Assignment.py 18096 2015-03-17 09:50:59Z behrisch $ This script is for executing the traffic assignment. Three assignment models are available: @@ -15,8 +15,8 @@ The c-logit model are set as default. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -25,7 +25,13 @@ (at your option) any later version. """ -import os, random, string, sys, datetime, math, operator +import os +import random +import string +import sys +import datetime +import math +import operator from xml.sax import saxutils, make_parser, handler from optparse import OptionParser from elements import Predecessor, Vertex, Edge, Path, Vehicle @@ -42,7 +48,7 @@ def initLinkChoiceMap(net, startVertices, endVertices, matrixPshort, linkChoiceMap, odPairsMap): odpairCounts = 0 for start, startVertex in enumerate(startVertices): - odPairsMap[startVertex.label]= {} + odPairsMap[startVertex.label] = {} for end, endVertex in enumerate(endVertices): if startVertex.label != endVertex.label and matrixPshort[start][end] > 0.: odpairCounts += 1 @@ -55,16 +61,19 @@ return linkChoiceMap + def main(): # for measuring the required time for reading input files inputreaderstart = datetime.datetime.now() foutlog = file('%s_log.txt' % options.type, 'w') - foutlog.write('The stochastic user equilibrium traffic assignment will be executed with the %s model.\n' % options.type) - foutlog.write('All vehicular releasing times are determined randomly(uniform).\n') - + foutlog.write( + 'The stochastic user equilibrium traffic assignment will be executed with the %s model.\n' % options.type) + foutlog.write( + 'All vehicular releasing times are determined randomly(uniform).\n') + matrices = options.mtxpsfile.split(",") parser = make_parser() - + if options.verbose: print "Reading net" print 'net file:', options.netfile @@ -83,11 +92,11 @@ if options.curvefile: updateCurveTable(options.curvefile) - + if options.hours == 24.: assignHours = 16. else: - assignHours = options.hours + assignHours = options.hours for edge in net.getEdges(): if edge._lanes: @@ -101,16 +110,16 @@ if options.verbose: print "after link reduction:", net.getfullEdgeCounts(), "edges read" - # calculate link travel time for all district connectors + # calculate link travel time for all district connectors getConnectionTravelTime(net._startVertices, net._endVertices) - + foutlog.write('- Initial calculation of link parameters : done.\n') - # the required time for reading the network + # the required time for reading the network timeForInput(inputreaderstart) - + if options.debug: outputNetwork(net) - + # initialize the map for recording the number of the assigned vehicles AssignedVeh = {} # initialize the map for recording the number of the assigned trips @@ -119,26 +128,26 @@ linkChoiceMap = {} odPairsMap = {} for start, startVertex in enumerate(net._startVertices): - AssignedVeh[startVertex]={} - AssignedTrip[startVertex]={} + AssignedVeh[startVertex] = {} + AssignedTrip[startVertex] = {} smallDemand.append([]) for end, endVertex in enumerate(net._endVertices): AssignedVeh[startVertex][endVertex] = 0 AssignedTrip[startVertex][endVertex] = 0. smallDemand[-1].append(0.) - + # initialization vehID = 0 matrixSum = 0.0 lohse = (options.type == "lohse") incremental = (options.type == "incremental") checkKPaths = False - + if not incremental and options.kPaths > 1: checkKPaths = True if not incremental: net.initialPathSet() - + starttime = datetime.datetime.now() # initialize the file for recording the routes if options.odestimation: @@ -146,38 +155,46 @@ else: foutroute = open('routes.rou.xml', 'w') print >> foutroute, """ - + """ % starttime - - for counter, matrix in enumerate(matrices): #for counter in range (0, len(matrices)): - # delete all vehicle information related to the last matrix for saving the disk space + + # for counter in range (0, len(matrices)): + for counter, matrix in enumerate(matrices): + # delete all vehicle information related to the last matrix for saving + # the disk space vehicles = [] iterInterval = 0 - matrixPshort, startVertices, endVertices, CurrentMatrixSum, begintime, assignPeriod, Pshort_EffCells, matrixSum, smallDemandRatio = getMatrix(net, options.verbose, matrix, matrixSum, options.demandscale) + matrixPshort, startVertices, endVertices, CurrentMatrixSum, begintime, assignPeriod, Pshort_EffCells, matrixSum, smallDemandRatio = getMatrix( + net, options.verbose, matrix, matrixSum, options.demandscale) options.hours = float(assignPeriod) - smallDemandPortion = math.ceil(float(options.maxiteration)/2. * smallDemandRatio) + smallDemandPortion = math.ceil( + float(options.maxiteration) / 2. * smallDemandRatio) if float(smallDemandPortion) != 0.: - iterInterval = math.ceil(float(options.maxiteration) / float(smallDemandPortion)) - + iterInterval = math.ceil( + float(options.maxiteration) / float(smallDemandPortion)) + departtime = begintime * 3600 - + if options.verbose: print 'the analyzed matrices:', counter print 'Begintime:', begintime, "O'Clock" print 'departtime', departtime print 'Matrix und OD Zone already read for Interval', counter print 'CurrentMatrixSum:', CurrentMatrixSum - + foutlog.write('Reading matrix and O-D zones: done.\n') - foutlog.write('Matrix und OD Zone already read for Interval:%s\n' %counter) - foutlog.write('CurrentMatrixSum:%s\n' %CurrentMatrixSum) - foutlog.write('number of current startVertices:%s\n' %len(startVertices)) - foutlog.write('number of current endVertices:%s\n' %len(endVertices)) - + foutlog.write( + 'Matrix und OD Zone already read for Interval:%s\n' % counter) + foutlog.write('CurrentMatrixSum:%s\n' % CurrentMatrixSum) + foutlog.write('number of current startVertices:%s\n' % + len(startVertices)) + foutlog.write('number of current endVertices:%s\n' % len(endVertices)) + if options.odestimation: linkChoiceMap.clear() odPairsMap.clear() - linkChoiceMap = initLinkChoiceMap(net, startVertices, endVertices, matrixPshort, linkChoiceMap, odPairsMap) + linkChoiceMap = initLinkChoiceMap( + net, startVertices, endVertices, matrixPshort, linkChoiceMap, odPairsMap) for edge in net.getEdges(): edge.flow = 0. @@ -188,24 +205,28 @@ edge.TT = 0. edge.delta = 0. edge.helpacttimeEx = 0. - - # the number of origins, the umber of destinations and the number of the OD pairs + + # the number of origins, the umber of destinations and the number of + # the OD pairs origins = len(startVertices) dests = len(endVertices) ODpairs = origins * dests - - # output the origin and destination zones and the number of effective OD pairs + + # output the origin and destination zones and the number of effective + # OD pairs if options.debug: - outputODZone(startVertices, endVertices, Pshort_EffCells, counter) # matrixCounter) - + # matrixCounter) + outputODZone(startVertices, endVertices, Pshort_EffCells, counter) + if incremental: print 'begin the incremental assignment!' iter = 0 options.lamda = 0. while iter < options.maxiteration: - foutlog.write('- Current iteration(not executed yet):%s\n' %iter) + foutlog.write( + '- Current iteration(not executed yet):%s\n' % iter) iter += 1 - if iterInterval != 0 and operator.mod(iter,iterInterval) == 0: + if iterInterval != 0 and operator.mod(iter, iterInterval) == 0: assignSmallDemand = True else: assignSmallDemand = False @@ -213,22 +234,24 @@ targets = set() for end, endVertex in enumerate(endVertices): if assignSmallDemand and matrixPshort[start][end] > 0. and matrixPshort[start][end] < 1.: - smallDemand[start][end] = matrixPshort[start][end]/float(smallDemandPortion) - + smallDemand[start][end] = matrixPshort[ + start][end] / float(smallDemandPortion) + if matrixPshort[start][end] > 1. or (assignSmallDemand and smallDemand[start][end] > 0.): targets.add(endVertex) if len(targets) > 0: if options.dijkstra == 'boost': - D,P = dijkstraBoost(net._boostGraph, startVertex.boost) + D, P = dijkstraBoost( + net._boostGraph, startVertex.boost) elif options.dijkstra == 'plain': - D,P = dijkstraPlain(startVertex, targets) + D, P = dijkstraPlain(startVertex, targets) elif options.dijkstra == 'extend': - D,P = dijkstra(startVertex, targets) + 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) + 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 @@ -247,67 +270,82 @@ first = True # begin the traffic Assignment while newRoutes > 0: - foutlog.write('- SUE iteration:%s\n' %iter_outside) - # Generate the effective routes als intital path solutions, when considering k shortest paths (k is defined by the user.) + foutlog.write('- SUE iteration:%s\n' % iter_outside) + # Generate the effective routes als intital path solutions, + # when considering k shortest paths (k is defined by the user.) if checkKPaths: - checkPathStart = datetime.datetime.now() - newRoutes = net.calcKPaths(options.verbose, options.kPaths, newRoutes, startVertices, endVertices, matrixPshort, options.gamma) + checkPathStart = datetime.datetime.now() + newRoutes = net.calcKPaths( + options.verbose, options.kPaths, newRoutes, startVertices, endVertices, matrixPshort, options.gamma) checkPathEnd = datetime.datetime.now() - checkPathStart - foutlog.write('- Time for finding the k-shortest paths: %s\n' %checkPathEnd) - foutlog.write('- Finding the k-shortest paths for each OD pair: done.\n') + foutlog.write( + '- Time for finding the k-shortest paths: %s\n' % checkPathEnd) + foutlog.write( + '- Finding the k-shortest paths for each OD pair: done.\n') if options.verbose: print 'iter_outside:', iter_outside - print 'number of k shortest paths:', options.kPaths + print 'number of k shortest paths:', options.kPaths print 'number of new routes:', newRoutes - + elif not checkKPaths and iter_outside == 1 and counter == 0: print 'search for the new path' - newRoutes = net.findNewPath(startVertices, endVertices, newRoutes, matrixPshort, options.gamma, lohse, options.dijkstra) - + newRoutes = net.findNewPath( + startVertices, endVertices, newRoutes, matrixPshort, options.gamma, lohse, options.dijkstra) + checkKPaths = False - + if options.verbose: print 'iter_outside:', iter_outside print 'number of new routes:', newRoutes - + stable = False iter_inside = 1 while not stable: if options.verbose: print 'iter_inside:', iter_inside - stable = doSUEAssign(net, options, startVertices, endVertices, matrixPshort, iter_inside, lohse, first) - # The matrixPlong and the matrixTruck should be added when considering the long-distance trips and the truck trips. + stable = doSUEAssign( + net, options, startVertices, endVertices, matrixPshort, iter_inside, lohse, first) + # The matrixPlong and the matrixTruck should be added when + # considering the long-distance trips and the truck trips. if lohse: - stable = doLohseStopCheck(net, options, stable, iter_inside, options.maxiteration, foutlog) + stable = doLohseStopCheck( + net, options, stable, iter_inside, options.maxiteration, foutlog) iter_inside += 1 - + if options.verbose: print 'stable:', stable - - newRoutes = net.findNewPath(startVertices, endVertices, newRoutes, matrixPshort, options.gamma, lohse, options.dijkstra) - first = False + newRoutes = net.findNewPath( + startVertices, endVertices, newRoutes, matrixPshort, options.gamma, lohse, options.dijkstra) + + first = False iter_outside += 1 - - if newRoutes < 3 and iter_outside > int((options.maxiteration)/2): + + if newRoutes < 3 and iter_outside > int((options.maxiteration) / 2): newRoutes = 0 - + if iter_outside > options.maxiteration: print 'The max. number of iterations is reached!' - foutlog.write('The max. number of iterations is reached!\n') - foutlog.write('The number of new routes and the parameter stable will be set to zero and True respectively.\n') - print 'newRoutes:', newRoutes + foutlog.write( + 'The max. number of iterations is reached!\n') + foutlog.write( + 'The number of new routes and the parameter stable will be set to zero and True respectively.\n') + print 'newRoutes:', newRoutes stable = True newRoutes = 0 - - # update the path choice probability and the path flows as well as generate vehicle data - vehID = doSUEVehAssign(net, vehicles, options, counter, matrixPshort, startVertices, endVertices, AssignedVeh, AssignedTrip, vehID, lohse) - # output the generated vehicular releasing times and routes, based on the current matrix - print 'done with the assignment' # debug + # update the path choice probability and the path flows as well as + # generate vehicle data + vehID = doSUEVehAssign(net, vehicles, options, counter, matrixPshort, + startVertices, endVertices, AssignedVeh, AssignedTrip, vehID, lohse) + + # output the generated vehicular releasing times and routes, based on + # the current matrix + print 'done with the assignment' # debug if options.odestimation: - linkChoicesOutput(net, startVertices, endVertices, matrixPshort, linkChoiceMap, odPairsMap, options.outputdir, starttime) + linkChoicesOutput(net, startVertices, endVertices, matrixPshort, + linkChoiceMap, odPairsMap, options.outputdir, starttime) else: sortedVehOutput(vehicles, departtime, options, foutroute) @@ -317,8 +355,9 @@ # output the global performance indices assigntime = outputStatistics(net, starttime, len(matrices)) - - foutlog.write('- Assignment is completed and all required information is generated. ') + + foutlog.write( + '- Assignment is completed and all required information is generated. ') foutlog.close() if options.verbose: @@ -327,18 +366,18 @@ print 'Total number of the assigned trips:', matrixSum optParser = OptionParser() -optParser.add_option("-m", "--matrix-file", dest="mtxpsfile", +optParser.add_option("-m", "--matrix-file", dest="mtxpsfile", help="read OD matrix for passenger vehicles from FILE (mandatory)", metavar="FILE") -optParser.add_option("-G", "--globalmatrix-file", dest="glbmtxfile", +optParser.add_option("-G", "--globalmatrix-file", dest="glbmtxfile", help="read daily OD matrix for passenger vehicles from FILE (mandatory)", metavar="FILE") -optParser.add_option("-n", "--net-file", dest="netfile", +optParser.add_option("-n", "--net-file", dest="netfile", help="read SUMO network from FILE (mandatory)", metavar="FILE") optParser.add_option("-d", "--district-file", dest="confile", - help="read OD Zones from FILE (mandatory)", metavar="FILE") + help="read OD Zones from FILE (mandatory)", metavar="FILE") optParser.add_option("-s", "--extrasignal-file", dest="sigfile", help="read extra/updated signal timing plans from FILE", metavar="FILE") optParser.add_option("-u", "--crCurve-file", dest="curvefile", - help="read parameters used in cost functions from FILE", metavar="FILE") + help="read parameters used in cost functions from FILE", metavar="FILE") optParser.add_option("-k", "--k-shortest-paths", dest="kPaths", type="int", default=8, help="number of the paths should be found at the first iteration") optParser.add_option("-i", "--max-sue-iteration", dest="maxiteration", type="int", @@ -376,14 +415,15 @@ default="clogit", help="type of assignment [default: %default]") optParser.add_option("-H", "--hours", dest="hours", type="float", default=1., help="the analysing period(hours)") -optParser.add_option("-r", "--profile", action="store_true", dest="profile", +optParser.add_option("-r", "--profile", action="store_true", dest="profile", default=False, help="writing profiling info") optParser.add_option("-+", "--dijkstra", dest="dijkstra", type="choice", choices=('extend', 'plain', 'boost'), default="plain", help="use penalty, plain(original) or boost in dijkstra implementation [default: %default]") optParser.add_option("-x", "--odestimation", action="store_true", dest="odestimation", default=False, help="generate trips for OD estimation") -optParser.add_option("-f", "--scale-factor", dest="demandscale", type="float", default=1., help="scale demand by ") +optParser.add_option("-f", "--scale-factor", dest="demandscale", + type="float", default=1., help="scale demand by ") optParser.add_option("-O", "--output-dir", dest="outputdir", default=os.getcwd(), help="define the output directory name and path") (options, args) = optParser.parse_args() @@ -393,7 +433,8 @@ sys.exit() if options.profile: - import hotshot, hotshot.stats + import hotshot + import hotshot.stats hotshotFile = "hotshot_%s_stats" % options.type prof = hotshot.Profile(hotshotFile) prof.runcall(main) diff -Nru sumo-0.21.0+dfsg/tools/assign/assign.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/assign.py --- sumo-0.21.0+dfsg/tools/assign/assign.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/assign.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,13 +4,13 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-11-25 -@version $Id: assign.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: assign.py 18096 2015-03-17 09:50:59Z behrisch $ This script is for executing traffic assignment according to the required assignment model. The incremental assignment model, the C-Logit assignment model and the Lohse assignment model are included in this script. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -19,11 +19,13 @@ (at your option) any later version. """ -import math, operator +import math +import operator import elements from elements import Vertex, Edge, Path, Vehicle from network import Net + def doIncAssign(net, vehicles, verbose, iteration, odestimation, endVertices, start, startVertex, matrixPshort, smallDemand, D, P, AssignedVeh, AssignedTrip, vehID, assignSmallDemand, linkChoiceMap, odPairsMap): for end, endVertex in enumerate(endVertices): @@ -32,12 +34,13 @@ getlinkChoices = True if startVertex._id != endVertex._id and getlinkChoices: - # if matrixPling and the matrixTruck exist, matrixPlong[start][end] > 0.0 or matrixTruck[start][end] > 0.0): should be added. + # if matrixPling and the matrixTruck exist, matrixPlong[start][end] + # > 0.0 or matrixTruck[start][end] > 0.0): should be added. helpPath = [] vertex = endVertex demand = 0. if matrixPshort[start][end] > 1. or odestimation: - demand = matrixPshort[start][end]/float(iteration) + demand = matrixPshort[start][end] / float(iteration) if assignSmallDemand and not odestimation: demand += smallDemand[start][end] @@ -52,74 +55,87 @@ vertex = P[vertex].source helpPath.reverse() - # the amount of the pathflow, which will be released at this iteration + # the amount of the pathflow, which will be released at this + # iteration if assignSmallDemand: smallDemand[start][end] = 0. if not odestimation: AssignedTrip[startVertex][endVertex] += demand - vehID = assignVeh(verbose, vehicles, startVertex, endVertex, helpPath, AssignedVeh, AssignedTrip, vehID) + vehID = assignVeh( + verbose, vehicles, startVertex, endVertex, helpPath, AssignedVeh, AssignedTrip, vehID) return vehID, smallDemand, linkChoiceMap # execute the SUE model with the given path set -def doSUEAssign(net, options, startVertices, endVertices, matrixPshort, iter, lohse, first): + + +def doSUEAssign(net, options, startVertices, endVertices, matrixPshort, iter, lohse, first): if lohse: if options.verbose: foutassign = file('lohse_pathSet.txt', 'a') - foutassign.write('\niter:%s\n' %iter) + foutassign.write('\niter:%s\n' % iter) # matrixPlong and matrixTruck should be added if available. if options.verbose: print 'pathNum in doSUEAssign:', elements.pathNum - # calculate the overlapping factors between any two paths of a given OD pair - for start, startVertex in enumerate(startVertices): + # calculate the overlapping factors between any two paths of a given OD + # pair + for start, startVertex in enumerate(startVertices): for end, endVertex in enumerate(endVertices): cumulatedflow = 0. - pathcount = 0 + pathcount = 0 if matrixPshort[start][end] > 0. and startVertex._id != endVertex._id: ODPaths = net._paths[startVertex][endVertex] - + for path in ODPaths: path.getPathTimeUpdate() calCommonalityAndChoiceProb(ODPaths, options.alpha, lohse) - - # calculate the path choice probabilities and the path flows for the given OD Pair + + # calculate the path choice probabilities and the path flows + # for the given OD Pair for path in ODPaths: pathcount += 1 if pathcount < len(ODPaths): - path.helpflow = matrixPshort[start][end] * path.choiceprob + path.helpflow = matrixPshort[ + start][end] * path.choiceprob cumulatedflow += path.helpflow if lohse and options.verbose: foutassign.write(' path:%s\n' % path.label) - foutassign.write(' path.choiceprob:%s\n' % path.choiceprob) - foutassign.write(' path.helpflow:%s\n' % path.helpflow) - foutassign.write(' cumulatedflow:%s\n' % cumulatedflow) + foutassign.write( + ' path.choiceprob:%s\n' % path.choiceprob) + foutassign.write( + ' path.helpflow:%s\n' % path.helpflow) + foutassign.write( + ' cumulatedflow:%s\n' % cumulatedflow) else: - path.helpflow = matrixPshort[start][end] - cumulatedflow + path.helpflow = matrixPshort[ + start][end] - cumulatedflow if lohse and options.verbose: - foutassign.write(' last_path.helpflow:%s\n' % path.helpflow) + foutassign.write( + ' last_path.helpflow:%s\n' % path.helpflow) if first and iter == 1: for edge in path.edges: edge.flow += path.helpflow else: for edge in path.edges: edge.helpflow += path.helpflow - + # Reset the convergence index for the C-Logit model notstable = 0 stable = False - # link travel times and link flows will be updated according to the latest traffic assingment + # link travel times and link flows will be updated according to the latest + # traffic assingment for edge in net._edges: if (first and iter > 1) or (not first): exflow = edge.flow - edge.flow = edge.flow + (1./iter)*(edge.helpflow - edge.flow) - + edge.flow = edge.flow + (1. / iter) * (edge.helpflow - edge.flow) + if not lohse: if edge.flow > 0.: - if abs(edge.flow-exflow)/edge.flow > options.sueTolerance: + if abs(edge.flow - exflow) / edge.flow > options.sueTolerance: notstable += 1 elif edge.flow == 0.: - if exflow != 0. and (abs(edge.flow-exflow)/exflow > options.sueTolerance): + if exflow != 0. and (abs(edge.flow - exflow) / exflow > options.sueTolerance): notstable += 1 elif edge.flow < 0.: notstable += 1 @@ -136,32 +152,36 @@ notstable += 1 if lohse and options.verbose: foutassign.close() - + if not lohse and iter > 5: if notstable == 0: - stable = True - elif notstable < math.ceil(net.geteffEdgeCounts()*0.005) or notstable < 3: stable = True - + elif notstable < math.ceil(net.geteffEdgeCounts() * 0.005) or notstable < 3: + stable = True + if iter > options.maxiteration: stable = True print 'Number of max. iterations is reached!' print 'stable:', stable - + return stable # calculate the commonality factors in the C-Logit model + + def calCommonalityAndChoiceProb(ODPaths, alpha, lohse): if len(ODPaths) > 1: for path in ODPaths: if not lohse: - path.utility = path.actpathtime + alpha * math.log(path.sumOverlap) + path.utility = path.actpathtime + \ + alpha * math.log(path.sumOverlap) else: - path.utility = path.pathhelpacttime + alpha * math.log(path.sumOverlap) - + path.utility = path.pathhelpacttime + \ + alpha * math.log(path.sumOverlap) + if lohse: minpath = min(ODPaths, key=operator.attrgetter('pathhelpacttime')) - beta = 12./(1.+ math.exp(0.7 - 0.015 * minpath.pathhelpacttime)) + beta = 12. / (1. + math.exp(0.7 - 0.015 * minpath.pathhelpacttime)) else: theta = getThetaForCLogit(ODPaths) @@ -170,17 +190,24 @@ for pathtwo in ODPaths: if pathone != pathtwo: if not lohse: - sum_exputility += math.exp(theta*(pathone.utility - pathtwo.utility)) + sum_exputility += math.exp(theta * + (pathone.utility - pathtwo.utility)) else: - pathtwoPart = beta*(pathtwo.utility/minpath.utility -1.) - pathonePart = beta*(pathone.utility/minpath.utility -1.) - sum_exputility += math.exp(-(pathtwoPart*pathtwoPart)+ pathonePart*pathonePart) - pathone.choiceprob = 1./(1. + sum_exputility) + pathtwoPart = beta * \ + (pathtwo.utility / minpath.utility - 1.) + pathonePart = beta * \ + (pathone.utility / minpath.utility - 1.) + sum_exputility += math.exp(-(pathtwoPart * + pathtwoPart) + pathonePart * pathonePart) + pathone.choiceprob = 1. / (1. + sum_exputility) else: for path in ODPaths: path.choiceprob = 1. - -# calculate the path choice probabilities and the path flows and generate the vehicular data for each OD Pair + +# calculate the path choice probabilities and the path flows and generate +# the vehicular data for each OD Pair + + def doSUEVehAssign(net, vehicles, options, counter, matrixPshort, startVertices, endVertices, AssignedVeh, AssignedTrip, vehID, lohse): if options.verbose: if counter == 0: @@ -190,119 +217,132 @@ foutpath = file('paths.txt', 'a') fouterror = file('errors.txt', 'a') if lohse: - foutpath.write('begin the doSUEVehAssign based on the lohse assignment model!') + foutpath.write( + 'begin the doSUEVehAssign based on the lohse assignment model!') else: - foutpath.write('begin the doSUEVehAssign based on the c-logit model!') - foutpath.write('the analyzed matrix=%s' %counter) - + foutpath.write( + 'begin the doSUEVehAssign based on the c-logit model!') + foutpath.write('the analyzed matrix=%s' % counter) + TotalPath = 0 for start, startVertex in enumerate(startVertices): if options.verbose: - foutpath.write('\norigin=%s, ' %startVertex) + foutpath.write('\norigin=%s, ' % startVertex) for end, endVertex in enumerate(endVertices): pathcount = 0 cumulatedflow = 0. if matrixPshort[start][end] > 0. and startVertex._id != endVertex._id: if options.verbose: - foutpath.write('destination=%s' %endVertex) + foutpath.write('destination=%s' % endVertex) ODPaths = net._paths[startVertex][endVertex] - + for path in ODPaths: TotalPath += 1 path.getPathTimeUpdate() - if lohse: + if lohse: path.pathhelpacttime = path.actpathtime - + calCommonalityAndChoiceProb(ODPaths, options.alpha, lohse) - + for path in ODPaths: pathcount += 1 if pathcount < len(ODPaths): - path.pathflow = matrixPshort[start][end] * path.choiceprob + path.pathflow = matrixPshort[ + start][end] * path.choiceprob cumulatedflow += path.pathflow else: - path.pathflow = matrixPshort[start][end] - cumulatedflow + path.pathflow = matrixPshort[ + start][end] - cumulatedflow if options.verbose and path.pathflow < 0.: - fouterror.write('*********************** the path flow on the path:%s < 0.!!' %path.label) + fouterror.write( + '*********************** the path flow on the path:%s < 0.!!' % path.label) if options.verbose: - foutpath.write('\npathID= %s, path flow=%4.4f, actpathtime=%4.4f, choiceprob=%4.4f, edges=' - %(path.label, path.pathflow, path.actpathtime, path.choiceprob)) + foutpath.write('\npathID= %s, path flow=%4.4f, actpathtime=%4.4f, choiceprob=%4.4f, edges=' + % (path.label, path.pathflow, path.actpathtime, path.choiceprob)) for item in path.edges: - foutpath.write('%s, ' %(item._id)) - + foutpath.write('%s, ' % (item._id)) + AssignedTrip[startVertex][endVertex] += path.pathflow edges = [] for link in path.edges: edges.append(link) - vehID = assignVeh(options.verbose, vehicles, startVertex, endVertex, edges, AssignedVeh, AssignedTrip, vehID) + vehID = assignVeh( + options.verbose, vehicles, startVertex, endVertex, edges, AssignedVeh, AssignedTrip, vehID) if options.verbose: foutpath.write('\n') if options.verbose: - print 'total Number of the used paths for the current matrix:', TotalPath - foutpath.write('\ntotal Number of the used paths for the current matrix:%s' %TotalPath) + print 'total Number of the used paths for the current matrix:', TotalPath + foutpath.write( + '\ntotal Number of the used paths for the current matrix:%s' % TotalPath) foutpath.close() fouterror.close() return vehID - + def assignVeh(verbose, vehicles, startVertex, endVertex, edges, AssignedVeh, AssignedTrip, vehID): while AssignedVeh[startVertex][endVertex] < int(round(AssignedTrip[startVertex][endVertex])): vehID += 1 newVehicle = Vehicle(str(vehID)) newVehicle.route = edges vehicles.append(newVehicle) - + AssignedVeh[startVertex][endVertex] += 1 if verbose: print 'vehID:', vehID print 'AssignedTrip[start][end]', AssignedTrip[startVertex][endVertex] print 'AssignedVeh[start][end]', AssignedVeh[startVertex][endVertex] - + return vehID + def getThetaForCLogit(ODPaths): sum = 0. diff = 0. minpath = min(ODPaths, key=operator.attrgetter('actpathtime')) - + for path in ODPaths: sum += path.actpathtime - + meanpathtime = sum / float(len(ODPaths)) - + for path in ODPaths: diff += (path.actpathtime - meanpathtime)**2. - sdpathtime = (diff/float(len(ODPaths)))**0.5 + sdpathtime = (diff / float(len(ODPaths)))**0.5 if sdpathtime > 0.04: - theta = math.pi / (pow(6.,0.5) * sdpathtime * minpath.actpathtime) + theta = math.pi / (pow(6., 0.5) * sdpathtime * minpath.actpathtime) else: theta = 1. return theta - + + def doLohseStopCheck(net, options, stable, iter, maxIter, foutlog): stable = False - if iter > 1 : # Check if the convergence reaches. - counts = 0 + # Check if the convergence reaches. + if iter > 1: + counts = 0 for edge in net._edges.itervalues(): stop = edge.stopCheck(options) - if stop: + if stop: counts += 1 if counts == net.geteffEdgeCounts(): stable = True - foutlog.write('The defined convergence is reached. The number of the required iterations:%s\n' %iter) - elif counts < int(net.geteffEdgeCounts()*0.05) and float(iter) > options.maxiteration*0.85: + foutlog.write( + 'The defined convergence is reached. The number of the required iterations:%s\n' % iter) + elif counts < int(net.geteffEdgeCounts() * 0.05) and float(iter) > options.maxiteration * 0.85: stable = True - foutlog.write('The number of the links with convergence is 95% of the total links. The number of executed iterations:%s\n' %iter) + foutlog.write( + 'The number of the links with convergence is 95% of the total links. The number of executed iterations:%s\n' % iter) if iter >= maxIter: print 'The max. number of iterations is reached!' - foutlog.write('The max. number(%s) of iterations is reached!\n' %iter) - foutlog.write('The number of new routes will be set to 0, since the max. number of iterations is reached.') + foutlog.write('The max. number(%s) of iterations is reached!\n' % iter) + foutlog.write( + 'The number of new routes will be set to 0, since the max. number of iterations is reached.') stable = True print 'stop?:', stable print 'iter_inside:', iter - return stable \ No newline at end of file + return stable diff -Nru sumo-0.21.0+dfsg/tools/assign/cadytsIterate.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/cadytsIterate.py --- sumo-0.21.0+dfsg/tools/assign/cadytsIterate.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/cadytsIterate.py 2015-04-17 05:44:20.000000000 +0000 @@ -7,13 +7,13 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2010-09-15 -@version $Id: cadytsIterate.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: cadytsIterate.py 18096 2015-03-17 09:50:59Z behrisch $ Run cadyts to calibrate the simulation with given routes and traffic measurements. Respective traffic zones information has to exist in the given route files. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -21,11 +21,17 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import os, sys, subprocess, types +import os +import sys +import subprocess +import types from datetime import datetime from optparse import OptionParser from duaIterate import call, writeSUMOConf, addGenericOptions +sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) +import sumolib + def initOptions(): optParser = OptionParser() @@ -36,27 +42,29 @@ optParser.add_option("-d", "--detector-values", dest="detvals", help="adapt to the flow on the given edges", metavar="FILE") optParser.add_option("-c", "--classpath", dest="classpath", - default=os.path.join(os.path.dirname(sys.argv[0]), "..", "contributed", "calibration", "cadytsSumoController.jar"), + default=os.path.join(os.path.dirname( + sys.argv[0]), "..", "contributed", "calibration", "cadytsSumoController.jar"), help="classpath for the calibrator [default: %default]") optParser.add_option("-l", "--last-calibration-step", dest="calibStep", type="int", default=100, help="last step of the calibration [default: %default]") - optParser.add_option("-S", "--demandscale", dest="demandscale", type="float", default=2., help="scaled demand [default: %default]") + optParser.add_option("-S", "--demandscale", dest="demandscale", + type="float", default=2., help="scaled demand [default: %default]") optParser.add_option("-F", "--freezeit", dest="freezeit", type="int", default=85, help="define the number of iterations for stablizing the results in the DTA-calibration") optParser.add_option("-V", "--varscale", dest="varscale", type="float", default=1., help="define variance of the measured traffic flows for the DTA-calibration") optParser.add_option("-P", "--PREPITS", type="int", dest="PREPITS", - default = 5, help="number of preparatory iterations") - optParser.add_option("-W", "--evaluation-prefix", dest="evalprefix",type='string', + default=5, help="number of preparatory iterations") + optParser.add_option("-W", "--evaluation-prefix", dest="evalprefix", type='string', help="prefix of flow evaluation files; only for the calibration with use of detector data") optParser.add_option("-Y", "--bruteforce", action="store_true", dest="bruteforce", - default = False, help="fit the traffic counts as accurate as possible") + default=False, help="fit the traffic counts as accurate as possible") optParser.add_option("-Z", "--mincountstddev", type="float", dest="mincountstddev", - default = 25., help="minimal traffic count standard deviation") + default=25., help="minimal traffic count standard deviation") optParser.add_option("-O", "--overridett", action="store_true", dest="overridett", - default= False, help="override depart times according to updated link travel times") - optParser.add_option("-E", "--disable-summary", "--disable-emissions", action="store_true", dest="noSummary", - default=False, help="No summaries are written by the simulation") + default=False, help="override depart times according to updated link travel times") + 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", "--matrix-prefix", dest="fmaprefix", type='string', @@ -69,19 +77,21 @@ default=True, help="if exiting vehicles are assumed to cross the upstream sensor of their exit link") return optParser + def main(): optParser = initOptions() (options, args) = optParser.parse_args() if not options.net or not options.routes or not options.detvals: - optParser.error("--net-file, --routes and --detector-values have to be given!") + optParser.error( + "--net-file, --routes and --detector-values have to be given!") if options.mesosim: - sumoBinary = os.environ.get("SUMO_BINARY", os.path.join(options.path, "meso")) - print 'mesosim in action!' + sumoBinary = sumolib.checkBinary("meso", options.path) else: - sumoBinary = os.environ.get("SUMO_BINARY", os.path.join(options.path, "sumo")) - calibrator = ["java", "-cp", options.classpath, "cadyts.interfaces.sumo.SumoController"] + sumoBinary = sumolib.checkBinary("sumo", options.path) + calibrator = ["java", "-cp", options.classpath, + "cadyts.interfaces.sumo.SumoController"] log = open("cadySumo-log.txt", "w+") # calibration init @@ -93,15 +103,15 @@ # begin the calibration if options.fmaprefix: call(calibrator + ["INIT", "-varscale", options.varscale, "-freezeit", options.freezeit, - "-measfile", options.detvals, "-binsize", options.aggregation, "-PREPITS", options.PREPITS, - "-bruteforce", options.bruteforce, "-demandscale", options.demandscale, - "-mincountstddev", options.mincountstddev, "-overridett", options.overridett,"-clonepostfix", options.clonepostfix, - "-fmaprefix", options.fmaprefix, "-cntfirstlink", options.cntfirstlink, "-cntlastlink",options.cntlastlink], log) + "-measfile", options.detvals, "-binsize", options.aggregation, "-PREPITS", options.PREPITS, + "-bruteforce", options.bruteforce, "-demandscale", options.demandscale, + "-mincountstddev", options.mincountstddev, "-overridett", options.overridett, "-clonepostfix", options.clonepostfix, + "-fmaprefix", options.fmaprefix, "-cntfirstlink", options.cntfirstlink, "-cntlastlink", options.cntlastlink], log) else: call(calibrator + ["INIT", "-varscale", options.varscale, "-freezeit", options.freezeit, - "-measfile", options.detvals, "-binsize", options.aggregation, "-PREPITS", options.PREPITS, - "-bruteforce", options.bruteforce, "-mincountstddev", options.mincountstddev,"-overridett", options.overridett, - "-clonepostfix", options.clonepostfix,"-cntfirstlink", options.cntfirstlink, "-cntlastlink",options.cntlastlink], log) + "-measfile", options.detvals, "-binsize", options.aggregation, "-PREPITS", options.PREPITS, + "-bruteforce", options.bruteforce, "-mincountstddev", options.mincountstddev, "-overridett", options.overridett, + "-clonepostfix", options.clonepostfix, "-cntfirstlink", options.cntfirstlink, "-cntlastlink", options.cntlastlink], log) for step in range(options.calibStep): print 'calibration step:', step @@ -115,29 +125,33 @@ else: output = "%s_%03i.cal.xml" % (routname[:routname.find('.')], step) - call(calibrator + ["CHOICE", "-choicesetfile", options.routes, "-choicefile", "%s" % output], log) + call(calibrator + ["CHOICE", "-choicesetfile", + options.routes, "-choicefile", "%s" % output], log) files.append(output) - + # simulation print ">> Running simulation" btime = datetime.now() print ">>> Begin time: %s" % btime writeSUMOConf(sumoBinary, step, options, [], ",".join(files)) - retCode = call([sumoBinary, "-c", "iteration_%03i.sumocfg" % step], log) + retCode = call( + [sumoBinary, "-c", "iteration_%03i.sumocfg" % step], log) etime = datetime.now() print ">>> End time: %s" % etime - print ">>> Duration: %s" % (etime-btime) + print ">>> Duration: %s" % (etime - btime) print "<<" - + # calibration update if evalprefix: - call(calibrator + ["UPDATE", "-netfile", "dump_%03i_%s.xml" % (step, options.aggregation), "-flowfile", "%s_%03i.txt" % (evalprefix, step)], log) + call(calibrator + ["UPDATE", "-netfile", "dump_%03i_%s.xml" % ( + step, options.aggregation), "-flowfile", "%s_%03i.txt" % (evalprefix, step)], log) else: - call(calibrator + ["UPDATE", "-netfile", "dump_%03i_%s.xml" % (step, options.aggregation)], log) + call(calibrator + ["UPDATE", "-netfile", + "dump_%03i_%s.xml" % (step, options.aggregation)], log) print "< Step %s ended (duration: %s)" % (step, datetime.now() - btime) print "------------------\n" log.flush() - + print "calibration ended (duration: %s)" % (datetime.now() - starttime) log.close() diff -Nru sumo-0.21.0+dfsg/tools/assign/costFunctionChecker.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/costFunctionChecker.py --- sumo-0.21.0+dfsg/tools/assign/costFunctionChecker.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/costFunctionChecker.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ @author Daniel Krajzewicz @author Jakob Erdmann @date 2009-08-31 -@version $Id: costFunctionChecker.py 15692 2014-02-22 09:17:02Z behrisch $ +@version $Id: costFunctionChecker.py 18096 2015-03-17 09:50:59Z behrisch $ Run duarouter repeatedly and simulate weight changes via a cost function. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -18,35 +18,44 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import os, sys, subprocess, types +import os +import sys +import subprocess +import types from datetime import datetime from optparse import OptionParser from xml.sax import make_parser, handler +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +import sumolib + def call(command, log): if not isinstance(args, types.StringTypes): - command = [str(c) for c in command] + command = [str(c) for c in command] print >> log, "-" * 79 print >> log, command log.flush() retCode = subprocess.call(command, stdout=log, stderr=log) if retCode != 0: - print >> sys.stderr, "Execution of %s failed. Look into %s for details." % (command, log.name) - sys.exit(retCode) + print >> sys.stderr, "Execution of %s failed. Look into %s for details." % ( + command, log.name) + sys.exit(retCode) + def writeRouteConf(step, options, file, output): fd = open("iteration_" + str(step) + ".duarcfg", "w") print >> fd, """ """ % options.net - if step==0: + if step == 0: if options.flows: print >> fd, ' ' % file else: print >> fd, ' ' % file else: print >> fd, ' ' % file - print >> fd, ' ' % (step-1, options.aggregation) + print >> fd, ' ' % ( + step - 1, options.aggregation) print >> fd, """ @@ -70,6 +79,7 @@ """ % (options.verbose, options.noWarnings) fd.close() + class RouteReader(handler.ContentHandler): def __init__(self): @@ -92,6 +102,7 @@ def getMaxDepart(self): return self._maxDepart + class NetReader(handler.ContentHandler): def __init__(self): @@ -105,18 +116,22 @@ def getEdges(self): return self._edges + def identity(edge, weight): return weight + def generateWeights(step, options, edges, weights, costFunction): fd = open("dump_%s_%s.xml" % (step, options.aggregation), "w") print >> fd, '\n' - for time in range(0, int(reader.getMaxDepart()+1), options.aggregation): - print >> fd, ' ' % (time, time + options.aggregation, options.aggregation) + for time in range(0, int(reader.getMaxDepart() + 1), options.aggregation): + print >> fd, ' ' % ( + time, time + options.aggregation, options.aggregation) for edge in edges: cost = costFunction(edge, weights.getWeight(edge)) if cost != None: - print >> fd, ' ' % (edge, cost) + print >> fd, ' ' % ( + edge, cost) print >> fd, ' ' print >> fd, '' fd.close() @@ -155,8 +170,7 @@ type="int", default=0, help="First DUA step [default: %default]") optParser.add_option("-l", "--last-step", dest="lastStep", type="int", default=50, help="Last DUA step [default: %default]") -optParser.add_option("-p", "--path", dest="path", - default=os.environ.get("SUMO_BINDIR", ""), help="Path to binaries [default: %default]") +optParser.add_option("-p", "--path", dest="path", help="Path to binaries") optParser.add_option("-y", "--absrand", dest="absrand", action="store_true", default=False, help="use current time to generate random number") @@ -164,10 +178,11 @@ default="identity", help="(python) function to use as cost function") (options, args) = optParser.parse_args() if not options.net or not (options.trips or options.flows): - optParser.error("At least --net-file and --trips or --flows have to be given!") + optParser.error( + "At least --net-file and --trips or --flows have to be given!") -duaBinary = os.environ.get("DUAROUTER_BINARY", os.path.join(options.path, "duarouter")) +duaBinary = sumolib.checkBinary("duarouter", options.path) log = open("dua-log.txt", "w+") parser = make_parser() @@ -179,7 +194,7 @@ if "." in options.costfunc: idx = options.costfunc.rfind(".") module = options.costfunc[:idx] - func = options.costfunc[idx+1:] + func = options.costfunc[idx + 1:] exec("from %s import %s as costFunction" % (module, func)) else: exec("costFunction = %s" % options.costfunc) @@ -198,8 +213,9 @@ for tripFile in tripFiles: file = tripFile tripFile = os.path.basename(tripFile) - if step>0: - file = tripFile[:tripFile.find(".")] + "_%s.rou.alt.xml" % (step-1) + if step > 0: + file = tripFile[ + :tripFile.find(".")] + "_%s.rou.alt.xml" % (step - 1) output = tripFile[:tripFile.find(".")] + "_%s.rou.xml" % step print ">> Running router with " + file btime = datetime.now() @@ -208,7 +224,7 @@ retCode = call([duaBinary, "-c", "iteration_%s.duarcfg" % step], log) etime = datetime.now() print ">>> End time: %s" % etime - print ">>> Duration: %s" % (etime-btime) + print ">>> Duration: %s" % (etime - btime) print "<<" files.append(output) # generating weights file diff -Nru sumo-0.21.0+dfsg/tools/assign/costMemory.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/costMemory.py --- sumo-0.21.0+dfsg/tools/assign/costMemory.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/costMemory.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Jakob Erdmann @author Michael Behrisch @date 2012-03-14 -@version $Id: costMemory.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: costMemory.py 18096 2015-03-17 09:50:59Z behrisch $ Perform smoothing of edge costs across successive iterations of duaIterate -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -18,7 +18,8 @@ (at your option) any later version. """ from __future__ import print_function -import os,sys +import os +import sys from collections import defaultdict from xml.sax import saxutils, make_parser, handler @@ -27,6 +28,7 @@ class EdgeMemory: + def __init__(self, cost): self.cost = cost self.seen = True @@ -34,11 +36,13 @@ def update(self, cost, memory_weight, new_weight, pessimism): p = (cost / self.cost) ** pessimism if self.cost > 0 else 1 memory_factor = memory_weight / (memory_weight + new_weight * p) - self.cost = self.cost * memory_factor + cost * (1 - memory_factor) + self.cost = self.cost * memory_factor + cost * (1 - memory_factor) self.seen = True + class CostMemory(handler.ContentHandler): # memorize the weighted average of edge costs + def __init__(self, cost_attribute, pessimism=0, network_file=None): # the cost attribute to parse (i.e. 'traveltime') self.cost_attribute = cost_attribute.decode('utf8') @@ -47,53 +51,59 @@ # 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 -> (edge_id -> EdgeMemory) - self.intervals = defaultdict(dict) - # the intervall length (only known for certain if multiple intervals have been seen) - self.interval_length = 214748 # SUMOTIME_MAXSTRING + self.intervals = defaultdict(dict) + # the intervall length (only known for certain if multiple intervals + # have been seen) + self.interval_length = 214748 # SUMOTIME_MAXSTRING # the intervall currently being parsed self.current_interval = None # the combined weigth of all previously loaded costs self.memory_weight = 0.0 - # update is done according to: memory * memory_factor + new * (1 - memory_factor) + # 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 + # differences between the previously loaded costs and the memorized + # costs self.errors = None # some statistics self.num_loaded = 0 self.num_decayed = 0 # travel times without obstructing traffic - self.traveltime_free = defaultdict(lambda:0) # XXX could use the minimum known traveltime + # XXX could use the minimum known traveltime + self.traveltime_free = defaultdict(lambda: 0) if network_file is not None: - # build a map of default weights for decaying edges assuming the attribute is traveltime - self.traveltime_free = dict([(e.getID(), e.getLength() / e.getSpeed()) - for e in readNet(network_file).getEdges()]) + # build a map of default weights for decaying edges assuming the + # attribute is traveltime + self.traveltime_free = dict([(e.getID(), e.getLength() / e.getSpeed()) + for e in readNet(network_file).getEdges()]) self.pessimism = pessimism - def startElement(self, name, attrs): if name == 'interval': self.current_interval = self.intervals[float(attrs['begin'])] if name == 'edge': id = attrs['id'] - if attrs.has_key(self.cost_attribute): # may be missing for some + 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_weight, self.new_weight, self.pessimism) - #if id == "4.3to4.4": + edgeMemory.update( + cost, self.memory_weight, self.new_weight, self.pessimism) + # if id == "4.3to4.4": # with open('debuglog', 'a') as f: # print(self.memory_factor, edgeMemory.cost, file=f) 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 + # 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) + 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: @@ -116,25 +126,28 @@ for edges in self.intervals.itervalues(): for id, edgeMemory in edges.iteritems(): if not edgeMemory.seen: - edgeMemory.update(self.traveltime_free[id], self.memory_weight, self.new_weight, self.pessimism) + edgeMemory.update( + self.traveltime_free[id], self.memory_weight, self.new_weight, self.pessimism) self.num_decayed += 1 - #if id == "4.3to4.4": + # if id == "4.3to4.4": # with open('debuglog', 'a') as f: # print(self.memory_factor, 'decay', edgeMemory.cost, file=f) # figure out the interval length if len(self.intervals.keys()) > 1: sorted_begin_times = sorted(self.intervals.keys()) - self.interval_length = sorted_begin_times[1] - sorted_begin_times[0] + self.interval_length = sorted_begin_times[ + 1] - sorted_begin_times[0] self.memory_weight += self.new_weight - def write_costs(self, weight_file): with open(weight_file, 'w') as f: f.write('\n') for start, edge_costs in self.intervals.iteritems(): - f.write(' \n' % (start, start + self.interval_length)) + f.write(' \n' % + (start, start + self.interval_length)) for id, edgeMemory in edge_costs.iteritems(): - f.write(' \n' % (id, self.cost_attribute, edgeMemory.cost)) + f.write(' \n' % + (id, self.cost_attribute, edgeMemory.cost)) f.write(' \n') f.write('\n') @@ -147,21 +160,20 @@ return 0 def avg_abs_error(self): - return self.avg_error(map(abs,self.errors)) + 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] + return values[len(values) / 2] def mean_abs_error(self): - return self.mean_error(map(abs,self.errors)) + 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.21.0+dfsg/tools/assign/dijkstra.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/dijkstra.py --- sumo-0.21.0+dfsg/tools/assign/dijkstra.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/dijkstra.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,7 +5,7 @@ @author Michael Behrisch @author Jakob Erdmann @date 2007-10-25 -@version $Id: dijkstra.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: dijkstra.py 18096 2015-03-17 09:50:59Z behrisch $ This script is based on the script from David Eppstein, UC Irvine. This script is to find the shortest path from the given origin 'start' to the other nodes in the investigated network. @@ -13,8 +13,8 @@ the link information about the shortest paths and the corresponding travel times will be stored in the lists P and D respectively. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -23,7 +23,8 @@ (at your option) any later version. """ -import os,sys +import os +import sys from Queue import PriorityQueue from collections import defaultdict from xml.sax import make_parser, handler @@ -32,6 +33,7 @@ class priorityDictionary(dict): + def __init__(self): '''Initialize priorityDictionary by creating binary heap of pairs (value,key). Note that changing or removing a dict entry will @@ -49,9 +51,9 @@ lastItem = heap.pop() insertionPoint = 0 while 1: - smallChild = 2*insertionPoint+1 - if smallChild+1 < len(heap) and \ - heap[smallChild][0] > heap[smallChild+1][0]: + smallChild = 2 * insertionPoint + 1 + if smallChild + 1 < len(heap) and \ + heap[smallChild][0] > heap[smallChild + 1][0]: smallChild += 1 if smallChild >= len(heap) or lastItem <= heap[smallChild]: heap[insertionPoint] = lastItem @@ -69,25 +71,25 @@ del self[x] return iterfn() - def __setitem__(self,key,val): + def __setitem__(self, key, val): '''Change value stored in dictionary and add corresponding pair to heap. Rebuilds the heap if the number of deleted items grows too large, to avoid memory leakage.''' - dict.__setitem__(self,key,val) + dict.__setitem__(self, key, val) heap = self.__heap if len(heap) > 2 * len(self): - self.__heap = [(v,k) for k,v in self.iteritems()] + self.__heap = [(v, k) for k, v in self.iteritems()] self.__heap.sort() # builtin sort likely faster than O(n) heapify else: - newPair = (val,key) + newPair = (val, key) insertionPoint = len(heap) heap.append(None) - while insertionPoint > 0 and val < heap[(insertionPoint-1)//2][0]: - heap[insertionPoint] = heap[(insertionPoint-1)//2] - insertionPoint = (insertionPoint-1)//2 + while insertionPoint > 0 and val < heap[(insertionPoint - 1) // 2][0]: + heap[insertionPoint] = heap[(insertionPoint - 1) // 2] + insertionPoint = (insertionPoint - 1) // 2 heap[insertionPoint] = newPair - def setdefault(self,key,val): + def setdefault(self, key, val): '''Reimplement setdefault to call our customized __setitem__.''' if key not in self: self[key] = val @@ -152,10 +154,12 @@ def dijkstraBoost(boostGraph, start): from boost.graph import dijkstra_shortest_paths dijkstra_shortest_paths(boostGraph, start, - distance_map = boostGraph.vertex_properties['distance'], - predecessor_map = boostGraph.vertex_properties['predecessor'], - weight_map = boostGraph.edge_properties['weight']) - + distance_map=boostGraph.vertex_properties[ + 'distance'], + predecessor_map=boostGraph.vertex_properties[ + 'predecessor'], + weight_map=boostGraph.edge_properties['weight']) + # dictionary of final distances D = {} # dictionary of predecessors @@ -170,10 +174,12 @@ class DijkstraRouter(handler.ContentHandler): + """standalone class for routing on a sumolib network. The edges from the network recieve new attribute 'cost' based on a loaded meanData output """ + def __init__(self, netfile, weightfile=None): self.net = readNet(netfile) self.cost_attribute = 'traveltime' @@ -195,12 +201,14 @@ if name == 'interval': self.intervals += 1 if self.intervals > 1: - print("ignoring weights from interval [%s,%s]" % (attrs['begin'], attrs['end'])) + print("ignoring weights from interval [%s,%s]" % ( + attrs['begin'], attrs['end'])) if name == 'edge': if self.intervals > 1: return - if attrs.has_key(self.cost_attribute): # may be missing for some - self.net.getEdge(attrs['id']).cost = float(attrs[self.cost_attribute]) + if attrs.has_key(self.cost_attribute): # may be missing for some + self.net.getEdge(attrs['id']).cost = float( + attrs[self.cost_attribute]) def _route(self, start, dest, costFactors): if self.weightfile is None: @@ -216,7 +224,7 @@ D[edge] = Q[edge] #print("final const to %s: %s" % (edge.getID(), D[edge])) if edge == dest: - #print [(e.getID(), c) for e,c in Q.items()] + # print [(e.getID(), c) for e,c in Q.items()] return (D, P) cost = Q[edge] + edge.cost * costFactors[edge.getID()] for succ in edge.getOutgoing(): @@ -239,12 +247,12 @@ result.append(id) return result - def least_cost(self, start, dest, costFactors=defaultdict(lambda:1.0)): + def least_cost(self, start, dest, costFactors=defaultdict(lambda: 1.0)): """return the cost of the shortest path from start to destination edge""" start, dest = self._getEdge(start, dest) D, P = self._route(start, dest, costFactors) if dest in D: return D[dest] else: - raise("No path between %s and %s found" % (start.getID(), dest.getID())) - + raise("No path between %s and %s found" % + (start.getID(), dest.getID())) diff -Nru sumo-0.21.0+dfsg/tools/assign/duaIterate_analysis.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/duaIterate_analysis.py --- sumo-0.21.0+dfsg/tools/assign/duaIterate_analysis.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/duaIterate_analysis.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ @author Jakob Erdmann @author Michael Behrisch @date 2012-09-06 -@version $Id: duaIterate_analysis.py 16571 2014-06-10 12:34:58Z namdre $ +@version $Id: duaIterate_analysis.py 18096 2015-03-17 09:50:59Z behrisch $ Extract statistics from the outputs of a duaIterate run for plotting. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2012-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2012-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -18,7 +18,8 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import os,sys +import os +import sys import re import glob from optparse import OptionParser @@ -27,61 +28,64 @@ from sumolib.miscutils import Statistics, uMax from sumolib.output import parse_fast + 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("--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") + 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") + 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") + help="only parse the first INT number of iterations") optParser.add_option("--teleports", default="teleplot", - help="output prefix for plotting teleport-prone edges") - optParser.add_option("--mpl", help="output prefix for matplotlib plots or SHOW for plotting to the display") + help="output prefix for plotting teleport-prone edges") + optParser.add_option( + "--mpl", help="output prefix for matplotlib plots or SHOW for plotting to the display") 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 = ['#Inserted', 'Running', 'Waiting', 'Teleports', 'Loaded'] - step_values = [] # list of lists - step_counts = [] # list of edge teleport counters + step_values = [] # list of lists + step_counts = [] # list of edge teleport counters reInserted = re.compile("Inserted: (\d*)") reLoaded = re.compile("Loaded: (\d*)") reRunning = re.compile("Running: (\d*)") reWaiting = re.compile("Waiting: (\d*)") - reFrom = re.compile("from '([^']*)'") # mesosim + reFrom = re.compile("from '([^']*)'") # mesosim teleports = 0 inserted = None loaded = None running = None waiting = None haveMicrosim = None - counts = defaultdict(lambda:0) + counts = defaultdict(lambda: 0) for line in open(dualog): try: if "Warning: Teleporting vehicle" in line: if haveMicrosim is None: if "lane='" in line: haveMicrosim = True - reFrom = re.compile("lane='([^']*)'") + reFrom = re.compile("lane='([^']*)'") else: haveMicrosim = False teleports += 1 edge = reFrom.search(line).group(1) - if ':' in edge: # mesosim output + if ':' in edge: # mesosim output edge = edge.split(':')[0] counts[edge] += 1 elif "Inserted:" in line: inserted = reInserted.search(line).group(1) - if "Loaded:" in line: # optional output + if "Loaded:" in line: # optional output loaded = reLoaded.search(line).group(1) else: loaded = inserted @@ -93,10 +97,11 @@ break waiting = reWaiting.search(line).group(1) teleStats.add(teleports, iteration) - step_values.append([inserted, running, waiting, teleports, loaded]) + step_values.append( + [inserted, running, waiting, teleports, loaded]) teleports = 0 step_counts.append(counts) - counts = defaultdict(lambda:0) + counts = defaultdict(lambda: 0) except: sys.exit("error when parsing line '%s'" % line) @@ -104,11 +109,13 @@ 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 @@ -135,45 +142,45 @@ def gnuplot_teleport_edges(plotfile, step_counts, xlabel): datafile = plotfile + '.data' # an edge is interesting if a large proportion of teleports happen on it - interestingness = defaultdict(lambda:0) + 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:] + interestingness[edge] += count / teleports + interesting = sorted([(c, e) for e, c in interestingness.iteritems()])[-7:] print "most interesting edges:", interesting if len(interesting) > 0: - 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" % xlabel) - lines = ["'%s' using 0:%s title '%s' with lines" % (datafile, ii+1, edge) - for ii, edge in enumerate(interesting)] - f.write(', \\\n'.join(lines)) + 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" % xlabel) + 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 parse_trip_durations(): result = [] for file in sorted(glob.glob("tripinfo_*.xml")): - result.append([float(t.duration) for t in parse_fast(file, 'tripinfo', ['duration'])]) + result.append([float(t.duration) + for t in parse_fast(file, 'tripinfo', ['duration'])]) return result + def matplot(output): if output is not None: import matplotlib if output != 'SHOW': matplotlib.use('Agg') import matplotlib.pyplot as plt - - plt.ylim(0, 1) - plt.xticks([1,2], ["Iteration", "Trip durations"]) plt.boxplot(parse_trip_durations()) if output == 'SHOW': plt.show() @@ -186,7 +193,7 @@ datafile = plotfile + '.data' with open(datafile, 'w') as f: for values in step_values: - f.write(' '.join(map(str,values)) + '\n') + f.write(' '.join(map(str, values)) + '\n') with open(plotfile, 'w') as f: f.write(""" @@ -199,12 +206,14 @@ '%s' using 0:2 title 'running' with lines """ % ((xlabel,) + (datafile,) * 5)) + def main(): options = parse_args() step_values, step_counts = parse_dualog(options.dualog, options.limit) if options.stdout is not None: parse_stdout(step_values, options.stdout) - duaPath = os.path.dirname(os.path.abspath(options.dualog))[-options.label_size:] + duaPath = os.path.dirname( + os.path.abspath(options.dualog))[-options.label_size:] xlabel = 'Iterations in ' + duaPath gnuplot_vehicle_summary(options.output, xlabel, step_values) diff -Nru sumo-0.21.0+dfsg/tools/assign/duaIterate.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/duaIterate.py --- sumo-0.21.0+dfsg/tools/assign/duaIterate.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/duaIterate.py 2015-04-17 05:44:20.000000000 +0000 @@ -7,13 +7,13 @@ @author Jakob Erdmann @author Yun-Pang Floetteroed @date 2008-02-13 -@version $Id: duaIterate.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: duaIterate.py 18096 2015-03-17 09:50:59Z behrisch $ Run duarouter and sumo alternating to perform a dynamic user assignment. Based on the Perl script dua_iterate.pl. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -22,12 +22,18 @@ (at your option) any later version. """ from __future__ import print_function -import os, sys, subprocess, types, shutil +import os +import sys +import subprocess +import types +import shutil +import glob from datetime import datetime from optparse import OptionParser from costMemory import CostMemory sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) +import sumolib from sumolib.options import get_long_option_names @@ -49,35 +55,41 @@ type="int", default=900, help="Set main weights aggregation period [default: %default]") optParser.add_option("-m", "--mesosim", action="store_true", default=False, help="Whether mesosim shall be used") - optParser.add_option("-p", "--path", - default=os.environ.get("SUMO_BINDIR", ""), help="Path to binaries [default: %default]") + optParser.add_option("-p", "--path", help="Path to binaries") optParser.add_option("-y", "--absrand", action="store_true", - default= False, help="use current time to generate random number") + default=False, help="use current time to generate random number") optParser.add_option("-I", "--nointernal-link", action="store_true", dest="internallink", - default = False, help="not to simulate internal link: true or false") + default=False, help="not to simulate internal link: true or false") optParser.add_option("-L", "--lanechange-allowed", dest="lanechangeallowed", action="store_true", - default = False, help="lane change allowed to swap") + default=False, help="lane change allowed to swap") optParser.add_option("-j", "--meso-junctioncontrol", dest="mesojunctioncontrol", action="store_true", - default = False, help="Enable mesoscopic traffic light and priority junciton handling") + default=False, help="Enable mesoscopic traffic light and priority junciton handling") optParser.add_option("-q", "--meso-multiqueue", dest="mesomultiqueue", action="store_true", - default = False, help="Enable multiple queues at edge ends") - optParser.add_option("--meso-recheck", dest="mesorecheck", type="int", default=0, + default=False, help="Enable multiple queues at edge ends") + optParser.add_option("--meso-recheck", dest="mesorecheck", type="int", default=0, help="Delay before checking whether a jam is gone. (higher values can lead to a big speed increase)") optParser.add_option("-Q", "--eco-measure", dest="ecomeasure", type="choice", - choices=('CO', 'CO2', 'PMx', 'HC', 'NOx', 'fuel', 'noise'), + choices=( + 'CO', 'CO2', 'PMx', 'HC', 'NOx', 'fuel', 'noise'), help="define the applied eco measure, e.g. fuel, CO2, noise") optParser.add_option("--eager-insert", action="store_true", default=False, help="eager insertion tests (may slow down the sim considerably)") - optParser.add_option("--time-to-teleport", dest="timetoteleport", type="int", default=300, - help="Delay before blocked vehicles are teleported where -1 means no teleporting") - optParser.add_option("--time-to-teleport.highways", dest="timetoteleport_highways", type="int", default=0, + optParser.add_option("--time-to-teleport", dest="timetoteleport", type="float", default=300, + help="Delay before blocked vehicles are teleported (negative value disables teleporting)") + optParser.add_option("--time-to-teleport.highways", dest="timetoteleport_highways", type="float", default=0, help="Delay before blocked vehicles are teleported on wrong highway lanes") optParser.add_option("--cost-modifier", dest="costmodifier", type="choice", - choices=('grohnde', 'isar', 'None'), + choices=('grohnde', 'isar', 'None'), default='None', help="Whether to modify link travel costs of the given routes") + optParser.add_option("-7", "--zip", action="store_true", + default=False, help="zip old iterations using 7zip") + def initOptions(): - optParser = OptionParser() + optParser = OptionParser(usage="""usage: %prog [options] [sumo--options] +Any options of the form sumo--long-option-name will be passed to sumo. +These must be given after all the other options of %prog +example: sumo--step-length 0.5 will add the option --step-length 0.5 to sumo.""") addGenericOptions(optParser) optParser.add_option("-C", "--continue-on-unbuild", action="store_true", dest="continueOnUnbuild", @@ -112,16 +124,23 @@ type="int", default=0, help="First DUA step [default: %default]") optParser.add_option("-l", "--last-step", dest="lastStep", type="int", default=50, help="Last DUA step [default: %default]") - optParser.add_option("-D", "--districts", help="use districts as sources and targets", metavar="FILE") + optParser.add_option("--convergence-iterations", dest="convIt", + type="int", default=10, help="Number of iterations to use for convergence calculation [default: %default]") + optParser.add_option("--max-convergence-deviation", dest="convDev", + type="float", help="Maximum relative standard deviation in travel times [default: %default]") + optParser.add_option( + "-D", "--districts", help="use districts as sources and targets", metavar="FILE") optParser.add_option("-x", "--vehroute-file", dest="routefile", type="choice", - choices=('None', 'routesonly', 'detailed'), - default = 'None', help="choose the format of the route file") + choices=('None', 'routesonly', 'detailed'), + default='None', help="choose the format of the route file") optParser.add_option("-z", "--output-lastRoute", action="store_true", dest="lastroute", - default = False, help="output the last routes") + default=False, help="output the last routes") optParser.add_option("-K", "--keep-allroutes", action="store_true", dest="allroutes", - default = False, help="save routes with near zero probability") - optParser.add_option("--routing-algorithm", default="dijkstra", help="select the routing algorithm") - optParser.add_option("--max-alternatives", default=5, help="prune the number of alternatives to INT") + default=False, help="save routes with near zero probability") + optParser.add_option( + "--routing-algorithm", default="dijkstra", help="select the routing algorithm") + optParser.add_option( + "--max-alternatives", default=5, help="prune the number of alternatives to INT") optParser.add_option("--skip-first-routing", action="store_true", dest="skipFirstRouting", default=False, help="run simulation with demands before first routing") optParser.add_option("--logit", action="store_true", dest="logit", @@ -129,7 +148,7 @@ optParser.add_option("-g", "--logitbeta", type="float", dest="logitbeta", default=0.15, help="use the c-logit model for route choice; logit model when beta = 0") optParser.add_option("-i", "--logitgamma", type="float", dest="logitgamma", - default= 1., help="use the c-logit model for route choice") + default=1., help="use the c-logit model for route choice") optParser.add_option("-G", "--logittheta", type="float", dest="logittheta", help="parameter to adapt the cost unit") optParser.add_option("-J", "--addweights", dest="addweights", @@ -139,16 +158,18 @@ optParser.add_option("-M", "--external-gawron", action="store_true", dest="externalgawron", 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") + 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("--pessimism", default=1, type="float", help="give traffic jams a higher weight") + help="smooth edge weights across iterations") + optParser.add_option( + "--pessimism", default=1, type="float", help="give traffic jams a higher weight") 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): command = [str(c) for c in command] print("-" * 79, file=log) @@ -156,8 +177,10 @@ log.flush() retCode = subprocess.call(command, stdout=log, stderr=log) if retCode != 0: - print("Execution of %s failed. Look into %s for details." % (command, log.name), file=sys.stderr) - sys.exit(retCode) + print("Execution of %s failed. Look into %s for details." % + (command, log.name), file=sys.stderr) + sys.exit(retCode) + def writeRouteConf(step, options, file, output, routesInfo, initial_type): filename = os.path.basename(file) @@ -172,13 +195,15 @@ """ % options.net, file=fd) if options.districts: print(' ' % options.districts, file=fd) - if step==0: + if step == 0: print(' <%s-files value="%s"/>' % (initial_type, file), file=fd) else: print(' ' % file, file=fd) - print(' ' % get_weightfilename(options, step-1, "dump"), file=fd) + print(' ' % + get_weightfilename(options, step - 1, "dump"), file=fd) if options.ecomeasure: - print(' ' % options.ecomeasure, file=fd) + print(' ' % + options.ecomeasure, file=fd) print(""" @@ -196,22 +221,25 @@ """ % ( - options.continueOnUnbuild, - bool(options.districts), - options.gBeta, - options.gA, - options.allroutes, - options.routing_algorithm, - ("" if 'CH' not in options.routing_algorithm else '\n\n' % options.aggregation), - options.max_alternatives, - options.logit, - options.logitbeta, - options.logitgamma), file=fd) + options.continueOnUnbuild, + bool(options.districts), + options.gBeta, + options.gA, + options.allroutes, + options.routing_algorithm, + ("" if 'CH' not in options.routing_algorithm else '\n\n' % + options.aggregation), + options.max_alternatives, + options.logit, + options.logitbeta, + options.logitgamma), file=fd) if options.logittheta: - print(' ' % options.logittheta, file=fd) + print(' ' % + options.logittheta, file=fd) print(' ', file=fd) - - print(' ' % options.absrand, file=fd) + + print(' ' % + options.absrand, file=fd) print(' \n') self._foutrout.close() - + + class dumpsReader(handler.ContentHandler): - def __init__(self, edgesList,edgesMap): + + def __init__(self, edgesList, edgesMap): self._edgesList = edgesList self._edgeObj = None self._edgesMap = edgesMap @@ -355,12 +387,13 @@ if attrs.has_key('CO2_abs'): self._edgeObj.CO2_abs = float(attrs['CO2_abs']) if attrs.has_key('CO_abs'): - self._edgeObj.CO_abs = float(attrs['CO_abs']) - + self._edgeObj.CO_abs = float(attrs['CO_abs']) + def endElement(self, name): if name == 'edge': self._edgeObj = None + def resetEdges(edgesMap): for eid in edgesMap: e = edgesMap[eid] @@ -378,7 +411,9 @@ e.NOx_perVeh = 0. e.fuel_perVeh = 0. -def getRouteChoices(edgesMap, dumpfile, routeAltfile, netfile, addWeightsfile, alpha, beta, step, ecoMeasure=None): # check with Micha + +# check with Micha +def getRouteChoices(edgesMap, dumpfile, routeAltfile, netfile, addWeightsfile, alpha, beta, step, ecoMeasure=None): random.seed(42) # check with micha edgesList = [] vehList = [] @@ -398,20 +433,22 @@ if len(edgesMap) == 0: print 'parse network file' parse(netfile, netReader(edgesList, edgesMap)) - parse(addWeightsfile, addweightsReader(edgesList,edgesMap)) + parse(addWeightsfile, addweightsReader(edgesList, edgesMap)) else: resetEdges(edgesMap) - + fout = open(outputAltfile, 'w') foutrout = open(outputRoufile, 'w') fout.write('\n') fout.write('\n') + fout.write('route choices are generated with use of %s' % + os.path.join(os.getcwd(), 'routeChoices.py')) + fout.write('-->\n') fout.write('\n') foutrout.write('\n') foutrout.write('\n') foutrout.write('') @@ -420,21 +457,27 @@ parse(dumpfile, dumpsReader(edgesList, edgesMap)) print 'parse routeAltfile' print routeAltfile - parse(routeAltfile, routeReader(vehList, vehMap)) # parse routeAltfile from SUMO + # parse routeAltfile from SUMO + parse(routeAltfile, routeReader(vehList, vehMap)) print 'parse routeAltfile from externalGawron' - ex_outputAltFile = prefix[:prefix.rfind('_')] + '_%03i' %(step-1) + '.rou.galt.xml' + ex_outputAltFile = prefix[ + :prefix.rfind('_')] + '_%03i' % (step - 1) + '.rou.galt.xml' 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): a = alpha - delta = (r2.act_cost - r1.act_cost)/(r1.act_cost + r2.act_cost) - g = math.exp(a*delta/(1-delta*delta)) + delta = (r2.act_cost - r1.act_cost) / (r1.act_cost + r2.act_cost) + g = math.exp(a * delta / (1 - delta * delta)) ex_prob = r1.probability - r1.probability = (r1.probability*(r1.probability + r2.probability)*g)/(r1.probability*g + r2.probability) # check together with Eva + 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" @@ -444,23 +487,25 @@ vehList = [] vehMap = {} parse(netfile, netReader(edgesList, edgesMap)) - parse(addweights, addweightsReader(edgesList,edgesMap)) + parse(addweights, addweightsReader(edgesList, edgesMap)) parse(dumpfile, dumpsReader(edgesList, edgesMap)) parse(sumoAltFile, routeReader(vehList, vehMap)) - + fout = open(outputAltFile, 'w') foutrout = open(outputRouFile, 'w') fout.write('\n') fout.write('\n') + fout.write('route choices are generated with use of %s' % + os.path.join(os.getcwd(), 'routeChoices.py')) + 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: @@ -482,8 +527,8 @@ for r in vehObj.routesList: costSum += r.ex_cost for r in vehObj.routesList: - r.ex_probability = r.ex_cost/costSum - + r.ex_probability = r.ex_cost / costSum + randProb = random.random() selected = 0 if len(vehObj.routesList) > 1: @@ -493,20 +538,22 @@ 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) + 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)) + + # 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' % + (route.act_cost, route.ex_probability, route.edges)) self._fout.write(' \n') self._fout.write(' \n') self._fout.write('\n') diff -Nru sumo-0.21.0+dfsg/tools/assign/run.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/run.py --- sumo-0.21.0+dfsg/tools/assign/run.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/run.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ @author Daniel Krajzewicz @author Yun-Pang Floetteroed @date 2008-03-10 -@version $Id: run.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: run.py 18096 2015-03-17 09:50:59Z behrisch $ Runs the assignment tests. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -18,28 +18,35 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import glob, os, shutil, subprocess, time, optparse +import glob +import os +import shutil +import subprocess +import time +import optparse + def detectCPUs(): """Detects the number of effective CPUs in the system""" - #for Linux, Unix and MacOS + # for Linux, Unix and MacOS if hasattr(os, "sysconf"): - if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"): + if os.sysconf_names.has_key("SC_NPROCESSORS_ONLN"): #Linux and Unix ncpus = os.sysconf("SC_NPROCESSORS_ONLN") if isinstance(ncpus, int) and ncpus > 0: return ncpus - else: - #MacOS X + else: + # MacOS X return int(os.popen2("sysctl -n hw.ncpu")[1].read()) - #for Windows + # for Windows if os.environ.has_key("NUMBER_OF_PROCESSORS"): - ncpus = int(os.environ["NUMBER_OF_PROCESSORS"]); + ncpus = int(os.environ["NUMBER_OF_PROCESSORS"]) if ncpus > 0: return ncpus - #return the default value + # return the default value return 1 - + + def makeAndChangeDir(dirName): runID = 1 fullName = "%s%03i" % (dirName, runID) @@ -50,9 +57,10 @@ os.chdir(fullName) return fullName + def execute(command): if options.verbose: - print command + print command os.system(command) optParser = optparse.OptionParser() @@ -70,7 +78,8 @@ os.chdir("input") netFile = "../input/" + glob.glob("*.net.xml")[0] -mtxNamesList = ",".join(["../input/" + item for item in sorted(glob.glob("*.fma"))]) +mtxNamesList = ",".join( + ["../input/" + item for item in sorted(glob.glob("*.fma"))]) addFiles = ",".join(["../input/" + item for item in glob.glob("*.add.xml")]) pyAdds = "" @@ -94,12 +103,15 @@ if options.stats == 0: if not options.duaonly: succDir = makeAndChangeDir("../" + mesoAppendix + "successive") - execute("Assignment.py -e incremental -i 10 -d ../input/districts.xml -m %s -n %s" % (mtxNamesList, netFile)) + execute("Assignment.py -e incremental -i 10 -d ../input/districts.xml -m %s -n %s" % + (mtxNamesList, netFile)) if not options.od2trips: shutil.copy("%s/routes.rou.xml" % succDir, routes) - execute("route2trips.py %s > ../input/successive.trips.xml" % routes) + execute( + "route2trips.py %s > ../input/successive.trips.xml" % routes) duaDir = makeAndChangeDir("../" + mesoAppendix + "dua") - duaCall = "dua-iterate.py -e 90000 -C -n %s -t ../input/%s.trips.xml %s" % (netFile, trips, pyAdds) + duaCall = "dua-iterate.py -e 90000 -C -n %s -t ../input/%s.trips.xml %s" % ( + netFile, trips, pyAdds) if options.mesosim: duaCall = duaCall + " --mesosim" duaProcess = subprocess.Popen(duaCall, shell=True) @@ -110,7 +122,8 @@ time.sleep(1) shutil.copy("%s/trips_0.rou.xml" % duaDir, routes) shotDir = makeAndChangeDir("../" + mesoAppendix + "oneshot") - shotCall = "one-shot.py -e 90000 -n %s -t %s %s" % (netFile, routes, pyAdds) + shotCall = "one-shot.py -e 90000 -n %s -t %s %s" % ( + netFile, routes, pyAdds) if options.mesosim: shotCall = shotCall + " --mesosim" if ncpus > 2: @@ -118,9 +131,11 @@ else: execute(shotCall) clogDir = makeAndChangeDir("../" + mesoAppendix + "clogit") - execute("Assignment.py -i 60 -d ../input/districts.xml -m %s -n %s %s" % (mtxNamesList, netFile, signalAdds)) + execute("Assignment.py -i 60 -d ../input/districts.xml -m %s -n %s %s" % + (mtxNamesList, netFile, signalAdds)) lohseDir = makeAndChangeDir("../" + mesoAppendix + "lohse") - execute("Assignment.py -e lohse -i 60 -d ../input/districts.xml -m %s -n %s %s" % (mtxNamesList, netFile, signalAdds)) + execute("Assignment.py -e lohse -i 60 -d ../input/districts.xml -m %s -n %s %s" % + (mtxNamesList, netFile, signalAdds)) if oneshotProcess: oneshotProcess.wait() duaProcess.wait() @@ -130,7 +145,7 @@ clogDir = "../" + mesoAppendix + "clogit%03i" % options.stats lohseDir = "../" + mesoAppendix + "lohse%03i" % options.stats shotDir = "../" + mesoAppendix + "oneshot%03i" % options.stats - + makeAndChangeDir("../" + mesoAppendix + "statistics") tripinfos = "" routes = [] @@ -138,23 +153,29 @@ tripinfofile = "tripinfo_dua_%s.xml" % step shutil.copy("%s/tripinfo_%s.xml" % (duaDir, step), tripinfofile) tripinfos += tripinfofile + "," - execute("networkStatistics.py -t tripinfo_dua_%s.xml -o networkStatistics_%s_%s.txt" % (step, os.path.basename(duaDir), step)) + execute("networkStatistics.py -t tripinfo_dua_%s.xml -o networkStatistics_%s_%s.txt" % + (step, os.path.basename(duaDir), step)) routes.append("%s/%s_%s.rou.xml" % (duaDir, trips, step)) if not options.duaonly: for step in [-1, 15]: - tripinfofile = "tripinfo_oneshot_%s.xml" % step + tripinfofile = "tripinfo_oneshot_%s.xml" % step shutil.copy("%s/tripinfo_%s.xml" % (shotDir, step), tripinfofile) tripinfos += tripinfofile + "," routes.append("%s/vehroutes_%s.xml" % (shotDir, step)) - execute("sumo -W --no-step-log -n %s -e 90000 -r %s/routes.rou.xml --dump-basename dump_successive --dump-intervals 900 --emissions emissions_successive.xml --tripinfo-output tripinfo_successive.xml %s -l sumo_successive.log" % (netFile, succDir, sumoAdds)) - execute("sumo -W --no-step-log -n %s -e 90000 -r %s/routes.rou.xml --dump-basename dump_clogit --dump-intervals 900 --emissions emissions_clogit.xml --tripinfo-output tripinfo_clogit.xml %s -l sumo_clogit.log" % (netFile, clogDir, sumoAdds)) - execute("sumo -W --no-step-log -n %s -e 90000 -r %s/routes.rou.xml --dump-basename dump_lohse --dump-intervals 900 --emissions emissions_lohse.xml --tripinfo-output tripinfo_lohse.xml %s -l sumo_lohse.log" % (netFile, lohseDir, sumoAdds)) - tripinfos += tripinfofile + ",tripinfo_successive.xml,tripinfo_clogit.xml,tripinfo_lohse.xml" - execute("networkStatistics.py -t %s -o networkStatisticsWithSgT.txt" % tripinfos) - for dir in succDir, clogDir, lohseDir: + execute("sumo -W --no-step-log -n %s -e 90000 -r %s/routes.rou.xml --dump-basename dump_successive --dump-intervals 900 --emissions emissions_successive.xml --tripinfo-output tripinfo_successive.xml %s -l sumo_successive.log" % + (netFile, succDir, sumoAdds)) + execute("sumo -W --no-step-log -n %s -e 90000 -r %s/routes.rou.xml --dump-basename dump_clogit --dump-intervals 900 --emissions emissions_clogit.xml --tripinfo-output tripinfo_clogit.xml %s -l sumo_clogit.log" % + (netFile, clogDir, sumoAdds)) + execute("sumo -W --no-step-log -n %s -e 90000 -r %s/routes.rou.xml --dump-basename dump_lohse --dump-intervals 900 --emissions emissions_lohse.xml --tripinfo-output tripinfo_lohse.xml %s -l sumo_lohse.log" % + (netFile, lohseDir, sumoAdds)) + tripinfos += tripinfofile + \ + ",tripinfo_successive.xml,tripinfo_clogit.xml,tripinfo_lohse.xml" + execute( + "networkStatistics.py -t %s -o networkStatisticsWithSgT.txt" % tripinfos) + for dir in succDir, clogDir, lohseDir: routes.append(dir + "/routes.rou.xml") #outfilename = "routecompare.txt" -#for idx, route1 in enumerate(routes): +# for idx, route1 in enumerate(routes): # for route2 in routes[idx+1:]: # outfile = open(outfilename, "a") # print >> outfile, route1, route2 diff -Nru sumo-0.21.0+dfsg/tools/assign/statisticsElements.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/statisticsElements.py --- sumo-0.21.0+dfsg/tools/assign/statisticsElements.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/statisticsElements.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,15 +4,15 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2008-07-10 -@version $Id: statisticsElements.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: statisticsElements.py 18096 2015-03-17 09:50:59Z behrisch $ This script is to define classes, functions, parse-reader and output files/format for - calculating network performances - conducting significance tests (either t-Test or Kruskal-Wallis-Test) and - writing results into files. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -25,13 +25,15 @@ from xml.sax import saxutils, make_parser, handler -# This class is for storing vehicle information, such as departure time, route and travel time. +# This class is for storing vehicle information, such as departure time, +# route and travel time. class Vehicle: + def __init__(self, label): self.label = label self.method = None self.depart = 0. - self.arrival = 0. + self.arrival = 0. self.speed = 0. self.route = [] self.traveltime = 0. @@ -44,7 +46,10 @@ return "%s_%s_%s_%s_%s_%s<%s>" % (self.label, self.depart, self.arrival, self.speed, self.traveltime, self.travellength, self.route) # This class is used in the significance test. + + class Assign: + def __init__(self, method, totalVeh, totalTravelTime, totalTravelLength, totalDepartDelay, totalWaitTime, avgTravelTime, avgTravelLength, avgTravelSpeed, avgDepartDelay, avgWaitTime, SDTravelTime, SDLength, SDSpeed, SDWaitTime): self.label = method self.totalVeh = totalVeh @@ -58,17 +63,20 @@ self.avgDepartDelay = avgDepartDelay self.avgWaitTime = avgWaitTime self.SDTravelTime = SDTravelTime - self.SDLength = SDLength + self.SDLength = SDLength self.SDSpeed = SDSpeed self.SDWaitTime = SDWaitTime self.sumrank = 0. - + def __repr__(self): return "%s_<%s|%s|%s|%s|%s|%s|%s|%s|%s>" % (self.label, self.totalVeh, self.avgTravelTime, self.avgTravelLength, self.avgTravelSpeed, - self.avgWaitTime, self.SDTravelTime, self.SDLength, self.SDSpeed, self.SDWaitTime) + self.avgWaitTime, self.SDTravelTime, self.SDLength, self.SDSpeed, self.SDWaitTime) # This cloass is used for the t test in the significance test. + + class T_Value: + def __init__(self, avgtraveltime, avgtravelspeed, avgtravellength, avgwaittime, lowvalue, highvalue): self.avgtraveltime = avgtraveltime self.avgtravelspeed = avgtravelspeed @@ -76,12 +84,15 @@ self.avgwaittime = avgwaittime self.lowtvalue = lowvalue self.hightvalue = highvalue - + def __repr__(self): return "%<%s|%s|%s|%s>" % (self.avgtraveltime, self.avgtravelspeed, self.avgtravellength, self.avgwaittime) # This class is used for the Kruskal-Wallis test in the significance test. + + class H_Value: + def __init__(self, label, lowvalue, highvalue): self.label = label self.traveltime = 0. @@ -89,74 +100,101 @@ self.travellength = 0. self.waittime = 0. # 95% confidence interval - self.lowchivalue = lowvalue + self.lowchivalue = lowvalue # 99% confidence interval self.highchivalue = highvalue - + def __repr__(self): return "%<%s|%s|%s|%s|%s|%s>" % (self.traveltime, self.travelspeed, self.travellength, self.waittime, self.lowchivalue, self.highchivalue) - + # The class is for parsing the XML input file (vehicle information). This class is used in the networkStatistics.py for -# calculating the gloabal network performances, e.g. avg. travel time and avg. travel speed. +# calculating the gloabal network performances, e.g. avg. travel time and +# avg. travel speed. + + class VehInformationReader(handler.ContentHandler): + def __init__(self, vehList): self._vehList = vehList self._Vehicle = None self._routeString = '' - + def startElement(self, name, attrs): if name == 'tripinfo': self._Vehicle = Vehicle(attrs['id']) self._Vehicle.traveltime = float(attrs['duration']) self._Vehicle.travellength = float(attrs['routeLength']) self._Vehicle.departdelay = float(attrs['departDelay']) - self._Vehicle.waittime = float(attrs['departDelay']) + float(attrs['waitSteps']) + self._Vehicle.waittime = float( + attrs['departDelay']) + float(attrs['waitSteps']) self._vehList.append(self._Vehicle) - + # output the network statistics based on the sumo-simulation results + + def getStatisticsOutput(assignments, outputfile): foutveh = file(outputfile, 'w') - foutveh.write('average vehicular travel time(s) = the sum of all vehicular travel times / the number of vehicles\n') - foutveh.write('average vehicular travel length(m) = the sum of all vehicular travel lengths / the number of vehicles\n') - foutveh.write('average vehicular travel speed(m/s) = the sum of all vehicular travel speeds / the number of vehicles\n') + foutveh.write( + 'average vehicular travel time(s) = the sum of all vehicular travel times / the number of vehicles\n') + foutveh.write( + 'average vehicular travel length(m) = the sum of all vehicular travel lengths / the number of vehicles\n') + foutveh.write( + 'average vehicular travel speed(m/s) = the sum of all vehicular travel speeds / the number of vehicles\n') for method in assignments.itervalues(): - foutveh.write('\nAssignment Method:%s\n' %method.label) - foutveh.write('- total number of vehicles:%s\n' %method.totalVeh) - foutveh.write('- total departure delay(s):%s, ' %method.totalDepartDelay) - foutveh.write('- average departure delay(s):%s\n' %method.avgDepartDelay) - foutveh.write('- total waiting time(s):%s, ' %method.totalWaitTime) - foutveh.write('- average vehicular waiting time(s):%s\n' %method.avgWaitTime) - foutveh.write('- total travel time(s):%s, ' % method.totalTravelTime) - foutveh.write('- average vehicular travel time(s):%s\n' %method.avgTravelTime) - foutveh.write('- total travel length(m):%s, ' %method.totalTravelLength) - foutveh.write('- average vehicular travel length(m):%s\n' %method.avgTravelLength) - foutveh.write('- average vehicular travel speed(m/s):%s\n' %method.avgTravelSpeed) + foutveh.write('\nAssignment Method:%s\n' % method.label) + foutveh.write('- total number of vehicles:%s\n' % method.totalVeh) + foutveh.write('- total departure delay(s):%s, ' % + method.totalDepartDelay) + foutveh.write('- average departure delay(s):%s\n' % + method.avgDepartDelay) + foutveh.write('- total waiting time(s):%s, ' % method.totalWaitTime) + foutveh.write('- average vehicular waiting time(s):%s\n' % + method.avgWaitTime) + foutveh.write('- total travel time(s):%s, ' % method.totalTravelTime) + foutveh.write('- average vehicular travel time(s):%s\n' % + method.avgTravelTime) + foutveh.write('- total travel length(m):%s, ' % + method.totalTravelLength) + foutveh.write('- average vehicular travel length(m):%s\n' % + method.avgTravelLength) + foutveh.write('- average vehicular travel speed(m/s):%s\n' % + method.avgTravelSpeed) foutveh.close() - -# output the results of the significance tests according to the sumo-simulation results + +# output the results of the significance tests according to the +# sumo-simulation results + + def getSignificanceTestOutput(assignments, tTest, tValueAvg, hValues, outputfile): foutSGtest = file(outputfile, 'w') if tTest: - foutSGtest.write('The significances of the performance averages among the used assignment models are examined with the t test.\n') + foutSGtest.write( + 'The significances of the performance averages among the used assignment models are examined with the t test.\n') assignlist = list(assignments.itervalues()) for num, A in enumerate(assignlist): - for B in assignlist[num+1: ]: - foutSGtest.write('\nmethod:%s' %A.label) - foutSGtest.write('\nmethod:%s' %B.label) - foutSGtest.write('\n t-value for the avg. travel time:%s' %tValueAvg[A][B].avgtraveltime) - foutSGtest.write('\n t-value for the avg. travel length:%s'%tValueAvg[A][B].avgtravellength) - foutSGtest.write('\n t-value for the avg.travel speed:%s' %tValueAvg[A][B].avgtravelspeed) - foutSGtest.write('\n t-value for the avg. wait time:%s\n' %tValueAvg[A][B].avgwaittime) - foutSGtest.write('\n95 t-value:%s' %tValueAvg[A][B].lowtvalue) - foutSGtest.write('\n99 t-value:%s\n' %tValueAvg[A][B].hightvalue) - - foutSGtest.write('The significance test among the different assignment methods is also done with the Kruskal-Wallis test.\n') + for B in assignlist[num + 1:]: + foutSGtest.write('\nmethod:%s' % A.label) + foutSGtest.write('\nmethod:%s' % B.label) + foutSGtest.write( + '\n t-value for the avg. travel time:%s' % tValueAvg[A][B].avgtraveltime) + foutSGtest.write( + '\n t-value for the avg. travel length:%s' % tValueAvg[A][B].avgtravellength) + foutSGtest.write( + '\n t-value for the avg.travel speed:%s' % tValueAvg[A][B].avgtravelspeed) + foutSGtest.write( + '\n t-value for the avg. wait time:%s\n' % tValueAvg[A][B].avgwaittime) + foutSGtest.write('\n95 t-value:%s' % tValueAvg[A][B].lowtvalue) + foutSGtest.write('\n99 t-value:%s\n' % + tValueAvg[A][B].hightvalue) + + foutSGtest.write( + 'The significance test among the different assignment methods is also done with the Kruskal-Wallis test.\n') for h in hValues: - foutSGtest.write('\n\nmethods:%s' %h.label) - foutSGtest.write('\nH_traveltime:%s' %h.traveltime) - foutSGtest.write('\nH_travelspeed:%s' %h.travelspeed) - foutSGtest.write('\nH_travellength:%s' %h.travellength) - foutSGtest.write('\nH_waittime:%s\n' %h.waittime) - foutSGtest.write('\n95 chi-square value:%s' %h.lowchivalue) - foutSGtest.write('\n99 chi-square value:%s\n' %h.highchivalue) + foutSGtest.write('\n\nmethods:%s' % h.label) + foutSGtest.write('\nH_traveltime:%s' % h.traveltime) + foutSGtest.write('\nH_travelspeed:%s' % h.travelspeed) + foutSGtest.write('\nH_travellength:%s' % h.travellength) + foutSGtest.write('\nH_waittime:%s\n' % h.waittime) + foutSGtest.write('\n95 chi-square value:%s' % h.lowchivalue) + foutSGtest.write('\n99 chi-square value:%s\n' % h.highchivalue) foutSGtest.close() diff -Nru sumo-0.21.0+dfsg/tools/assign/tables.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/tables.py --- sumo-0.21.0+dfsg/tools/assign/tables.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/assign/tables.py 2015-04-17 05:44:20.000000000 +0000 @@ -12,8 +12,8 @@ - define link cost functions - conduct significance tests -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -33,7 +33,7 @@ "CR12": (1., 4., 1.), "CR13": (1., 2., 1.3)} -#crCurveTable = {"CR1": (1., 2., 1.), +# crCurveTable = {"CR1": (1., 2., 1.), # "CR2": (1., 2., 1.), # "CR3": (1., 2., 1.), # "CR4": (1., 2., 1.), @@ -42,6 +42,7 @@ # "CR10": (1., 2., 1.), # "CR11": (0.25, 2., 1.)} + def updateCurveTable(filename): f = open(filename) for line in f: @@ -50,155 +51,193 @@ for entry in elements[1:]: crCurveTable[elements[0]].append(float(entry)) -laneTypeTable = {1:[[5, 200.0, "CR7"],[7, 412.5, "CR7"],[9, 600.0, "CR6"],[11, 800.0, "CR5"],[13, 1125.0, "CR5"],[16, 1583.33, "CR4"],[18, 1100.0, "CR3"],[22, 1200.0, "CR3"],[26, 1300.0, "CR3"],[30, 1400.0, "CR3"],[999., 1400.0, "CR3"]], - 2:[[11, 800.0, "CR5"],[13, 875.0, "CR5"],[16, 1500.0, "CR4"],[30, 1800.0, "CR13"],[999., 1800.0, "CR13"]], - 3:[[11, 1333.33, "CR5"],[16, 1500.0, "CR3"],[30, 2000.0, "CR13"],[999., 2000.0, "CR13"]], - 4:[[30, 2000.0, "CR13"],[999., 2000.0, "CR13"]]} - -#laneTypeTable = {1:[[7., 200., "CR6"], [9., 800., "CR3"], [12., 800., "CR4"], [13., 800., "CR2"], [18., 1200., "CR2"], [19., 1300., "CR4"], [22., 1200., "CR2"], [25., 1300., "CR2"], [30., 1350., "CR1"], [33., 1400., "CR1"], [999., 1500., "CR1"]], +laneTypeTable = {1: [[5, 200.0, "CR7"], [7, 412.5, "CR7"], [9, 600.0, "CR6"], [11, 800.0, "CR5"], [13, 1125.0, "CR5"], [16, 1583.33, "CR4"], [18, 1100.0, "CR3"], [22, 1200.0, "CR3"], [26, 1300.0, "CR3"], [30, 1400.0, "CR3"], [999., 1400.0, "CR3"]], + 2: [[11, 800.0, "CR5"], [13, 875.0, "CR5"], [16, 1500.0, "CR4"], [30, 1800.0, "CR13"], [999., 1800.0, "CR13"]], + 3: [[11, 1333.33, "CR5"], [16, 1500.0, "CR3"], [30, 2000.0, "CR13"], [999., 2000.0, "CR13"]], + 4: [[30, 2000.0, "CR13"], [999., 2000.0, "CR13"]]} + +# laneTypeTable = {1:[[7., 200., "CR6"], [9., 800., "CR3"], [12., 800., "CR4"], [13., 800., "CR2"], [18., 1200., "CR2"], [19., 1300., "CR4"], [22., 1200., "CR2"], [25., 1300., "CR2"], [30., 1350., "CR1"], [33., 1400., "CR1"], [999., 1500., "CR1"]], # 2:[[7., 200., "CR6"], [9., 800., "CR3"], [13., 1000., "CR3"], [15., 1050., "CR2"], [16., 1100., "CR2"], [25., 1300., "CR2"], [27., 1400., "CR1"], [29., 1400., "CR3"], [30., 1500., "CR2"], [34., 1400., "CR2"], [999., 1500., "CR1"]], # 3:[[7., 200., "CR6"], [9., 800., "CR3"], [13., 1000, "CR3"], [16., 1100., "CR2"], [19., 1300., "CR2"], [25., 1400., "CR2"], [27., 1400., "CR1"], [30., 1500., "CR2"], [33., 1400., "CR1"], [999., 1500., "CR1"]], -# 4:[[7., 200., "CR6"], [9., 800., "CR3"], [13., 1000., "CR3"], [17, 1100., "CR2"], [19., 1300., "CR1"], [25., 1400., "CR2"], [27., 1400., "CR2"], [29., 1400., "CR3"], [30., 1500., "CR2"], [33., 1400., "CR1"], [999., 1500., "CR1"]]} - +# 4:[[7., 200., "CR6"], [9., 800., "CR3"], [13., 1000., "CR3"], [17, +# 1100., "CR2"], [19., 1300., "CR1"], [25., 1400., "CR2"], [27., 1400., +# "CR2"], [29., 1400., "CR3"], [30., 1500., "CR2"], [33., 1400., "CR1"], +# [999., 1500., "CR1"]]} + chiSquareTable = \ -[[ 0, 0.10, 0.05, 0.025, 0.01, 0.001], -[ 1, 2.706, 3.841, 5.024, 6.635, 10.828], -[ 2, 4.605, 5.991, 7.378, 9.210, 13.816], -[ 3, 6.251, 7.815, 9.348, 11.345, 16.266], -[ 4, 7.779, 9.488, 11.143, 13.277, 18.467], -[ 5, 9.236, 11.070, 12.833, 15.086, 20.515], -[ 6, 10.645, 12.592, 14.449, 16.812, 22.458], -[ 7, 12.017, 14.067, 16.013, 18.475, 24.322], -[ 8, 13.362, 15.507, 17.535, 20.090, 26.125], -[ 9, 14.684, 16.919, 19.023, 21.666, 27.877], -[ 10, 15.987, 18.307, 20.483, 23.209, 29.588], -[ 11, 17.275, 19.675, 21.920, 24.725, 31.264], -[ 12, 18.549, 21.026, 23.337, 26.217, 32.910], -[ 13, 19.812, 22.362, 24.736, 27.688, 34.528], -[ 14, 21.064, 23.685, 26.119, 29.141, 36.123], -[ 15, 22.307, 24.996, 27.488, 30.578, 37.697], -[ 16, 23.542, 26.296, 28.845, 32.000, 39.252], -[ 17, 24.769, 27.587, 30.191, 33.409, 40.790], -[ 18, 25.989, 28.869, 31.526, 34.805, 42.312], -[ 19, 27.204, 30.144, 32.852, 36.191, 43.820], -[ 20, 28.412, 31.410, 34.170, 37.566, 45.315], -[ 21, 29.615, 32.671, 35.479, 38.932, 46.797], -[ 22, 30.813, 33.924, 36.781, 40.289, 48.268], -[ 23, 32.007, 35.172, 38.076, 41.638, 49.728], -[ 24, 33.196, 36.415, 39.364, 42.980, 51.179], -[ 25, 34.382, 37.652, 40.646, 44.314, 52.620], -[ 26, 35.563, 38.885, 41.923, 45.642, 54.052], -[ 27, 36.741, 40.113, 43.195, 46.963, 55.476], -[ 28, 37.916, 41.337, 44.461, 48.278, 56.892], -[ 29, 39.087, 42.557, 45.722, 49.588, 58.301], -[ 30, 40.256, 43.773, 46.979, 50.892, 59.703], -[ 31, 41.422, 44.985, 48.232, 52.191, 61.098], -[ 32, 42.585, 46.194, 49.480, 53.486, 62.487], -[ 33, 43.745, 47.400, 50.725, 54.776, 63.870], -[ 34, 44.903, 48.602, 51.966, 56.061, 65.247], -[ 35, 46.059, 49.802, 53.203, 57.342, 66.619], -[ 36, 47.212, 50.998, 54.437, 58.619, 67.985], -[ 37, 48.363, 52.192, 55.668, 59.893, 69.347], -[ 38, 49.513, 53.384, 56.896, 61.162, 70.703], -[ 39, 50.660, 54.572, 58.120, 62.428, 72.055], -[ 40, 51.805, 55.758, 59.342, 63.691, 73.402], -[ 41, 52.949, 56.942, 60.561, 64.950, 74.745], -[ 42, 54.090, 58.124, 61.777, 66.206, 76.084], -[ 43, 55.230, 59.304, 62.990, 67.459, 77.419], -[ 44, 56.369, 60.481, 64.201, 68.710, 78.750], -[ 45, 57.505, 61.656, 65.410, 69.957, 80.077], -[ 46, 58.641, 62.830, 66.617, 71.201, 81.400], -[ 47, 59.774, 64.001, 67.821, 72.443, 82.720], -[ 48, 60.907, 65.171, 69.023, 73.683, 84.037], -[ 49, 62.038, 66.339, 70.222, 74.919, 85.351], -[ 50, 63.167, 67.505, 71.420, 76.154, 86.661], -[ 51, 64.295, 68.669, 72.616, 77.386, 87.968], -[ 52, 65.422, 69.832, 73.810, 78.616, 89.272], -[ 53, 66.548, 70.993, 75.002, 79.843, 90.573], -[ 54, 67.673, 72.153, 76.192, 81.069, 91.872], -[ 55, 68.796, 73.311, 77.380, 82.292, 93.168], -[ 56, 69.919, 74.468, 78.567, 83.513, 94.461], -[ 57, 71.040, 75.624, 79.752, 84.733, 95.751], -[ 58, 72.160, 76.778, 80.936, 85.950, 97.039], -[ 59, 73.279, 77.931, 82.117, 87.166, 98.324], -[ 60, 74.397, 79.082, 83.298, 88.379, 99.607], -[ 61, 75.514, 80.232, 84.476, 89.591, 100.888], -[ 62, 76.630, 81.381, 85.654, 90.802, 102.166], -[ 63, 77.745, 82.529, 86.830, 92.010, 103.442], -[ 64, 78.860, 83.675, 88.004, 93.217, 104.716], -[ 65, 79.973, 84.821, 89.177, 94.422, 105.988], -[ 66, 81.085, 85.965, 90.349, 95.626, 107.258], -[ 67, 82.197, 87.108, 91.519, 96.828, 108.526], -[ 68, 83.308, 88.250, 92.689, 98.028, 109.791], -[ 69, 84.418, 89.391, 93.856, 99.228, 111.055], -[ 70, 85.527, 90.531, 95.023, 100.425, 112.317], -[ 71, 86.635, 91.670, 96.189, 101.621, 113.577], -[ 72, 87.743, 92.808, 97.353, 102.816, 114.835], -[ 73, 88.850, 93.945, 98.516, 104.010, 116.092], -[ 74, 89.956, 95.081, 99.678, 105.202, 117.346], -[ 75, 91.061, 96.217, 100.839, 106.393, 118.599], -[ 76, 92.166, 97.351, 101.999, 107.583, 119.850], -[ 77, 93.270, 98.484, 103.158, 108.771, 121.100], -[ 78, 94.374, 99.617, 104.316, 109.958, 122.348], -[ 79, 95.476, 100.749, 105.473, 111.144, 123.594], -[ 80, 96.578, 101.879, 106.629, 112.329, 124.839], -[ 81, 97.680, 103.010, 107.783, 113.512, 126.083], -[ 82, 98.780, 104.139, 108.937, 114.695, 127.324], -[ 83, 99.880, 105.267, 110.090, 115.876, 128.565], -[ 84, 100.980, 106.395, 111.242, 117.057, 129.804], -[ 85, 102.079, 107.522, 112.393, 118.236, 131.041], -[ 86, 103.177, 108.648, 113.544, 119.414, 132.277], -[ 87, 104.275, 109.773, 114.693, 120.591, 133.512], -[ 88, 105.372, 110.898, 115.841, 121.767, 134.746], -[ 89, 106.469, 112.022, 116.989, 122.942, 135.978], -[ 90, 107.565, 113.145, 118.136, 124.116, 137.208], -[ 91, 108.661, 114.268, 119.282, 125.289, 138.438], -[ 92, 109.756, 115.390, 120.427, 126.462, 139.666], -[ 93, 110.850, 116.511, 121.571, 127.633, 140.893], -[ 94, 111.944, 117.632, 122.715, 128.803, 142.119], -[ 95, 113.038, 118.752, 123.858, 129.973, 143.344], -[ 96, 114.131, 119.871, 125.000, 131.141, 144.567], -[ 97, 115.223, 120.990, 126.141, 132.309, 145.789], -[ 98, 116.315, 122.108, 127.282, 133.476, 147.010], -[ 99, 117.407, 123.225, 128.422, 134.642, 148.230], -[100, 118.498, 124.342, 129.561, 135.807, 149.449]] + [[0, 0.10, 0.05, 0.025, 0.01, 0.001], + [1, 2.706, 3.841, 5.024, 6.635, 10.828], + [2, 4.605, 5.991, 7.378, 9.210, 13.816], + [3, 6.251, 7.815, 9.348, 11.345, 16.266], + [4, 7.779, 9.488, 11.143, 13.277, 18.467], + [5, 9.236, 11.070, 12.833, 15.086, 20.515], + [6, 10.645, 12.592, 14.449, 16.812, 22.458], + [7, 12.017, 14.067, 16.013, 18.475, 24.322], + [8, 13.362, 15.507, 17.535, 20.090, 26.125], + [9, 14.684, 16.919, 19.023, 21.666, 27.877], + [10, 15.987, 18.307, 20.483, 23.209, 29.588], + [11, 17.275, 19.675, 21.920, 24.725, 31.264], + [12, 18.549, 21.026, 23.337, 26.217, 32.910], + [13, 19.812, 22.362, 24.736, 27.688, 34.528], + [14, 21.064, 23.685, 26.119, 29.141, 36.123], + [15, 22.307, 24.996, 27.488, 30.578, 37.697], + [16, 23.542, 26.296, 28.845, 32.000, 39.252], + [17, 24.769, 27.587, 30.191, 33.409, 40.790], + [18, 25.989, 28.869, 31.526, 34.805, 42.312], + [19, 27.204, 30.144, 32.852, 36.191, 43.820], + [20, 28.412, 31.410, 34.170, 37.566, 45.315], + [21, 29.615, 32.671, 35.479, 38.932, 46.797], + [22, 30.813, 33.924, 36.781, 40.289, 48.268], + [23, 32.007, 35.172, 38.076, 41.638, 49.728], + [24, 33.196, 36.415, 39.364, 42.980, 51.179], + [25, 34.382, 37.652, 40.646, 44.314, 52.620], + [26, 35.563, 38.885, 41.923, 45.642, 54.052], + [27, 36.741, 40.113, 43.195, 46.963, 55.476], + [28, 37.916, 41.337, 44.461, 48.278, 56.892], + [29, 39.087, 42.557, 45.722, 49.588, 58.301], + [30, 40.256, 43.773, 46.979, 50.892, 59.703], + [31, 41.422, 44.985, 48.232, 52.191, 61.098], + [32, 42.585, 46.194, 49.480, 53.486, 62.487], + [33, 43.745, 47.400, 50.725, 54.776, 63.870], + [34, 44.903, 48.602, 51.966, 56.061, 65.247], + [35, 46.059, 49.802, 53.203, 57.342, 66.619], + [36, 47.212, 50.998, 54.437, 58.619, 67.985], + [37, 48.363, 52.192, 55.668, 59.893, 69.347], + [38, 49.513, 53.384, 56.896, 61.162, 70.703], + [39, 50.660, 54.572, 58.120, 62.428, 72.055], + [40, 51.805, 55.758, 59.342, 63.691, 73.402], + [41, 52.949, 56.942, 60.561, 64.950, 74.745], + [42, 54.090, 58.124, 61.777, 66.206, 76.084], + [43, 55.230, 59.304, 62.990, 67.459, 77.419], + [44, 56.369, 60.481, 64.201, 68.710, 78.750], + [45, 57.505, 61.656, 65.410, 69.957, 80.077], + [46, 58.641, 62.830, 66.617, 71.201, 81.400], + [47, 59.774, 64.001, 67.821, 72.443, 82.720], + [48, 60.907, 65.171, 69.023, 73.683, 84.037], + [49, 62.038, 66.339, 70.222, 74.919, 85.351], + [50, 63.167, 67.505, 71.420, 76.154, 86.661], + [51, 64.295, 68.669, 72.616, 77.386, 87.968], + [52, 65.422, 69.832, 73.810, 78.616, 89.272], + [53, 66.548, 70.993, 75.002, 79.843, 90.573], + [54, 67.673, 72.153, 76.192, 81.069, 91.872], + [55, 68.796, 73.311, 77.380, 82.292, 93.168], + [56, 69.919, 74.468, 78.567, 83.513, 94.461], + [57, 71.040, 75.624, 79.752, 84.733, 95.751], + [58, 72.160, 76.778, 80.936, 85.950, 97.039], + [59, 73.279, 77.931, 82.117, 87.166, 98.324], + [60, 74.397, 79.082, 83.298, 88.379, 99.607], + [61, 75.514, 80.232, 84.476, 89.591, 100.888], + [62, 76.630, 81.381, 85.654, 90.802, 102.166], + [63, 77.745, 82.529, 86.830, 92.010, 103.442], + [64, 78.860, 83.675, 88.004, 93.217, 104.716], + [65, 79.973, 84.821, 89.177, 94.422, 105.988], + [66, 81.085, 85.965, 90.349, 95.626, 107.258], + [67, 82.197, 87.108, 91.519, 96.828, 108.526], + [68, 83.308, 88.250, 92.689, 98.028, 109.791], + [69, 84.418, 89.391, 93.856, 99.228, 111.055], + [70, 85.527, 90.531, 95.023, 100.425, 112.317], + [71, 86.635, 91.670, 96.189, 101.621, 113.577], + [72, 87.743, 92.808, 97.353, 102.816, 114.835], + [73, 88.850, 93.945, 98.516, 104.010, 116.092], + [74, 89.956, 95.081, 99.678, 105.202, 117.346], + [75, 91.061, 96.217, 100.839, 106.393, 118.599], + [76, 92.166, 97.351, 101.999, 107.583, 119.850], + [77, 93.270, 98.484, 103.158, 108.771, 121.100], + [78, 94.374, 99.617, 104.316, 109.958, 122.348], + [79, 95.476, 100.749, 105.473, 111.144, 123.594], + [80, 96.578, 101.879, 106.629, 112.329, 124.839], + [81, 97.680, 103.010, 107.783, 113.512, 126.083], + [82, 98.780, 104.139, 108.937, 114.695, 127.324], + [83, 99.880, 105.267, 110.090, 115.876, 128.565], + [84, 100.980, 106.395, 111.242, 117.057, 129.804], + [85, 102.079, 107.522, 112.393, 118.236, 131.041], + [86, 103.177, 108.648, 113.544, 119.414, 132.277], + [87, 104.275, 109.773, 114.693, 120.591, 133.512], + [88, 105.372, 110.898, 115.841, 121.767, 134.746], + [89, 106.469, 112.022, 116.989, 122.942, 135.978], + [90, 107.565, 113.145, 118.136, 124.116, 137.208], + [91, 108.661, 114.268, 119.282, 125.289, 138.438], + [92, 109.756, 115.390, 120.427, 126.462, 139.666], + [93, 110.850, 116.511, 121.571, 127.633, 140.893], + [94, 111.944, 117.632, 122.715, 128.803, 142.119], + [95, 113.038, 118.752, 123.858, 129.973, 143.344], + [96, 114.131, 119.871, 125.000, 131.141, 144.567], + [97, 115.223, 120.990, 126.141, 132.309, 145.789], + [98, 116.315, 122.108, 127.282, 133.476, 147.010], + [99, 117.407, 123.225, 128.422, 134.642, 148.230], + [100, 118.498, 124.342, 129.561, 135.807, 149.449]] tTable = \ -[[0, 0.25, 0.20, 0.15, 0.10, 0.05, 0.025, 0.02, 0.01, 0.005, 0.0025, 0.001, 0.0005], -[1, 1.000, 1.376, 1.963, 3.078, 6.314, 12.71, 15.89, 31.82, 63.66, 127.3, 318.3, 636.6], -[2, 0.816, 1.061, 1.386, 1.886, 2.920, 4.303, 4.849, 6.965, 9.925, 14.09, 22.33, 31.60], -[3, 0.765, 0.978, 1.250, 1.638, 2.353, 3.182, 3.482, 4.541, 5.841, 7.453, 10.21, 12.92], -[4, 0.741, 0.941, 1.190, 1.533, 2.132, 2.776, 2.999, 3.747, 4.604, 5.598, 7.173, 8.610], -[5, 0.727, 0.920, 1.156, 1.476, 2.015, 2.571, 2.757, 3.365, 4.032, 4.773, 5.893, 6.869], -[6, 0.718, 0.906, 1.134, 1.440, 1.943, 2.447, 2.612, 3.143, 3.707, 4.317, 5.208, 5.959], -[7, 0.711, 0.896, 1.119, 1.415, 1.895, 2.365, 2.517, 2.998, 3.499, 4.029, 4.785, 5.408], -[8, 0.706, 0.889, 1.108, 1.397, 1.860, 2.306, 2.449, 2.896, 3.355, 3.833, 4.501, 5.041], -[9, 0.703, 0.883, 1.100, 1.383, 1.833, 2.262, 2.398, 2.821, 3.250, 3.690, 4.297, 4.781], -[10, 0.700, 0.879, 1.093, 1.372, 1.812, 2.228, 2.359, 2.764, 3.169, 3.581, 4.144, 4.587], -[11, 0.697, 0.876, 1.088, 1.363, 1.796, 2.201, 2.328, 2.718, 3.106, 3.497, 4.025, 4.437], -[12, 0.695, 0.873, 1.083, 1.356, 1.782, 2.179, 2.303, 2.681, 3.055, 3.428, 3.930, 4.318], -[13, 0.694, 0.870, 1.079, 1.350, 1.771, 2.160, 2.282, 2.650, 3.012, 3.372, 3.852, 4.221], -[14, 0.692, 0.868, 1.076, 1.345, 1.761, 2.145, 2.264, 2.624, 2.977, 3.326, 3.787, 4.140], -[15, 0.691, 0.866, 1.074, 1.341, 1.753, 2.131, 2.249, 2.602, 2.947, 3.286, 3.733, 4.073], -[16, 0.690, 0.865, 1.071, 1.337, 1.746, 2.120, 2.235, 2.583, 2.921, 3.252, 3.686, 4.015], -[17, 0.689, 0.863, 1.069, 1.333, 1.740, 2.110, 2.224, 2.567, 2.898, 3.222, 3.646, 3.965], -[18, 0.688, 0.862, 1.067, 1.330, 1.734, 2.101, 2.214, 2.552, 2.878, 3.197, 3.611, 3.922], -[19, 0.688, 0.861, 1.066, 1.328, 1.729, 2.093, 2.205, 2.539, 2.861, 3.174, 3.579, 3.883], -[20, 0.687, 0.860, 1.064, 1.325, 1.725, 2.086, 2.197, 2.528, 2.845, 3.153, 3.552, 3.850], -[21, 0.663, 0.859, 1.063, 1.323, 1.721, 2.080, 2.189, 2.518, 2.831, 3.135, 3.527, 3.819], -[22, 0.686, 0.858, 1.061, 1.321, 1.717, 2.074, 2.183, 2.508, 2.819, 3.119, 3.505, 3.792], -[23, 0.685, 0.858, 1.060, 1.319, 1.714, 2.069, 2.177, 2.500, 2.807, 3.104, 3.485, 3.768], -[24, 0.685, 0.857, 1.059, 1.318, 1.711, 2.064, 2.172, 2.492, 2.797, 3.091, 3.467, 3.745], -[25, 0.684, 0.856, 1.058, 1.316, 1.708, 2.060, 2.167, 2.485, 2.787, 3.078, 3.450, 3.725], -[26, 0.684, 0.856, 1.058, 1.315, 1.706, 2.056, 2.162, 2.479, 2.779, 3.067, 3.435, 3.707], -[27, 0.684, 0.855, 1.057, 1.314, 1.703, 2.052, 2.15, 2.473, 2.771, 3.057, 3.421, 3.690], -[28, 0.683, 0.855, 1.056, 1.313, 1.701, 2.048, 2.154, 2.467, 2.763, 3.047, 3.408, 3.674], -[29, 0.683, 0.854, 1.055, 1.311, 1.699, 2.045, 2.150, 2.462, 2.756, 3.038, 3.396, 3.659], -[30, 0.683, 0.854, 1.055, 1.310, 1.697, 2.042, 2.147, 2.457, 2.750, 3.030, 3.385, 3.646], -[40, 0.681, 0.851, 1.050, 1.303, 1.684, 2.021, 2.123, 2.423, 2.704, 2.971, 3.307, 3.551], -[50, 0.679, 0.849, 1.047, 1.295, 1.676, 2.009, 2.109, 2.403, 2.678, 2.937, 3.261, 3.496], -[60, 0.679, 0.848, 1.045, 1.296, 1.671, 2.000, 2.099, 2.390, 2.660, 2.915, 3.232, 3.460], -[80, 0.678, 0.846, 1.043, 1.292, 1.664, 1.990, 2.088, 2.374, 2.639, 2.887, 3.195, 3.416], -[100, 0.677, 0.845, 1.042, 1.290, 1.660, 1.984, 2.081, 2.364, 2.626, 2.871, 3.174, 3.390], -[1000, 0.675, 0.842, 1.037, 1.282, 1.646, 1.962, 2.056, 2.330, 2.581, 2.813, 3.098, 3.300]] + [[0, 0.25, 0.20, 0.15, 0.10, 0.05, 0.025, 0.02, 0.01, 0.005, 0.0025, 0.001, 0.0005], + [1, 1.000, 1.376, 1.963, 3.078, 6.314, 12.71, + 15.89, 31.82, 63.66, 127.3, 318.3, 636.6], + [2, 0.816, 1.061, 1.386, 1.886, 2.920, 4.303, + 4.849, 6.965, 9.925, 14.09, 22.33, 31.60], + [3, 0.765, 0.978, 1.250, 1.638, 2.353, 3.182, + 3.482, 4.541, 5.841, 7.453, 10.21, 12.92], + [4, 0.741, 0.941, 1.190, 1.533, 2.132, 2.776, + 2.999, 3.747, 4.604, 5.598, 7.173, 8.610], + [5, 0.727, 0.920, 1.156, 1.476, 2.015, 2.571, + 2.757, 3.365, 4.032, 4.773, 5.893, 6.869], + [6, 0.718, 0.906, 1.134, 1.440, 1.943, 2.447, + 2.612, 3.143, 3.707, 4.317, 5.208, 5.959], + [7, 0.711, 0.896, 1.119, 1.415, 1.895, 2.365, + 2.517, 2.998, 3.499, 4.029, 4.785, 5.408], + [8, 0.706, 0.889, 1.108, 1.397, 1.860, 2.306, + 2.449, 2.896, 3.355, 3.833, 4.501, 5.041], + [9, 0.703, 0.883, 1.100, 1.383, 1.833, 2.262, + 2.398, 2.821, 3.250, 3.690, 4.297, 4.781], + [10, 0.700, 0.879, 1.093, 1.372, 1.812, 2.228, + 2.359, 2.764, 3.169, 3.581, 4.144, 4.587], + [11, 0.697, 0.876, 1.088, 1.363, 1.796, 2.201, + 2.328, 2.718, 3.106, 3.497, 4.025, 4.437], + [12, 0.695, 0.873, 1.083, 1.356, 1.782, 2.179, + 2.303, 2.681, 3.055, 3.428, 3.930, 4.318], + [13, 0.694, 0.870, 1.079, 1.350, 1.771, 2.160, + 2.282, 2.650, 3.012, 3.372, 3.852, 4.221], + [14, 0.692, 0.868, 1.076, 1.345, 1.761, 2.145, + 2.264, 2.624, 2.977, 3.326, 3.787, 4.140], + [15, 0.691, 0.866, 1.074, 1.341, 1.753, 2.131, + 2.249, 2.602, 2.947, 3.286, 3.733, 4.073], + [16, 0.690, 0.865, 1.071, 1.337, 1.746, 2.120, + 2.235, 2.583, 2.921, 3.252, 3.686, 4.015], + [17, 0.689, 0.863, 1.069, 1.333, 1.740, 2.110, + 2.224, 2.567, 2.898, 3.222, 3.646, 3.965], + [18, 0.688, 0.862, 1.067, 1.330, 1.734, 2.101, + 2.214, 2.552, 2.878, 3.197, 3.611, 3.922], + [19, 0.688, 0.861, 1.066, 1.328, 1.729, 2.093, + 2.205, 2.539, 2.861, 3.174, 3.579, 3.883], + [20, 0.687, 0.860, 1.064, 1.325, 1.725, 2.086, + 2.197, 2.528, 2.845, 3.153, 3.552, 3.850], + [21, 0.663, 0.859, 1.063, 1.323, 1.721, 2.080, + 2.189, 2.518, 2.831, 3.135, 3.527, 3.819], + [22, 0.686, 0.858, 1.061, 1.321, 1.717, 2.074, + 2.183, 2.508, 2.819, 3.119, 3.505, 3.792], + [23, 0.685, 0.858, 1.060, 1.319, 1.714, 2.069, + 2.177, 2.500, 2.807, 3.104, 3.485, 3.768], + [24, 0.685, 0.857, 1.059, 1.318, 1.711, 2.064, + 2.172, 2.492, 2.797, 3.091, 3.467, 3.745], + [25, 0.684, 0.856, 1.058, 1.316, 1.708, 2.060, + 2.167, 2.485, 2.787, 3.078, 3.450, 3.725], + [26, 0.684, 0.856, 1.058, 1.315, 1.706, 2.056, + 2.162, 2.479, 2.779, 3.067, 3.435, 3.707], + [27, 0.684, 0.855, 1.057, 1.314, 1.703, 2.052, + 2.15, 2.473, 2.771, 3.057, 3.421, 3.690], + [28, 0.683, 0.855, 1.056, 1.313, 1.701, 2.048, + 2.154, 2.467, 2.763, 3.047, 3.408, 3.674], + [29, 0.683, 0.854, 1.055, 1.311, 1.699, 2.045, + 2.150, 2.462, 2.756, 3.038, 3.396, 3.659], + [30, 0.683, 0.854, 1.055, 1.310, 1.697, 2.042, + 2.147, 2.457, 2.750, 3.030, 3.385, 3.646], + [40, 0.681, 0.851, 1.050, 1.303, 1.684, 2.021, + 2.123, 2.423, 2.704, 2.971, 3.307, 3.551], + [50, 0.679, 0.849, 1.047, 1.295, 1.676, 2.009, + 2.109, 2.403, 2.678, 2.937, 3.261, 3.496], + [60, 0.679, 0.848, 1.045, 1.296, 1.671, 2.000, + 2.099, 2.390, 2.660, 2.915, 3.232, 3.460], + [80, 0.678, 0.846, 1.043, 1.292, 1.664, 1.990, + 2.088, 2.374, 2.639, 2.887, 3.195, 3.416], + [100, 0.677, 0.845, 1.042, 1.290, 1.660, 1.984, + 2.081, 2.364, 2.626, 2.871, 3.174, 3.390], + [1000, 0.675, 0.842, 1.037, 1.282, 1.646, 1.962, 2.056, 2.330, 2.581, 2.813, 3.098, 3.300]] diff -Nru sumo-0.21.0+dfsg/tools/bin/traceExporter.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/bin/traceExporter.py --- sumo-0.21.0+dfsg/tools/bin/traceExporter.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/bin/traceExporter.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,252 +0,0 @@ -#!/usr/bin/env python -""" -A script for converting SUMO's fcd-output into files readable by PHEM and communication simulators. - -@file traceExporter.py -@author Daniel Krajzewicz -@author Jakob Erdmann -@author Michael Behrisch -@date 2013-01-15 -@version $Id: traceExporter.py 16005 2014-03-24 12:46:02Z cschmidt87 $ - -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2013-2014 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. -""" - -from __future__ import print_function -import os, sys, random, datetime -sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'tools')) -sys.path.append(os.path.join(os.environ.get("SUMO_HOME", os.path.join(os.path.dirname(__file__), '..', '..')), 'tools')) - -import sumolib.net -import sumolib.output.convert.phem as phem -import sumolib.output.convert.omnet as omnet -import sumolib.output.convert.shawn as shawn -import sumolib.output.convert.ns2 as ns2 -import sumolib.output.convert.gpsdat as gpsdat -import sumolib.output.convert.gpx as gpx -import sumolib.output.convert.poi as poi - -class FCDVehicleEntry: - def __init__(self, id, x, y, z, speed, typev, lane, slope): - self.id = id - self.x = x - self.y = y - self.z = z - self.speed = speed - self.type = typev - self.lane = lane - self.slope = slope - - -class FCDTimeEntry: - def __init__(self, t): - self.time = t - self.vehicle = [] - -def disturb_gps(x, y, deviation): - if deviation == 0: - return x, y - x += random.gauss(0, deviation) - y += random.gauss(0, deviation) - return x, y - -def _getOutputStream(name): - if not name: - return None - return open(name, "w") - -def _closeOutputStream(strm): - if strm: strm.close() - - -def procFCDStream(fcdstream, options): - pt = -1 # "prior" time step - lt = -1 # "last" time step - ft = -1 # "first" time step - lastExported = -1 - chosen = {} - for i,q in enumerate(fcdstream): - pt = lt - lt = float(q.time.encode("latin1")) - if ft<0: - # this is the first step contained in the simulation - ft = lt # save it for later purposes - if options.begin and options.begin>lt: - continue # do not export steps before a set begin - if options.end and options.end<=lt: - continue # do not export steps after a set end - if lastExported>=0 and (options.delta and options.delta+lastExported>lt): - continue # do not export between delta-t, if set - lastExported = lt - e = FCDTimeEntry(lt) - if q.vehicle: - for v in q.vehicle: - if v.id not in chosen: - chosen[v.id] = random.random() < options.penetration - if chosen[v.id]: - x, y = disturb_gps(float(v.x), float(v.y), options.blur) - if v.z: z = v.z - else: z = 0 - e.vehicle.append(FCDVehicleEntry(v.id, x, y, z, v.speed, v.type, v.lane, v.slope)) - yield e - t = lt-pt+lt - yield FCDTimeEntry(t) - -def runMethod(inputFile, outputFile, writer, options, further={}): - further["app"] = os.path.split(__file__)[1] - if options.base >= 0: - further["base-date"] = datetime.datetime.fromtimestamp(options.base) - else: - further["base-date"] = datetime.datetime.now() - o = _getOutputStream(outputFile) - fcdStream = sumolib.output.parse(inputFile, "timestep") - ret = writer(procFCDStream(fcdStream, options), o, further) - _closeOutputStream(o) - return ret - - -def main(args=None): - """The main function; parses options and converts...""" - ## ---------- build and read options ---------- - from optparse import OptionParser - optParser = OptionParser() - optParser.add_option("-i", "--fcd-input", dest="fcd", metavar="FILE", - help="Defines the FCD-output file to use as input") - optParser.add_option("-n", "--net-input", dest="net", metavar="FILE", - help="Defines the network file to use as input") - optParser.add_option("-p", "--penetration", type="float", dest="penetration", - default=1., help="Defines the percentage (0-1) of vehicles to export") - optParser.add_option("-b", "--begin", dest="begin", - type="float", help="Defines the first step to export") - optParser.add_option("-e", "--end", dest="end", - type="float", help="Defines the first step not longer to export") - optParser.add_option("-d", "--delta-t", dest="delta", - type="float", help="Defines the export step length") - optParser.add_option("--gps-blur", dest="blur", default=0, - type="float", help="Defines the GPS blur") - optParser.add_option("-s", "--seed", dest="seed", default=42, - type="float", help="Defines the randomizer seed") - optParser.add_option("--base-date", dest="base", default=-1, type="int", help="Defines the base date") - # PHEM - optParser.add_option("--dri-output", dest="dri", metavar="FILE", - help="Defines the name of the PHEM .dri-file to generate") - optParser.add_option("--str-output", dest="str", metavar="FILE", - help="Defines the name of the PHEM .str-file to generate") - optParser.add_option("--fzp-output", dest="fzp", metavar="FILE", - help="Defines the name of the PHEM .fzp-file to generate") - optParser.add_option("--flt-output", dest="flt", metavar="FILE", - help="Defines the name of the PHEM .flt-file to generate") - # OMNET - optParser.add_option("--omnet-output", dest="omnet", metavar="FILE", - help="Defines the name of the OMNET file to generate") - # Shawn - optParser.add_option("--shawn-output", dest="shawn", metavar="FILE", - help="Defines the name of the Shawn file to generate") - # ns2 - optParser.add_option("--ns2activity-output", dest="ns2activity", metavar="FILE", - help="Defines the name of the ns2 file to generate") - optParser.add_option("--ns2config-output", dest="ns2config", metavar="FILE", - help="Defines the name of the ns2 file to generate") - optParser.add_option("--ns2mobility-output", dest="ns2mobility", metavar="FILE", - help="Defines the name of the ns2 file to generate") - # GPSDAT - optParser.add_option("--gpsdat-output", dest="gpsdat", metavar="FILE", - help="Defines the name of the gpsdat file to generate") - - # GPX - optParser.add_option("--gpx-output", dest="gpx", metavar="FILE", - help="Defines the name of the gpx file to generate") - # POI - optParser.add_option("--poi-output", dest="poi", metavar="FILE", - help="Defines the name of the poi file to generate") - # parse - options, remaining_args = optParser.parse_args(args=args) - - if options.seed: - random.seed(options.seed) - ## ---------- process ---------- - net = None - ## ----- check needed values - if options.delta and options.delta<=0: - print("delta-t must be a positive value.") - return 1 - # phem - if (options.dri or options.fzp or options.flt) and not options.fcd: - print("A fcd-output from SUMO must be given using the --fcd-input.") - return 1 - if (options.str or options.fzp or options.flt) and not options.net: - print("A SUMO network must be given using the --net-input option.") - return 1 - # omnet - if options.omnet and not options.fcd: - print("A fcd-output from SUMO must be given using the --fcd-input.") - return 1 - ## ----- check needed values - - ## ----- OMNET - if options.omnet: runMethod(options.fcd, options.omnet, omnet.fcd2omnet, options) - ## ----- OMNET - - ## ----- Shawn - if options.shawn: runMethod(options.fcd, options.shawn, shawn.fcd2shawn, options) - ## ----- Shawn - - ## ----- GPSDAT - if options.gpsdat: runMethod(options.fcd, options.gpsdat, gpsdat.fcd2gpsdat, options) - ## ----- GPSDAT - - ## ----- GPX - if options.gpx: runMethod(options.fcd, options.gpx, gpx.fcd2gpx, options) - ## ----- GPX - - ## ----- GPX - if options.poi: runMethod(options.fcd, options.poi, poi.fcd2poi, options) - ## ----- GPX - - ## ----- ns2 - if options.ns2mobility or options.ns2config or options.ns2activity: - vIDm, vehInfo, begin, end, area = runMethod(options.fcd, options.ns2mobility, ns2.fcd2ns2mobility, options) - if options.ns2activity: - o = _getOutputStream(options.ns2activity) - ns2.writeNS2activity(o, vehInfo) - _closeOutputStream(o) - if options.ns2config: - o = _getOutputStream(options.ns2config) - ns2.writeNS2config(o, vehInfo, options.ns2activity, options.ns2mobility, begin, end, area) - _closeOutputStream(o) - ## ----- ns2 - - ## ----- PHEM - # .dri - if options.dri: runMethod(options.fcd, options.dri, phem.fcd2dri, options) - # .str (we need the net for other outputs, too) - if options.str or options.fzp or options.flt: - if not options.net: - print("A SUMO network must be given using the --net-input option.") - return 1 - if not net: net = sumolib.net.readNet(options.net) - o = _getOutputStream(options.str) - sIDm = phem.net2str(net, o) - _closeOutputStream(o) - # .fzp - if options.flt or options.fzp: - vIDm, vtIDm = runMethod(options.fcd, options.fzp, phem.fcd2fzp, options, {"phemStreetMap":sIDm}) - # .flt - if options.flt: - o = _getOutputStream(options.flt) - phem.vehicleTypes2flt(o, vtIDm) - _closeOutputStream(o) - ## ----- PHEM - return 0 - - -if __name__ == "__main__": - sys.exit(main(sys.argv)) - diff -Nru sumo-0.21.0+dfsg/tools/build/apply_astyle.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/apply_astyle.py --- sumo-0.21.0+dfsg/tools/build/apply_astyle.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/apply_astyle.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,13 +4,13 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2007 -@version $Id: apply_astyle.py 15692 2014-02-22 09:17:02Z behrisch $ +@version $Id: apply_astyle.py 18096 2015-03-17 09:50:59Z behrisch $ Applies astyle with the proper settings used in SUMO on all files in src. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -19,13 +19,31 @@ (at your option) any later version. """ -import os, subprocess +import os +import subprocess +try: + import autopep8 + autopep = True +except: + autopep = False srcRoot = os.path.join(os.path.dirname(__file__), "../../src/") for root, dirs, files in os.walk(srcRoot): for name in files: if name.endswith(".h") or name.endswith(".cpp"): - subprocess.call("astyle --style=java --unpad-paren --pad-header --pad-oper --add-brackets --indent-switches --align-pointer=type -n".split() + [os.path.join(root, name)]) + subprocess.call( + "astyle --style=java --unpad-paren --pad-header --pad-oper --add-brackets --indent-switches --align-pointer=type -n".split() + [os.path.join(root, name)]) + for ignoreDir in ['.svn', 'foreign']: + if ignoreDir in dirs: + dirs.remove(ignoreDir) + +if autopep: + sumoRoot = os.path.join(os.path.dirname(__file__), "../../") + for root, dirs, files in os.walk(sumoRoot): + for name in files: + if name.endswith(".py"): + subprocess.call( + "autopep8 --in-place".split() + [os.path.join(root, name)]) for ignoreDir in ['.svn', 'foreign']: if ignoreDir in dirs: dirs.remove(ignoreDir) diff -Nru sumo-0.21.0+dfsg/tools/build/buildHTMLDocs.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/buildHTMLDocs.py --- sumo-0.21.0+dfsg/tools/build/buildHTMLDocs.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/buildHTMLDocs.py 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,326 @@ +#!/usr/bin/env python +""" +@file buildHTMLDocs.py +@author Daniel Krajzewicz +@author Michael Behrisch +@date 2011-10-20 +@version $Id: buildHTMLDocs.py 18096 2015-03-17 09:50:59Z behrisch $ + +Converts wiki-documentation into HTML pages. + +Determines what to convert, first: if a command line argument is given, +it is interpreted as the page to convert. Otherwise, "Special:AllPages" is +downloaded and parsed for obtaining the list of all pages which will be +converted in subsequent steps. + +For each of the pages to convert, the HTML-representation of the +page is downloaded and stripped from wiki-header/footer, first. +Then, the image-links are extracted from the HTML page and stored +temporarily, the links themselves are patched to point to local pages/images +(if the page behind the link exists). +The page is saved into options.mirror/. + +After parsing all pages, the images are downloaded and stored into +options.mirror/images. + +After downloading all data, the title page is extracted and the content +included in this page is extracted. This content is embedded into "index.html" +between the / markers. +All pages downloaded earlier are loaded, and embedded into the index.html +between the / markers. Then, +the page is saved into options.output/. All images are copied +from options.mirror/images to options.output/images. + +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2011-2015 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. +""" +import urllib +import os +import sys +import shutil +import datetime +from optparse import OptionParser + +from mirrorWiki import readParsePage, readParseEditPage + + +def patchLinks(page, name): + images = set() + level = len(name.split("/")) - 1 + level = "../" * level + b = page.find("= 0: + # images/files + if page[b + 9:].startswith("/wiki/File:") or page[b + 9:].startswith("/wiki/Image:"): + b2 = b + b = page.find(":", b) + 1 + images.add(page[b2 + 9:page.find("\"", b)]) + page = page[:b2 + 9] + level + "images/" + page[b:] + # pages (HTML) + elif page[b + 9:].startswith("/wiki/"): + e = b + 9 + 6 + e2 = page.find("\"", b + 9) + link = page[e:e2] + if link.find("action=edit") < 0: + if link.find("#") > 0: + link = level + link.replace("#", ".html#") + elif link.find("#") < 0 and not (link.endswith(".png") or link.endswith(".jpg") or link.endswith(".svg")): + link = level + link + ".html" + page = page[:b + 9] + link + page[e2:] + else: + page = page[:b + 9] + "http://sourceforge.net/" + page[b + 10:] + b = page.find("= 0: + b += 5 + e = page.find("\"", b + 2) + add = page[b:e] + l = add[add.rfind("/"):] + if add.find("thumb") >= 0: + l = l[l.find("-") + 1:] + images.add(add) + page = page[:b] + level + "images/" + l + page[e:] + b = page.find("= 0: + # internal link + b = l.find("[") + 2 + e = l.find("]", b) + t = l[b:e] + if t.find("|") < 0: + link = t + text = t + else: + link, text = t.split("|") + link = link.replace(" ", "_") + if link.find("#") >= 0: + link = link.replace("#", ".html#") + else: + link = link + ".html" + # external link + elif l.find("[") >= 0: + b = l.find("[") + 1 + e = l.find("]", b) + t = l[b:e] + link = t[:t.find(" ")] + text = t[t.find(" ") + 1:] + else: + # text + text = l[l.find(" ") + 1:] + link = "" + return text, link + +optParser = OptionParser() +optParser.add_option("-m", "--mirror", default="mirror", help="mirror folder") +optParser.add_option("-o", "--output", default="docs", help="output folder") +optParser.add_option("-i", "--index", default=os.path.join(os.path.dirname( + __file__), "..", "..", "docs", "wiki", "index.html"), help="index template file") +optParser.add_option("-r", "--version", help="add version info") +(options, args) = optParser.parse_args() + +try: + os.mkdir(options.mirror) +except: + pass +try: + os.mkdir(options.mirror + "/images") +except: + pass +images = set() +if len(args) == 0: + p = readParsePage("Special:AllPages") + p = p[p.find(""):] + p = p[p.find(" 0: + try: + os.makedirs(os.path.join(options.mirror, name[:name.rfind("/")])) + except: + pass + if True: # name.find(".")<0: + c, pi, level = patchLinks(c, name) + for i in pi: + images.add(i) + c, pi = patchImages(c, name) + for i in pi: + images.add(i) + name = name + ".html" + fd = open(os.path.join(options.mirror, name), "w") + fd.write(c) + fd.close() + +imageFiles = [] +for i in images: + print "Fetching image %s" % i + if i.find(":") >= 0: + f = urllib.urlopen("http://sumo.dlr.de%s" % i) + c = f.read() + b = c.find("
") + b = c.find("href=", b) + 6 + e = c.find("\"", b + 1) + f = urllib.urlopen("http://sumo.dlr.de/%s" % c[b:e]) + i = i[i.find(":") + 1:] + else: + f = urllib.urlopen("http://sumo.dlr.de/%s" % i) + i = i[i.rfind("/") + 1:] + if i.find("px-") >= 0: + i = i[:i.find('-') + 1] + fd = open(os.path.join(options.mirror, "images", i), "wb") + fd.write(f.read()) + fd.close() + imageFiles.append(os.path.join("images", i)) + +# build navigation +nav = readParseEditPage("SUMO_User_Documentation") +lines = nav[nav.find("="):].split("\n") +level = 0 +c = "" +hadHeader = False +for l in lines: + if len(l) == 0: + continue + if l[0] == '=': + text, link = parseWikiLink(" " + l.replace("=", "")) + if hadHeader: + if level > 0: + c += "\n" * level + spc = ' ' * (level + 1) + c = c + spc + "
  • " + if link != "": + c = c + "" + c = c + text + if link != "": + c = c + "" + c = c + "
  • \n" + hadHeader = True + level = 0 + continue + if l[0].find('*') < 0: + continue + text, link = parseWikiLink(l) + nLevel = l.count('*') + if level > nLevel: + c = c + ("\n" * (level - nLevel)) + if level < nLevel: + c = c + \ + ('
    • \n' * + (nLevel - level)) + spc = ' ' * (nLevel + 1) + #+ str(level) + "-" + str(nLevel) + c = c + spc + "
    • " + if link != "": + c = c + '' + text + '' + else: + c = c + text + c = c + "
    • \n" + level = nLevel +if level > 0: + c += "
  • \n" * level + +# get template and embed navigation +fd = open(options.index) +tpl = fd.read() +fd.close() +b = tpl.find("") +b = tpl.find(">", b) + 1 +e = tpl.find("") +tpl = tpl[:b] + c + tpl[e:] + +# build HTML pages +try: + os.mkdir(options.output) +except: + pass +try: + os.mkdir(options.output + "/images") +except: + pass +for p in pages: + if not p.startswith("href"): + continue + b = p.find("/wiki/") + e = p.find("\"", b) + name = p[b + 6:e] + if name.endswith(".css"): + print "Skipping css-file %s" % name + continue + fromStr = 'generated on %s from the wiki page for %s' % ( + datetime.datetime.now(), name, name) + name = name + ".html" + t = os.path.join(options.output, name) + fd = open(os.path.join(options.mirror, name)) + c = fd.read() + if options.version: + fromStr += " for SUMO %s" % options.version + c = c.replace( + '
    From Sumo
    ', '
    %s
    ' % fromStr) + fd.close() + # + if name.find('/') >= 0: + level = name.count("/") + else: + level = name.count("\\") + level = "../" * level + # title + cc = tpl.replace("", "<title>" + name[:name.rfind(".html")] + " - ") + # css inclusion + cc = cc.replace("sumo.css", level + "sumo.css") + cc = cc.replace("logo.png", level + "logo.png") + # links + b = cc.find("<a href=") + while b >= 0: + b = cc.find('"', b) + if not cc[b + 1:].startswith("http"): + cc = cc[:b + 1] + level + cc[b + 1:] + b = cc.find("<a href=", b) + # content + b = cc.find("<!-- content begins -->") + e = cc.find("<!-- content ends -->", b) + e = cc.find("<", e + 1) - 1 + cc = cc[:b] + c + cc[e:] + + try: + os.makedirs(os.path.split(t)[0]) + except: + pass + fd = open(t, "w") + fd.write(cc) + fd.close() +for i in imageFiles: + shutil.copy( + os.path.join(options.mirror, i), os.path.join(options.output, i)) +if os.path.exists(os.path.join(options.output, 'SUMO_User_Documentation.html')): + shutil.copy(os.path.join(options.output, 'SUMO_User_Documentation.html'), + os.path.join(options.output, 'index.html')) diff -Nru sumo-0.21.0+dfsg/tools/build/checkAuthors.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/checkAuthors.py --- sumo-0.21.0+dfsg/tools/build/checkAuthors.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/checkAuthors.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2011-11-07 -@version $Id: checkAuthors.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: checkAuthors.py 18096 2015-03-17 09:50:59Z behrisch $ Checks authors for all files. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -18,12 +18,17 @@ (at your option) any later version. """ -import os, subprocess, sys, xml.sax +import os +import subprocess +import sys +import xml.sax from optparse import OptionParser _SOURCE_EXT = [".h", ".cpp", ".py", ".pl", ".java"] + class PropertyReader(xml.sax.handler.ContentHandler): + """Reads the svn properties of files as written by svn log --xml""" def __init__(self, outfile): @@ -55,7 +60,7 @@ e = ticket + 1 while e < len(msg) and msg[e].isdigit(): e += 1 - if msg[ticket+1:e] not in ignoreTickets: + if msg[ticket + 1:e] not in ignoreTickets: keep = True break ticket = msg.find("#", e) @@ -79,6 +84,7 @@ pass authorFiles["thank"].add(self._out.name) + def checkAuthors(fullName, pattern): authors = set() found = False @@ -95,16 +101,18 @@ print >> log, "no author", fullName return authors + def setAuthors(fullName, removal, add, pattern): if options.fix: - out = open(fullName+".tmp", "w") + out = open(fullName + ".tmp", "w") authors = [] for line in open(fullName): if line.startswith(pattern): for item in line[len(pattern):].split(","): a = item.strip() if a in removal: - print >> log, "author %s not in svn log for %s" % (a, fullName) + print >> log, "author %s not in svn log for %s" % ( + a, fullName) authors.append(a) elif authors: if options.fix: @@ -127,17 +135,19 @@ "6399", "6069", "5922", "5048", "4669", "4389", "4257", "4166", "4165", "4084", "4076", "4015", "3966", "3486"]) ignoreTickets = set(["2", "22", "409"]) -sumoRoot = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +sumoRoot = os.path.dirname( + os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) optParser = OptionParser() optParser.add_option("-v", "--verbose", action="store_true", default=False, help="tell me what you are doing") optParser.add_option("-f", "--fix", action="store_true", - default=False, help="fix invalid svn properties") + default=False, help="fix invalid svn properties") optParser.add_option("-a", "--authors", action="store_true", - default=False, help="print author files") -optParser.add_option("-r", "--root", default=sumoRoot, help="root to start parsing at") + default=False, help="print author files") +optParser.add_option( + "-r", "--root", default=sumoRoot, help="root to start parsing at") (options, args) = optParser.parse_args() -authorFiles = {"thank":set()} +authorFiles = {"thank": set()} realNames = {} for line in open(os.path.join(sumoRoot, 'AUTHORS')): entries = line.split() @@ -171,17 +181,19 @@ print >> log, "cannot parse for authors", fullName continue authors = checkAuthors(fullName, pattern) - p = subprocess.Popen(["svn", "log", "--xml", fullName], stdout=subprocess.PIPE) + p = subprocess.Popen( + ["svn", "log", "--xml", fullName], stdout=subprocess.PIPE) output = p.communicate()[0] if p.returncode == 0: if options.authors: - out = open(fullName+".authors", "w") + out = open(fullName + ".authors", "w") else: out = open(os.devnull, "w") pr = PropertyReader(out) xml.sax.parseString(output, pr) out.close() - setAuthors(fullName, authors - pr._authors, pr._authors - authors, pattern) + setAuthors( + fullName, authors - pr._authors, pr._authors - authors, pattern) for ignoreDir in ['.svn', 'foreign', 'contributed', 'foxtools']: if ignoreDir in dirs: dirs.remove(ignoreDir) diff -Nru sumo-0.21.0+dfsg/tools/build/checkSvnProps.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/checkSvnProps.py --- sumo-0.21.0+dfsg/tools/build/checkSvnProps.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/checkSvnProps.py 2015-04-17 05:44:20.000000000 +0000 @@ -3,12 +3,12 @@ @file checkSvnProps.py @author Michael Behrisch @date 2010-08-29 -@version $Id: checkSvnProps.py 15697 2014-02-22 10:02:20Z behrisch $ +@version $Id: checkSvnProps.py 18096 2015-03-17 09:50:59Z behrisch $ Checks svn property settings for all files. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -17,21 +17,27 @@ (at your option) any later version. """ -import os, subprocess, sys, xml.sax +import os +import subprocess +import sys +import xml.sax from optparse import OptionParser _SOURCE_EXT = [".h", ".cpp", ".py", ".pl", ".java", ".am"] _TESTDATA_EXT = [".xml", ".prog", ".csv", - ".complex", ".dfrouter", ".duarouter", ".jtrrouter", + ".complex", ".dfrouter", ".duarouter", ".jtrrouter", ".marouter", ".astar", ".chrouter", ".internal", ".tcl", ".txt", ".netconvert", ".netgen", ".od2trips", ".polyconvert", ".sumo", ".meso", ".tools", ".traci", ".activitygen", ".scenario", ".sumocfg", ".netccfg", ".netgcfg"] -_VS_EXT = [".vsprops", ".sln", ".vcproj", ".bat", ".props", ".vcxproj", ".filters"] +_VS_EXT = [".vsprops", ".sln", ".vcproj", + ".bat", ".props", ".vcxproj", ".filters"] _IGNORE = set(["binstate.sumo", "binstate.sumo.meso", "image.tools"]) _KEYWORDS = "HeadURL Id LastChangedBy LastChangedDate LastChangedRevision" + class PropertyReader(xml.sax.handler.ContentHandler): + """Reads the svn properties of files as written by svn pl -v --xml""" def __init__(self, doFix): @@ -53,7 +59,6 @@ if self._property: self._value += content - def endElement(self, name): ext = os.path.splitext(self._file)[1] if name == 'property' and self._property == "svn:eol-style": @@ -65,32 +70,39 @@ if name == 'property' and self._property == "svn:executable" and ext not in [".py", ".pl", ".bat"]: print self._file, self._property, self._value if self._fix: - subprocess.call(["svn", "pd", "svn:executable", self._file]) + subprocess.call( + ["svn", "pd", "svn:executable", self._file]) if name == 'property' and self._property == "svn:mime-type": print self._file, self._property, self._value if self._fix: - subprocess.call(["svn", "pd", "svn:mime-type", self._file]) + subprocess.call( + ["svn", "pd", "svn:mime-type", self._file]) if ext in _SOURCE_EXT or ext in _TESTDATA_EXT: if name == 'property' and self._property == "svn:eol-style" and self._value != "LF"\ or name == "target" and not self._hadEOL: print self._file, "svn:eol-style", self._value if self._fix: if os.name == "posix": - subprocess.call(["sed", "-i", r's/\r$//', self._file]) - subprocess.call(["sed", "-i", r's/\r/\n/g', self._file]) - subprocess.call(["svn", "ps", "svn:eol-style", "LF", self._file]) + subprocess.call( + ["sed", "-i", r's/\r$//', self._file]) + subprocess.call( + ["sed", "-i", r's/\r/\n/g', self._file]) + subprocess.call( + ["svn", "ps", "svn:eol-style", "LF", self._file]) if ext in _SOURCE_EXT: if name == 'property' and self._property == "svn:keywords" and self._value != _KEYWORDS\ or name == "target" and not self._hadKeywords: print self._file, "svn:keywords", self._value if self._fix: - subprocess.call(["svn", "ps", "svn:keywords", _KEYWORDS, self._file]) + subprocess.call( + ["svn", "ps", "svn:keywords", _KEYWORDS, self._file]) if ext in _VS_EXT: if name == 'property' and self._property == "svn:eol-style" and self._value != "CRLF"\ or name == "target" and not self._hadEOL: print self._file, "svn:eol-style", self._value if self._fix: - subprocess.call(["svn", "ps", "svn:eol-style", "CRLF", self._file]) + subprocess.call( + ["svn", "ps", "svn:eol-style", "CRLF", self._file]) if name == 'property': self._value = "" self._property = None @@ -99,15 +111,16 @@ self._hadKeywords = False -sumoRoot = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +sumoRoot = os.path.dirname( + os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) svnRoots = [sumoRoot] optParser = OptionParser() optParser.add_option("-v", "--verbose", action="store_true", default=False, help="tell me what you are doing") optParser.add_option("-f", "--fix", action="store_true", - default=False, help="fix invalid svn properties") + default=False, help="fix invalid svn properties") optParser.add_option("-r", "--recheck", - default=sumoRoot, help="fully recheck all files in given dir") + default=sumoRoot, help="fully recheck all files in given dir") (options, args) = optParser.parse_args() seen = set() if len(args) > 0: @@ -119,12 +132,13 @@ svnRoots.append(os.path.join(upDir, l.split()[0])) for svnRoot in svnRoots: if options.verbose: - print "checking", svnRoot - output = subprocess.Popen(["svn", "pl", "-v", "-R", "--xml", svnRoot], stdout=subprocess.PIPE).communicate()[0] + print "checking", svnRoot + output = subprocess.Popen( + ["svn", "pl", "-v", "-R", "--xml", svnRoot], stdout=subprocess.PIPE).communicate()[0] xml.sax.parseString(output, PropertyReader(options.fix)) if options.verbose: - print "re-checking tree at", options.recheck + print "re-checking tree at", options.recheck for root, dirs, files in os.walk(options.recheck): for name in files: fullName = os.path.join(root, name) @@ -136,15 +150,18 @@ print fullName, "svn:eol-style" if options.fix: if ext in _VS_EXT: - subprocess.call(["svn", "ps", "svn:eol-style", "CRLF", fullName]) + subprocess.call( + ["svn", "ps", "svn:eol-style", "CRLF", fullName]) else: if os.name == "posix": subprocess.call(["sed", "-i", 's/\r$//', fullName]) - subprocess.call(["svn", "ps", "svn:eol-style", "LF", fullName]) + subprocess.call( + ["svn", "ps", "svn:eol-style", "LF", fullName]) if ext in _SOURCE_EXT: print fullName, "svn:keywords" if options.fix: - subprocess.call(["svn", "ps", "svn:keywords", _KEYWORDS, fullName]) + subprocess.call( + ["svn", "ps", "svn:keywords", _KEYWORDS, fullName]) for ignoreDir in ['.svn', 'foreign', 'contributed', 'texttesttmp']: if ignoreDir in dirs: dirs.remove(ignoreDir) diff -Nru sumo-0.21.0+dfsg/tools/build/configTemplateToWiki.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/configTemplateToWiki.py --- sumo-0.21.0+dfsg/tools/build/configTemplateToWiki.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/configTemplateToWiki.py 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,102 @@ +#!/usr/bin/env python +""" +@file configTemplateToWiki.py +@author Michael Behrisch +@date 2012-01-26 +@version $Id: configTemplateToWiki.py 18096 2015-03-17 09:50:59Z behrisch $ + +Generate Wiki table from configuration template. + +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 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. +""" +import os +import sys +from xml.sax import parse, handler + +from mirrorWiki import readParseEditPage + + +class ConfigReader(handler.ContentHandler): + + def __init__(self, mergeWikiTxt): + self._level = 0 + self._mergeWiki = mergeWikiTxt + self._intro = {} + self._end = len(mergeWikiTxt) + active = False + currSect = "" + for idx, line in enumerate(mergeWikiTxt): + line = line.strip('\n\r') + if line == "==Options==": + active = True + if active: + if line[:3] == "===": + start = idx + currSect = line + elif line[:2] == "{|": + self._intro[currSect] = (start, idx) + elif line[:4] == "----" or (len(line) > 2 and line[0] == "=" and line[1] != "="): + self._end = idx + break + if currSect == "": + print line + + def startElement(self, name, attrs): + if self._level == 1: + # subtopic + title = "===%s===" % name.replace("_", " ").title() + if title in self._intro: + begin, end = self._intro[title] + title = ("".join(self._mergeWiki[begin:end])) + else: + title += "\n" + print """%s{| class="wikitable" style="width:90%%" +|- +! style="background:#ddffdd; vertical-align:top; width:350px" | Option +! style="background:#ddffdd; vertical-align:top" | Description""" % title + if self._level == 2: + # entry + print '|-\n| style="vertical-align:top" |', + a = "" + for s in attrs.get('synonymes', '').split(): + if len(s) == 1: + a = s + if a != "": + print '{{Option|-%s {{DT_%s}}}}<br/>' % (a, attrs['type']), + print '{{Option|--%s {{DT_%s}}}}' % (name, attrs['type']) + suffix = "" + if attrs['value']: + suffix = "; ''default: '''%s'''''" % attrs['value'] + print '| style="vertical-align:top" | %s%s' % (attrs['help'], suffix) + self._level += 1 + + def endElement(self, name): + self._level -= 1 + if self._level == 1: + # subtopic end + print "|-\n|}\n" + + def endDocument(self): + print ("".join(self._mergeWiki[self._end:])).strip() + +if __name__ == "__main__": + if len(sys.argv) == 2: + app = sys.argv[1].lower() + if app == "netgenerate": + app = "netgen" + cfg = os.path.join(os.path.dirname( + __file__), "..", "..", "tests", app, "meta", "write_template_full", "cfg." + app) + parse( + cfg, ConfigReader(readParseEditPage(sys.argv[1].upper()).splitlines(True))) + elif len(sys.argv) == 3: + parse(sys.argv[1], ConfigReader(open(sys.argv[2]).readlines())) + else: + print >> sys.stderr, "Usage: %s <template> <wikisrc>\n or: %s <app>" % ( + os.path.basename(__file__), os.path.basename(__file__)) diff -Nru sumo-0.21.0+dfsg/tools/build/dailyBuildMSVC.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/dailyBuildMSVC.py --- sumo-0.21.0+dfsg/tools/build/dailyBuildMSVC.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/dailyBuildMSVC.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,15 +5,15 @@ @author Jakob Erdmann @author Laura Bieker @date 2008 -@version $Id: dailyBuildMSVC.py 16543 2014-06-05 20:41:32Z behrisch $ +@version $Id: dailyBuildMSVC.py 18096 2015-03-17 09:50:59Z behrisch $ Does the nightly svn update on the windows server and the visual studio build. The script is also used for the meso build. Some paths especially for the temp dir and the compiler are hard coded into this script. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -22,15 +22,25 @@ (at your option) any later version. """ from __future__ import with_statement -import re, io +import re +import io from datetime import date -import optparse, os, glob, subprocess, zipfile, shutil, datetime, sys -import status, wix +import optparse +import os +import glob +import subprocess +import zipfile +import shutil +import datetime +import sys +import status +import wix optParser = optparse.OptionParser() optParser.add_option("-r", "--root-dir", dest="rootDir", default=r"D:\Sumo", help="root for svn and log output") -optParser.add_option("-s", "--suffix", default="", help="suffix to the fileprefix") +optParser.add_option( + "-s", "--suffix", default="", help="suffix to the fileprefix") optParser.add_option("-p", "--project", default=r"trunk\sumo\build\msvc10\prj.sln", help="path to project solution relative to the root dir") optParser.add_option("-b", "--bin-dir", dest="binDir", default=r"trunk\sumo\bin", @@ -53,19 +63,27 @@ import runInternalTests env = os.environ -env["SMTP_SERVER"]="smtprelay.dlr.de" -env["TEMP"]=env["TMP"]=r"D:\Delphi\texttesttmp" -nightlyDir=r"O:\Daten\Sumo\Nightly" -compiler=r"D:\Programme\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" -svnrev="" -for platform in ["Win32", "x64"]: - env["FILEPREFIX"]="msvc10" + options.suffix + platform +env["SMTP_SERVER"] = "smtprelay.dlr.de" +env["TEMP"] = env["TMP"] = r"D:\Delphi\texttesttmp" +env["REMOTEDIR_BASE"] = 'O:/Daten/Sumo' +compiler = r"D:\Programme\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" +svnrev = "" + +maxTime = 0 +sumoAllZip = None +for fname in glob.glob(r"O:\Daten\Sumo\Nightly\sumo-all-*.zip"): + if os.path.getmtime(fname) > maxTime: + maxTime = os.path.getmtime(fname) + sumoAllZip = fname +for platform, nightlyDir in [("Win32", r"O:\Daten\Sumo\Nightly"), ("x64", r"O:\Daten\Sumo\Nightly\bin64")]: + env["FILEPREFIX"] = "msvc10" + options.suffix + platform prefix = os.path.join(options.remoteDir, env["FILEPREFIX"]) makeLog = prefix + "Release.log" makeAllLog = prefix + "Debug.log" statusLog = prefix + "status.log" testLog = prefix + "test.log" - env["SUMO_BATCH_RESULT"] = os.path.join(options.rootDir, env["FILEPREFIX"]+"batch_result") + env["SUMO_BATCH_RESULT"] = os.path.join( + options.rootDir, env["FILEPREFIX"] + "batch_result") env["SUMO_REPORT"] = prefix + "report" binaryZip = os.path.join(nightlyDir, "sumo-%s-svn.zip" % env["FILEPREFIX"]) binDir = "sumo-svn/bin/" @@ -77,7 +95,8 @@ pass if platform == "Win32": with open(makeLog, 'w') as log: - subprocess.call("svn.exe up %s\\trunk" % options.rootDir, stdout=log, stderr=subprocess.STDOUT) + subprocess.call( + "svn.exe up %s\\trunk" % options.rootDir, stdout=log, stderr=subprocess.STDOUT) update_log = open(makeLog).read() match_rev = re.search('At revision (\d*)\.', update_log) if match_rev: @@ -85,117 +104,143 @@ else: open(makeLog, 'a').write("Error parsing svn revision\n") sys.exit() - end_marker = 'Fetching external' + end_marker = 'Fetching external' if end_marker in update_log: - update_lines = len(update_log[:update_log.index(end_marker)].splitlines()) + 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") + open(makeLog, 'a').write( + "No changes since last update, skipping build and test\n") print "No changes since last update, skipping build and test" sys.exit() - subprocess.call(compiler+" /rebuild Release|%s %s\\%s /out %s" % (platform, options.rootDir, options.project, makeLog)) + subprocess.call(compiler + " /rebuild Release|%s %s\\%s /out %s" % + (platform, options.rootDir, options.project, makeLog)) if options.addConf: - subprocess.call(compiler+" /rebuild %sRelease|%s %s\\%s /out %s" % (options.addConf, platform, options.rootDir, options.project, makeLog)) + subprocess.call(compiler + " /rebuild %sRelease|%s %s\\%s /out %s" % + (options.addConf, platform, options.rootDir, options.project, makeLog)) if options.addSln: - subprocess.call(compiler+" /rebuild Release|%s %s\\%s /out %s" % (platform, options.rootDir, options.addSln, makeLog)) + subprocess.call(compiler + " /rebuild Release|%s %s\\%s /out %s" % + (platform, options.rootDir, options.addSln, makeLog)) programSuffix = envSuffix = "" if platform == "x64": - envSuffix="_64" - programSuffix="64" + envSuffix = "_64" + programSuffix = "64" # we need to use io.open here due to http://bugs.python.org/issue16273 log = io.open(makeLog, 'a') try: - maxTime = 0 - for fname in glob.glob(os.path.join(nightlyDir, "sumo-all-*.zip")): - if os.path.getmtime(fname) > maxTime: - maxTime = os.path.getmtime(fname) - maxFile = fname - if maxTime > 0: - binaryZip = maxFile.replace("-all-", "-%s-" % env["FILEPREFIX"]) + if sumoAllZip: + binaryZip = sumoAllZip.replace("-all-", "-%s-" % env["FILEPREFIX"]) zipf = zipfile.ZipFile(binaryZip, 'w', zipfile.ZIP_DEFLATED) - srcZip = zipfile.ZipFile(maxFile) + srcZip = zipfile.ZipFile(sumoAllZip) write = False for f in srcZip.namelist(): if f.count('/') == 1: write = False if f.endswith('/') and f.count('/') == 2: - write = (f.endswith('/bin/') or f.endswith('/examples/') or f.endswith('/tools/') or f.endswith('/data/') or f.endswith('/docs/')) + write = (f.endswith('/bin/') or f.endswith('/examples/') + or f.endswith('/tools/') or f.endswith('/data/') or f.endswith('/docs/')) if f.endswith('/bin/'): binDir = f + elif f.endswith('/') and '/docs/' in f and f.count('/') == 3: + write = not f.endswith('/doxygen/') elif write or os.path.basename(f) in ["COPYING", "README"]: zipf.writestr(f, srcZip.read(f)) srcZip.close() else: zipf = zipfile.ZipFile(binaryZip, 'w', zipfile.ZIP_DEFLATED) 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-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")) + - glob.glob(os.path.join(options.rootDir, options.binDir, "*.bat"))) + 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-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")) + + glob.glob(os.path.join(options.rootDir, options.binDir, "*.bat"))) for f in files_to_zip: zipf.write(f, os.path.join(binDir, os.path.basename(f))) - if platform == "Win32" and not f.startswith(nightlyDir): + if not f.startswith(nightlyDir): try: shutil.copy2(f, nightlyDir) except IOError, (errno, strerror): - print >> log, "Warning: Could not copy %s to %s!" % (f, nightlyDir) + print >> log, "Warning: Could not copy %s to %s!" % ( + f, nightlyDir) print >> log, "I/O error(%s): %s" % (errno, strerror) zipf.close() shutil.copy2(binaryZip, options.remoteDir) - wix.buildMSI(binaryZip, binaryZip.replace(".zip", ".msi"), platformSuffix=programSuffix) + wix.buildMSI(binaryZip, binaryZip.replace( + ".zip", ".msi"), platformSuffix=programSuffix) shutil.copy2(binaryZip.replace(".zip", ".msi"), options.remoteDir) except IOError, (errno, strerror): print >> log, "Warning: Could not zip to %s!" % binaryZip print >> log, "I/O error(%s): %s" % (errno, strerror) if platform == "Win32" and options.sumoExe == "sumo": try: - setup = os.path.join(os.path.dirname(__file__), '..', 'game', 'setup.py') - subprocess.call(['python', setup], stdout=log, stderr=subprocess.STDOUT) + 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 + print >> log, "Warning: Could not create nightly sumo-game.zip! (%s)" % e + if platform == "x64" and options.sumoExe == "meso": + try: + setup = os.path.join( + os.path.dirname(__file__), '..', 'game', 'setup.py') + subprocess.call( + ['python', setup, 'internal'], stdout=log, stderr=subprocess.STDOUT) + except Exception as e: + print >> log, "Warning: Could not create nightly sumo-game-internal.zip! (%s)" % e log.close() - subprocess.call(compiler+" /rebuild Debug|%s %s\\%s /out %s" % (platform, options.rootDir, options.project, makeAllLog)) + subprocess.call(compiler + " /rebuild Debug|%s %s\\%s /out %s" % + (platform, options.rootDir, options.project, makeAllLog)) if options.addConf: - subprocess.call(compiler+" /rebuild %sDebug|%s %s\\%s /out %s" % (options.addConf, platform, options.rootDir, options.project, makeAllLog)) + subprocess.call(compiler + " /rebuild %sDebug|%s %s\\%s /out %s" % + (options.addConf, platform, options.rootDir, options.project, makeAllLog)) # run tests - env["TEXTTEST_TMP"] = os.path.join(options.rootDir, env["FILEPREFIX"]+"texttesttmp") + 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"] = os.path.join(os.path.dirname(__file__), '..', '..') shutil.rmtree(env["TEXTTEST_TMP"], True) if not os.path.exists(env["SUMO_REPORT"]): os.makedirs(env["SUMO_REPORT"]) - 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") + for name in ["dfrouter", "duarouter", "jtrrouter", "marouter", "netconvert", "netgenerate", + "od2trips", "sumo", "polyconvert", "sumo-gui", "activitygen", + "emissionsDrivingCycle", "emissionsMap"]: + binary = os.path.join( + options.rootDir, options.binDir, name + programSuffix + ".exe") if name == "sumo-gui": if os.path.exists(binary): env["GUISIM_BINARY"] = binary elif os.path.exists(binary): - env[name.upper()+"_BINARY"] = binary + env[name.upper() + "_BINARY"] = binary log = open(testLog, 'w') # provide more information than just the date: nameopt = " -name %sr%s" % (date.today().strftime("%d%b%y"), svnrev) if options.sumoExe == "meso": - runInternalTests.runInternal(programSuffix, "-b "+env["FILEPREFIX"]+nameopt, log) + 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) + 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(50) - subprocess.call('texttest.py -s "batch.ArchiveRepository session='+env["FILEPREFIX"]+' before=%s"' % ago.strftime("%d%b%Y"), + subprocess.call('texttest.py -s "batch.ArchiveRepository session=' + env["FILEPREFIX"] + ' before=%s"' % ago.strftime("%d%b%Y"), stdout=log, stderr=subprocess.STDOUT, shell=True) log.close() log = open(statusLog, 'w') - status.printStatus(makeLog, makeAllLog, env["TEXTTEST_TMP"], env["SMTP_SERVER"], log) + status.printStatus( + makeLog, makeAllLog, env["TEXTTEST_TMP"], env["SMTP_SERVER"], log) log.close() diff -Nru sumo-0.21.0+dfsg/tools/build/dailyUpdateMakeGCC sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/dailyUpdateMakeGCC --- sumo-0.21.0+dfsg/tools/build/dailyUpdateMakeGCC 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/dailyUpdateMakeGCC 1970-01-01 00:00:00.000000000 +0000 @@ -1,94 +0,0 @@ -#!/bin/bash -PREFIX=$1 -export FILEPREFIX=$2 -export SMTP_SERVER=$3 -REMOTEDIR=$4 -MAKELOG=$PREFIX/${FILEPREFIX}make.log -MAKEALLLOG=$PREFIX/${FILEPREFIX}makealloptions.log -STATUSLOG=$PREFIX/${FILEPREFIX}status.log -TESTLOG=$PREFIX/${FILEPREFIX}test.log -export SUMO_BATCH_RESULT=$PREFIX/${FILEPREFIX}batch_result -export SUMO_REPORT=$PREFIX/${FILEPREFIX}report -export SUMO_BINDIR=$PREFIX/sumo/bin -CONFIGURE_OPT=$5 -if test $# -ge 6; then - NIGHTDIR=$6 -fi - -rm -f $STATUSLOG -echo -n "$FILEPREFIX, " > $STATUSLOG -date >> $STATUSLOG -echo "--" >> $STATUSLOG -cd $PREFIX/sumo -make distclean &> /dev/null -make -f Makefile.cvs clean &> /dev/null -basename $MAKELOG >> $STATUSLOG -svn up &> $MAKELOG || (echo "svn up failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) -SVNREV=`grep -io 'revision [0-9]*' $MAKELOG | cut -d ' ' -f 2 | tail -1` -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 $CONFIGURE_OPT >> $MAKELOG 2>&1 || (echo "configure failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) -if make >> $MAKELOG 2>&1; then - $PREFIX/sumo/unittest/src/sumo-unittest >> $MAKELOG 2>&1 || (echo "unit tests failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) - if make install >> $MAKELOG 2>&1; then - if test -d "$NIGHTDIR"; then - make distcheck >> $MAKELOG 2>&1 || (echo "make distcheck failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) - if make dist-complete >> $MAKELOG 2>&1; then - for f in $PREFIX/sumo/sumo-*.tar.* $PREFIX/sumo/sumo-*.zip; do - if test $f -nt $PREFIX/sumo/configure; then - cp $f $NIGHTDIR - scp -q $f $REMOTEDIR - fi - done - rsync -rcz $PREFIX/sumo/docs/pydoc $PREFIX/sumo/docs/doxygen $PREFIX/sumo/docs/userdoc $REMOTEDIR - else - echo "make dist-complete failed" | tee -a $STATUSLOG; tail -10 $MAKELOG - fi - fi - else - echo "make install failed" | tee -a $STATUSLOG; tail -10 $MAKELOG - fi -else - echo "make failed" | tee -a $STATUSLOG; tail -20 $MAKELOG -fi -echo `grep -c '[Ww]arn[iu]ng:' $MAKELOG` warnings >> $STATUSLOG -scp -q $MAKELOG $REMOTEDIR - -echo "--" >> $STATUSLOG -if test -e $SUMO_BINDIR/sumo -a $SUMO_BINDIR/sumo -nt $PREFIX/sumo/configure; then - # run tests - export PATH=$PREFIX/texttest/bin:$PATH - export TEXTTEST_TMP=$PREFIX/texttesttmp -# find $SUMO_BATCH_RESULT -mtime +20 -type f | xargs -r rm - rm -rf $TEXTTEST_TMP/* - if test $FILEPREFIX == meso; then - tests/runInternalTests.py "b $FILEPREFIX" &> $TESTLOG - else - tests/runTests.sh -b $FILEPREFIX -name `date +%d%b%y`r$SVNREV &> $TESTLOG - fi - if which Xvfb &>/dev/null; then - tests/runTests.sh -a sumo.gui -b $FILEPREFIX -name `date +%d%b%y`r$SVNREV >> $TESTLOG 2>&1 - fi - tests/runTests.sh -b $FILEPREFIX -name `date +%d%b%y`r$SVNREV -coll >> $TESTLOG 2>&1 - find $TEXTTEST_TMP -name batchreport."*" -exec echo -n '{} ' \; -exec head -1 '{}' \; | sort >> $STATUSLOG - rsync -r $SUMO_REPORT $REMOTEDIR -fi - -echo "--" >> $STATUSLOG -basename $MAKEALLLOG >> $STATUSLOG -export CXXFLAGS="$CXXFLAGS -Wall -W -pedantic -Wno-long-long -Wformat -Wformat-security" -./configure --prefix=$PREFIX/sumo --program-suffix=A --with-python \ - --disable-double-precision --disable-subsecond --disable-internal-lanes \ - --enable-memcheck $CONFIGURE_OPT &> $MAKEALLLOG || (echo "configure with all options failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG) -if make >> $MAKEALLLOG 2>&1; then - make install >> $MAKEALLLOG 2>&1 || (echo "make install with all options failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG) -else - echo "make with all options failed" | tee -a $STATUSLOG; tail -20 $MAKEALLLOG -fi -echo `grep -c '[Ww]arn[iu]ng:' $MAKEALLLOG` warnings >> $STATUSLOG -scp -q $MAKEALLLOG $REMOTEDIR -echo "--" >> $STATUSLOG -scp -q $STATUSLOG $REMOTEDIR diff -Nru sumo-0.21.0+dfsg/tools/build/dailyUpdateMakeGCC.sh sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/dailyUpdateMakeGCC.sh --- sumo-0.21.0+dfsg/tools/build/dailyUpdateMakeGCC.sh 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/dailyUpdateMakeGCC.sh 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,94 @@ +#!/bin/bash +PREFIX=$1 +export FILEPREFIX=$2 +export SMTP_SERVER=$3 +REMOTEDIR=$4 +MAKELOG=$PREFIX/${FILEPREFIX}make.log +MAKEALLLOG=$PREFIX/${FILEPREFIX}makealloptions.log +STATUSLOG=$PREFIX/${FILEPREFIX}status.log +TESTLOG=$PREFIX/${FILEPREFIX}test.log +export SUMO_BATCH_RESULT=$PREFIX/${FILEPREFIX}batch_result +export SUMO_REPORT=$PREFIX/${FILEPREFIX}report +export SUMO_BINDIR=$PREFIX/sumo/bin +CONFIGURE_OPT=$5 +if test $# -ge 6; then + NIGHTDIR=$6 +fi + +rm -f $STATUSLOG +echo -n "$FILEPREFIX " > $STATUSLOG +date >> $STATUSLOG +echo "--" >> $STATUSLOG +cd $PREFIX/sumo +make distclean &> /dev/null +make -f Makefile.cvs clean &> /dev/null +basename $MAKELOG >> $STATUSLOG +svn up &> $MAKELOG || (echo "svn up failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) +SVNREV=`grep -io 'revision [0-9]*' $MAKELOG | cut -d ' ' -f 2 | tail -1` +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 $CONFIGURE_OPT >> $MAKELOG 2>&1 || (echo "configure failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) +if make >> $MAKELOG 2>&1; then + $PREFIX/sumo/unittest/src/sumo-unittest >> $MAKELOG 2>&1 || (echo "unit tests failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) + $PREFIX/sumo/unittest/testSuiteTools.py >> $MAKELOG 2>&1 || (echo "python unit tests failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) + if make install >> $MAKELOG 2>&1; then + if test -d "$NIGHTDIR"; then + make distcheck >> $MAKELOG 2>&1 || (echo "make distcheck failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) + if make dist-complete >> $MAKELOG 2>&1; then + for f in $PREFIX/sumo/sumo-*.tar.* $PREFIX/sumo/sumo-*.zip; do + if test $f -nt $PREFIX/sumo/configure; then + cp $f $NIGHTDIR + scp -q $f $REMOTEDIR + fi + done + rsync -rcz $PREFIX/sumo/docs/pydoc $PREFIX/sumo/docs/doxygen $PREFIX/sumo/docs/userdoc $REMOTEDIR + else + echo "make dist-complete failed" | tee -a $STATUSLOG; tail -10 $MAKELOG + fi + fi + else + echo "make install failed" | tee -a $STATUSLOG; tail -10 $MAKELOG + fi +else + echo "make failed" | tee -a $STATUSLOG; tail -20 $MAKELOG +fi +echo `grep -c '[Ww]arn[iu]ng:' $MAKELOG` warnings >> $STATUSLOG +scp -q $MAKELOG $REMOTEDIR + +echo "--" >> $STATUSLOG +if test -e $SUMO_BINDIR/sumo -a $SUMO_BINDIR/sumo -nt $PREFIX/sumo/configure; then + # run tests + export PATH=$PREFIX/texttest/bin:$PATH + export TEXTTEST_TMP=$PREFIX/texttesttmp +# find $SUMO_BATCH_RESULT -mtime +20 -type f | xargs -r rm + rm -rf $TEXTTEST_TMP/* + if test $FILEPREFIX == meso -o $FILEPREFIX == clangInternal; then + tests/runInternalTests.py "b $FILEPREFIX" &> $TESTLOG + else + tests/runTests.sh -b $FILEPREFIX -name `date +%d%b%y`r$SVNREV &> $TESTLOG + fi + if which Xvfb &>/dev/null; then + tests/runTests.sh -a sumo.gui -b $FILEPREFIX -name `date +%d%b%y`r$SVNREV >> $TESTLOG 2>&1 + fi + tests/runTests.sh -b $FILEPREFIX -name `date +%d%b%y`r$SVNREV -coll >> $TESTLOG 2>&1 + find $TEXTTEST_TMP -name batchreport."*" -exec echo -n '{} ' \; -exec head -1 '{}' \; | sort >> $STATUSLOG + rsync -r $SUMO_REPORT $REMOTEDIR +fi + +echo "--" >> $STATUSLOG +basename $MAKEALLLOG >> $STATUSLOG +export CXXFLAGS="$CXXFLAGS -Wall -W -pedantic -Wno-long-long -Wformat -Wformat-security" +./configure --prefix=$PREFIX/sumo --program-suffix=A --with-python \ + --disable-double-precision --disable-subsecond --disable-internal-lanes \ + --enable-memcheck $CONFIGURE_OPT &> $MAKEALLLOG || (echo "configure with all options failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG) +if make >> $MAKEALLLOG 2>&1; then + make install >> $MAKEALLLOG 2>&1 || (echo "make install with all options failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG) +else + echo "make with all options failed" | tee -a $STATUSLOG; tail -20 $MAKEALLLOG +fi +echo `grep -c '[Ww]arn[iu]ng:' $MAKEALLLOG` warnings >> $STATUSLOG +scp -q $MAKEALLLOG $REMOTEDIR +echo "--" >> $STATUSLOG +scp -q $STATUSLOG $REMOTEDIR diff -Nru sumo-0.21.0+dfsg/tools/build/history.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/history.py --- sumo-0.21.0+dfsg/tools/build/history.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/history.py 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,56 @@ +#!/usr/bin/env python +""" +@file history.py +@author Michael Behrisch +@date 2014-06-21 +@version $Id: history.py 18096 2015-03-17 09:50:59Z behrisch $ + +This script builds all sumo versions in a certain revision range +and tries to eliminate duplicates afterwards. + +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2011-2015 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. +""" + +import subprocess +import optparse +import shutil +import os + +optParser = optparse.OptionParser() +optParser.add_option("-b", "--begin", type="int", + default=16000, help="first revision to build") +optParser.add_option("-e", "--end", type="int", + help="last revision to build") +optParser.add_option("-s", "--step", type="int", + default=1, help="increment") +options, args = optParser.parse_args() + +if not options.end: + for line in subprocess.check_output('svn info http://svn.code.sf.net/p/sumo/code/trunk/sumo', shell=True).splitlines(): + l = line.split() + if len(l) == 2 and l[0] == "Revision:": + options.end = int(l[1]) +for rev in range(options.begin, options.end + 1, options.step): + if not os.path.exists('bin%s' % rev): + ret = subprocess.call( + 'svn up --ignore-externals -r %s sumo' % rev, shell=True) + if ret != 0: + break + subprocess.call('cd sumo; make clean; make -j 16; cd ..', shell=True) + shutil.copytree('sumo/bin', 'bin%s' % rev, + ignore=shutil.ignore_patterns('Makefile*', '*.bat', '*.jar')) + subprocess.call('strip -R .note.gnu.build-id bin%s/*' % + rev, shell=True) + subprocess.call( + "sed -i 's/dev-SVN-r%s/dev-SVN-r00000/' bin%s/*" % (rev, rev), shell=True) +for line in subprocess.check_output('fdupes -1 -q bin*', shell=True).splitlines(): + dups = line.split() + for d in dups[1:]: + subprocess.call('ln -sf ../%s %s' % (dups[0], d), shell=True) diff -Nru sumo-0.21.0+dfsg/tools/build/mirrorWiki.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/mirrorWiki.py --- sumo-0.21.0+dfsg/tools/build/mirrorWiki.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/mirrorWiki.py 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,135 @@ +#!/usr/bin/env python +""" +@file mirrorWiki.py +@author Daniel Krajzewicz +@author Michael Behrisch +@date 2011-10-20 +@version $Id: mirrorWiki.py 18096 2015-03-17 09:50:59Z behrisch $ + +Mirrors wiki-documentation. + +Determines what to mirror, first: if a command line argument is given, +it is interpreted as the page to mirror. Otherwise, "Special:AllPages" is +downloaded and parsed for obtaining the list of all pages which will be +converted in subsequent steps. + +For each of the pages to mirror, the page is downloaded as for +being edited and is stripped from wiki-header/footer, first. +Then, the image-links are extracted from the HTML page and stored +temporarily. +The page is saved into MIRROR_FOLDER/<PAGE_PATH>. + +After mirroring all pages, the images are downloaded and stored into +MIRROR_FOLDER/images. + +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 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. +""" +import urllib +import os +import sys +import shutil +from optparse import OptionParser + + +def readParsePage(page): + f = urllib.urlopen("http://sumo.dlr.de/wiki/%s" % page) + c = f.read() + b = c.find("This page was last modified on") + e = c.find("<", b) + lastMod = c[b:e] + b = c.find('<a id="top"') + e = c.find('<div class="printfooter">') + c = c[b:e] + c = c.replace('<h3 id="siteSub">From sumo</h3>', '') + b = c.find('<div id="jump-to-nav"') + e = c.find('</div>', b) + 6 + return c[:b] + c[e:] + '</div><hr/><div id="lastmod">' + lastMod + '</div>' + + +def readParseEditPage(page): + f = urllib.urlopen( + "http://sumo.dlr.de/w/index.php?title=%s&action=edit" % page) + c = f.read() + b = c.find("wpTextbox1") + b = c.find('>', b) + 1 + e = c.find("</textarea>") + return c[b:e] + + +def getImages(page): + images = set() + for t in ["Image:", "File:"]: + b = page.find(t) + while b >= 0: + e = len(page) + for ch in ["|", "\n", "]"]: + pos = page.find(ch, b) + if pos >= 0 and pos < e: + e = pos + images.add(page[b:e].strip()) + b = page.find(t, b + 1) + return images + +if __name__ == "__main__": + optParser = OptionParser() + optParser.add_option( + "-o", "--output", default="wiki", help="output folder") + (options, args) = optParser.parse_args() + + try: + os.makedirs(os.path.join(options.output, "images")) + except: + pass + images = set() + if len(args) == 0: + p = readParsePage("Special:AllPages") + p = p[p.find("<input type=\"submit\" value=\"Go\" />"):] + p = p[p.find("<table "):] + pages = p.split("<a ") + else: + pages = ['href="/wiki/%s"' % a for a in args] + for p in pages: + if not p.startswith("href"): + continue + b = p.find("/wiki/") + e = p.find("\"", b) + name = p[b + 6:e] + print "Fetching %s" % name + c = readParseEditPage(name) + if name.find("/") > 0: + try: + os.makedirs( + os.path.join(options.output, name[:name.rfind("/")])) + except: + pass + images.update(getImages(c)) + name = name + ".txt" + fd = open(os.path.join(options.output, name), "w") + fd.write(c) + fd.close() + + for i in images: + print "Fetching image %s" % i + if i.find(":") >= 0: + f = urllib.urlopen("http://sumo.dlr.de/wiki/%s" % i) + c = f.read() + b = c.find("<div class=\"fullImageLink\" id=\"file\">") + b = c.find("href=", b) + 6 + e = c.find("\"", b + 1) + f = urllib.urlopen("http://sourceforge.net/%s" % c[b:e]) + i = i[i.find(":") + 1:] + else: + f = urllib.urlopen("http://sourceforge.net/%s" % i) + i = i[i.rfind("/") + 1:] + if i.find("px-") >= 0: + i = i[:i.find('-') + 1] + fd = open(os.path.join(options.output, "images", i), "wb") + fd.write(f.read()) + fd.close() diff -Nru sumo-0.21.0+dfsg/tools/build/pythonPropsMSVC.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/pythonPropsMSVC.py --- sumo-0.21.0+dfsg/tools/build/pythonPropsMSVC.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/pythonPropsMSVC.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,13 +5,13 @@ @author Daniel Krajzewicz @author Jakob Erdmann @date 2011 -@version $Id: pythonPropsMSVC.py 15692 2014-02-22 09:17:02Z behrisch $ +@version $Id: pythonPropsMSVC.py 18096 2015-03-17 09:50:59Z behrisch $ This script rebuilds "../../build/msvc/python.props", the file which gives information about the python includes and library. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -20,10 +20,12 @@ (at your option) any later version. """ -import sys, distutils.sysconfig +import sys +import distutils.sysconfig from os.path import dirname, join -propsFile = join(dirname(__file__), '..', '..', 'build', 'msvc10', 'python.props') +propsFile = join( + dirname(__file__), '..', '..', 'build', 'msvc10', 'python.props') print('generating %s ' % propsFile) props = open(propsFile, 'w') libPrefix = "%s\libs\python%s%s" % (sys.prefix, sys.version[0], sys.version[2]) diff -Nru sumo-0.21.0+dfsg/tools/build/status.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/status.py --- sumo-0.21.0+dfsg/tools/build/status.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/status.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,11 +4,11 @@ @author Michael Behrisch @author Laura Bieker @date 2007-03-13 -@version $Id: status.py 15959 2014-03-17 16:58:35Z cschmidt87 $ +@version $Id: status.py 18096 2015-03-17 09:50:59Z behrisch $ -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -17,10 +17,14 @@ (at your option) any later version. """ -import os, sys, smtplib, re +import os +import sys +import smtplib +import re from os.path import basename, join, commonprefix from datetime import datetime + def printStatus(makeLog, makeAllLog, textTestTmp, smtpServer, out): failed = "" build = commonprefix([basename(makeLog), basename(makeAllLog)]) diff -Nru sumo-0.21.0+dfsg/tools/build/svn-hook-post-commit sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/svn-hook-post-commit --- sumo-0.21.0+dfsg/tools/build/svn-hook-post-commit 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/svn-hook-post-commit 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -#!/bin/sh -/usr/lib64/subversion/contrib/hook-scripts/svnnotify --set-sender --repos-path "$1" --revision "$2" --to "sumo-cvs@lists.sourceforge.net" --subject-prefix "SF.net SVN: sumo:" --subject-cx --no-first-line --with-diff --viewcvs-url "http://sourceforge.net/p/sumo/code/%s" --user-domain "users.sourceforge.net" --footer "This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site." -l /usr/bin/svnlook --max-diff-length 100000 -/usr/lib64/subversion/contrib/hook-scripts/svnnotify --set-sender --repos-path "$1" --revision "$2" --to "trigger@ifttt.com" --subject-prefix "SF.net SVN: sumo:" --subject-cx --no-first-line --from "behrisch@users.sourceforge.net" -l /usr/bin/svnlook --max-diff-length 1 -#/usr/lib64/subversion/contrib/hook-scripts/ciabot_svn.py --revisionURI="http://sourceforge.net/p/sumo/code/%(revision)s" --repositoryURI=http://svn.code.sf.net/p/sumo/code/ "$1" "$2" "Simulation of Urban MObility" -exit 0 diff -Nru sumo-0.21.0+dfsg/tools/build/svn-hook-post-commit.sh sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/svn-hook-post-commit.sh --- sumo-0.21.0+dfsg/tools/build/svn-hook-post-commit.sh 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/svn-hook-post-commit.sh 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,5 @@ +#!/bin/sh +/usr/lib64/subversion/contrib/hook-scripts/svnnotify --set-sender --repos-path "$1" --revision "$2" --to "sumo-cvs@lists.sourceforge.net" --subject-prefix "SF.net SVN: sumo:" --subject-cx --no-first-line --with-diff --viewcvs-url "http://sourceforge.net/p/sumo/code/%s" --user-domain "users.sourceforge.net" --footer "This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site." -l /usr/bin/svnlook --max-diff-length 100000 +/usr/lib64/subversion/contrib/hook-scripts/svnnotify --set-sender --repos-path "$1" --revision "$2" --to "trigger@ifttt.com" --subject-prefix "SF.net SVN: sumo:" --subject-cx --no-first-line --from "behrisch@users.sourceforge.net" -l /usr/bin/svnlook --max-diff-length 1 +#/usr/lib64/subversion/contrib/hook-scripts/ciabot_svn.py --revisionURI="http://sourceforge.net/p/sumo/code/%(revision)s" --repositoryURI=http://svn.code.sf.net/p/sumo/code/ "$1" "$2" "Simulation of Urban MObility" +exit 0 diff -Nru sumo-0.21.0+dfsg/tools/build/ubuntuBuild.sh sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/ubuntuBuild.sh --- sumo-0.21.0+dfsg/tools/build/ubuntuBuild.sh 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/ubuntuBuild.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,287 +0,0 @@ -#!/bin/bash -# -# This script can be used for automatic installation of SUMO on Ubuntu distributions. -# Currently, Ubuntu 8.04 - 10.04 are supported. -# -# If you don't install the supplemental packages (GDAL, etc.) via packet manager, you -# may have to adjust the configuration parameters below - -# Specifies the absolute path to the SUMO sources -SOURCEPATH=`pwd` - -# Specifies the path where the binaries are to be installed -INSTALL_PATH="--prefix=/opt/sumo/" - -# Additional configuration parameters (The paths' to GDAL, etc. are specified further below -ADDITIONAL_CONFIG_PARAMS="$INSTALL_PATH" - -# Description of SUMO which will be used as description of the package if you decide to use "checkinstall" instead of "make install" -DESCRIPTION="\"Simulation of Urban MObility\" (SUMO) is an open source, highly portable, microscopic road traffic simulation package designed to handle large road networks. -It is mainly developed by employees of the Institute of Transportation Systems at the German Aerospace Center. -SUMO is licensed under the GPL. -The project homepage can be found at http://sumo.sourceforge.net/" - - -#----------------------------------------------------------------------------------------------------------------------------------- - -# Queries the user for the packet manager to be used to install supplemental packages -function read_packet_manager(){ - - if [ "$PACKET_MANAGER" != "apt-get" ] && [ "$PACKET_MANAGER" != "apt-get" ]; - then - while [ "$PACKMAN" != "1" ] && [ "$PACKMAN" != "2" ]; - do - echo "Which packet manager front-end do you use? (1) apt-get, (2) aptitude?"; - read PACKMAN; - done - - if [ "$PACKMAN" == "1" ]; then - PACKET_MANAGER="apt-get"; - else - PACKET_MANAGER="aptitude"; - fi - - sudo $PACKET_MANAGER update; - fi -} - - -#------------------------------------------------------------------------------------------------------------------------------------ -# -# Fetch the SUMO sources from the repository's trunk or locate previously fetched ones -# -# -echo "You can choose to fetch the latest SUMO version from the SUMO repository or to install SUMO from sources located in your local file system." -echo "Do you want to fetch the latest version from the repository?" -while [ "$FETCH" != "y" ] && [ "$FETCH" != "n" ]; do - echo "[y,n]" - read FETCH -done - -echo "Please specify the path to the source code's destination." -echo "If the correct path equals (\""$SOURCEPATH"\"), just press [Enter]." -read SRCPATH; -if [ -n "$SRCPATH" ]; then - SOURCEPATH="$SRCPATH" -fi - -if [ "$FETCH" == "y" ]; -then - # prepare the directory where the sources will be placed - if [ -d "$SOURCEPATH/sumo" ]; - then - echo "The content of the directory \"$SOURCEPATH/sumo\" will be completely destroyed." - echo "Press [ENTER] to continue." - read xyz - rm -rf "$SOURCEPATH/sumo" - fi - mkdir -p "$SOURCEPATH" - cd "$SOURCEPATH" - - # install subversion if it is not installed, yet - if [ -z "$(dpkg -l | grep subversion)" ]; - then - read_packet_manager - sudo $PACKET_MANAGER install subversion; - fi - echo "Start svn checkout..." - svn co https://sumo.svn.sourceforge.net/svnroot/sumo/trunk/sumo - SOURCEPATH="$SOURCEPATH/sumo" - cd "$SOURCEPATH" - make -f Makefile.cvs -fi - - - - -#------------------------------------------------------------------------------------------------------------------------------------ -# -# Installation of required packages -# -# -echo "Sumo depends on some packages packages which are available in the Ubuntu sources or on the projects' sites as source code." -echo " You can choose to install them from the sources or to compile them on your own." - -while [ "$PM" != "y" ] && [ "$PM" != "N" ]; do - echo "Do you want to install them via packet manager? [y,N]" - read PM -done - -if [ "$PM" == "y" ]; -then - - while [ "$GUI" != "y" ] && [ "$GUI" != "N" ]; do - echo "Do you want to build the SUMO GUI? [y,N]"; - read GUI; - done - - read_packet_manager - - if [ -n "$(lsb_release -d | grep 10.04)" ] || [ -n "$(lsb_release -d | grep 9.10)" ] || [ -n "$(lsb_release -d | grep 9.04)" ] || [ -n "$(lsb_release -d | grep 8.10)" ]; - then - - if [ -n "$(lsb_release -d | grep 10.04)" ] ; - then - GDAL="/usr/lib/libgdal1.6.0.so" - FOX="1.6" - else - GDAL="/usr/lib/libgdal1.5.0.so" - if [ -n "$(lsb_release -d | grep 9.10)" ] ; - then - FOX="1.6" - else - FOX="1.4" - fi - fi - - PKGLIST="g++ autoconf libtool libgdal1-dev proj libxerces-c2-dev" - - if [ "$GUI" == "y" ]; - then - PKGLIST="$PKGLIST libfox-$FOX-dev libgl1-mesa-dev libglu1-mesa-dev" - fi - - sudo $PACKET_MANAGER install $PKGLIST - - if [ -z "$(ls -l /usr/lib/libgdal.so)" ] - then - if [ -n "$(ls -l $GDAL)" ]; - - then - echo "creating symbolic link: /usr/lib/libgdal.so --> $GDAL" - sudo ln -s "$GDAL" /usr/lib/libgdal.so - else - echo "/usr/lib/libgdal.so was not found. You have to create a symbolic link to the version which is currently installed!" - fi - fi - else - if [ -n "$(lsb_release -d | grep 8.04)" ]; - then - - FOX="1.4" - PKGLIST="g++ autoconf libtool libgdal1-dev proj libxerces27-dev" - - if [ "$GUI" == "y" ]; - then - PKGLIST="$PKGLIST libfox$FOX-dev libgl1-mesa-dev libglu1-mesa-dev" - fi - - sudo $PACKET_MANAGER install "$PKGLIST" - - if [ -z "$(ls -l /usr/lib/libgdal.so)" ] - then - if [ -n "$(ls -l /usr/lib/libgdal1.4.0.so.1)" ]; - then - echo "creating symbolic link: /usr/lib/libgdal.so --> /usr/lib/libgdal1.4.0.so.1" - sudo ln -s /usr/lib/libgdal1.4.0.so.1 /usr/lib/libgdal.so - else - echo "/usr/lib/libgdal.so was not found. You have to create it as symbolic link to the version which is currently installed!" - fi - fi - - fi - fi -fi - - -#------------------------------------------------------------------------------------------------------------------------------------ -# -# Configuration -# -# -if [ "$PM" != "y" ]; then - echo "You did not install the required packages via packet manager." - echo "If you did not install them previously and adjusted the configuration parameters," - echo "the installation process will almost certainly fail!" -fi -echo "Press [Enter] to start the compilation and installation process" -read - -cd $SOURCEPATH - -# generate configure script -make -f Makefile.cvs - -# configure the path's to the libraries -# If you installed one of the libraries manually, you may have to adjust the paths' -./configure --with-fox-includes=/usr/include/fox-$FOX \ - --with-gdal-includes=/usr/include/gdal \ - --with-proj-libraries=/usr \ - --with-gdal-libraries=/usr \ - --with-proj-gdal \ - $ADDITIONAL_CONFIG_PARAMS|| exit - - -#------------------------------------------------------------------------------------------------------------------------------------ -# -# Compilation and installation -# -# - -# run a 'make clean' first to get rid of intermediate files which my be left from an aborted compilation process -make clean || exit -make || exit - -echo "The SUMO binaries were build but not installed, yet." -echo "However, the installation process is optional since SUMO can be can be run from the source folder by calling \"src/sumo\" and \"src/sumo-gui\", respectively." -echo "The installation process will copy the binaries to the previously configured path and you may delete the source and intermediate files afterwards." -echo "Do you want to install SUMO now? (Note that the source and intermediate files will not be deleted automatically by this script!)" -while [ "$INSTALLSUMO" != "y" ] && [ "$INSTALLSUMO" != "N" ]; do - echo "[y,N]" - read INSTALLSUMO -done - -if [ "$INSTALLSUMO" == "y" ]; -then - - echo "When using \"checkinstall \" instead of \"make install\" SUMO will be installed as *.deb packet via packet manager." - while [ "$CHECKINSTALL" != "y" ] && [ "$CHECKINSTALL" != "N" ]; do - echo "Do you want to use \"checkinstall\" to install SUMO? [y,N]" - read CHECKINSTALL - done - - if [ "$CHECKINSTALL" == "y" ]; - then - - # check if checkinstall is already installed - if [ -z "$(dpkg -l | grep checkinstall)" ]; - then - read_packet_manager - sudo $PACKET_MANAGER install checkinstall - fi - - # auto-configure packet name, etc. - cd $SOURCEPATH - - # if information about a subversion revision is available - use them - if [ -e ./src/version.h ]; then - VERSION=`grep VERSION_STRING src/version.h | cut -d " " -f 3` - else - VERSION=`grep VERSION_STRING src/config.h | cut -d " " -f 3` - fi - echo $DESCRIPTION > description-pak - sudo checkinstall --pkgname "sumo" --bk --pkgversion $VERSION || exit - echo "The packet was created successfully." - else - make install || exit - fi -fi - - - -# generate documentation -echo "Do you want to create the documentation via doxygen?" - -while [ "$DOXY" != "y" ] && [ "$DOXY" != "N" ]; do - echo "[y,N]" - read DOXY -done - -if [ "$DOXY" == "y" ]; then - if [ -z "$(dpkg -l | grep doxygen)" ]; then - read_packet_manager - sudo $PACKET_MANAGER install doxygen - fi - cd $SOURCEPATH - doxygen sumo.doxyconf -fi diff -Nru sumo-0.21.0+dfsg/tools/build/version.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/version.py --- sumo-0.21.0+dfsg/tools/build/version.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/version.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,7 +5,7 @@ @author Daniel Krajzewicz @author Jakob Erdmann @date 2007 -@version $Id: version.py 15692 2014-02-22 09:17:02Z behrisch $ +@version $Id: version.py 18096 2015-03-17 09:50:59Z behrisch $ This script rebuilds "../../src/version.h", the file which lets the applications know the version of their build. @@ -14,8 +14,8 @@ 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-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -35,13 +35,15 @@ 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 + # 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 + join(searchRoot, SVNDIR), # src + join(searchRoot, '..', SVNDIR), # sumo + join(searchRoot, '..', '..', SVNDIR)] # trunk for d in candidates: if isdir(d): return d @@ -50,9 +52,9 @@ def find_svnFile(svnDir): candidates = [ - join(svnDir, SVN17FILE), - join(svnDir, SVN16FILE2), - join(svnDir, SVN16FILE)] + join(svnDir, SVN17FILE), + join(svnDir, SVN16FILE2), + join(svnDir, SVN16FILE)] for f in candidates: if exists(f): return f @@ -64,7 +66,7 @@ # new style wc.db svnRevision = -1 for l in open(svnFile, 'rb'): - m = re.search('[!]svn[/]ver[/](\d*)', l) + m = re.search('[!]svn[/]ver[/](\d*)[/]', l) if m: try: svnRevision = max(svnRevision, int(m.group(1))) @@ -122,8 +124,8 @@ # svnFile is newer. lets update the revision number try: svnRevision = int(re.search( - 'Revision: (\d*)\n', - Popen(['svn', 'info', sumoSrc], stdout=PIPE).communicate()[0]).group(1)) + 'Revision: (\d*)\n', + Popen(['svn', 'info', sumoSrc], stdout=PIPE).communicate()[0]).group(1)) except: svnRevision = parseRevision(svnFile) create_version_file(versionFile, svnRevision, svnFile) diff -Nru sumo-0.21.0+dfsg/tools/build/wix.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/wix.py --- sumo-0.21.0+dfsg/tools/build/wix.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/build/wix.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Michael Behrisch @author Jakob Erdmann @date 2011 -@version $Id: wix.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: wix.py 18096 2015-03-17 09:50:59Z behrisch $ Builds the installer based on the nightly zip. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2011-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2011-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -17,26 +17,38 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import optparse, subprocess, zipfile, os, sys, tempfile, glob, shutil +import optparse +import subprocess +import zipfile +import os +import sys +import tempfile +import glob +import shutil INPUT_DEFAULT = r"O:\Daten\Sumo\Nightly\sumo-msvc10Win32-svn.zip" OUTPUT_DEFAULT = r"O:\Daten\Sumo\Nightly\sumo-msvc10Win32-svn.msi" -WIX_DEFAULT = "%sbin" % os.environ.get("WIX", r"D:\Programme\Windows Installer XML v3.5\\") -WXS_DEFAULT = os.path.join(os.path.dirname(__file__), "..", "..", "build", "sumo.wxs") -LICENSE = os.path.join(os.path.dirname(__file__), "..", "..", "build", "License.rtf") +WIX_DEFAULT = "%sbin" % os.environ.get( + "WIX", r"D:\Programme\Windows Installer XML v3.5\\") +WXS_DEFAULT = os.path.join( + os.path.dirname(__file__), "..", "..", "build", "sumo.wxs") +LICENSE = os.path.join( + os.path.dirname(__file__), "..", "..", "build", "License.rtf") + def buildFragment(wixBin, sourceDir, targetLabel, tmpDir): base = os.path.basename(sourceDir) subprocess.call([os.path.join(wixBin, "heat.exe"), "dir", sourceDir, "-cg", base, "-gg", "-dr", targetLabel, "-out", os.path.join(tmpDir, "Fragment.wxs")]) fragIn = open(os.path.join(tmpDir, "Fragment.wxs")) - fragOut = open(os.path.join(tmpDir, base+"Fragment.wxs"), "w") + fragOut = open(os.path.join(tmpDir, base + "Fragment.wxs"), "w") for l in fragIn: fragOut.write(l.replace("SourceDir", sourceDir)) fragOut.close() fragIn.close() return fragOut.name + def buildMSI(sourceZip=INPUT_DEFAULT, outFile=OUTPUT_DEFAULT, wixBin=WIX_DEFAULT, wxs=WXS_DEFAULT, license=LICENSE, platformSuffix=""): tmpDir = tempfile.mkdtemp() @@ -44,21 +56,28 @@ sumoRoot = glob.glob(os.path.join(tmpDir, "sumo-*"))[0] fragments = [] for d in ["userdoc", "pydoc", "tutorial", "examples"]: - fragments.append(buildFragment(wixBin, os.path.join(sumoRoot, "docs", d), "DOCDIR", tmpDir)) - fragments.append(buildFragment(wixBin, os.path.join(sumoRoot, "data"), "INSTALLDIR", tmpDir)) - fragments.append(buildFragment(wixBin, os.path.join(sumoRoot, "tools"), "INSTALLDIR", tmpDir)) + fragments.append( + buildFragment(wixBin, os.path.join(sumoRoot, "docs", d), "DOCDIR", tmpDir)) + fragments.append( + buildFragment(wixBin, os.path.join(sumoRoot, "data"), "INSTALLDIR", tmpDir)) + fragments.append( + buildFragment(wixBin, os.path.join(sumoRoot, "tools"), "INSTALLDIR", tmpDir)) wxsIn = open(wxs) wxsOut = open(os.path.join(tmpDir, "sumo.wxs"), "w") for l in wxsIn: l = l.replace("License.rtf", license) - l = l.replace(".exe' />", "%s.exe' />" % platformSuffix).replace(r"Nightly\sumo-gui.exe", r"Nightly\sumo-gui%s.exe" % platformSuffix) - wxsOut.write(l.replace(r"O:\Daten\Sumo\Nightly", os.path.join(sumoRoot, "bin"))) + l = l.replace(".exe' />", "%s.exe' />" % platformSuffix).replace( + r"Nightly\sumo-gui.exe", r"Nightly\sumo-gui%s.exe" % platformSuffix) + wxsOut.write( + l.replace(r"O:\Daten\Sumo\Nightly", os.path.join(sumoRoot, "bin"))) wxsOut.close() wxsIn.close() - subprocess.call([os.path.join(wixBin, "candle.exe"), "-o", tmpDir+"\\", wxsOut.name] + fragments) - wixObj = [f.replace(".wxs", ".wixobj") for f in [wxsOut.name] + fragments] - subprocess.call([os.path.join(wixBin, "light.exe"), "-ext", "WixUIExtension", "-o", outFile] + wixObj) - shutil.rmtree(tmpDir, True) #comment this out when debugging + subprocess.call( + [os.path.join(wixBin, "candle.exe"), "-o", tmpDir + "\\", wxsOut.name] + fragments) + wixObj = [f.replace(".wxs", ".wixobj") for f in [wxsOut.name] + fragments] + subprocess.call([os.path.join(wixBin, "light.exe"), + "-ext", "WixUIExtension", "-o", outFile] + wixObj) + shutil.rmtree(tmpDir, True) # comment this out when debugging if __name__ == "__main__": optParser = optparse.OptionParser() @@ -66,8 +85,12 @@ default=INPUT_DEFAULT, help="full path to nightly zip") optParser.add_option("-o", "--output", default=OUTPUT_DEFAULT, help="full path to output file") - optParser.add_option("-w", "--wix", default=WIX_DEFAULT, help="path to the wix binaries") - optParser.add_option("-x", "--wxs", default=WXS_DEFAULT, help="path to wxs template") - optParser.add_option("-l", "--license", default=LICENSE, help="path to the license") + optParser.add_option( + "-w", "--wix", default=WIX_DEFAULT, help="path to the wix binaries") + optParser.add_option( + "-x", "--wxs", default=WXS_DEFAULT, help="path to wxs template") + optParser.add_option( + "-l", "--license", default=LICENSE, help="path to the license") (options, args) = optParser.parse_args() - buildMSI(options.nightlyZip, options.output, options.wix, options.wxs, options.license) + buildMSI(options.nightlyZip, options.output, + options.wix, options.wxs, options.license) diff -Nru sumo-0.21.0+dfsg/tools/contributed/sumoplayer/convert_sumoplayer_op_2_lonlat.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/sumoplayer/convert_sumoplayer_op_2_lonlat.py --- sumo-0.21.0+dfsg/tools/contributed/sumoplayer/convert_sumoplayer_op_2_lonlat.py 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/sumoplayer/convert_sumoplayer_op_2_lonlat.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,7 +5,7 @@ @author Laura Bieker @author Michael Behrisch @date 2011-05-30 -@version $Id: convert_sumoplayer_op_2_lonlat.py 15959 2014-03-17 16:58:35Z cschmidt87 $ +@version $Id: convert_sumoplayer_op_2_lonlat.py 18096 2015-03-17 09:50:59Z behrisch $ This code takes the sumoplayer output as input file . The sumoplayer output has the syntax : time, vehicle_id , x, y , speed(meters). if anyone want to check the real location on the openstreetmap, he need to convert x,y back to lon lat format , This code does that for you . @@ -14,8 +14,8 @@ IMP-->Makesure you have installed python and pyproj package to run this code command : python convert_sumoplayer_op_2_lonlat.py sumoplayer_output.txt -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -27,27 +27,27 @@ import sys from pyproj import Proj from string import split -if __name__=="__main__": +if __name__ == "__main__": - f=open(sys.argv[1],'r') + f = open(sys.argv[1], 'r') while True: - - x=f.readline() + + x = f.readline() if x is None: break else: - r=split(x,' ') - player_x=r[2] - player_y=r[3] - time_=r[0] - vid=r[1] - speed=r[4] - offset_x=-342498.94 - offset_y=-5630725.14 - actual_x= float(player_x) - offset_x - actual_y= float(player_y) - offset_y - - p=Proj(proj='utm',zone=32,ellps='WGS84') - lat,lon=p(actual_x,actual_y,inverse=True) - print time_,vid,lon,lat,speed + r = split(x, ' ') + player_x = r[2] + player_y = r[3] + time_ = r[0] + vid = r[1] + speed = r[4] + offset_x = -342498.94 + offset_y = -5630725.14 + actual_x = float(player_x) - offset_x + actual_y = float(player_y) - offset_y + + p = Proj(proj='utm', zone=32, ellps='WGS84') + lat, lon = p(actual_x, actual_y, inverse=True) + print time_, vid, lon, lat, speed exit diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/build.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/build.xml --- sumo-0.21.0+dfsg/tools/contributed/traas/build.xml 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/build.xml 2015-04-17 05:44:20.000000000 +0000 @@ -11,7 +11,7 @@ <target name="compile" description="compile the source"> <tstamp /> <mkdir dir="${build}" /> - <javac srcdir="${src}" destdir="${build}" /> + <javac srcdir="${src}" destdir="${build}" includeantruntime="false" /> </target> <target name="javadoc"> diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/ArealDetector.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/ArealDetector.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/ArealDetector.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/ArealDetector.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -33,6 +33,7 @@ /** * Returns a list of all areal detectors in the network. + * @return a list of IDs of all areal detectors */ public static SumoCommand getIDList(){ @@ -41,6 +42,7 @@ /** * Returns the number of the areal detectors in the network. + * @return the number of areal detectors */ public static SumoCommand getIDCount(){ @@ -50,14 +52,19 @@ /** * getJamLengthVehicle + * @param loopID a string identifying the loop + * @return jam length in vehicles */ + public static SumoCommand getJamLengthVehicle(String loopID){ return new SumoCommand(Constants.CMD_GET_AREAL_DETECTOR_VARIABLE, Constants.JAM_LENGTH_VEHICLE, loopID, Constants.RESPONSE_GET_AREAL_DETECTOR_VARIABLE, Constants.TYPE_INTEGER); } /** * getJamLengthMeters + * @param loopID a string identifying the loop + * @return jam length in [m] */ public static SumoCommand getJamLengthMeters(String loopID){ @@ -66,6 +73,8 @@ /** * getLastStepMeanSpeed + * @param loopID a string identifying the loop + * @return last step mean speed */ public static SumoCommand getLastStepMeanSpeed(String loopID){ @@ -75,6 +84,8 @@ /** * getLastStepOccupancy + * @param loopID a string identifying the loop + * @return last step occupancy */ public static SumoCommand getLastStepOccupancy(String loopID){ diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Edge.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Edge.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Edge.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Edge.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -266,7 +266,11 @@ /** - * getWaitingTime + *Returns the waiting time (in s) on the given edge on this edge + * within the last time step. + * @param edgeID + * a string identifying the edge + * @return the waiting time */ public static SumoCommand getWaitingTime(String edgeID){ @@ -284,6 +288,7 @@ * a string identifying the edge * @param time * travel time value (in s) + * @return SumoCommand */ public static SumoCommand adaptTraveltime(String edgeID, int time){ @@ -298,6 +303,7 @@ * a string identifying the edge * @param effort * effort value + * @return SumoCommand */ public static SumoCommand setEffort(String edgeID, double effort){ @@ -312,6 +318,8 @@ * a string identifying the edge * @param speed * maximum speed (in m/s) + * @return SumoCommand + */ public static SumoCommand setMaxSpeed(String edgeID, double speed){ diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Gui.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Gui.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Gui.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Gui.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -103,6 +103,7 @@ * extension, the available formats differ from platform to * platform but should at least include ps, svg and pdf, on linux * probably gif, png and jpg as well + * @return SumoCommand */ public static SumoCommand screenshot(String viewID, String filename){ @@ -127,6 +128,7 @@ * @param ymax * y-coordinate (double) of the upper right corner of the current * view + * @return SumoCommand */ public static SumoCommand setBoundary(String viewID, double xmin, double ymin, double xmax, double ymax){ @@ -144,6 +146,7 @@ * x-offset of the center of the visible network * @param y * y-offset of the center of the visible network + * @return SumoCommand */ public static SumoCommand setOffset(String viewID, double x, double y){ @@ -159,10 +162,10 @@ * a string identifying the view in the simulation GUI * @param schemeName * the coloring scheme + * @return SumoCommand */ public static SumoCommand setSchema(String viewID, String schemeName){ - return new SumoCommand(Constants.CMD_SET_GUI_VARIABLE, Constants.VAR_VIEW_SCHEMA, viewID, schemeName); } @@ -173,10 +176,10 @@ * a string identifying the view in the simulation GUI * @param zoom * desired zoom factor + * @return SumoCommand */ public static SumoCommand setZoom(String viewID, double zoom){ - return new SumoCommand(Constants.CMD_SET_GUI_VARIABLE, Constants.VAR_VIEW_ZOOM, viewID, zoom); } @@ -187,10 +190,10 @@ * a string identifying the view in the simulation GUI * @param vehID * a string identifying the vehicle + * @return SumoCommand */ public static SumoCommand trackVehicle(String viewID, String vehID){ - return new SumoCommand(Constants.CMD_SET_GUI_VARIABLE, Constants.VAR_TRACK_VEHICLE, viewID, vehID); } diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Inductionloop.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Inductionloop.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Inductionloop.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Inductionloop.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -44,6 +44,7 @@ /** * Returns the number of all induction loops in the network. + * @return the number of detectors */ public static SumoCommand getIDCount(){ @@ -159,6 +160,7 @@ * * @param loopID * a SumoStringList containing induction loops + * @return several information about vehicles which passed the detector. */ public static SumoCommand getVehicleData(String loopID){ diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Junction.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Junction.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Junction.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Junction.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -43,6 +43,7 @@ /** * Returns the number of all junctions in the network. + * @return the number of junctions */ public static SumoCommand getIDCount(){ @@ -63,6 +64,9 @@ /** * getShape + *@param junctionID + * a string identifying the junction + * @return the shape */ public static SumoCommand getShape(String junctionID){ diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Lane.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Lane.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Lane.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Lane.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -47,6 +47,7 @@ /** * Returns the number of all lanes in the network. + * @return the number of lanes */ public static SumoCommand getIDCount(){ @@ -340,6 +341,9 @@ /** * getWaitingTime + * @param laneID + * a string identifying a lane + * @return the waiting time of the lane (in s) */ public static SumoCommand getWaitingTime(String laneID){ @@ -356,6 +360,7 @@ * a string identifying a lane * @param allowedClasses * allowed vehicle classes + * @return SumoCommand */ public static SumoCommand setAllowed(String laneID, SumoStringList allowedClasses){ @@ -370,6 +375,7 @@ * a string identifying a lane * @param disallowedClasses * not allowed vehicle classes + * @return SumoCommand */ public static SumoCommand setDisallowed(String laneID, SumoStringList disallowedClasses){ @@ -384,6 +390,7 @@ * a string identifying a lane * @param length * new length (in m) of the lane + * @return SumoCommand */ public static SumoCommand setLength(String laneID, double length){ @@ -398,6 +405,7 @@ * a string identifying a lane * @param speed * maximum velocity allowed (in m/s) + * @return SumoCommand */ public static SumoCommand setMaxSpeed(String laneID, double speed){ diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Multientryexit.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Multientryexit.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Multientryexit.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Multientryexit.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -44,6 +44,7 @@ /** * Returns the number of all multi-entry/multi-exit detectors in the network. + * @return the number of detectors */ public static SumoCommand getIDCount(){ diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Person.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Person.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Person.java 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Person.java 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,237 @@ +/* + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology + + This file is part of TraaS. + + TraaS 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. + + TraaS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TraaS. If not, see <http://www.gnu.org/licenses/>. +*/ + + +package de.tudresden.sumo.cmd; +import de.tudresden.sumo.config.Constants; +import de.tudresden.sumo.util.SumoCommand; + +/** + * + * @author Mario Krumnow + * + */ + +public class Person { + + //getter methods + + + /** + * Returns the number of all persons in the network. + * @return the number of persons in the network + */ + + public static SumoCommand getIDCount(){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.ID_COUNT, "", Constants.RESPONSE_GET_PERSON_VARIABLE, Constants.TYPE_INTEGER); + } + + + /** + * Returns a list of ids of all persons + * + * @return list of IDs of all persons + */ + + public static SumoCommand getIDList(){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.ID_LIST, "", Constants.RESPONSE_GET_PERSON_VARIABLE, Constants.TYPE_STRINGLIST); + } + + /** + * get speed + * + * @param id + * a string identifying the person + * @return the speed in m/s + */ + + public static SumoCommand getSpeed(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_SPEED, id, Constants.RESPONSE_GET_PERSON_VARIABLE, Constants.TYPE_DOUBLE); + } + + /** + * get position + * + * @param id + * a string identifying the person + * @return the position 2D + */ + + public static SumoCommand getPosition(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_POSITION, id, Constants.RESPONSE_GET_PERSON_VARIABLE,Constants.POSITION_2D); + } + + /** + * get position3D + * + * @param id + * a string identifying the person + * @return the position 3D + */ + + public static SumoCommand getPosition3D(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_POSITION3D, id, Constants.RESPONSE_GET_PERSON_VARIABLE,Constants.POSITION_3D); + } + + /** + * get angle + * + * @param id + * a string identifying the person + * @return the angle + */ + + public static SumoCommand getAngle(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_ANGLE, id, Constants.RESPONSE_GET_PERSON_VARIABLE,Constants.TYPE_DOUBLE); + } + + /** + * get road ID + * + * @param id + * a string identifying the person + * @return the id of the road + */ + + public static SumoCommand getRoadID(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_ROAD_ID, id, Constants.RESPONSE_GET_PERSON_VARIABLE,Constants.TYPE_STRING); + } + + /** + * get type ID + * + * @param id + * a string identifying the person + * @return the type ID of the person + */ + + public static SumoCommand getTypeID(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_TYPE, id, Constants.RESPONSE_GET_PERSON_VARIABLE,Constants.TYPE_STRING); + } + + /** + * get lane position + * + * @param id + * a string identifying the person + * @return the position on the lane + */ + + public static SumoCommand getLanePosition(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_LANEPOSITION, id, Constants.RESPONSE_GET_PERSON_VARIABLE,Constants.TYPE_DOUBLE); + } + + /** + * get color + * + * @param id + * a string identifying the person + * @return the color of the person in the GUI + */ + + public static SumoCommand getColor(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_COLOR, id, Constants.RESPONSE_GET_PERSON_VARIABLE,Constants.TYPE_COLOR); + } + + + /** + * get person number + * + * @param id + * a string identifying the person + * @return the person number + */ + + public static SumoCommand getPersonNumber(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_PERSON_NUMBER, id, Constants.RESPONSE_GET_PERSON_VARIABLE,Constants.TYPE_INTEGER); + } + + /** + * get length + * + * @param id + * a string identifying the person + * @return the length of the person + */ + + public static SumoCommand getLength(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_LENGTH, id, Constants.RESPONSE_GET_PERSON_VARIABLE,Constants.TYPE_DOUBLE); + } + + /** + * get waiting time + * + * @param id + * a string identifying the person + * @return the waiting time of the person + */ + + + public static SumoCommand getWaitingTime(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_WAITING_TIME, id, Constants.RESPONSE_GET_PERSON_VARIABLE,Constants.TYPE_DOUBLE); + } + + /** + * get width + * + * @param id + * a string identifying the person + * @return the width of the person + */ + + public static SumoCommand getWidth(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_WIDTH, id, Constants.RESPONSE_GET_PERSON_VARIABLE,Constants.TYPE_DOUBLE); + } + + /** + * get minGap + * + * @param id + * a string identifying the person + * @return the value for the minimum Ggap of the person + */ + + public static SumoCommand getMinGap(String id){ + return new SumoCommand(Constants.CMD_GET_PERSON_VARIABLE, Constants.VAR_MINGAP, id, Constants.RESPONSE_GET_PERSON_VARIABLE,Constants.TYPE_DOUBLE); + } + + //setter methods + + + /* not yet implemented! + + public static SumoCommand add(String id, String typeID, SumoStringList edges, int depart, double pos, double speed){ + + Object[] array = new Object[]{typeID, edges, depart, pos, speed}; + return new SumoCommand(Constants.CMD_SET_PERSON_VARIABLE, Constants.ADD, id, array); + } + + public static SumoCommand setColor(String id, SumoColor color){ + return new SumoCommand(Constants.CMD_SET_PERSON_VARIABLE, Constants.VAR_COLOR, id, color); + } + + public static SumoCommand setSpeed(String id, double speed){ + return new SumoCommand(Constants.CMD_SET_PERSON_VARIABLE, Constants.VAR_SPEED, id, speed); + } + + public static SumoCommand remove(String id, byte reason){ + return new SumoCommand(Constants.CMD_SET_PERSON_VARIABLE, Constants.REMOVE, id, reason); + } + + */ +} \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Poi.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Poi.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Poi.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Poi.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -47,6 +47,8 @@ * a string identifying the type of a poi * @param layer * an integer identifying the layer + * + * @return SumoCommand */ public static SumoCommand add(String poiID, double x, double y, SumoColor color, String poiType, int layer){ @@ -56,6 +58,7 @@ /** * Returns the number of all Poi's in the network. + * @return the number of POI's in the network */ public static SumoCommand getIDCount(){ @@ -117,6 +120,7 @@ * a string identifying the point-of-interest * @param layer * an integer identifying the layer + * @return SumoCommand */ public static SumoCommand remove(String poiID, int layer){ @@ -131,6 +135,7 @@ * a string identifying the point-of-interest * @param color * value (r,g,b,a) of color + * @return SumoCommand */ public static SumoCommand setColor(String poiID, SumoColor color){ @@ -147,6 +152,7 @@ * x-coordinate of the point * @param y * y-coordinate of the point + * @return SumoCommand */ public static SumoCommand setPosition(String poiID, double x, double y){ @@ -162,11 +168,12 @@ * a string identifying the point-of-interest * @param poiType * a string identifying the type of a poi + * @return SumoCommand */ public static SumoCommand setType(String poiID, String poiType){ - return new SumoCommand(Constants.CMD_SET_POI_VARIABLE, Constants.CMD_SET_POI_VARIABLE, poiID, poiType); + return new SumoCommand(Constants.CMD_SET_POI_VARIABLE, Constants.VAR_TYPE, poiID, poiType); } diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Polygon.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Polygon.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Polygon.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Polygon.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -59,6 +59,7 @@ /** * Returns the number of all Polygons in the network. + * @return the number of polygons in the network */ public static SumoCommand getIDCount(){ @@ -71,6 +72,7 @@ * @param polygonID * a string identifying the polygon return the shape of the * polygon + * @return the shape */ public static SumoCommand getShape(String polygonID){ @@ -106,10 +108,10 @@ * type of the polygon * @param layer * an integer identifying the layer + * @return SumoCommand */ public static SumoCommand add(String polygonID, SumoGeometry shape, SumoColor color, boolean fill, String polygonType, int layer){ - Object[] array = new Object[]{shape, color, fill, polygonType, layer}; return new SumoCommand(Constants.CMD_SET_POLYGON_VARIABLE, Constants.ADD, polygonID, array); } @@ -121,11 +123,11 @@ * a string identifying the polygon * @param layer * an integer identifying the layer + * @return SumoCommand */ public static SumoCommand remove(String polygonID, int layer){ - - return new SumoCommand(Constants.CMD_SET_POLYGON_VARIABLE, Constants.CMD_SET_POLYGON_VARIABLE, polygonID, layer); + return new SumoCommand(Constants.CMD_SET_POLYGON_VARIABLE, Constants.REMOVE, polygonID, layer); } /** @@ -135,11 +137,11 @@ * a string identifying the polygon * @param color * value (r,g,b,a) of color + * @return SumoCommand */ public static SumoCommand setColor(String polygonID, SumoColor color){ - - return new SumoCommand(Constants.CMD_SET_POLYGON_VARIABLE, Constants.TYPE_COLOR, polygonID, color); + return new SumoCommand(Constants.CMD_SET_POLYGON_VARIABLE, Constants.VAR_COLOR, polygonID, color); } /** @@ -149,11 +151,11 @@ * a string identifying the polygon * @param shape * shape of the polygon + * @return SumoCommand */ public static SumoCommand setShape(String polygonID, SumoStringList shape){ - - return new SumoCommand(Constants.CMD_SET_POLYGON_VARIABLE, Constants.CMD_SET_POLYGON_VARIABLE, polygonID, shape); + return new SumoCommand(Constants.CMD_SET_POLYGON_VARIABLE, Constants.VAR_SHAPE, polygonID, shape); } /** @@ -163,11 +165,11 @@ * a string identifying the polygon * @param polygonType * type of the polygon + * @return SumoCommand */ public static SumoCommand setType(String polygonID, String polygonType){ - - return new SumoCommand(Constants.CMD_SET_POLYGON_VARIABLE, Constants.CMD_SET_POLYGON_VARIABLE, polygonID, polygonType); + return new SumoCommand(Constants.CMD_SET_POLYGON_VARIABLE, Constants.VAR_TYPE, polygonID, polygonType); } diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Route.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Route.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Route.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Route.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -56,6 +56,7 @@ /** * Returns the number of all Routes in the network. + * @return the number of routes in the network */ public static SumoCommand getIDCount(){ @@ -72,6 +73,7 @@ * a string identifying the route * @param edges * list of edges the new route is following + * @return SumoCommand */ public static SumoCommand add(String routeID, SumoStringList edges){ diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Simulation.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Simulation.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Simulation.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Simulation.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -33,8 +33,12 @@ /** * convert2D + * @param edgeID edge id + * @param pos pos + * @param laneIndex index + * @param toGeo geo + * @return SumoCommand */ - public static SumoCommand convert2D(String edgeID, double pos, byte laneIndex, String toGeo){ Object[] array = new Object[]{pos, laneIndex, toGeo}; return new SumoCommand(Constants.CMD_GET_SIM_VARIABLE, Constants.POSITION_CONVERSION, edgeID, array, Constants.RESPONSE_GET_SIM_VARIABLE, Constants.TYPE_STRINGLIST); @@ -42,8 +46,12 @@ /** * convert3D + * @return SumoCommand + * @param edgeID edge id + * @param pos pos + * @param laneIndex index + * @param toGeo geo */ - public static SumoCommand convert3D(String edgeID, double pos, byte laneIndex, String toGeo){ Object[] array = new Object[]{pos, laneIndex, toGeo}; return new SumoCommand(Constants.CMD_GET_SIM_VARIABLE, Constants.POSITION_CONVERSION, edgeID, array, Constants.RESPONSE_GET_SIM_VARIABLE, Constants.TYPE_STRINGLIST); @@ -52,8 +60,11 @@ /** * convertGeo + * @return SumoCommand + * @param x x + * @param y y + * @param fromGeo geo */ - public static SumoCommand convertGeo(double x, double y, String fromGeo){ Object[] array = new Object[]{y, fromGeo}; return new SumoCommand(Constants.CMD_GET_SIM_VARIABLE, Constants.POSITION_CONVERSION, x, array, Constants.RESPONSE_GET_SIM_VARIABLE, Constants.TYPE_STRINGLIST); @@ -61,8 +72,11 @@ /** * convertRoad + * @return SumoCommand + * @param x x + * @param y y + * @param isGeo geo */ - public static SumoCommand convertRoad(double x, double y, String isGeo){ Object[] array = new Object[]{y, isGeo}; return new SumoCommand(Constants.CMD_GET_SIM_VARIABLE, Constants.VAR_POSITION, x, array, Constants.RESPONSE_GET_SIM_VARIABLE, Constants.POSITION_2D); @@ -70,6 +84,7 @@ /** * Returns a list of IDs of vehicles which arrived in this time step. + * @return list of vehicles */ public static SumoCommand getArrivedIDList(){ @@ -78,6 +93,7 @@ /** * Returns the number of vehicles which arrived in this time step. + * @return number of vehicles */ public static SumoCommand getArrivedNumber(){ @@ -85,17 +101,17 @@ } /** - * Returns the current simulation time (in ms). + * Returns the current waiting time on bus stops(in ms). + * @return waiting time */ public static SumoCommand getBusStopWaiting(){ return new SumoCommand(Constants.CMD_GET_SIM_VARIABLE, Constants.VAR_BUS_STOP_WAITING, "", Constants.RESPONSE_GET_SIM_VARIABLE, Constants.TYPE_INTEGER); } - - /** * getParkingEndingVehiclesIDList() + * @return number of vehicles */ public static SumoCommand getParkingEndingVehiclesIDList(){ @@ -105,6 +121,7 @@ /** * getParkingEndingVehiclesNumber() + * @return number of vehicles */ public static SumoCommand getParkingEndingVehiclesNumber(){ @@ -113,6 +130,7 @@ /** * getParkingStartingVehiclesIDList() + * @return number of vehicles */ public static SumoCommand getParkingStartingVehiclesIDList(){ @@ -122,6 +140,7 @@ /** * getParkingStartingVehiclesNumber() + * @return number of vehicles */ public static SumoCommand getParkingStartingVehiclesNumber(){ @@ -131,6 +150,7 @@ /** * getStopEndingVehiclesIDList() + * @return number of vehicles */ public static SumoCommand getStopEndingVehiclesIDList(){ @@ -140,6 +160,7 @@ /** * getStopEndingVehiclesNumber() + * @return number of vehicles */ public static SumoCommand getStopEndingVehiclesNumber(){ @@ -148,6 +169,7 @@ /** * getStopStartingVehiclesIDList() + * @return list of vehicles */ public static SumoCommand getStopStartingVehiclesIDList(){ @@ -157,6 +179,7 @@ /** * getStopStartingVehiclesIDList() + * @return list of vehicles */ public static SumoCommand getStopStartingVehiclesNumber(){ @@ -166,6 +189,7 @@ /** * getCurrentTime + * @return current time */ public static SumoCommand getCurrentTime(){ @@ -174,6 +198,7 @@ /** * getDeltaT + * @return delat time */ public static SumoCommand getDeltaT(){ @@ -182,6 +207,7 @@ /** * Returns a list of IDs of vehicles which departed in this time step. + * @return list of IDs of vehicles which departed in this time step. */ public static SumoCommand getDepartedIDList(){ @@ -190,6 +216,7 @@ /** * Returns the number of vehicles which departed in this time step. + * @return the number of vehicles which departed in this time step. */ public static SumoCommand getDepartedNumber(){ @@ -200,6 +227,15 @@ * getDistance2D */ + /** + * @param x1 x1 + * @param y1 y1 + * @param x2 x2 + * @param y2 y2 + * @param isGeo is geo + * @param isDriving is driving + * @return distance + */ public static SumoCommand getDistance2D(double x1, double y1, double x2, double y2, String isGeo, String isDriving){ Object[] array = new Object[]{y1, x2, y2, isGeo, isDriving}; return new SumoCommand(Constants.CMD_GET_SIM_VARIABLE, Constants.POSITION_LON_LAT, x1, array, Constants.RESPONSE_GET_SIM_VARIABLE, Constants.TYPE_DOUBLE); @@ -209,6 +245,14 @@ * getDistanceRoad */ + /** + * @param edgeID1 first edge + * @param pos1 first position + * @param edgeID2 second edge + * @param pos2 second position + * @param isDriving is drinving + * @return the distance in [m] + */ public static SumoCommand getDistanceRoad(String edgeID1, double pos1, String edgeID2, double pos2, String isDriving){ Object[] array = new Object[]{pos1, edgeID2, pos2, isDriving}; return new SumoCommand(Constants.CMD_GET_SIM_VARIABLE, Constants.REQUEST_DRIVINGDIST, edgeID1, array, Constants.RESPONSE_GET_SIM_VARIABLE, Constants.TYPE_DOUBLE); @@ -216,6 +260,7 @@ /** * Returns a list of IDs of vehicles which ended to be teleported in this time step. + * @return SumoCommand */ public static SumoCommand getEndingTeleportIDList(){ @@ -224,6 +269,7 @@ /** * Returns the number of vehicles which ended to be teleported in this time step. + * @return SumoCommand */ public static SumoCommand getEndingTeleportNumber(){ @@ -232,6 +278,7 @@ /** * Returns a list of IDs of vehicles which were loaded in this time step. + * @return SumoCommand */ public static SumoCommand getLoadedIDList(){ @@ -239,7 +286,8 @@ } /** - * Return the number of vehicles which were loaded in this time step. + * Return the number of vehicles which were loaded in this time step. * @return SumoCommand + * @return SumoCommand */ public static SumoCommand getLoadedNumber(){ @@ -248,6 +296,7 @@ /** * Returns the number of vehicles which are in the net plus the ones still waiting to start. + * @return SumoCommand */ public static SumoCommand getMinExpectedNumber(){ @@ -256,14 +305,15 @@ /** * Returns the boundary box of the simulation network. + * @return SumoCommand */ - public static SumoCommand getNetBoundary(){ return new SumoCommand(Constants.CMD_GET_SIM_VARIABLE, Constants.VAR_NET_BOUNDING_BOX, "", Constants.RESPONSE_GET_SIM_VARIABLE, Constants.TYPE_BOUNDINGBOX); } /** * Returns a list of IDs of vehicles which started to teleport in this time step. + * @return SumoCommand */ public static SumoCommand getStartingTeleportIDList(){ @@ -272,6 +322,7 @@ /** * Returns the number of vehicles which started to teleport in this time step. + * @return SumoCommand */ public static SumoCommand getStartingTeleportNumber(){ @@ -282,11 +333,11 @@ /** * Clear pending - * + * @param routeID route id + * @return SumoCommand */ public static SumoCommand clearPending(String routeID){ - return new SumoCommand(Constants.CMD_SET_SIM_VARIABLE, Constants.CMD_CLEAR_PENDING_VEHICLES, "", routeID); } diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Trafficlights.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Trafficlights.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Trafficlights.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Trafficlights.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -37,6 +37,7 @@ * Returns the complete traffic light program. * * @param tlsID a string identifying the traffic light + * @return program definition */ public static SumoCommand getCompleteRedYellowGreenDefinition(String tlsID){ @@ -46,6 +47,7 @@ /** * Returns the number of all traffic lights in the network. + * @return number of traffic lights */ public static SumoCommand getIDCount(){ @@ -54,6 +56,8 @@ /** * getPhaseDuration + * @param tlsID a string identifying the traffic light + * @return phase duration */ public static SumoCommand getPhaseDuration(String tlsID){ @@ -130,6 +134,7 @@ * Returns the named tl's state as a tuple of light definitions from rRgGyYoO, for red, green, yellow, off, where lower case letters mean that the stream has to decelerate. * * @param tlsID a string identifying the traffic light + * @return SumoCommand */ public static SumoCommand getRedYellowGreenState(String tlsID){ @@ -143,10 +148,10 @@ * * @param tlsID a string identifying the traffic light * @param tls complete program definition + * @return SumoCommand */ public static SumoCommand setCompleteRedYellowGreenDefinition(String tlsID, SumoTLSLogic tls){ - return new SumoCommand(Constants.CMD_SET_TL_VARIABLE, Constants.TL_COMPLETE_PROGRAM_RYG, tlsID, tls); } @@ -155,6 +160,7 @@ * * @param tlsID a string identifying the traffic light * @param index an integer identifying the phase (it must be between 0 and the number of phases known to the current program of the tls - 1) + * @return SumoCommand */ public static SumoCommand setPhase(String tlsID, int index){ @@ -167,6 +173,7 @@ * * @param tlsID a string identifying the traffic light * @param phaseDuration remaining duration of the current phase + * @return SumoCommand */ public static SumoCommand setPhaseDuration(String tlsID, int phaseDuration){ @@ -179,10 +186,10 @@ * * @param tlsID a string identifying the traffic light * @param programID a string identifying the program + * @return SumoCommand */ public static SumoCommand setProgram(String tlsID, String programID){ - return new SumoCommand(Constants.CMD_SET_TL_VARIABLE, Constants.TL_PROGRAM, tlsID, programID); } @@ -191,12 +198,11 @@ * * @param tlsID a string identifying the traffic light * @param state as a tuple of light definitions from rRgGyYoO, for red, green, yellow, off, where lower case letters mean that the stream has to decelerate + * @return SumoCommand */ public static SumoCommand setRedYellowGreenState(String tlsID, String state){ - return new SumoCommand(Constants.CMD_SET_TL_VARIABLE, Constants.TL_RED_YELLOW_GREEN_STATE, tlsID, state); } - } \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Vehicle.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Vehicle.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Vehicle.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Vehicle.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -36,6 +36,8 @@ /** * Returns the acceleration of the named vehicle within the last step. + * @param vehID id of the vehicle + * @return acceleration */ public static SumoCommand getAccel(String vehID){ @@ -44,6 +46,7 @@ /** * Returns the number of all vehicles in the network. + * @return current number of vehicles in the network */ public static SumoCommand getIDCount(){ @@ -53,8 +56,11 @@ /** * Returns the edge travel time for the given time as stored in the vehicle's internal container. + * @param vehID id of the vehicle + * @param time time + * @param edgeID id of the edge + * @return SumoCommand */ - public static SumoCommand getAdaptedTraveltime(String vehID, int time, String edgeID){ Object[] array = new Object[]{time, edgeID}; return new SumoCommand(Constants.CMD_GET_VEHICLE_VARIABLE, Constants.VAR_EDGE_TRAVELTIME, vehID, array, Constants.RESPONSE_GET_VEHICLE_VARIABLE, Constants.TYPE_DOUBLE); @@ -62,6 +68,8 @@ /** * Returns the angle of the named vehicle within the last time step. + * @param vehID id of the vehicle + * @return angle */ public static SumoCommand getAngle(String vehID){ @@ -71,6 +79,8 @@ /** * Returns the maximum allowed speed on the current lane regarding speed factor in m/s for this vehicle. + * @param vehID id of the vehicle + * @return allowed speed */ public static SumoCommand getAllowedSpeed(String vehID){ @@ -81,6 +91,9 @@ /** * Return the leading vehicle id together with the distance. The dist parameter defines the maximum lookahead, 0 calculates a lookahead from the brake gap. + * @param vehID id of the vehicle + * @param dist distance + * @return the leading vehicle */ public static SumoCommand getLeader(String vehID, double dist){ @@ -93,6 +106,8 @@ /** * getPersonNumber + * @param vehID id of the vehicle + * @return person number */ public static SumoCommand getPersonNumber(String vehID){ @@ -102,6 +117,8 @@ /** * getBestLanes + * @param vehID id of the vehicle + * @return list of the best lanes */ public static SumoCommand getBestLanes(String vehID){ @@ -110,6 +127,8 @@ /** * Returns the CO2 emission in mg for the last time step. + * @param vehID id of the vehicle + * @return value for co2 */ public static SumoCommand getCO2Emission(String vehID){ @@ -118,6 +137,8 @@ /** * Returns the CO emission in mg for the last time step. + * @param vehID id of the vehicle + * @return value for co2 */ public static SumoCommand getCOEmission(String vehID){ @@ -126,6 +147,8 @@ /** * Returns the vehicle's color (RGBA). + * @param vehID id of the vehicle + * @return color */ public static SumoCommand getColor(String vehID){ @@ -134,6 +157,8 @@ /** * Returns the deceleration of the named vehicle within the last time step. + * @param vehID id of the vehicle + * @return deceleration */ public static SumoCommand getDecel(String vehID){ @@ -142,8 +167,12 @@ /** * Returns the driving distance (in m) of the named vehicle within the last tine step. + * @param vehID id + * @param edgeID edge id + * @param pos pos + * @param laneID lane id + * @return the distance */ - public static SumoCommand getDrivingDistance(String vehID, String edgeID, double pos, int laneID){ Object[] array = new Object[]{edgeID, pos, laneID}; return new SumoCommand(Constants.CMD_GET_VEHICLE_VARIABLE, Constants.DISTANCE_REQUEST, vehID, array, Constants.RESPONSE_GET_VEHICLE_VARIABLE, Constants.TYPE_DOUBLE); @@ -151,8 +180,11 @@ /** * getDrivingDistance2D + * @param vehID id of the vehicle + * @param x x + * @param y y + * @return the distance */ - public static SumoCommand getDrivingDistance2D(String vehID, double x, double y){ Object[] array = new Object[]{x, y}; return new SumoCommand(Constants.CMD_GET_VEHICLE_VARIABLE, Constants.DISTANCE_REQUEST, vehID, array, Constants.RESPONSE_GET_VEHICLE_VARIABLE, Constants.TYPE_DOUBLE); @@ -160,6 +192,8 @@ /** * Get the distance to the starting point acts as a odometer + * @param vehID id of the vehicle + * @return the current distance of the vehicle (odometer) */ public static SumoCommand getDistance(String vehID){ @@ -167,12 +201,13 @@ } - - /** * Returns the edge effort for the given time as stored in the vehicle's internal container. + * @param vehID id of the vehicle + * @param time time + * @param edgeID edge id + * @return the effort */ - public static SumoCommand getEffort(String vehID, int time, String edgeID){ Object[] array = new Object[]{time, edgeID}; return new SumoCommand(Constants.CMD_GET_VEHICLE_VARIABLE, Constants.VAR_EDGE_EFFORT, vehID, array, Constants.RESPONSE_GET_VEHICLE_VARIABLE, Constants.TYPE_DOUBLE); @@ -180,6 +215,8 @@ /** * Returns the emission class of the named vehicle. + * @param vehID id of the vehicle + * @return emission class */ public static SumoCommand getEmissionClass(String vehID){ @@ -188,6 +225,8 @@ /** * Returns the fuel consumption in ml for the last time step. + * @param vehID id of the vehicle + * @return fuel consumption */ public static SumoCommand getFuelConsumption(String vehID){ @@ -196,6 +235,8 @@ /** * Returns the HC emission (in mg) during the last time step. + * @param vehID id of the vehicle + * @return value for hc */ public static SumoCommand getHCEmission(String vehID){ @@ -204,6 +245,7 @@ /** * Returns a list of ids of all vehicles currently running within the scenario. + * @return list of vehicles */ public static SumoCommand getIDList(){ @@ -212,6 +254,8 @@ /** * getImperfection + * @param vehID id of the vehicle + * @return value for imperfection */ public static SumoCommand getImperfection(String vehID){ @@ -220,6 +264,8 @@ /** * Returns the id of the lane the named vehicle was at within the last step. + * @param vehID id of the vehicle + * @return lane id */ public static SumoCommand getLaneID(String vehID){ @@ -228,6 +274,8 @@ /** * Returns the index of the lane the named vehicle was at within the last step. + * @param vehID id of the vehicle + * @return lane index */ public static SumoCommand getLaneIndex(String vehID){ @@ -236,6 +284,8 @@ /** * Returns the position of the vehicle along the lane (in m). + * @param vehID id of the vehicle + * @return lane position */ public static SumoCommand getLanePosition(String vehID){ @@ -244,6 +294,8 @@ /** * Returns the length (in m) of the named vehicle. + * @param vehID id of the vehicle + * @return length */ public static SumoCommand getLength(String vehID){ @@ -252,6 +304,8 @@ /** * Returns the maximum speed(in m/s) of the named vehicle. + * @param vehID id of the vehicle + * @return max speed */ public static SumoCommand getMaxSpeed(String vehID){ @@ -260,6 +314,8 @@ /** * Returns the minimum gap (in m) between this vehicle and the vehicle before it. + * @param vehID id of the vehicle + * @return min gap */ public static SumoCommand getMinGap(String vehID){ @@ -268,6 +324,8 @@ /** * Returns the NOx emissions (in mg) generated by the vehicle during the last time step. + * @param vehID id of the vehicle + * @return value for nox */ public static SumoCommand getNOxEmission(String vehID){ @@ -276,6 +334,8 @@ /** * Returns the noise emission (in db) generated by the vehicle during the last time step. + * @param vehID id of the vehicle + * @return value for noise emission */ public static SumoCommand getNoiseEmission(String vehID){ @@ -284,6 +344,8 @@ /** * Returns the particular matter emissions (in mg) generated by the vehicle during the last time step. + * @param vehID id of the vehicle + * @return value for pmx */ public static SumoCommand getPMxEmission(String vehID){ @@ -292,6 +354,8 @@ /** * Returns the position of the named vehicle within the last step [m,m]. + * @param vehID id of the vehicle + * @return position 2D */ public static SumoCommand getPosition(String vehID){ @@ -299,7 +363,9 @@ } /** - * Returns the position of the named vehicle within the last step [m,m]. + * Returns the position of the named vehicle within the last step [m,m,m]. + * @param vehID id of the vehicle + * @return position 3D */ public static SumoCommand getPosition3D(String vehID){ @@ -308,6 +374,8 @@ /** * Returns the id of the edge the named vehicle was at within the last step. + * @param vehID id of the vehicle + * @return road id */ public static SumoCommand getRoadID(String vehID){ @@ -316,6 +384,8 @@ /** * Returns the ids of the edges the vehicle's route is made of. + * @param vehID id of the vehicle + * @return route */ public static SumoCommand getRoute(String vehID){ @@ -324,6 +394,8 @@ /** * Returns the id of the route of the named vehicle. + * @param vehID id of the vehicle + * @return route id */ public static SumoCommand getRouteID(String vehID){ @@ -332,6 +404,8 @@ /** * getShapeClass + * @param vehID id of the vehicle + * @return shape class */ public static SumoCommand getShapeClass(String vehID){ @@ -340,6 +414,8 @@ /** * getSignals + * @param vehID id of the vehicle + * @return the signal state of the vehicle */ public static SumoCommand getSignals(String vehID){ @@ -348,6 +424,8 @@ /** * Returns the speed (in m/s) of the named vehicle within the last step. + * @param vehID id of the vehicle + * @return speed in m/s */ public static SumoCommand getSpeed(String vehID){ @@ -356,6 +434,8 @@ /** * Returns the standard deviation of the estimated maximum speed (see speed factor) divided by this speed. + * @param vehID id of the vehicle + * @return speed deviation */ public static SumoCommand getSpeedDeviation(String vehID){ @@ -364,6 +444,8 @@ /** * Returns the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed. + * @param vehID id of the vehicle + * @return speed factor */ public static SumoCommand getSpeedFactor(String vehID){ @@ -372,6 +454,8 @@ /** * getSpeedWithoutTraCI + * @param vehID id of the vehicle + * @return speed in m/s */ public static SumoCommand getSpeedWithoutTraCI(String vehID){ @@ -380,6 +464,8 @@ /** * getTau + * @param vehID id of the vehicle + * @return tau */ public static SumoCommand getTau(String vehID){ @@ -388,6 +474,8 @@ /** * The waiting time of a vehicle is defined as the time (in seconds) spent with a speed below 0.1m/s since the last time it was faster than 0.1m/s. (basically, the waiting time of a vehicle is reset to 0 every time it moves). + * @param vehID id of the vehicle + * @return waiting time */ public static SumoCommand getWaitingTime(String vehID){ @@ -397,6 +485,8 @@ /** * Returns the id of the type of the named vehicle. + * @param vehID id of the vehicle + * @return type id */ public static SumoCommand getTypeID(String vehID){ @@ -405,6 +495,8 @@ /** * Returns the vehicle class. + * @param vehID id of the vehicle + * @return vehicle class */ public static SumoCommand getVehicleClass(String vehID){ @@ -413,6 +505,8 @@ /** * Returns the vehicle's width (in m). + * @param vehID id of the vehicle + * @return width */ public static SumoCommand getWidth(String vehID){ @@ -422,6 +516,8 @@ /** * Returns whether the Route is valid. + * @param vehID id of the vehicle + * @return route valid */ public static SumoCommand isRouteValid(String vehID){ @@ -430,6 +526,10 @@ /** * Reduces the speed to the given for the given amount of time. + * @param vehID id of the vehicle + * @param speed speed + * @param duration duration + * @return SumoCommand */ public static SumoCommand slowDown(String vehID, double speed, int duration){ @@ -441,8 +541,16 @@ /** * Add a new vehicle. - */ + * @param vehID vehicle id + * @param typeID type id + * @param routeID route id + * @param depart depart + * @param pos position + * @param speed speed + * @param lane lane + * @return SumoCommand + */ public static SumoCommand add(String vehID, String typeID, String routeID, int depart, double pos, double speed, byte lane){ Object[] array = new Object[]{typeID, routeID, depart, pos, speed, lane}; @@ -451,8 +559,12 @@ /** * Forces a lane change to the lane with the given index; if successful, the lane will be chosen for the given amount of time. - */ + * @param vehID vehicle id + * @param laneIndex lane index + * @param duration duration + * @return SumoCommand + */ public static SumoCommand changeLane(String vehID, byte laneIndex, int duration){ Object[] array = new Object[]{laneIndex, duration}; @@ -461,8 +573,10 @@ /** * The vehicle's destination edge is set to the given. The route is rebuilt. + * @param vehID vehicle id + * @param edgeID edge id + * @return SumoCommand */ - public static SumoCommand changeTarget(String vehID, String edgeID){ return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.CMD_CHANGETARGET, vehID, edgeID); @@ -470,8 +584,13 @@ /** * Moves the vehicle to a new position. - */ + * @param vehID vehicle id + * @param laneID lane id + * @param pos position + * @return SumoCommand + */ + public static SumoCommand moveTo(String vehID, String laneID, double pos){ Object[] array = new Object[]{laneID, pos}; @@ -480,8 +599,14 @@ /** * moveToVTD - */ + * @param vehID vehicle id + * @param edgeID edge id + * @param lane lane + * @param x x + * @param y y + * @return SumoCommand + */ public static SumoCommand moveToVTD(String vehID, String edgeID, int lane, double x, double y){ Object[] array = new Object[]{edgeID, lane, x, y}; @@ -490,46 +615,57 @@ /** * Removes vehicle with the given ID for the given reason. Reasons are defined in module constants and start with REMOVE_ - */ + * @param vehID vehicle id + * @param reason reason + * @return SumoCommand + */ public static SumoCommand remove(String vehID, byte reason){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.REMOVE, vehID, reason); } /** * Computes a new route using the vehicle's internal and the global edge effort information. + * @param vehID id of the vehicle + * @return SumoCommand */ public static SumoCommand rerouteEffort(String vehID){ - Object[] array = new Object[]{vehID}; return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.CMD_REROUTE_EFFORT, vehID, array); } /** * Computes a new route using the vehicle's internal and the global edge travel time information. + * @param vehID id of the vehicle + * @return SumoCommand */ public static SumoCommand rerouteTraveltime(String vehID){ - Object[] array = new Object[]{vehID}; return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.CMD_REROUTE_TRAVELTIME, vehID, array); } /** * Sets the acceleration of the named vehicle. + * @param vehID id of the vehicle + * @param accel acceleration + * @return SumoCommand */ public static SumoCommand setAccel(String vehID, double accel){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_ACCEL, vehID, accel); } /** * Sets the edge travel time of the named vehicle. + * @param vehID id of the vehicle + * @param begTime begin time + * @param endTime end time + * @param edgeID edge id + * @param time time + * @return SumoCommand */ - public static SumoCommand setAdaptedTraveltime(String vehID, int begTime, int endTime, String edgeID, double time){ Object[] array = new Object[]{begTime, endTime, edgeID, time}; @@ -539,34 +675,41 @@ /** * Sets the vehicle's color (RGBA). - */ + * @param vehID id of the vehicle + * @param color color + * @return SumoCommand + */ public static SumoCommand setColor(String vehID, SumoColor color){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_COLOR, vehID, color); } /** * Sets the deceleration of the named vehicle. + * @param vehID id of the vehicle + * @param decel deceleration + * @return SumoCommand */ - public static SumoCommand setDecel(String vehID, double decel){ - - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_DECEL, vehID, decel); + return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_DECEL, vehID, decel); } /** * Sets the vehicle's lane change mode as a bitset. + * @param vehID id of the vehicle + * @param lcm lane change model + * @return SumoCommand */ - public static SumoCommand setLaneChangeMode(String vehID, int lcm){ return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_LANECHANGE_MODE, vehID, lcm); } /** * Sets the IDs of the edges the vehicle's route is made of. + * @param vehID id of the vehicle + * @param edgeList edges list + * @return SumoCommand */ - public static SumoCommand setRoute(String vehID, SumoStringList edgeList){ Object[] array = new Object[]{edgeList}; return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_ROUTE, vehID, array); @@ -574,8 +717,10 @@ /** * Sets the id of the type for the named vehicle. + * @param vehID id of the vehicle + * @param typeID type id + * @return SumoCommand */ - public static SumoCommand setType(String vehID, String typeID){ return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_TYPE, vehID, typeID); } @@ -584,8 +729,13 @@ /** * Sets the edge effort for the given time as stored in the vehicle's internal container. + * @param vehID id of the vehicle + * @param begTime begin time + * @param endTime end time + * @param edgeID edge id + * @param effort effort + * @return SumoCommand */ - public static SumoCommand setEffort(String vehID, int begTime, int endTime, String edgeID, double effort){ Object[] array = new Object[]{begTime, endTime, edgeID, effort}; @@ -594,107 +744,139 @@ /** * Sets the emission class of the named vehicle. - */ + * @param vehID id of the vehicle + * @param clazz emission class + * @return SumoCommand + */ public static SumoCommand setEmissionClass(String vehID, String clazz){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_EMISSIONCLASS, vehID, clazz); } /** * setImperfection + * @param vehID vehicle id + * @param imperfection imperfection + * @return SumoCommand */ - public static SumoCommand setImperfection(String vehID, double imperfection){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_IMPERFECTION, vehID, imperfection); } /** * Sets the length (in m) of the named vehicle. + * @param vehID vehicle id + * @param length length + * @return SumoCommand */ - public static SumoCommand setLength(String vehID, double length){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_LENGTH, vehID, length); } /** * Sets the maximum speed (in m/s) of the named vehicle. + * @param vehID vehicle id + * @param speed speed + * @return SumoCommand */ - public static SumoCommand setMaxSpeed(String vehID, double speed){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_MAXSPEED, vehID, speed); } /** * Sets the minimum gap (in m) between this vehicle and the vehicle before it. + * @param vehID vehicle id + * @param minGap minimum gap + * @return SumoCommand */ - public static SumoCommand setMinGap(String vehID, double minGap){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_MINGAP, vehID, minGap); } /** * Sets the id of the route of the named vehicle. + * @param vehID vehicle id + * @param routeID route id + * @return SumoCommand */ public static SumoCommand setRouteID(String vehID, String routeID){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_ROUTE_ID, vehID, routeID); } /** * setShapeClass + * @param vehID vehicle id + * @param clazz shape class + * @return SumoCommand */ - public static SumoCommand setShapeClass(String vehID, String clazz){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_SHAPECLASS, vehID, clazz); } /** * setSignals + * @param vehID vehicle id + * @param signals signals + * @return SumoCommand */ - public static SumoCommand setSignals(String vehID, String signals){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_SIGNALS, vehID, signals); } /** * Sets the speed (in m/s) of the named vehicle. + * @param vehID vehicle id + * @param speed speed + * @return SumoCommand */ - + public static SumoCommand setSpeed(String vehID, double speed){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_SPEED, vehID, speed); } - + /** * Sets the standard deviation of the estimated maximum speed. + * @param vehID vehicle id + * @param deviation deviation + * @return SumoCommand */ - public static SumoCommand setSpeedDeviation(String vehID, double deviation){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_SPEED_DEVIATION, vehID, deviation); } /** * Sets the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed. + * @param vehID vehicle id + * @param factor factor + * @return SumoCommand */ - + public static SumoCommand setSpeedFactor(String vehID, double factor){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_SPEED_FACTOR, vehID, factor); } + /** - * Lets the vehicle stop at the given edge, at the given position and lane. The vehicle will stop for the given duration. Re-issuing a stop command with the same lane and position allows changing the duration. + * Sets the vehicle's speed mode as a bitset. + * @param vehID vehicle id + * @param sm speed mode + * @return SumoCommand */ + public static SumoCommand setspeedMode(String vehID, int sm){ + return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_SPEEDSETMODE, vehID, sm); + } + /** + * Lets the vehicle stop at the given edge, at the given position and lane. The vehicle will stop for the given duration. Re-issuing a stop command with the same lane and position allows changing the duration. + * @param vehID vehicle id + * @param edgeID edge id + * @param pos positon + * @param laneIndex lane index + * @param duration duration + * @param stopType stop type + * @return SumoCommand + */ public static SumoCommand setStop(String vehID, String edgeID, double pos, byte laneIndex, int duration, byte stopType){ Object[] array = new Object[]{edgeID, pos, laneIndex, duration, stopType}; @@ -704,39 +886,43 @@ /** * Continue after a stop + * @param vehID vehicle id + * @return SumoCommand */ - - public static SumoCommand setResume(String vehID){ + public static SumoCommand Resume(String vehID){ Object[] array = new Object[]{vehID}; return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.CMD_RESUME, vehID, array); } /** * setTau + * @param vehID vehicle id + * @param tau tau + * @return SumoCommand */ - public static SumoCommand setTau(String vehID, double tau){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_TAU, vehID, tau); } /** * Sets the vehicle class. + * @param vehID vehicle id + * @param clazz vehicle class + * @return SumoCommand */ - public static SumoCommand setVehicleClass(String vehID, String clazz){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_VEHICLECLASS, vehID, clazz); } /** * Sets the vehicle's width (in m). + * @param vehID vehicle id + * @param width width + * @return SumoCommand */ public static SumoCommand setWidth(String vehID, double width){ - return new SumoCommand(Constants.CMD_SET_VEHICLE_VARIABLE, Constants.VAR_WIDTH, vehID, width); } - } \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Vehicletype.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Vehicletype.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/cmd/Vehicletype.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/cmd/Vehicletype.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -34,14 +34,16 @@ /** * Returns the maximum acceleration of the named vehicle class. + * @param typeID type id + * @return acceleration */ - public static SumoCommand getAccel(String typeID){ return new SumoCommand(Constants.CMD_GET_VEHICLETYPE_VARIABLE, Constants.VAR_ACCEL, typeID, Constants.RESPONSE_GET_VEHICLETYPE_VARIABLE, Constants.TYPE_DOUBLE); } /** * Returns the number of all vehicle types in the network. + * @return number of vehicle types */ public static SumoCommand getIDCount(){ @@ -50,14 +52,17 @@ /** * Returns the vehicle type's color. + * @param typeID type id + * @return color color */ - public static SumoCommand getColor(String typeID){ return new SumoCommand(Constants.CMD_GET_VEHICLETYPE_VARIABLE, Constants.VAR_COLOR, typeID, Constants.RESPONSE_GET_VEHICLETYPE_VARIABLE, Constants.TYPE_COLOR); } /** * Returns the maximum deceleration of the names vehicle type. + * @param typeID type id + * @return deceleration */ public static SumoCommand getDecel(String typeID){ @@ -66,6 +71,8 @@ /** * Returns the emission class of the named vehicle type. + * @param typeID type id + * @return emission class */ public static SumoCommand getEmissionClass(String typeID){ @@ -74,6 +81,7 @@ /** * Returns a list of all known vehicle types. + * @return list of vechicle types */ public static SumoCommand getIDList(){ @@ -82,6 +90,8 @@ /** * getImperfection + * @param typeID type id + * @return imperfection */ public static SumoCommand getImperfection(String typeID){ @@ -90,6 +100,8 @@ /** * Returns the length of the named vehicle type. + * @param typeID type id + * @return length */ public static SumoCommand getLength(String typeID){ @@ -98,6 +110,8 @@ /** * Return the maximum speed of the named vehicle type. + * @param typeID type id + * @return max speed */ public static SumoCommand getMaxSpeed(String typeID){ @@ -106,6 +120,8 @@ /** * Returns the minimum headway gap of the named vehicle type. + * @param typeID type id + * @return min gap */ public static SumoCommand getMinGap(String typeID){ @@ -114,6 +130,8 @@ /** * getShapeClass + * @param typeID type id + * @return shape class */ public static SumoCommand getShapeClass(String typeID){ @@ -122,6 +140,8 @@ /** * Returns the speed deviation of the named vehicle type. + * @param typeID type id + * @return speed deviation */ public static SumoCommand getSpeedDeviation(String typeID){ @@ -130,6 +150,8 @@ /** * Return the speed factor of the names vehicle type. + * @param typeID type id + * @return speed factor */ public static SumoCommand getSpeedFactor(String typeID){ @@ -138,6 +160,8 @@ /** * getTau + * @param typeID type id + * @return tau */ public static SumoCommand getTau(String typeID){ @@ -146,6 +170,8 @@ /** * Returns the vehicle class of the names vehicle type. + * @param typeID type id + * @return vehicle class */ public static SumoCommand getVehicleClass(String typeID){ @@ -154,6 +180,8 @@ /** * Returns the width of the named vehicle type. + * @param typeID type id + * @return width */ public static SumoCommand getWidth(String typeID){ @@ -164,8 +192,10 @@ /** * Sets the vehicle type's wished maximum acceleration to the given value. + * @param typeID type id + * @param accel acceleration + * @return SumoCommand */ - public static SumoCommand setAccel(String typeID, double accel){ return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_ACCEL, typeID, accel); @@ -173,8 +203,10 @@ /** * Sets the vehicle type's color. + * @param typeID type id + * @param color color + * @return SumoCommand */ - public static SumoCommand setColor(String typeID, SumoColor color){ return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_COLOR, typeID, color); @@ -182,8 +214,11 @@ /** * Sets the vehicle type's wished maximum deceleration to the given value. - */ + * @param typeID type id + * @param decel deceleration + * @return SumoCommand + */ public static SumoCommand setDecel(String typeID, double decel){ return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_DECEL, typeID, decel); @@ -191,8 +226,10 @@ /** * Sets the vehicle type's emission class to the given value. + * @param typeID type id + * @param clazz emission class + * @return SumoCommand */ - public static SumoCommand setEmissionClass(String typeID, String clazz){ return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_EMISSIONCLASS, typeID, clazz); @@ -200,8 +237,10 @@ /** * setImperfection + * @param typeID type id + * @param imperfection imperfection + * @return SumoCommand */ - public static SumoCommand setImperfection(String typeID, double imperfection){ return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_IMPERFECTION, typeID, imperfection); @@ -209,80 +248,91 @@ /** * Sets the vehicle type's length to the given value. + * @param typeID type id + * @param length length + * @return SumoCommand */ - public static SumoCommand setLength(String typeID, double length){ - return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_LENGTH, typeID, length); } /** * Sets the vehicle type's maximum speed to the given value. + * @param typeID type id + * @param speed speed + * @return SumoCommand */ - + public static SumoCommand setMaxSpeed(String typeID, double speed){ - - return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_MAXSPEED, typeID, speed); + return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_MAXSPEED, typeID, speed); } /** * Sets the vehicle type's minimum headway gap to the given value. + * @param typeID type id + * @param minGap minimum gap + * @return SumoCommand */ - public static SumoCommand setMinGap(String typeID, double minGap){ - return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_MINGAP, typeID, minGap); } /** * setShapeClass + * @param typeID type id + * @param clazz shape class + * @return SumoCommand */ - public static SumoCommand setShapeClass(String typeID, String clazz){ - return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_SHAPECLASS, typeID, clazz); } /** * Sets the vehicle type's speed deviation to the given value. + * @param typeID type id + * @param deviation deviation + * @return SumoCommand */ - public static SumoCommand setSpeedDeviation(String typeID, double deviation){ - return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_SPEED_DEVIATION, typeID, deviation); } /** * Sets the vehicle type's speed factor to the given value. + * @param typeID type id + * @param factor factor + * @return SumoCommand */ - public static SumoCommand setSpeedFactor(String typeID, double factor){ - return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_SPEED_FACTOR, typeID, factor); } /** * setTau + * @param typeID type id + * @param tau tau + * @return SumoCommand */ - public static SumoCommand setTau(String typeID, double tau){ - return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_TAU, typeID, tau); } /** * Sets the vehicle type's vehicle class to the given value. + * @param typeID type id + * @param clazz vehicle class + * @return SumoCommand */ - public static SumoCommand setVehicleClass(String typeID, String clazz){ - return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_VEHICLECLASS, typeID, clazz); } /** * Sets the vehicle type's width to the given value. + * @param typeID type id + * @param width width + * @return SumoCommand */ - public static SumoCommand setWidth(String typeID, double width){ return new SumoCommand(Constants.CMD_SET_VEHICLETYPE_VARIABLE, Constants.VAR_WIDTH, typeID, width); diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/config/Constants.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/config/Constants.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/config/Constants.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/config/Constants.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -34,11 +34,8 @@ public static final int VAR_LEADER = 0x68; - public static final byte STOP_DEFAULT = 0; - - public static final byte STOP_PARKING = 1; - - public static final byte STOP_TRIGGERED = 2; + /**sets/retrieves abstract parameter*/ + public static final int VAR_PARAMETER = 0x7e; /** how lane changing is performed (set: vehicle)*/ @@ -190,13 +187,35 @@ public static final int RESPONSE_SUBSCRIBE_AREAL_DETECTOR_CONTEXT = 0x9d; /**command: subscribe areal detector (e2) variable*/ - public static final int CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE = 0x8f; + public static final int CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE = 0xdd; /**response: subscribe areal detector (e2) variable*/ - public static final int RESPONSE_SUBSCRIBE_AREAL_DETECTOR_VARIABLE = 0x9f; + public static final int RESPONSE_SUBSCRIBE_AREAL_DETECTOR_VARIABLE = 0xed; + + + /**command: get person variable*/ + public static final int CMD_GET_PERSON_VARIABLE = 0xae; + + /**command: set person variable*/ + public static final int CMD_SET_PERSON_VARIABLE = 0xce; + + /**response: get person variable*/ + public static final int RESPONSE_GET_PERSON_VARIABLE = 0xbe; + + /**command: subscribe person context*/ + public static final int CMD_SUBSCRIBE_PERSON_CONTEXT = 0x8e; + + /**command: subscribe person variable*/ + public static final int CMD_SUBSCRIBE_PERSON_VARIABLE = 0xde; + + /**response: subscribe person context*/ + public static final int RESPONSE_SUBSCRIBE_PERSON_CONTEXT = 0x9e; + + /**response: subscribe person variable*/ + public static final int RESPONSE_SUBSCRIBE_PERSON_VARIABLE = 0xee; - /**route id (get & set: vehicles)*/ + /**route id (get and set: vehicles)*/ public static final int VAR_ROUTE_ID = 0x53; /**response: subscribe poi context*/ @@ -242,7 +261,7 @@ public static final int VAR_WIDTH = 0x4d; /**get area detector (e2) variable*/ - public static final int CMD_GET_AREAL_DETECTOR_VARIABLE = 0x8e; + public static final int CMD_GET_AREAL_DETECTOR_VARIABLE = 0xad; /**get multi-entry/multi-exit detector (e3) variable*/ @@ -601,7 +620,7 @@ /**current CO emission of a node (get: vehicle, lane, edge)*/ public static final int VAR_COEMISSION = 0x61; - /**list of allowed vehicle classes (get&set: lanes)*/ + /**list of allowed vehicle classes (get and set: lanes)*/ public static final int LANE_ALLOWED = 0x34; /**subscribe edge context*/ @@ -640,7 +659,7 @@ /**response: subscribe polygon variable*/ public static final int RESPONSE_SUBSCRIBE_POLYGON_VARIABLE = 0xe8; - /**effort information (get&set: vehicle)*/ + /**effort information (get and set: vehicle)*/ public static final int VAR_EDGE_EFFORT = 0x59; /**subscribe simulation variable*/ @@ -670,7 +689,7 @@ /**outgoing link definitions (get: lanes)*/ public static final int LANE_LINKS = 0x33; - /**list of not allowed vehicle classes (get&set: lanes)*/ + /**list of not allowed vehicle classes (get and set: lanes)*/ public static final int LANE_DISALLOWED = 0x35; /**response: subscribe lane context*/ @@ -755,7 +774,7 @@ /**response: get area detector (e3) variable*/ - public static final int RESPONSE_GET_AREAL_DETECTOR_VARIABLE = 0x9e; + public static final int RESPONSE_GET_AREAL_DETECTOR_VARIABLE = 0xbd; /**response: get multi-/entry detector (e3) variable*/ @@ -802,7 +821,7 @@ /**response: subscribe simulation variable*/ public static final int RESPONSE_SUBSCRIBE_SIM_VARIABLE = 0xeb; - /**travel time information (get&set: vehicle)*/ + /**travel time information (get and set: vehicle)*/ public static final int VAR_EDGE_TRAVELTIME = 0x58; /**current PMx emission of a node (get: vehicle, lane, edge)*/ diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/util/CommandProcessor.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/util/CommandProcessor.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/util/CommandProcessor.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/util/CommandProcessor.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/util/ConvertHelper.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/util/ConvertHelper.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/util/ConvertHelper.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/util/ConvertHelper.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/util/SumoCommand.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/util/SumoCommand.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/util/SumoCommand.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/util/SumoCommand.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -134,6 +134,16 @@ } } + else if((Integer) input2 == Constants.VAR_ROUTE){ + + cmd.content().writeUnsignedByte(Constants.TYPE_STRINGLIST); + SumoStringList sl = (SumoStringList) array[0]; + cmd.content().writeInt(sl.size()); + for(String s : sl) { + cmd.content().writeStringASCII(s); + } + + } else if((Integer) input2 == Constants.CMD_REROUTE_EFFORT || (Integer) input2 == Constants.CMD_REROUTE_TRAVELTIME || (Integer) input2 == Constants.CMD_RESUME){ cmd.content().writeUnsignedByte(Constants.TYPE_COMPOUND); cmd.content().writeInt(0); @@ -325,6 +335,8 @@ this.cmd.content().writeUnsignedByte(Constants.POSITION_3D); }else if(input.getClass().equals(Boolean.class)){ this.cmd.content().writeUnsignedByte(Constants.TYPE_UBYTE); + }else if(input.getClass().equals(SumoStringList.class)){ + this.cmd.content().writeUnsignedByte(Constants.TYPE_STRINGLIST); } } @@ -379,9 +391,15 @@ this.cmd.content().writeUnsignedByte(Constants.TYPE_STRING); cmd.content().writeStringASCII(stp.phasedef); - } - + }else if(input.getClass().equals(SumoStringList.class)){ + + SumoStringList sl = (SumoStringList) input; + cmd.content().writeInt(sl.size()); + for(String s : sl) { + cmd.content().writeStringASCII(s); + } + } } diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/util/Sumo.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/util/Sumo.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/sumo/util/Sumo.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/sumo/util/Sumo.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/conf/Config.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/conf/Config.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/conf/Config.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/conf/Config.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoBoundingBox.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoBoundingBox.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoBoundingBox.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoBoundingBox.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoColor.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoColor.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoColor.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoColor.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoGeometry.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoGeometry.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoGeometry.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoGeometry.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoLink.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoLink.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoLink.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoLink.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoLinkList.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoLinkList.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoLinkList.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoLinkList.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoPosition2D.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoPosition2D.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoPosition2D.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoPosition2D.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoPosition3D.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoPosition3D.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoPosition3D.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoPosition3D.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoStringList.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoStringList.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoStringList.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoStringList.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoTLSLogic.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoTLSLogic.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoTLSLogic.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoTLSLogic.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoTLSPhase.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoTLSPhase.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoTLSPhase.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoTLSPhase.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoVehicleSignal.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoVehicleSignal.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoVehicleSignal.java 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoVehicleSignal.java 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,66 @@ +/* + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology + + This file is part of TraaS. + + TraaS 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. + + TraaS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TraaS. If not, see <http://www.gnu.org/licenses/>. +*/ + +package de.tudresden.ws.container; + +import java.util.LinkedList; + +/** + * + * @author Mario Krumnow + * @author Anja Liebscher + * + */ + +public class SumoVehicleSignal { + + LinkedList<Integer> ll_states; + + public SumoVehicleSignal(int code){ + + String s1 = this.getDual(code); + String[] tmp = s1.split(""); + + //init + this.ll_states = new LinkedList<Integer>(); + for(int i=0; i<14; i++){this.ll_states.add(0);} + + for(int i = tmp.length-1; i>0; i--){ + int pos = tmp.length-i-1; + this.ll_states.set(pos, Integer.valueOf(tmp[i])); + } + + } + + public boolean getState(SumoVehicleSignalState s){ + + boolean out = false; + if(this.ll_states.get(s.getPos()) == 1){out = true;} + return out; + + } + + + private String getDual(int code) { + if (code < 2) {return "" + code;} + else {return getDual(code / 2) + code % 2; + + } + } + +} diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoVehicleSignalState.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoVehicleSignalState.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/container/SumoVehicleSignalState.java 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/container/SumoVehicleSignalState.java 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,51 @@ +/* + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology + + This file is part of TraaS. + + TraaS 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. + + TraaS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with TraaS. If not, see <http://www.gnu.org/licenses/>. +*/ + +package de.tudresden.ws.container; + +/** + * + * @author Mario Krumnow + * @author Anja Liebscher + * + */ + +public enum SumoVehicleSignalState { + + VEH_SIGNAL_BLINKER_RIGHT (0), + VEH_SIGNAL_BLINKER_LEFT (1), + VEH_SIGNAL_BLINKER_EMERGENCY (2), + VEH_SIGNAL_BRAKELIGHT(3), + VEH_SIGNAL_FRONTLIGHT(4), + VEH_SIGNAL_FOGLIGHT(5), + VEH_SIGNAL_HIGHBEAM(6), + VEH_SIGNAL_BACKDRIVE(7), + VEH_SIGNAL_WIPER(8), + VEH_SIGNAL_DOOR_OPEN_LEFT(9), + VEH_SIGNAL_DOOR_OPEN_RIGHT(10), + VEH_SIGNAL_EMERGENCY_BLUE(11), + VEH_SIGNAL_EMERGENCY_RED(12), + VEH_SIGNAL_EMERGENCY_YELLOW(13); + + private final int pos; + + SumoVehicleSignalState(int pos){this.pos = pos;} + + public int getPos(){return this.pos;} + +} diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/log/Log.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/log/Log.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/log/Log.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/log/Log.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -29,10 +29,20 @@ * * @param input the input */ - public void write(String input, int Prioritaet); + /** + * @param input input + * @param priority priority level + */ + public void write(String input, int priority); + /** + * @param el stacktrace + */ public void write(StackTraceElement[] el); + /** + * @param txt_output boolean text output + */ public void txt_output(boolean txt_output); } diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/log/Log_txt.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/log/Log_txt.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/log/Log_txt.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/log/Log_txt.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -28,10 +28,10 @@ private boolean txt_output = false; @Override - public void write(String input, int Prioritaet) { + public void write(String input, int priority) { - if(Prioritaet==1){ + if(priority==1){ System.out.println(input); } diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/Service_Impl.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/Service_Impl.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/Service_Impl.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/Service_Impl.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/Service.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/Service.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/Service.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/Service.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/ShutdownHook.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/ShutdownHook.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/ShutdownHook.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/ShutdownHook.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/Traci.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/Traci.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/Traci.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/Traci.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. @@ -28,6 +28,7 @@ import de.tudresden.sumo.cmd.ArealDetector; import de.tudresden.sumo.cmd.Lane; import de.tudresden.sumo.cmd.Multientryexit; +import de.tudresden.sumo.cmd.Person; import de.tudresden.sumo.cmd.Poi; import de.tudresden.sumo.cmd.Polygon; import de.tudresden.sumo.cmd.Route; @@ -210,8 +211,8 @@ } @WebMethod(action="Vehicle: setResume") - public void Vehicle_setResume(@WebParam(name = "vehID") String vehID){ - this.sumo.set_cmd(Vehicle.setResume(vehID)); + public void Vehicle_Resume(@WebParam(name = "vehID") String vehID){ + this.sumo.set_cmd(Vehicle.Resume(vehID)); } @WebMethod(action="Vehicle: setTau") @@ -584,6 +585,86 @@ return this.helper.getDouble(this.sumo.get_cmd(ArealDetector.getLastStepOccupancy(loopID))); } + + + //new + + + @WebMethod(action="Person: getIDList") + public SumoStringList Person_getIDList(){ + return this.helper.getStringList(this.sumo.get_cmd(Person.getIDList())); + } + + @WebMethod(action="Person: getIDCount") + public int Person_getIDCount(){ + return this.helper.getInt(this.sumo.get_cmd(Person.getIDCount())); + } + + @WebMethod(action="Person: getSpeed") + public double Person_getSpeed(@WebParam(name = "personID") String personID){ + return this.helper.getDouble(this.sumo.get_cmd(Person.getSpeed(personID))); + } + + @WebMethod(action="Person: getPosition") + public SumoPosition2D Person_getPosition(@WebParam(name = "personID") String personID){ + return this.helper.getPosition2D(this.sumo.get_cmd(Person.getPosition(personID))); + } + + @WebMethod(action="Person: getPosition3D") + public SumoPosition3D Person_getPosition3D(@WebParam(name = "personID") String personID){ + return this.helper.getPosition3D(this.sumo.get_cmd(Person.getPosition3D(personID))); + } + + @WebMethod(action="Person: getAngle") + public int Person_getAngle(@WebParam(name = "vehID") String personID){ + return this.helper.getInt(this.sumo.get_cmd(Person.getAngle(personID))); + } + + @WebMethod(action="Person: getRoadID") + public String Person_getRoadID(@WebParam(name = "personID") String personID){ + return this.helper.getString(this.sumo.get_cmd(Person.getRoadID(personID))); + } + + @WebMethod(action="Person: getTypeID") + public String Person_getTypeID(@WebParam(name = "personID") String personID){ + return this.helper.getString(this.sumo.get_cmd(Person.getTypeID(personID))); + } + + @WebMethod(action="Person: getLanePosition") + public double Person_getLanePosition(@WebParam(name = "personID") String personID){ + return this.helper.getDouble(this.sumo.get_cmd(Person.getLanePosition(personID))); + } + + @WebMethod(action="Person: getColor") + public SumoColor Person_getColor(@WebParam(name = "personID") String personID){ + return this.helper.getColor(this.sumo.get_cmd(Person.getColor(personID))); + } + + @WebMethod(action="Person: getPersonNumber") + public int Person_getPersonNumber(@WebParam(name = "personID") String personID){ + return this.helper.getInt(this.sumo.get_cmd(Person.getPersonNumber(personID))); + } + + @WebMethod(action="Person: getLength") + public double Person_getLength(@WebParam(name = "personID") String personID){ + return this.helper.getDouble(this.sumo.get_cmd(Person.getLength(personID))); + } + + @WebMethod(action="Person: getWaitingTime") + public double Person_getWaitingTime(@WebParam(name = "personID") String personID){ + return this.helper.getDouble(this.sumo.get_cmd(Person.getWaitingTime(personID))); + } + + @WebMethod(action="Person: getWidth") + public double Person_getWidth(@WebParam(name = "personID") String personID){ + return this.helper.getDouble(this.sumo.get_cmd(Person.getWidth(personID))); + } + + @WebMethod(action="Person: getMinGap") + public double Person_getMinGap(@WebParam(name = "personID") String personID){ + return this.helper.getDouble(this.sumo.get_cmd(Person.getMinGap(personID))); + } + @WebMethod(action="Vehicle: getAccel") public double Vehicle_getAccel(@WebParam(name = "vehID") String vehID){ return this.helper.getDouble(this.sumo.get_cmd(Vehicle.getAccel(vehID))); diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/WebService.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/WebService.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/de/tudresden/ws/WebService.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/de/tudresden/ws/WebService.java 2015-04-17 05:44:20.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Mario Krumnow, Dresden University of Technology + Copyright (C) 2015 Mario Krumnow, Dresden University of Technology This file is part of TraaS. diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/it/polito/appeal/traci/protocol/Command.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/it/polito/appeal/traci/protocol/Command.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/it/polito/appeal/traci/protocol/Command.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/it/polito/appeal/traci/protocol/Command.java 2015-04-17 05:44:20.000000000 +0000 @@ -50,7 +50,7 @@ * <p> * Note that this will advance the storage's internal pointer to the next * data. - * @param rawStorage + * @param rawStorage raw storage */ public Command(Storage rawStorage) { int contentLen = rawStorage.readUnsignedByte(); @@ -71,7 +71,7 @@ /** * Creates a command with a given identifier and an empty content. - * @param id + * @param id id */ public Command(int id) { if (id > 255) @@ -101,7 +101,7 @@ * object. * <p> * Note: this will advance the internal pointer of the given storage. - * @param out + * @param out output */ public void writeRawTo(Storage out) { /* @@ -119,6 +119,7 @@ /** * Returns the expected size of the serialized form of this command. + * @return raw size */ public int rawSize() { return HEADER_SIZE + content.size(); diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/it/polito/appeal/traci/protocol/RequestMessage.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/it/polito/appeal/traci/protocol/RequestMessage.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/it/polito/appeal/traci/protocol/RequestMessage.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/it/polito/appeal/traci/protocol/RequestMessage.java 2015-04-17 05:44:20.000000000 +0000 @@ -49,7 +49,7 @@ /** * Adds a command to the tail of this message. - * @param c + * @param c c * @throws NullPointerException if the command is <code>null</code>. */ public void append(Command c) { @@ -61,8 +61,8 @@ /** * Writes the commands to the specified {@link DataOutputStream} object, in * the same order as the calls of {@link #append(Command)}. - * @param dos - * @throws IOException + * @param dos data output stream + * @throws IOException Exception */ public void writeTo(DataOutputStream dos) throws IOException { int totalLen = Integer.SIZE / 8; // the length header @@ -72,12 +72,6 @@ } Checksum checksum = null; -// if (log.isDebugEnabled()) { -// checksum = new CRC32(); -// log.debug("sending a message " + totalLen + " bytes long"); -// -// } - dos.writeInt(totalLen); @@ -87,10 +81,14 @@ writeStorage(s, dos, checksum); } -// if (log.isDebugEnabled()) -// log.debug("message checksum (without len) = " + checksum.getValue()); } + /** + * @param storage storage + * @param os os + * @param checksum checksum + * @throws IOException Exception + */ private void writeStorage(Storage storage, OutputStream os, Checksum checksum) throws IOException { diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/it/polito/appeal/traci/protocol/ResponseContainer.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/it/polito/appeal/traci/protocol/ResponseContainer.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/it/polito/appeal/traci/protocol/ResponseContainer.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/it/polito/appeal/traci/protocol/ResponseContainer.java 2015-04-17 05:44:20.000000000 +0000 @@ -38,9 +38,9 @@ * Constructor for a response container with status response, response * command and zero or more sub-responses. * - * @param status - * @param response - * @param subResponses + * @param status status + * @param response response + * @param subResponses sub response */ public ResponseContainer(StatusResponse status, Command response, List<Command> subResponses) { @@ -53,8 +53,8 @@ * Constructor for a response container with status response and a response * command. * - * @param status - * @param response + * @param status status + * @param response response */ public ResponseContainer(StatusResponse status, Command response) { this(status, response, null); diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/it/polito/appeal/traci/protocol/ResponseMessage.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/it/polito/appeal/traci/protocol/ResponseMessage.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/it/polito/appeal/traci/protocol/ResponseMessage.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/it/polito/appeal/traci/protocol/ResponseMessage.java 2015-04-17 05:44:20.000000000 +0000 @@ -44,6 +44,7 @@ Constants.CMD_SET_EDGE_VARIABLE, Constants.CMD_SET_GUI_VARIABLE, Constants.CMD_SET_LANE_VARIABLE, + Constants.CMD_SET_PERSON_VARIABLE, Constants.CMD_SET_POI_VARIABLE, Constants.CMD_SET_POLYGON_VARIABLE, Constants.CMD_SET_ROUTE_VARIABLE, @@ -75,8 +76,8 @@ * A new {@link ResponseMessage}, collecting all the data that belong to the * same request, is built and appended to an internal list. * - * @param dis - * @throws IOException + * @param dis dis + * @throws IOException Exception */ public ResponseMessage(DataInputStream dis) throws IOException { int totalLen = dis.readInt() - Integer.SIZE/8; diff -Nru sumo-0.21.0+dfsg/tools/contributed/traas/src/it/polito/appeal/traci/SumoTraciConnection.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/it/polito/appeal/traci/SumoTraciConnection.java --- sumo-0.21.0+dfsg/tools/contributed/traas/src/it/polito/appeal/traci/SumoTraciConnection.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traas/src/it/polito/appeal/traci/SumoTraciConnection.java 2015-04-17 05:44:20.000000000 +0000 @@ -265,15 +265,12 @@ * Closes the connection, quits the simulator, frees any stale * resource and makes all {@link Vehicle} instances inactive. * - * @throws InterruptedException - * if the current thread was interrupted while waiting for SUMO - * to close. */ + public void close(){ try { socket.close(); } catch (IOException e) { - // TODO Auto-generated catch block e.printStackTrace(); } } @@ -290,6 +287,7 @@ * Returns <code>true</code> if the connection was closed by the user, or if * an {@link IOException} was thrown after the connection was made. * @see #close() + * @return boolean */ public boolean isClosed() { return socket == null || socket.isClosed(); diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/build.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/build.xml --- sumo-0.21.0+dfsg/tools/contributed/traci4j/build.xml 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/build.xml 2015-04-17 05:44:20.000000000 +0000 @@ -8,8 +8,6 @@ <property environment="env"/> <property name="junit.output.dir" value="junit"/> <property name="debuglevel" value="source,lines,vars"/> - <property name="target" value="1.6"/> - <property name="source" value="1.6"/> <path id="TraCI4J.classpath"> <pathelement location="bin"/> <pathelement location="lib/junit.jar"/> @@ -45,12 +43,12 @@ <target name="build-subprojects"/> <target depends="init,generate" name="build-project"> <echo message="${ant.project.name}: ${ant.file}"/> - <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}"> + <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false"> <src path="src"/> <exclude name="sumo/traci/"/> <classpath refid="TraCI4J.classpath"/> </javac> - <javac debug="true" debuglevel="${debuglevel}" destdir="bin" source="${source}" target="${target}"> + <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false"> <src path="test/java"/> <classpath refid="TraCI4J.classpath"/> </javac> @@ -123,7 +121,6 @@ nonavbar="false" notree="false" packagenames="it.polito.appeal.traci.*" - source="1.6" sourcepath="src/java" splitindex="true" use="true" @@ -132,13 +129,13 @@ </javadoc> </target> - <target name="deploy"> - <jar destfile="traci4j-1.6.jar" + <target name="deploy" depends="build"> + <jar destfile="traci4j.jar" duplicate="fail" update="yes"> <fileset dir="bin"/> </jar> - <jar destfile="traci4j-1.6-sources.jar" + <jar destfile="traci4j-sources.jar" duplicate="fail" update="yes"> <fileset dir="src/java"/> diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/.externalToolBuilders/TraCI4J [Builder].launch sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/.externalToolBuilders/TraCI4J [Builder].launch --- sumo-0.21.0+dfsg/tools/contributed/traci4j/.externalToolBuilders/TraCI4J [Builder].launch 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/.externalToolBuilders/TraCI4J [Builder].launch 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType"> +<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="clean,"/> +<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AUTO_TARGETS" value="build,"/> +<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/> +<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/> +<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${resource}"/> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/TraCI4J/build.xml"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/> +<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> +<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="TraCI4J"/> +<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/> +<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_HIDE_INTERNAL_TARGETS" value="true"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/TraCI4J/build.xml}"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/> +<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/> +<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/> +</launchConfiguration> diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/.gitignore sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/.gitignore --- sumo-0.21.0+dfsg/tools/contributed/traci4j/.gitignore 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -bin/ -junit*.properties -junit/ - -*~ - -# can be un-ignored when Javadoc is complete enough -doc/ diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/.project sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/.project --- sumo-0.21.0+dfsg/tools/contributed/traci4j/.project 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/.project 2015-04-17 05:44:20.000000000 +0000 @@ -10,6 +10,16 @@ <arguments> </arguments> </buildCommand> + <buildCommand> + <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> + <triggers>auto,full,incremental,</triggers> + <arguments> + <dictionary> + <key>LaunchConfigHandle</key> + <value><project>/.externalToolBuilders/TraCI4J [Builder].launch</value> + </dictionary> + </arguments> + </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/de/uniluebeck/itm/tcpip/Socket.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/de/uniluebeck/itm/tcpip/Socket.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/de/uniluebeck/itm/tcpip/Socket.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/de/uniluebeck/itm/tcpip/Socket.java 2015-04-17 05:44:20.000000000 +0000 @@ -39,17 +39,21 @@ public void accept() throws IOException { - serverSocket = new ServerSocket(port); - socketConnection = serverSocket.accept(); - + System.out.println("accept"); + serverSocket = new ServerSocket(port); + socketConnection = serverSocket.accept(); + socketConnection.setTcpNoDelay(true); + outStream = socketConnection.getOutputStream(); inStream = socketConnection.getInputStream(); } public void connect() throws UnknownHostException, IOException { - socketConnection = new java.net.Socket(host, port); - + System.out.println("connect"); + socketConnection = new java.net.Socket(host, port); + socketConnection.setTcpNoDelay(true); + outStream = socketConnection.getOutputStream(); inStream = socketConnection.getInputStream(); } diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/it/polito/appeal/traci/AddVehicleQuery.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/it/polito/appeal/traci/AddVehicleQuery.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/it/polito/appeal/traci/AddVehicleQuery.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/it/polito/appeal/traci/AddVehicleQuery.java 2015-04-17 05:44:20.000000000 +0000 @@ -44,6 +44,7 @@ private double insertionPosition; private double insertionSpeed; private final Repository<Vehicle> vehicles; + private int departureTime; AddVehicleQuery(DataInputStream dis, DataOutputStream dos, Repository<Vehicle> vehicles) { @@ -67,6 +68,7 @@ VehicleType vehicleType, Route route, int lane, + int departureTime, double insertionPosition, double insertionSpeed) throws IOException { @@ -80,7 +82,7 @@ this.lane = lane; this.insertionPosition = insertionPosition; this.insertionSpeed = insertionSpeed; - + this.departureTime = departureTime; } @Override @@ -98,7 +100,7 @@ content.writeStringASCII(route.getID()); content.writeUnsignedByte(Constants.TYPE_INTEGER); - content.writeInt(0); // departure time - TODO add departure times in the future + content.writeInt(departureTime); content.writeUnsignedByte(Constants.TYPE_DOUBLE); content.writeDouble(insertionPosition); diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeAccelQuery.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeAccelQuery.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeAccelQuery.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeAccelQuery.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* - Copyright (C) 2013 ApPeAL Group, Politecnico di Torino - - This file is part of TraCI4J-master. - - TraCI4J-master 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. - - TraCI4J-master is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with TraCI4J-master. If not, see <http://www.gnu.org/licenses/>. -*/ - -package it.polito.appeal.traci; - -import it.polito.appeal.traci.ChangeObjectVarQuery.ChangeDoubleQ; -import it.polito.appeal.traci.protocol.Constants; - -import java.io.DataInputStream; -import java.io.DataOutputStream; - -import de.uniluebeck.itm.tcpip.Storage; - -public class ChangeAccelQuery extends ChangeDoubleQ { - - ChangeAccelQuery(DataInputStream dis, DataOutputStream dos, - String objectID) { - super(dis, dos, Constants.CMD_SET_VEHICLETYPE_VARIABLE, objectID, Constants.VAR_ACCEL); - } - - @Override - protected void writeValueTo(Double accel, Storage content) { - content.writeByte(Constants.TYPE_DOUBLE); - content.writeDouble(accel); - } - -} diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeColorQuery.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeColorQuery.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeColorQuery.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeColorQuery.java 2015-04-17 05:44:20.000000000 +0000 @@ -33,7 +33,7 @@ */ public class ChangeColorQuery extends ChangeObjectVarQuery<Color> { ChangeColorQuery(DataInputStream dis, DataOutputStream dos, - String objectID, int commandID, int variableID) { + int commandID, String objectID, int variableID) { super(dis, dos, commandID, objectID, variableID); } diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeCompleteProgramQuery.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeCompleteProgramQuery.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeCompleteProgramQuery.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeCompleteProgramQuery.java 2015-04-17 05:44:20.000000000 +0000 @@ -36,7 +36,7 @@ public class ChangeCompleteProgramQuery extends ChangeObjectVarQuery<Logic> { ChangeCompleteProgramQuery(DataInputStream dis, - DataOutputStream dos, String objectID, int commandID, int variableID) { + DataOutputStream dos, int commandID, String objectID, int variableID) { super(dis, dos, commandID, objectID, variableID); } diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeObjectVarQuery.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeObjectVarQuery.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeObjectVarQuery.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/it/polito/appeal/traci/ChangeObjectVarQuery.java 2015-04-17 05:44:20.000000000 +0000 @@ -75,8 +75,8 @@ * */ public static class ChangeStringQ extends ChangeObjectVarQuery<String> { - ChangeStringQ(DataInputStream dis, DataOutputStream dos, - String objectID, int commandID, int variableID) { + ChangeStringQ(DataInputStream dis, DataOutputStream dos, int commandID, + String objectID, int variableID) { super(dis, dos, commandID, objectID, variableID); } @@ -95,8 +95,8 @@ */ public static class ChangeIntegerQ extends ChangeObjectVarQuery<Integer> { - ChangeIntegerQ(DataInputStream dis, DataOutputStream dos, - String objectID, int commandID, int variableID) { + ChangeIntegerQ(DataInputStream dis, DataOutputStream dos, int commandID, + String objectID, int variableID) { super(dis, dos, commandID, objectID, variableID); } diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/it/polito/appeal/traci/protocol/Constants.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/it/polito/appeal/traci/protocol/Constants.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java/it/polito/appeal/traci/protocol/Constants.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java/it/polito/appeal/traci/protocol/Constants.java 2015-04-17 05:44:20.000000000 +0000 @@ -13,7 +13,7 @@ public class Constants { // **************************************** - /** VERSION */ + // VERSION // **************************************** public static final int TRACI_VERSION = 5; @@ -641,4 +641,7 @@ /** vehicle waiting time */ public static final int VAR_WAITING_TIME = 122; + /** lane change mode (change: vehicle state) */ + public static final int VAR_LANE_CHANGE_MODE = 0xb6; + } \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Edge.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Edge.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Edge.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Edge.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,357 +0,0 @@ - - -/* - THIS FILE IS GENERATED AUTOMATICALLY. DO NOT EDIT: CHANGES WILL BE OVERWRITTEN. - File generated by traciObject.xslt. -*/ - -/* - Copyright (C) 2013 ApPeAL Group, Politecnico di Torino - - This file is part of TraCI4J. - - TraCI4J 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. - - TraCI4J is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with TraCI4J. If not, see <http://www.gnu.org/licenses/>. -*/ - - -package it.polito.appeal.traci; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -/** - - Representation of an edge in the SUMO environment. It contains one or more lanes. - @see <a href="http://sumo.sourceforge.net/doc/current/docs/userdoc/Networks/SUMO_Road_Networks.html#Edges_and_Lanes">SUMO documentation</a> - @author Enrico Gueli <enrico.gueli@polito.it> - -*/ -public class Edge -extends TraciObject<Edge.Variable> -implements StepAdvanceListener -{ - - /** - * Enumerates all the read queries. Each value can be used as an argument - * for {@link TraciObject#getReadQuery(Enum)}. - * - * @author Enrico Gueli <enrico.gueli@polito.it> - */ - public static enum Variable { - - /** - * Query "ReadGlobalTravelTime" - * @see {@link #queryReadGlobalTravelTime} - */ - TRAVEL_TIME, - - /** - * Query "ReadCO2Emission" - * @see {@link #queryReadCO2Emission} - */ - CO2_EMISSION, - - /** - * Query "ReadCOEmission" - * @see {@link #queryReadCOEmission} - */ - CO_EMISSION, - - /** - * Query "ReadHCEmission" - * @see {@link #queryReadHCEmission} - */ - HC_EMISSION, - - /** - * Query "ReadPMXEmission" - * @see {@link #queryReadPMXEmission} - */ - PMX_EMISSION, - - /** - * Query "ReadNOXEmission" - * @see {@link #queryReadNOXEmission} - */ - NOX_EMISSION, - - /** - * Query "ReadFuelConsumption" - * @see {@link #queryReadFuelConsumption} - */ - FUEL_CONSUMPTION, - - /** - * Query "ReadNoiseEmission" - * @see {@link #queryReadNoiseEmission} - */ - NOISE_EMISSION, - - } - - - private final ChangeGlobalTravelTimeQuery csqvar_ChangeTravelTime; - Edge ( - DataInputStream dis, - DataOutputStream dos, - String id - - ) { - super(id, Variable.class); - - /* - * initialization of read queries - */ - - addReadQuery(Variable.TRAVEL_TIME, - new ReadGlobalTravelTimeQuery (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_EDGE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_EDGE_TRAVELTIME - - )); - - addReadQuery(Variable.CO2_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_EDGE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_CO2EMISSION - - )); - - addReadQuery(Variable.CO_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_EDGE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_COEMISSION - - )); - - addReadQuery(Variable.HC_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_EDGE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_HCEMISSION - - )); - - addReadQuery(Variable.PMX_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_EDGE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_PMXEMISSION - - )); - - addReadQuery(Variable.NOX_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_EDGE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_NOXEMISSION - - )); - - addReadQuery(Variable.FUEL_CONSUMPTION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_EDGE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_FUELCONSUMPTION - - )); - - addReadQuery(Variable.NOISE_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_EDGE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_NOISEEMISSION - - )); - - - /* - * initialization of change state queries - */ - - csqvar_ChangeTravelTime = new ChangeGlobalTravelTimeQuery(dis, dos, id - ) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadGlobalTravelTime().setObsolete(); - - } - }; - - - } - - - - @Override - public void nextStep(double step) { - - getReadQuery(Variable.CO2_EMISSION).setObsolete(); - - getReadQuery(Variable.CO_EMISSION).setObsolete(); - - getReadQuery(Variable.HC_EMISSION).setObsolete(); - - getReadQuery(Variable.PMX_EMISSION).setObsolete(); - - getReadQuery(Variable.NOX_EMISSION).setObsolete(); - - getReadQuery(Variable.FUEL_CONSUMPTION).setObsolete(); - - getReadQuery(Variable.NOISE_EMISSION).setObsolete(); - - } - - - - - - /** - * @return the instance of {@link ReadGlobalTravelTimeQuery} relative to this query. - */ - public ReadGlobalTravelTimeQuery queryReadGlobalTravelTime() { - return (ReadGlobalTravelTimeQuery) getReadQuery(Variable.TRAVEL_TIME); - } - - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadCO2Emission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.CO2_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getCo2Emission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.CO2_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadCOEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.CO_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getCoEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.CO_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadHCEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.HC_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getHcEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.HC_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadPMXEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.PMX_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getPmxEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.PMX_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadNOXEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.NOX_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getNoxEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.NOX_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadFuelConsumption() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.FUEL_CONSUMPTION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getFuelConsumption() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.FUEL_CONSUMPTION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadNoiseEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.NOISE_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getNoiseEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.NOISE_EMISSION)).get(); - } - - /** - * @return the instance of {@link ChangeGlobalTravelTimeQuery} relative to this query. - */ - public ChangeGlobalTravelTimeQuery queryChangeTravelTime() { - return csqvar_ChangeTravelTime; - } - - -} - diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/InductionLoop.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/InductionLoop.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/InductionLoop.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/InductionLoop.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,248 +0,0 @@ - - -/* - THIS FILE IS GENERATED AUTOMATICALLY. DO NOT EDIT: CHANGES WILL BE OVERWRITTEN. - File generated by traciObject.xslt. -*/ - -/* - Copyright (C) 2013 ApPeAL Group, Politecnico di Torino - - This file is part of TraCI4J. - - TraCI4J 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. - - TraCI4J is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with TraCI4J. If not, see <http://www.gnu.org/licenses/>. -*/ - - -package it.polito.appeal.traci; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -/** - - Representation of an induction loop in the SUMO environment. - @see <a href="http://sumo.sourceforge.net/doc/current/docs/userdoc/Simulation/Output/Induction_Loops_Detectors_(E1).html">SUMO documentation</a> - @author Enrico Gueli <enrico.gueli@polito.it> - -*/ -public class InductionLoop -extends TraciObject<InductionLoop.Variable> -implements StepAdvanceListener -{ - - /** - * Enumerates all the read queries. Each value can be used as an argument - * for {@link TraciObject#getReadQuery(Enum)}. - * - * @author Enrico Gueli <enrico.gueli@polito.it> - */ - public static enum Variable { - - /** - * Query "ReadLane" - * @see {@link #queryReadLane} - */ - LANE, - - /** - * Query "ReadPositionInLane" - * @see {@link #queryReadPositionInLane} - */ - POSITION, - - /** - * Query "ReadLastStepVehicleNumber" - * @see {@link #queryReadLastStepVehicleNumber} - */ - VEHICLE_NUMBER, - - /** - * Query "ReadLastStepMeanSpeed" - * @see {@link #queryReadLastStepMeanSpeed} - */ - MEAN_SPEED, - - /** - * Query "ReadLastStepVehicles" - * @see {@link #queryReadLastStepVehicles} - */ - LAST_STEP_VEHICLES, - - } - - InductionLoop ( - DataInputStream dis, - DataOutputStream dos, - String id - - , Repository<Lane> repoLane - , Repository<Vehicle> repoVehicle - ) { - super(id, Variable.class); - - /* - * initialization of read queries - */ - - addReadQuery(Variable.LANE, - new ReadObjectVarQuery.LaneQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_INDUCTIONLOOP_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_LANE_ID - , repoLane - - )); - - addReadQuery(Variable.POSITION, - new ReadObjectVarQuery.PositionQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_INDUCTIONLOOP_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_POSITION - - )); - - addReadQuery(Variable.VEHICLE_NUMBER, - new ReadObjectVarQuery.IntegerQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_INDUCTIONLOOP_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.LAST_STEP_VEHICLE_NUMBER - - )); - - addReadQuery(Variable.MEAN_SPEED, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_INDUCTIONLOOP_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.LAST_STEP_MEAN_SPEED - - )); - - addReadQuery(Variable.LAST_STEP_VEHICLES, - new VehicleSetQuery (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_INDUCTIONLOOP_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.LAST_STEP_VEHICLE_ID_LIST - , repoVehicle - - )); - - - /* - * initialization of change state queries - */ - - - } - - - - @Override - public void nextStep(double step) { - - getReadQuery(Variable.VEHICLE_NUMBER).setObsolete(); - - getReadQuery(Variable.MEAN_SPEED).setObsolete(); - - getReadQuery(Variable.LAST_STEP_VEHICLES).setObsolete(); - - } - - - - - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Lane> queryReadLane() { - return (ReadObjectVarQuery.LaneQ) getReadQuery(Variable.LANE); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Lane getLane() throws IOException { - return ((ReadObjectVarQuery.LaneQ) getReadQuery(Variable.LANE)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.awt.geom.Point2D> queryReadPositionInLane() { - return (ReadObjectVarQuery.PositionQ) getReadQuery(Variable.POSITION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.awt.geom.Point2D getPosition() throws IOException { - return ((ReadObjectVarQuery.PositionQ) getReadQuery(Variable.POSITION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Integer> queryReadLastStepVehicleNumber() { - return (ReadObjectVarQuery.IntegerQ) getReadQuery(Variable.VEHICLE_NUMBER); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Integer getVehicleNumber() throws IOException { - return ((ReadObjectVarQuery.IntegerQ) getReadQuery(Variable.VEHICLE_NUMBER)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Double> queryReadLastStepMeanSpeed() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.MEAN_SPEED); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Double getMeanSpeed() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.MEAN_SPEED)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.util.Set<Vehicle>> queryReadLastStepVehicles() { - return (VehicleSetQuery) getReadQuery(Variable.LAST_STEP_VEHICLES); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.util.Set<Vehicle> getLastStepVehicles() throws IOException { - return ((VehicleSetQuery) getReadQuery(Variable.LAST_STEP_VEHICLES)).get(); - } - -} - diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Lane.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Lane.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Lane.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Lane.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,530 +0,0 @@ - - -/* - THIS FILE IS GENERATED AUTOMATICALLY. DO NOT EDIT: CHANGES WILL BE OVERWRITTEN. - File generated by traciObject.xslt. -*/ - -/* - Copyright (C) 2013 ApPeAL Group, Politecnico di Torino - - This file is part of TraCI4J. - - TraCI4J 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. - - TraCI4J is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with TraCI4J. If not, see <http://www.gnu.org/licenses/>. -*/ - - -package it.polito.appeal.traci; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -/** - - Representation of a lane in the SUMO environment. - @see <a href="http://sumo.sourceforge.net/doc/current/docs/userdoc/Networks/SUMO_Road_Networks.html#Edges_and_Lanes">SUMO documentation</a> - @author Enrico Gueli <enrico.gueli@polito.it> - -*/ -public class Lane -extends TraciObject<Lane.Variable> -implements StepAdvanceListener -{ - - /** - * Enumerates all the read queries. Each value can be used as an argument - * for {@link TraciObject#getReadQuery(Enum)}. - * - * @author Enrico Gueli <enrico.gueli@polito.it> - */ - public static enum Variable { - - /** - * Query "ReadShape" - * @see {@link #queryReadShape} - */ - SHAPE, - - /** - * Query "ReadLength" - * @see {@link #queryReadLength} - */ - LENGTH, - - /** - * Query "ReadLastStepOccupancy" - * @see {@link #queryReadLastStepOccupancy} - */ - LAST_STEP_OCCUPANCY, - - /** - * Query "ReadMaxSpeed" - * @see {@link #queryReadMaxSpeed} - */ - MAX_SPEED, - - /** - * Query "ReadParentEdge" - * @see {@link #queryReadParentEdge} - */ - PARENT_EDGE, - - /** - * Query "ReadLinks" - * @see {@link #queryReadLinks} - */ - LINKS, - - /** - * Query "ReadLastStepVehicleNumber" - * @see {@link #queryReadLastStepVehicleNumber} - */ - LAST_STEP_VEHICLE_NUMBER, - - /** - * Query "ReadCO2Emission" - * @see {@link #queryReadCO2Emission} - */ - CO2_EMISSION, - - /** - * Query "ReadCOEmission" - * @see {@link #queryReadCOEmission} - */ - CO_EMISSION, - - /** - * Query "ReadHCEmission" - * @see {@link #queryReadHCEmission} - */ - HC_EMISSION, - - /** - * Query "ReadPMXEmission" - * @see {@link #queryReadPMXEmission} - */ - PMX_EMISSION, - - /** - * Query "ReadNOXEmission" - * @see {@link #queryReadNOXEmission} - */ - NOX_EMISSION, - - /** - * Query "ReadFuelConsumption" - * @see {@link #queryReadFuelConsumption} - */ - FUEL_CONSUMPTION, - - /** - * Query "ReadNoiseEmission" - * @see {@link #queryReadNoiseEmission} - */ - NOISE_EMISSION, - - } - - Lane ( - DataInputStream dis, - DataOutputStream dos, - String id - - , Repository<Edge> repoEdge - , Repository<Lane> repoLane - ) { - super(id, Variable.class); - - /* - * initialization of read queries - */ - - addReadQuery(Variable.SHAPE, - new ReadShapeQuery (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_SHAPE - - )); - - addReadQuery(Variable.LENGTH, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_LENGTH - - )); - - addReadQuery(Variable.LAST_STEP_OCCUPANCY, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.LAST_STEP_OCCUPANCY - - )); - - addReadQuery(Variable.MAX_SPEED, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_MAXSPEED - - )); - - addReadQuery(Variable.PARENT_EDGE, - new ReadObjectVarQuery.EdgeQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.LANE_EDGE_ID - , repoEdge - - )); - - addReadQuery(Variable.LINKS, - new ReadLinksQuery (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.LANE_LINKS - , repoLane - - )); - - addReadQuery(Variable.LAST_STEP_VEHICLE_NUMBER, - new ReadObjectVarQuery.IntegerQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.LAST_STEP_VEHICLE_NUMBER - - )); - - addReadQuery(Variable.CO2_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_CO2EMISSION - - )); - - addReadQuery(Variable.CO_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_COEMISSION - - )); - - addReadQuery(Variable.HC_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_HCEMISSION - - )); - - addReadQuery(Variable.PMX_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_PMXEMISSION - - )); - - addReadQuery(Variable.NOX_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_NOXEMISSION - - )); - - addReadQuery(Variable.FUEL_CONSUMPTION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_FUELCONSUMPTION - - )); - - addReadQuery(Variable.NOISE_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_LANE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_NOISEEMISSION - - )); - - - /* - * initialization of change state queries - */ - - - } - - - - @Override - public void nextStep(double step) { - - getReadQuery(Variable.LAST_STEP_OCCUPANCY).setObsolete(); - - getReadQuery(Variable.LAST_STEP_VEHICLE_NUMBER).setObsolete(); - - getReadQuery(Variable.CO2_EMISSION).setObsolete(); - - getReadQuery(Variable.CO_EMISSION).setObsolete(); - - getReadQuery(Variable.HC_EMISSION).setObsolete(); - - getReadQuery(Variable.PMX_EMISSION).setObsolete(); - - getReadQuery(Variable.NOX_EMISSION).setObsolete(); - - getReadQuery(Variable.FUEL_CONSUMPTION).setObsolete(); - - getReadQuery(Variable.NOISE_EMISSION).setObsolete(); - - } - - - - - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.awt.geom.Path2D> queryReadShape() { - return (ReadShapeQuery) getReadQuery(Variable.SHAPE); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.awt.geom.Path2D getShape() throws IOException { - return ((ReadShapeQuery) getReadQuery(Variable.SHAPE)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Double> queryReadLength() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.LENGTH); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Double getLength() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.LENGTH)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Double> queryReadLastStepOccupancy() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.LAST_STEP_OCCUPANCY); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Double getLastStepOccupancy() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.LAST_STEP_OCCUPANCY)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Double> queryReadMaxSpeed() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.MAX_SPEED); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Double getMaxSpeed() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.MAX_SPEED)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Edge> queryReadParentEdge() { - return (ReadObjectVarQuery.EdgeQ) getReadQuery(Variable.PARENT_EDGE); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Edge getParentEdge() throws IOException { - return ((ReadObjectVarQuery.EdgeQ) getReadQuery(Variable.PARENT_EDGE)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.util.List<Link>> queryReadLinks() { - return (ReadLinksQuery) getReadQuery(Variable.LINKS); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.util.List<Link> getLinks() throws IOException { - return ((ReadLinksQuery) getReadQuery(Variable.LINKS)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Integer> queryReadLastStepVehicleNumber() { - return (ReadObjectVarQuery.IntegerQ) getReadQuery(Variable.LAST_STEP_VEHICLE_NUMBER); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Integer getLastStepVehicleNumber() throws IOException { - return ((ReadObjectVarQuery.IntegerQ) getReadQuery(Variable.LAST_STEP_VEHICLE_NUMBER)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadCO2Emission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.CO2_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getCo2Emission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.CO2_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadCOEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.CO_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getCoEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.CO_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadHCEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.HC_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getHcEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.HC_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadPMXEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.PMX_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getPmxEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.PMX_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadNOXEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.NOX_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getNoxEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.NOX_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadFuelConsumption() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.FUEL_CONSUMPTION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getFuelConsumption() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.FUEL_CONSUMPTION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadNoiseEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.NOISE_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getNoiseEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.NOISE_EMISSION)).get(); - } - -} - diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/MeMeDetector.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/MeMeDetector.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/MeMeDetector.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/MeMeDetector.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,186 +0,0 @@ - - -/* - THIS FILE IS GENERATED AUTOMATICALLY. DO NOT EDIT: CHANGES WILL BE OVERWRITTEN. - File generated by traciObject.xslt. -*/ - -/* - Copyright (C) 2013 ApPeAL Group, Politecnico di Torino - - This file is part of TraCI4J. - - TraCI4J 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. - - TraCI4J is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with TraCI4J. If not, see <http://www.gnu.org/licenses/>. -*/ - - -package it.polito.appeal.traci; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -/** - - Representation of a Multi-Entry Multi-Exit detector (E3) in the SUMO environment. - @see <a href="http://sumo.sourceforge.net/doc/current/docs/userdoc/Simulation/Output/Multi-Entry_Multi-Exit_Detectors_(E3).html">SUMO documentation</a> - @author Enrico Gueli <enrico.gueli@polito.it> - -*/ -public class MeMeDetector -extends TraciObject<MeMeDetector.Variable> -implements StepAdvanceListener -{ - - /** - * Enumerates all the read queries. Each value can be used as an argument - * for {@link TraciObject#getReadQuery(Enum)}. - * - * @author Enrico Gueli <enrico.gueli@polito.it> - */ - public static enum Variable { - - /** - * Query "ReadLastStepVehicleNumber" - * @see {@link #queryReadLastStepVehicleNumber} - */ - VEHICLE_NUMBER, - - /** - * Query "ReadLastStepMeanSpeed" - * @see {@link #queryReadLastStepMeanSpeed} - */ - MEAN_SPEED, - - /** - * Query "ReadLastStepVehicles" - * @see {@link #queryReadLastStepVehicles} - */ - VEHICLES, - - } - - MeMeDetector ( - DataInputStream dis, - DataOutputStream dos, - String id - - , Repository<Vehicle> repoVehicle - ) { - super(id, Variable.class); - - /* - * initialization of read queries - */ - - addReadQuery(Variable.VEHICLE_NUMBER, - new ReadObjectVarQuery.IntegerQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.LAST_STEP_VEHICLE_NUMBER - - )); - - addReadQuery(Variable.MEAN_SPEED, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.LAST_STEP_MEAN_SPEED - - )); - - addReadQuery(Variable.VEHICLES, - new VehicleSetQuery (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.LAST_STEP_VEHICLE_ID_LIST - , repoVehicle - - )); - - - /* - * initialization of change state queries - */ - - - } - - - - @Override - public void nextStep(double step) { - - getReadQuery(Variable.VEHICLE_NUMBER).setObsolete(); - - getReadQuery(Variable.MEAN_SPEED).setObsolete(); - - getReadQuery(Variable.VEHICLES).setObsolete(); - - } - - - - - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Integer> queryReadLastStepVehicleNumber() { - return (ReadObjectVarQuery.IntegerQ) getReadQuery(Variable.VEHICLE_NUMBER); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Integer getVehicleNumber() throws IOException { - return ((ReadObjectVarQuery.IntegerQ) getReadQuery(Variable.VEHICLE_NUMBER)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Double> queryReadLastStepMeanSpeed() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.MEAN_SPEED); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Double getMeanSpeed() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.MEAN_SPEED)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.util.Set<Vehicle>> queryReadLastStepVehicles() { - return (VehicleSetQuery) getReadQuery(Variable.VEHICLES); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.util.Set<Vehicle> getVehicles() throws IOException { - return ((VehicleSetQuery) getReadQuery(Variable.VEHICLES)).get(); - } - -} - diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/POI.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/POI.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/POI.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/POI.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,279 +0,0 @@ - - -/* - THIS FILE IS GENERATED AUTOMATICALLY. DO NOT EDIT: CHANGES WILL BE OVERWRITTEN. - File generated by traciObject.xslt. -*/ - -/* - Copyright (C) 2013 ApPeAL Group, Politecnico di Torino - - This file is part of TraCI4J. - - TraCI4J 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. - - TraCI4J is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with TraCI4J. If not, see <http://www.gnu.org/licenses/>. -*/ - - -package it.polito.appeal.traci; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -/** - - Represents a POI (Point-of-Interest) in the SUMO environment. - @author Enrico Gueli <enrico.gueli@polito.it> - -*/ -public class POI -extends TraciObject<POI.Variable> -implements StepAdvanceListener -{ - - /** - * Enumerates all the read queries. Each value can be used as an argument - * for {@link TraciObject#getReadQuery(Enum)}. - * - * @author Enrico Gueli <enrico.gueli@polito.it> - */ - public static enum Variable { - - /** - * Query "ReadType" - * @see {@link #queryReadType} - */ - TYPE, - - /** - * Query "ReadColor" - * @see {@link #queryReadColor} - */ - COLOR, - - /** - * Query "ReadPosition" - * @see {@link #queryReadPosition} - */ - POSITION, - - } - - - private final ChangeColorQuery csqvar_ChangeColor; - - private final ChangeObjectVarQuery.ChangeStringQ csqvar_ChangeType; - - private final ChangePositionQuery csqvar_ChangePosition; - POI ( - DataInputStream dis, - DataOutputStream dos, - String id - - ) { - super(id, Variable.class); - - /* - * initialization of read queries - */ - - addReadQuery(Variable.TYPE, - new ReadObjectVarQuery.StringQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_POI_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_TYPE - - )); - - addReadQuery(Variable.COLOR, - new ReadObjectVarQuery.ColorQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_POI_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_COLOR - - )); - - addReadQuery(Variable.POSITION, - new ReadObjectVarQuery.PositionQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_POI_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_POSITION - - )); - - - /* - * initialization of change state queries - */ - - csqvar_ChangeColor = new ChangeColorQuery(dis, dos, id - , it.polito.appeal.traci.protocol.Constants.CMD_SET_POI_VARIABLE, it.polito.appeal.traci.protocol.Constants.VAR_COLOR) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadColor().setObsolete(); - - } - }; - - csqvar_ChangeType = new ChangeObjectVarQuery.ChangeStringQ(dis, dos, id - , it.polito.appeal.traci.protocol.Constants.CMD_SET_POI_VARIABLE, it.polito.appeal.traci.protocol.Constants.VAR_TYPE) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadType().setObsolete(); - - } - }; - - csqvar_ChangePosition = new ChangePositionQuery(dis, dos, id - ) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadPosition().setObsolete(); - - } - }; - - - } - - - - @Override - public void nextStep(double step) { - - } - - - - - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.String> queryReadType() { - return (ReadObjectVarQuery.StringQ) getReadQuery(Variable.TYPE); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.String getType() throws IOException { - return ((ReadObjectVarQuery.StringQ) getReadQuery(Variable.TYPE)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.awt.Color> queryReadColor() { - return (ReadObjectVarQuery.ColorQ) getReadQuery(Variable.COLOR); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.awt.Color getColor() throws IOException { - return ((ReadObjectVarQuery.ColorQ) getReadQuery(Variable.COLOR)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.awt.geom.Point2D> queryReadPosition() { - return (ReadObjectVarQuery.PositionQ) getReadQuery(Variable.POSITION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.awt.geom.Point2D getPosition() throws IOException { - return ((ReadObjectVarQuery.PositionQ) getReadQuery(Variable.POSITION)).get(); - } - - /** - * @return the instance of {@link ChangeColorQuery} relative to this query. - */ - public ChangeColorQuery queryChangeColor() { - return csqvar_ChangeColor; - } - - - /** - * Execute an instance of ChangeColorQuery set to the given value. - * - * This setter method is equivalent to queryChangeColor().setValue(value).run(). - */ - public void changeColor(java.awt.Color value) throws IOException { - ChangeColorQuery q = csqvar_ChangeColor; - q.setValue(value); - q.run(); - } - - /** - * @return the instance of {@link ChangeObjectVarQuery.ChangeStringQ} relative to this query. - */ - public ChangeObjectVarQuery.ChangeStringQ queryChangeType() { - return csqvar_ChangeType; - } - - - /** - * Execute an instance of ChangeObjectVarQuery.ChangeStringQ set to the given value. - * - * This setter method is equivalent to queryChangeType().setValue(value).run(). - */ - public void changeType(String value) throws IOException { - ChangeObjectVarQuery.ChangeStringQ q = csqvar_ChangeType; - q.setValue(value); - q.run(); - } - - /** - * @return the instance of {@link ChangePositionQuery} relative to this query. - */ - public ChangePositionQuery queryChangePosition() { - return csqvar_ChangePosition; - } - - - /** - * Execute an instance of ChangePositionQuery set to the given value. - * - * This setter method is equivalent to queryChangePosition().setValue(value).run(). - */ - public void changePosition(java.awt.geom.Point2D value) throws IOException { - ChangePositionQuery q = csqvar_ChangePosition; - q.setValue(value); - q.run(); - } - -} - diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Route.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Route.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Route.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Route.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ - - -/* - THIS FILE IS GENERATED AUTOMATICALLY. DO NOT EDIT: CHANGES WILL BE OVERWRITTEN. - File generated by traciObject.xslt. -*/ - -/* - Copyright (C) 2013 ApPeAL Group, Politecnico di Torino - - This file is part of TraCI4J. - - TraCI4J 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. - - TraCI4J is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with TraCI4J. If not, see <http://www.gnu.org/licenses/>. -*/ - - -package it.polito.appeal.traci; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -/** - - Representation of a route in the SUMO environment. - @see <a href="http://sumo.sourceforge.net/doc/current/docs/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html#Vehicle_Types">SUMO documentation</a> - @author Enrico Gueli <enrico.gueli@polito.it> - -*/ -public class Route -extends TraciObject<Route.Variable> -implements StepAdvanceListener -{ - - /** - * Enumerates all the read queries. Each value can be used as an argument - * for {@link TraciObject#getReadQuery(Enum)}. - * - * @author Enrico Gueli <enrico.gueli@polito.it> - */ - public static enum Variable { - - /** - * Query "ReadRoute" - * @see {@link #queryReadRoute} - */ - ROUTE, - - } - - Route ( - DataInputStream dis, - DataOutputStream dos, - String id - - , Repository<Edge> repoEdge - ) { - super(id, Variable.class); - - /* - * initialization of read queries - */ - - addReadQuery(Variable.ROUTE, - new RouteQuery (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_ROUTE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_EDGES - , repoEdge - - )); - - - /* - * initialization of change state queries - */ - - - } - - - - @Override - public void nextStep(double step) { - - } - - - - - - /** - * @return the instance of {@link RouteQuery} relative to this query. - */ - public RouteQuery queryReadRoute() { - return (RouteQuery) getReadQuery(Variable.ROUTE); - } - - -} - diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/TrafficLight.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/TrafficLight.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/TrafficLight.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/TrafficLight.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,410 +0,0 @@ - - -/* - THIS FILE IS GENERATED AUTOMATICALLY. DO NOT EDIT: CHANGES WILL BE OVERWRITTEN. - File generated by traciObject.xslt. -*/ - -/* - Copyright (C) 2013 ApPeAL Group, Politecnico di Torino - - This file is part of TraCI4J. - - TraCI4J 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. - - TraCI4J is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with TraCI4J. If not, see <http://www.gnu.org/licenses/>. -*/ - - -package it.polito.appeal.traci; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -/** - - Representation of a traffic light in the SUMO environment. - @see <a href="http://sumo.sourceforge.net/doc/current/docs/userdoc/Simulation/Traffic_Lights.html">SUMO documentation</a> - @author Enrico Gueli <enrico.gueli@polito.it> - -*/ -public class TrafficLight -extends TraciObject<TrafficLight.Variable> -implements StepAdvanceListener -{ - - /** - * Enumerates all the read queries. Each value can be used as an argument - * for {@link TraciObject#getReadQuery(Enum)}. - * - * @author Enrico Gueli <enrico.gueli@polito.it> - */ - public static enum Variable { - - /** - * Query "ReadState" - * @see {@link #queryReadState} - */ - STATE, - - /** - * Query "ReadDefaultCurrentPhaseDuration" - * @see {@link #queryReadDefaultCurrentPhaseDuration} - */ - DEFAULT_CURRENT_PHASE_DURATION, - - /** - * Query "ReadControlledLanes" - * @see {@link #queryReadControlledLanes} - */ - CONTROLLED_LANES, - - /** - * Query "ReadControlledLinks" - * @see {@link #queryReadControlledLinks} - */ - CONTROLLED_LINKS, - - /** - * Query "ReadCurrentPhase" - * @see {@link #queryReadCurrentPhase} - */ - CURRENT_PHASE, - - /** - * Query "ReadCurrentProgram" - * @see {@link #queryReadCurrentProgram} - */ - CURRENT_PROGRAM, - - /** - * Query "ReadCompleteDefinition" - * @see {@link #queryReadCompleteDefinition} - */ - COMPLETE_DEFINITION, - - /** - * Query "ReadAssumedNextSwitchTime" - * @see {@link #queryReadAssumedNextSwitchTime} - */ - ASSUMED_NEXT_SWITCH_TIME, - - } - - - private final ChangeLightsStateQuery csqvar_ChangeLightsState; - - private final ChangeObjectVarQuery.ChangeIntegerQ csqvar_ChangePhaseIndex; - - private final ChangeObjectVarQuery.ChangeStringQ csqvar_ChangeProgram; - - private final ChangeObjectVarQuery.ChangeIntegerQ csqvar_ChangePhaseDuration; - - private final ChangeCompleteProgramQuery csqvar_ChangeCompleteProgramDefinition; - TrafficLight ( - DataInputStream dis, - DataOutputStream dos, - String id - - , Repository<Lane> repoLane - ) { - super(id, Variable.class); - - /* - * initialization of read queries - */ - - addReadQuery(Variable.STATE, - new ReadTLStateQuery (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_TL_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.TL_RED_YELLOW_GREEN_STATE - - )); - - addReadQuery(Variable.DEFAULT_CURRENT_PHASE_DURATION, - new ReadObjectVarQuery.IntegerQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_TL_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.TL_PHASE_DURATION - - )); - - addReadQuery(Variable.CONTROLLED_LANES, - new LaneListQuery (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_TL_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.TL_CONTROLLED_LANES - , repoLane - - )); - - addReadQuery(Variable.CONTROLLED_LINKS, - new ReadControlledLinksQuery (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_TL_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.TL_CONTROLLED_LINKS - , repoLane - - )); - - addReadQuery(Variable.CURRENT_PHASE, - new ReadObjectVarQuery.IntegerQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_TL_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.TL_CURRENT_PHASE - - )); - - addReadQuery(Variable.CURRENT_PROGRAM, - new ReadObjectVarQuery.StringQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_TL_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.TL_CURRENT_PROGRAM - - )); - - addReadQuery(Variable.COMPLETE_DEFINITION, - new ReadCompleteDefinitionQuery (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_TL_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.TL_COMPLETE_DEFINITION_RYG - - )); - - addReadQuery(Variable.ASSUMED_NEXT_SWITCH_TIME, - new ReadObjectVarQuery.IntegerQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_TL_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.TL_RED_YELLOW_GREEN_STATE - - )); - - - /* - * initialization of change state queries - */ - - csqvar_ChangeLightsState = new ChangeLightsStateQuery(dis, dos, id - ) - ; - - csqvar_ChangePhaseIndex = new ChangeObjectVarQuery.ChangeIntegerQ(dis, dos, id - , it.polito.appeal.traci.protocol.Constants.CMD_SET_TL_VARIABLE, it.polito.appeal.traci.protocol.Constants.TL_CURRENT_PHASE) - ; - - csqvar_ChangeProgram = new ChangeObjectVarQuery.ChangeStringQ(dis, dos, id - , it.polito.appeal.traci.protocol.Constants.CMD_SET_TL_VARIABLE, it.polito.appeal.traci.protocol.Constants.TL_PROGRAM) - ; - - csqvar_ChangePhaseDuration = new ChangeObjectVarQuery.ChangeIntegerQ(dis, dos, id - , it.polito.appeal.traci.protocol.Constants.CMD_SET_TL_VARIABLE, it.polito.appeal.traci.protocol.Constants.TL_PHASE_DURATION) - ; - - csqvar_ChangeCompleteProgramDefinition = new ChangeCompleteProgramQuery(dis, dos, id - , it.polito.appeal.traci.protocol.Constants.CMD_SET_TL_VARIABLE, it.polito.appeal.traci.protocol.Constants.TL_COMPLETE_PROGRAM_RYG) - ; - - - } - - - - @Override - public void nextStep(double step) { - - getReadQuery(Variable.STATE).setObsolete(); - - getReadQuery(Variable.DEFAULT_CURRENT_PHASE_DURATION).setObsolete(); - - getReadQuery(Variable.CURRENT_PHASE).setObsolete(); - - getReadQuery(Variable.CURRENT_PROGRAM).setObsolete(); - - getReadQuery(Variable.ASSUMED_NEXT_SWITCH_TIME).setObsolete(); - - } - - - - - - /** - * @return the instance of {@link ReadTLStateQuery} relative to this query. - */ - public ReadTLStateQuery queryReadState() { - return (ReadTLStateQuery) getReadQuery(Variable.STATE); - } - - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Integer> queryReadDefaultCurrentPhaseDuration() { - return (ReadObjectVarQuery.IntegerQ) getReadQuery(Variable.DEFAULT_CURRENT_PHASE_DURATION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Integer getDefaultCurrentPhaseDuration() throws IOException { - return ((ReadObjectVarQuery.IntegerQ) getReadQuery(Variable.DEFAULT_CURRENT_PHASE_DURATION)).get(); - } - - /** - * @return the instance of {@link LaneListQuery} relative to this query. - */ - public LaneListQuery queryReadControlledLanes() { - return (LaneListQuery) getReadQuery(Variable.CONTROLLED_LANES); - } - - - /** - * @return the instance of {@link ReadControlledLinksQuery} relative to this query. - */ - public ReadControlledLinksQuery queryReadControlledLinks() { - return (ReadControlledLinksQuery) getReadQuery(Variable.CONTROLLED_LINKS); - } - - - /** - * @return the instance of {@link ReadObjectVarQuery.IntegerQ} relative to this query. - */ - public ReadObjectVarQuery.IntegerQ queryReadCurrentPhase() { - return (ReadObjectVarQuery.IntegerQ) getReadQuery(Variable.CURRENT_PHASE); - } - - - /** - * @return the instance of {@link ReadObjectVarQuery.StringQ} relative to this query. - */ - public ReadObjectVarQuery.StringQ queryReadCurrentProgram() { - return (ReadObjectVarQuery.StringQ) getReadQuery(Variable.CURRENT_PROGRAM); - } - - - /** - * @return the instance of {@link ReadCompleteDefinitionQuery} relative to this query. - */ - public ReadCompleteDefinitionQuery queryReadCompleteDefinition() { - return (ReadCompleteDefinitionQuery) getReadQuery(Variable.COMPLETE_DEFINITION); - } - - - /** - * @return the instance of {@link ReadObjectVarQuery.IntegerQ} relative to this query. - */ - public ReadObjectVarQuery.IntegerQ queryReadAssumedNextSwitchTime() { - return (ReadObjectVarQuery.IntegerQ) getReadQuery(Variable.ASSUMED_NEXT_SWITCH_TIME); - } - - - /** - * @return the instance of {@link ChangeLightsStateQuery} relative to this query. - */ - public ChangeLightsStateQuery queryChangeLightsState() { - return csqvar_ChangeLightsState; - } - - - /** - * Execute an instance of ChangeLightsStateQuery set to the given value. - * - * This setter method is equivalent to queryChangeLightsState().setValue(value).run(). - */ - public void changeLightsState(TLState value) throws IOException { - ChangeLightsStateQuery q = csqvar_ChangeLightsState; - q.setValue(value); - q.run(); - } - - /** - * @return the instance of {@link ChangeObjectVarQuery.ChangeIntegerQ} relative to this query. - */ - public ChangeObjectVarQuery.ChangeIntegerQ queryChangePhaseIndex() { - return csqvar_ChangePhaseIndex; - } - - - /** - * Execute an instance of ChangeObjectVarQuery.ChangeIntegerQ set to the given value. - * - * This setter method is equivalent to queryChangePhaseIndex().setValue(value).run(). - */ - public void changePhaseIndex(Integer value) throws IOException { - ChangeObjectVarQuery.ChangeIntegerQ q = csqvar_ChangePhaseIndex; - q.setValue(value); - q.run(); - } - - /** - * @return the instance of {@link ChangeObjectVarQuery.ChangeStringQ} relative to this query. - */ - public ChangeObjectVarQuery.ChangeStringQ queryChangeProgram() { - return csqvar_ChangeProgram; - } - - - /** - * Execute an instance of ChangeObjectVarQuery.ChangeStringQ set to the given value. - * - * This setter method is equivalent to queryChangeProgram().setValue(value).run(). - */ - public void changeProgram(String value) throws IOException { - ChangeObjectVarQuery.ChangeStringQ q = csqvar_ChangeProgram; - q.setValue(value); - q.run(); - } - - /** - * @return the instance of {@link ChangeObjectVarQuery.ChangeIntegerQ} relative to this query. - */ - public ChangeObjectVarQuery.ChangeIntegerQ queryChangePhaseDuration() { - return csqvar_ChangePhaseDuration; - } - - - /** - * Execute an instance of ChangeObjectVarQuery.ChangeIntegerQ set to the given value. - * - * This setter method is equivalent to queryChangePhaseDuration().setValue(value).run(). - */ - public void changePhaseDuration(Integer value) throws IOException { - ChangeObjectVarQuery.ChangeIntegerQ q = csqvar_ChangePhaseDuration; - q.setValue(value); - q.run(); - } - - /** - * @return the instance of {@link ChangeCompleteProgramQuery} relative to this query. - */ - public ChangeCompleteProgramQuery queryChangeCompleteProgramDefinition() { - return csqvar_ChangeCompleteProgramDefinition; - } - - - /** - * Execute an instance of ChangeCompleteProgramQuery set to the given value. - * - * This setter method is equivalent to queryChangeCompleteProgramDefinition().setValue(value).run(). - */ - public void changeCompleteProgramDefinition(Logic value) throws IOException { - ChangeCompleteProgramQuery q = csqvar_ChangeCompleteProgramDefinition; - q.setValue(value); - q.run(); - } - -} - diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Vehicle.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Vehicle.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Vehicle.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/Vehicle.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,829 +0,0 @@ - - -/* - THIS FILE IS GENERATED AUTOMATICALLY. DO NOT EDIT: CHANGES WILL BE OVERWRITTEN. - File generated by traciObject.xslt. -*/ - -/* - Copyright (C) 2013 ApPeAL Group, Politecnico di Torino - - This file is part of TraCI4J. - - TraCI4J 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. - - TraCI4J is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with TraCI4J. If not, see <http://www.gnu.org/licenses/>. -*/ - - -package it.polito.appeal.traci; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -/** - - Representation of a vehicle in the SUMO environment. - @see <a href="http://sumo.sourceforge.net/doc/current/docs/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html#Vehicle_Types">SUMO documentation</a> - @author Enrico Gueli <enrico.gueli@polito.it> - -*/ -public class Vehicle -extends TraciObject<Vehicle.Variable> -implements StepAdvanceListener -{ - - /** - * Enumerates all the read queries. Each value can be used as an argument - * for {@link TraciObject#getReadQuery(Enum)}. - * - * @author Enrico Gueli <enrico.gueli@polito.it> - */ - public static enum Variable { - - /** - * Query "ReadSpeed" - * @see {@link #queryReadSpeed} - */ - SPEED, - - /** - * Query "ReadPosition" - * @see {@link #queryReadPosition} - */ - POSITION, - - /** - * Query "ReadLanePosition" - * @see {@link #queryReadLanePosition} - */ - LANE_POSITION, - - /** - * Query "ReadCurrentLaneIndex" - * @see {@link #queryReadCurrentLaneIndex} - */ - LANE_INDEX, - - /** - * Query "ReadCurrentLane" - * @see {@link #queryReadCurrentLane} - */ - LANE_ID, - - /** - * Query "ReadCurrentRoute" - * @see {@link #queryReadCurrentRoute} - */ - CURRENT_ROUTE, - - /** - * Query "ReadCurrentEdge" - * @see {@link #queryReadCurrentEdge} - */ - CURRENT_EDGE, - - /** - * Query "ReadCO2Emission" - * @see {@link #queryReadCO2Emission} - */ - CO2_EMISSION, - - /** - * Query "ReadCOEmission" - * @see {@link #queryReadCOEmission} - */ - CO_EMISSION, - - /** - * Query "ReadHCEmission" - * @see {@link #queryReadHCEmission} - */ - HC_EMISSION, - - /** - * Query "ReadPMXEmission" - * @see {@link #queryReadPMXEmission} - */ - PMX_EMISSION, - - /** - * Query "ReadNOXEmission" - * @see {@link #queryReadNOXEmission} - */ - NOX_EMISSION, - - /** - * Query "ReadFuelConsumption" - * @see {@link #queryReadFuelConsumption} - */ - FUEL_CONSUMPTION, - - /** - * Query "ReadNoiseEmission" - * @see {@link #queryReadNoiseEmission} - */ - NOISE_EMISSION, - - /** - * Query "ReadColor" - * @see {@link #queryReadColor} - */ - COLOR, - - /** - * Query "ReadType" - * @see {@link #queryReadType} - */ - TYPE, - - } - - - private final ChangeEdgeTravelTimeQuery csqvar_SetEdgeTravelTime; - - private final RerouteQuery csqvar_Reroute; - - private final ChangeLaneIndexQuery csqvar_ChangeLaneIndex; - - private final ChangeColorQuery csqvar_ChangeColor; - - private final ChangeTargetQuery csqvar_ChangeTarget; - - private final ChangeMaxSpeedQuery csqvar_ChangeMaxSpeed; - - private final ChangeRouteQuery csqvar_ChangeRoute; - - private final ChangeSpeedQuery csqvar_ChangeSpeed; - Vehicle ( - DataInputStream dis, - DataOutputStream dos, - String id - - , Repository<Edge> repoEdge - , Repository<Lane> repoLane - ) { - super(id, Variable.class); - - /* - * initialization of read queries - */ - - addReadQuery(Variable.SPEED, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_SPEED - - )); - - addReadQuery(Variable.POSITION, - new ReadObjectVarQuery.PositionQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_POSITION - - )); - - addReadQuery(Variable.LANE_POSITION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_LANEPOSITION - - )); - - addReadQuery(Variable.LANE_INDEX, - new ReadObjectVarQuery.IntegerQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_LANE_INDEX - - )); - - addReadQuery(Variable.LANE_ID, - new ReadObjectVarQuery.LaneQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_LANE_ID - , repoLane - - )); - - addReadQuery(Variable.CURRENT_ROUTE, - new RouteQuery (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_EDGES - , repoEdge - - )); - - addReadQuery(Variable.CURRENT_EDGE, - new ReadObjectVarQuery.EdgeQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_ROAD_ID - , repoEdge - - )); - - addReadQuery(Variable.CO2_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_CO2EMISSION - - )); - - addReadQuery(Variable.CO_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_COEMISSION - - )); - - addReadQuery(Variable.HC_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_HCEMISSION - - )); - - addReadQuery(Variable.PMX_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_PMXEMISSION - - )); - - addReadQuery(Variable.NOX_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_NOXEMISSION - - )); - - addReadQuery(Variable.FUEL_CONSUMPTION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_FUELCONSUMPTION - - )); - - addReadQuery(Variable.NOISE_EMISSION, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_NOISEEMISSION - - )); - - addReadQuery(Variable.COLOR, - new ReadObjectVarQuery.ColorQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_COLOR - - )); - - addReadQuery(Variable.TYPE, - new ReadObjectVarQuery.StringQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_TYPE - - )); - - - /* - * initialization of change state queries - */ - - csqvar_SetEdgeTravelTime = new ChangeEdgeTravelTimeQuery(dis, dos, id - ) - ; - - csqvar_Reroute = new RerouteQuery(dis, dos, id - ) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadCurrentRoute().setObsolete(); - - } - }; - - csqvar_ChangeLaneIndex = new ChangeLaneIndexQuery(dis, dos, id - ) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadCurrentLaneIndex().setObsolete(); - - } - }; - - csqvar_ChangeColor = new ChangeColorQuery(dis, dos, id - , it.polito.appeal.traci.protocol.Constants.CMD_SET_VEHICLE_VARIABLE, it.polito.appeal.traci.protocol.Constants.VAR_COLOR) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadColor().setObsolete(); - - } - }; - - csqvar_ChangeTarget = new ChangeTargetQuery(dis, dos, id - ) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadCurrentRoute().setObsolete(); - - } - }; - - csqvar_ChangeMaxSpeed = new ChangeMaxSpeedQuery(dis, dos, id - ) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - } - }; - - csqvar_ChangeRoute = new ChangeRouteQuery(dis, dos, id - ) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadCurrentRoute().setObsolete(); - - } - }; - - csqvar_ChangeSpeed = new ChangeSpeedQuery(dis, dos, id - ) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadSpeed().setObsolete(); - - } - }; - - - } - - - - @Override - public void nextStep(double step) { - - getReadQuery(Variable.SPEED).setObsolete(); - - getReadQuery(Variable.POSITION).setObsolete(); - - getReadQuery(Variable.LANE_POSITION).setObsolete(); - - getReadQuery(Variable.LANE_INDEX).setObsolete(); - - getReadQuery(Variable.LANE_ID).setObsolete(); - - getReadQuery(Variable.CURRENT_EDGE).setObsolete(); - - getReadQuery(Variable.CO2_EMISSION).setObsolete(); - - getReadQuery(Variable.CO_EMISSION).setObsolete(); - - getReadQuery(Variable.HC_EMISSION).setObsolete(); - - getReadQuery(Variable.PMX_EMISSION).setObsolete(); - - getReadQuery(Variable.NOX_EMISSION).setObsolete(); - - getReadQuery(Variable.FUEL_CONSUMPTION).setObsolete(); - - getReadQuery(Variable.NOISE_EMISSION).setObsolete(); - - getReadQuery(Variable.COLOR).setObsolete(); - - } - - - - - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadSpeed() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.SPEED); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getSpeed() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.SPEED)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.awt.geom.Point2D> queryReadPosition() { - return (ReadObjectVarQuery.PositionQ) getReadQuery(Variable.POSITION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.awt.geom.Point2D getPosition() throws IOException { - return ((ReadObjectVarQuery.PositionQ) getReadQuery(Variable.POSITION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadLanePosition() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.LANE_POSITION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getLanePosition() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.LANE_POSITION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Integer> queryReadCurrentLaneIndex() { - return (ReadObjectVarQuery.IntegerQ) getReadQuery(Variable.LANE_INDEX); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Integer getLaneIndex() throws IOException { - return ((ReadObjectVarQuery.IntegerQ) getReadQuery(Variable.LANE_INDEX)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Lane> queryReadCurrentLane() { - return (ReadObjectVarQuery.LaneQ) getReadQuery(Variable.LANE_ID); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Lane getLaneId() throws IOException { - return ((ReadObjectVarQuery.LaneQ) getReadQuery(Variable.LANE_ID)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.util.List<Edge>> queryReadCurrentRoute() { - return (RouteQuery) getReadQuery(Variable.CURRENT_ROUTE); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.util.List<Edge> getCurrentRoute() throws IOException { - return ((RouteQuery) getReadQuery(Variable.CURRENT_ROUTE)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Edge> queryReadCurrentEdge() { - return (ReadObjectVarQuery.EdgeQ) getReadQuery(Variable.CURRENT_EDGE); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Edge getCurrentEdge() throws IOException { - return ((ReadObjectVarQuery.EdgeQ) getReadQuery(Variable.CURRENT_EDGE)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadCO2Emission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.CO2_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getCo2Emission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.CO2_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadCOEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.CO_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getCoEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.CO_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadHCEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.HC_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getHcEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.HC_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadPMXEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.PMX_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getPmxEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.PMX_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadNOXEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.NOX_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getNoxEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.NOX_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadFuelConsumption() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.FUEL_CONSUMPTION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getFuelConsumption() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.FUEL_CONSUMPTION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.Double> queryReadNoiseEmission() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.NOISE_EMISSION); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.Double getNoiseEmission() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.NOISE_EMISSION)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.awt.Color> queryReadColor() { - return (ReadObjectVarQuery.ColorQ) getReadQuery(Variable.COLOR); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.awt.Color getColor() throws IOException { - return ((ReadObjectVarQuery.ColorQ) getReadQuery(Variable.COLOR)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<java.lang.String> queryReadType() { - return (ReadObjectVarQuery.StringQ) getReadQuery(Variable.TYPE); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public java.lang.String getType() throws IOException { - return ((ReadObjectVarQuery.StringQ) getReadQuery(Variable.TYPE)).get(); - } - - /** - * @return the instance of {@link ChangeEdgeTravelTimeQuery} relative to this query. - */ - public ChangeEdgeTravelTimeQuery querySetEdgeTravelTime() { - return csqvar_SetEdgeTravelTime; - } - - - /** - * @return the instance of {@link RerouteQuery} relative to this query. - */ - public RerouteQuery queryReroute() { - return csqvar_Reroute; - } - - - /** - * @return the instance of {@link ChangeLaneIndexQuery} relative to this query. - */ - public ChangeLaneIndexQuery queryChangeLaneIndex() { - return csqvar_ChangeLaneIndex; - } - - - /** - * Execute an instance of ChangeLaneIndexQuery set to the given value. - * - * This setter method is equivalent to queryChangeLaneIndex().setValue(value).run(). - */ - public void changeLaneIndex(LaneIndexQueryParameter value) throws IOException { - ChangeLaneIndexQuery q = csqvar_ChangeLaneIndex; - q.setValue(value); - q.run(); - } - - /** - * @return the instance of {@link ChangeColorQuery} relative to this query. - */ - public ChangeColorQuery queryChangeColor() { - return csqvar_ChangeColor; - } - - - /** - * Execute an instance of ChangeColorQuery set to the given value. - * - * This setter method is equivalent to queryChangeColor().setValue(value).run(). - */ - public void changeColor(java.awt.Color value) throws IOException { - ChangeColorQuery q = csqvar_ChangeColor; - q.setValue(value); - q.run(); - } - - /** - * @return the instance of {@link ChangeTargetQuery} relative to this query. - */ - public ChangeTargetQuery queryChangeTarget() { - return csqvar_ChangeTarget; - } - - - /** - * Execute an instance of ChangeTargetQuery set to the given value. - * - * This setter method is equivalent to queryChangeTarget().setValue(value).run(). - */ - public void changeTarget(Edge value) throws IOException { - ChangeTargetQuery q = csqvar_ChangeTarget; - q.setValue(value); - q.run(); - } - - /** - * @return the instance of {@link ChangeMaxSpeedQuery} relative to this query. - */ - public ChangeMaxSpeedQuery queryChangeMaxSpeed() { - return csqvar_ChangeMaxSpeed; - } - - - /** - * @return the instance of {@link ChangeRouteQuery} relative to this query. - */ - public ChangeRouteQuery queryChangeRoute() { - return csqvar_ChangeRoute; - } - - - /** - * Execute an instance of ChangeRouteQuery set to the given value. - * - * This setter method is equivalent to queryChangeRoute().setValue(value).run(). - */ - public void changeRoute(java.util.List<Edge> value) throws IOException { - ChangeRouteQuery q = csqvar_ChangeRoute; - q.setValue(value); - q.run(); - } - - /** - * @return the instance of {@link ChangeSpeedQuery} relative to this query. - */ - public ChangeSpeedQuery queryChangeSpeed() { - return csqvar_ChangeSpeed; - } - - - /** - * Execute an instance of ChangeSpeedQuery set to the given value. - * - * This setter method is equivalent to queryChangeSpeed().setValue(value).run(). - */ - public void changeSpeed(Double value) throws IOException { - ChangeSpeedQuery q = csqvar_ChangeSpeed; - q.setValue(value); - q.run(); - } - -} - diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/VehicleType.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/VehicleType.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/VehicleType.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/java-gen/it/polito/appeal/traci/VehicleType.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,334 +0,0 @@ - - -/* - THIS FILE IS GENERATED AUTOMATICALLY. DO NOT EDIT: CHANGES WILL BE OVERWRITTEN. - File generated by traciObject.xslt. -*/ - -/* - Copyright (C) 2013 ApPeAL Group, Politecnico di Torino - - This file is part of TraCI4J. - - TraCI4J 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. - - TraCI4J is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with TraCI4J. If not, see <http://www.gnu.org/licenses/>. -*/ - - -package it.polito.appeal.traci; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -/** - - Representation of a class of vehicles in the SUMO environment. - @see <a href="http://sumo.sourceforge.net/doc/current/docs/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html#Vehicle_Types">SUMO documentation</a> - @author Enrico Gueli <enrico.gueli@polito.it> - -*/ -public class VehicleType -extends TraciObject<VehicleType.Variable> -implements StepAdvanceListener -{ - - /** - * Enumerates all the read queries. Each value can be used as an argument - * for {@link TraciObject#getReadQuery(Enum)}. - * - * @author Enrico Gueli <enrico.gueli@polito.it> - */ - public static enum Variable { - - /** - * Query "ReadGlobalTravelTime" - * @see {@link #queryReadGlobalTravelTime} - */ - LENGTH, - - /** - * Query "ReadAccel" - * @see {@link #queryReadAccel} - */ - ACCEL, - - /** - * Query "ReadDecel" - * @see {@link #queryReadDecel} - */ - DECEL, - - /** - * Query "ReadMaxSpeed" - * @see {@link #queryReadMaxSpeed} - */ - MAXSPEED, - - /** - * Query "ReadMinGap" - * @see {@link #queryReadMinGap} - */ - MINGAP, - - } - - - private final ChangeAccelQuery csqvar_ChangeAccel; - - private final ChangeDecelQuery csqvar_ChangeDecel; - - private final ChangeMaxSpeedQuery csqvar_ChangeMaxSpeed; - - private final ChangeMinGapQuery csqvar_ChangeMinGap; - VehicleType ( - DataInputStream dis, - DataOutputStream dos, - String id - - ) { - super(id, Variable.class); - - /* - * initialization of read queries - */ - - addReadQuery(Variable.LENGTH, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLETYPE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_LENGTH - - )); - - addReadQuery(Variable.ACCEL, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLETYPE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_ACCEL - - )); - - addReadQuery(Variable.DECEL, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLETYPE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_DECEL - - )); - - addReadQuery(Variable.MAXSPEED, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLETYPE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_MAXSPEED - - )); - - addReadQuery(Variable.MINGAP, - new ReadObjectVarQuery.DoubleQ (dis, dos, - it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLETYPE_VARIABLE, - id, - it.polito.appeal.traci.protocol.Constants.VAR_MINGAP - - )); - - - /* - * initialization of change state queries - */ - - csqvar_ChangeAccel = new ChangeAccelQuery(dis, dos, id - ) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadAccel().setObsolete(); - - } - }; - - csqvar_ChangeDecel = new ChangeDecelQuery(dis, dos, id - ) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadDecel().setObsolete(); - - } - }; - - csqvar_ChangeMaxSpeed = new ChangeMaxSpeedQuery(dis, dos, id - ) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadMaxSpeed().setObsolete(); - - } - }; - - csqvar_ChangeMinGap = new ChangeMinGapQuery(dis, dos, id - ) - { - @Override - void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) - throws TraCIException { - super.pickResponses(responseIterator); - - queryReadMinGap().setObsolete(); - - } - }; - - - } - - - - @Override - public void nextStep(double step) { - - getReadQuery(Variable.MAXSPEED).setObsolete(); - - getReadQuery(Variable.MINGAP).setObsolete(); - - } - - - - - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Double> queryReadGlobalTravelTime() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.LENGTH); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Double getLength() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.LENGTH)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Double> queryReadAccel() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.ACCEL); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Double getAccel() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.ACCEL)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Double> queryReadDecel() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.DECEL); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Double getDecel() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.DECEL)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Double> queryReadMaxSpeed() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.MAXSPEED); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Double getMaxspeed() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.MAXSPEED)).get(); - } - - /** - * @return the instance of {@link ReadObjectVarQuery} relative to this query. - */ - public ReadObjectVarQuery<Double> queryReadMinGap() { - return (ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.MINGAP); - } - - - /** - * Executes an instance of {@link ReadObjectVarQuery} relative to this query, - * and returns the corresponding value. - */ - public Double getMingap() throws IOException { - return ((ReadObjectVarQuery.DoubleQ) getReadQuery(Variable.MINGAP)).get(); - } - - /** - * @return the instance of {@link ChangeAccelQuery} relative to this query. - */ - public ChangeAccelQuery queryChangeAccel() { - return csqvar_ChangeAccel; - } - - - /** - * @return the instance of {@link ChangeDecelQuery} relative to this query. - */ - public ChangeDecelQuery queryChangeDecel() { - return csqvar_ChangeDecel; - } - - - /** - * @return the instance of {@link ChangeMaxSpeedQuery} relative to this query. - */ - public ChangeMaxSpeedQuery queryChangeMaxSpeed() { - return csqvar_ChangeMaxSpeed; - } - - - /** - * @return the instance of {@link ChangeMinGapQuery} relative to this query. - */ - public ChangeMinGapQuery queryChangeMinGap() { - return csqvar_ChangeMinGap; - } - - -} - diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/xml/traciObjects/VehicleType.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/xml/traciObjects/VehicleType.xml --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/xml/traciObjects/VehicleType.xml 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/xml/traciObjects/VehicleType.xml 2015-04-17 05:44:20.000000000 +0000 @@ -22,7 +22,8 @@ </repos> <command>it.polito.appeal.traci.protocol.Constants.CMD_GET_VEHICLETYPE_VARIABLE</command> - + <changeStateCommand>it.polito.appeal.traci.protocol.Constants.CMD_SET_VEHICLETYPE_VARIABLE</changeStateCommand> + <readQueries> <readQuery> <name>ReadGlobalTravelTime</name> @@ -77,8 +78,9 @@ <changeStateQuery> <name>ChangeAccel</name> - <query>ChangeAccelQuery</query> - <affects> + <query>ChangeObjectVarQuery.ChangeDoubleQ</query> + <const>it.polito.appeal.traci.protocol.Constants.VAR_ACCEL</const> + <affects> <affect>ReadAccel</affect> </affects> </changeStateQuery> diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/xml/traciObjects/Vehicle.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/xml/traciObjects/Vehicle.xml --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/xml/traciObjects/Vehicle.xml 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/xml/traciObjects/Vehicle.xml 2015-04-17 05:44:20.000000000 +0000 @@ -261,8 +261,13 @@ <affect>ReadSpeed</affect> </affects> </changeStateQuery> - - + + <changeStateQuery> + <name>ChangeLaneChangeMode</name> + <query>ChangeObjectVarQuery.ChangeIntegerQ</query> + <const>it.polito.appeal.traci.protocol.Constants.VAR_LANE_CHANGE_MODE</const> + </changeStateQuery> + </changeStateQueries> </traciClass> diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/src/xslt/traciObject.xslt sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/xslt/traciObject.xslt --- sumo-0.21.0+dfsg/tools/contributed/traci4j/src/xslt/traciObject.xslt 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/src/xslt/traciObject.xslt 2015-04-17 05:44:20.000000000 +0000 @@ -137,8 +137,10 @@ * initialization of change state queries */ <xsl:for-each select="changeStateQueries/changeStateQuery"> - csqvar_<xsl:value-of select="name"/> = new <xsl:value-of select="query"/>(dis, dos, id - <xsl:if test="const">, <xsl:value-of select="../../changeStateCommand"/>, <xsl:value-of select="const"/></xsl:if>) + csqvar_<xsl:value-of select="name"/> = new <xsl:value-of select="query"/>(dis, dos + <xsl:if test="const">, <xsl:value-of select="../../changeStateCommand"/></xsl:if> + , id + <xsl:if test="const">, <xsl:value-of select="const"/></xsl:if>) <xsl:if test="affects">{ @Override void pickResponses(java.util.Iterator<it.polito.appeal.traci.protocol.ResponseContainer> responseIterator) diff -Nru sumo-0.21.0+dfsg/tools/contributed/traci4j/test/java/it/polito/appeal/traci/test/TraCITest.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/test/java/it/polito/appeal/traci/test/TraCITest.java --- sumo-0.21.0+dfsg/tools/contributed/traci4j/test/java/it/polito/appeal/traci/test/TraCITest.java 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/traci4j/test/java/it/polito/appeal/traci/test/TraCITest.java 2015-04-17 05:44:20.000000000 +0000 @@ -832,7 +832,7 @@ } /** - * Checks for the correct adding of a new vehicle. + * Checks for the correct adding of new vehicles. * * @throws IOException */ @@ -841,23 +841,38 @@ conn.nextSimStep(); //assertTrue(conn.getVehicleRepository().getIDs().size() > 0); - final String id = "A_NEW_VEHICLE"; + final String id1 = "A_NEW_VEHICLE"; + final String id2 = "ANOTHER_NEW_VEHICLE"; Route route = conn.getRouteRepository().getByID("0"); VehicleType vType = conn.getVehicleTypeRepository().getByID("KRAUSS_DEFAULT"); + + int now = conn.getCurrentSimStep() * 1000; // time is in ms + + /* + * Add one vehicle now and one at a later time. + */ + AddVehicleQuery avqNow = conn.queryAddVehicle(); + avqNow.setVehicleData(id1, vType, route, 0, now, 0, 0); + avqNow.run(); - AddVehicleQuery avq = conn.queryAddVehicle(); - avq.setVehicleData(id, vType, route, 0, 0, 0); - avq.run(); + AddVehicleQuery avqLater = conn.queryAddVehicle(); + avqLater.setVehicleData(id2, vType, route, 0, now+70001, 0, 0); + avqLater.run(); /* - * The new vehicle won't enter the simulation immediately, because other - * vehicles are waiting the lane to be freed before entering. + * The new vehicle might not enter the simulation immediately because its + * lane must be freed of other waiting vehicles first. */ + for (int t=0; t<70; t++) + conn.nextSimStep(); + + assertTrue(conn.getVehicleRepository().getAll().containsKey(id1)); + assertFalse(conn.getVehicleRepository().getAll().containsKey(id2)); for (int t=0; t<70; t++) conn.nextSimStep(); - assertTrue(conn.getVehicleRepository().getAll().containsKey(id)); + assertTrue(conn.getVehicleRepository().getAll().containsKey(id2)); } /** diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/examples/traci_test2.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/examples/traci_test2.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/examples/traci_test2.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/examples/traci_test2.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,608 @@ +%% TRACI TEST 2 +% This m-file shows how to use Traci4Matlab. +% This example uses the files of the SUMO traci tutorial, see +% http://sumo-sim.org/userdoc/Tutorials/TraCI4Traffic_Lights.html. If you +% want to test a TraCI command, just uncomment it. The commands are +% organized by SUMO object type, some of them needed to be included in +% the main loop of the script. + +% Copyright 2013 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: traci_test2.m 20 2015-03-02 16:52:32Z afacostag $ + +clear all +close all +clc + +%% MAIN +% The scenario consists of a single intersection controlled by a traffic light +% whose phases are changed if vehicles pass through an induction loop. + +% Initialize SUMO from the system. note that it is initialized in graphical +% interface mode. You have to set the SUMO_HOME environment variable +% pointing to your SUMO root directory and modify the windows path to +% include the %SUMO_HOME%/bin directory. + +try + system(['sumo-gui -c ' getenv('SUMO_HOME') '\docs\tutorial\traci_tls\data\cross.sumocfg&']); +catch err +end + + +% To test sine vehicle commands, we have to check wether the sumo 0.20.0 +% version is installed, because in that version the prefix of the vehicle +% names has changed. +if isempty(strfind(getenv('SUMO_HOME'),'sumo-0.21.0')) + testVehicle = '10'; +else + testVehicle = 'right_10'; +end + +import traci.constants + +% Initialize TraCI +traci.init(); + +% Define the traffic light phases in a sumo-readable way +NSGREEN = 'GrGr'; +NSYELLOW = 'yryr'; +WEGREEN = 'rGrG'; +WEYELLOW = 'ryry'; + +% Define the traffic light program. The duration of the phases is based on +% the time required for a car to cross the traffic light from north to +% south +PROGRAM = {WEYELLOW,WEYELLOW,WEYELLOW,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSYELLOW,NSYELLOW,WEGREEN}; + +programPointer = length(PROGRAM); +% step = 0; +% steps = zeros(1,800); + + +%% GETIDLIST COMMANDS + + +% areal_dets = traci.areal.getIDList(); +% fprintf('IDs of the areal detectors in the simulation:\n') +% for i=1:length(areal_dets) +% fprintf('%s\n',areal_dets{i}); +% end +% edges = traci.edge.getIDList(); +% fprintf('IDs of the edges in the simulation:\n') +% for i=1:length(edges) +% fprintf('%s\n',edges{i}); +% end +% views = traci.gui.getIDList(); +% fprintf('IDs of the views in the simulacion:\n') +% for i=1:length(views) +% fprintf('%s\n',views{i}); +% end +% inductionloops = traci.inductionloop.getIDList(); +% fprintf('IDs of the induction loops in the simulation:\n') +% for i=1:length(inductionloops) +% fprintf('%s\n',inductionloops{i}); +% end +% junctions = traci.junction.getIDList(); +% fprintf('IDs of the junctions in the simulation:\n') +% for i=1:length(junctions) +% fprintf('%s\n',junctions{i}); +% end +% lanes = traci.lane.getIDList(); +% fprintf('IDs of the lanes in the simulation:\n') +% for i=1:length(lanes) +% fprintf('%s\n',lanes{i}); +% end +% detectors = traci.multientryexit.getIDList(); +% fprintf('IDs of the multi-entry/multi-exit detectors in the simulation:\n') +% for i=1:length(detectors) +% fprintf('%s\n',detectors{i}); +% end +% polygons = traci.polygon.getIDList(); +% fprintf('IDs of te polygons in the simulation:\n') +% for i=1:length(polygons) +% fprintf('%s\n',polygons{i}); +% end +% routes = traci.route.getIDList(); +% fprintf('IDs of the routes in the simulation:\n') +% for i=1:length(routes) +% fprintf('%s\n',routes{i}); +% end +% trafficlights = traci.trafficlights.getIDList(); +% fprintf('IDs of the traffic lights in the simulation:\n') +% for i=1:length(trafficlights) +% fprintf('%s\n',trafficlights{i}); +% end +% vehicletypes = traci.vehicletype.getIDList(); +% fprintf('IDs of the vehicle types in the simulation:\n') +% for i=1:length(vehicletypes) +% fprintf('%s\n',vehicletypes{i}); +% end + +% THE GETIDLIST COMMAND FOR POIS AND POLYGONS IS TESTED AFTER ADDING THOSE +% OBJECTS TO THE SIMULATION +% +% THE GETIDLIST COMMAND FOR VEHICLES IS PERFOMED ONCE THE VEHICLES ARE +% LOADED IN THE NETWORK, IN THE MAIN LOOP + + +%% SUBSCIBE COMMANDS: Note that you have to create the required detectors in the cross.det.xml file + +% traci.edge.subscribe('1i'); +% traci.gui.subscribe('View #0'); +% traci.inductionloop.subscribe('0'); +% traci.junction.subscribe('0'); +% traci.lane.subscribe('1i_0'); +% traci.multientryexit.subscribe('e3_0_1i'); +% traci.route.subscribe('down'); +% traci.simulation.subscribe(); +% traci.trafficlights.subscribe('0',{constants.TL_RED_YELLOW_GREEN_STATE}); +% tlsCurrentPhaseHandle = traci.trafficlights.getSubscriptionResults('0'); +% tlsCurrentPhase = tlsCurrentPhaseHandle(constants.TL_RED_YELLOW_GREEN_STATE); +% fprintf('Traffic lights phase: %s\n', tlsCurrentPhase) +% traci.vehicle.subscribe(testVehicle); +% traci.vehicletype.subscribe('typeWE'); +% maxSpeedWEHandle = traci.vehicletype.getSubscriptionResults('typeWE'); +% maxSpeedWE = maxSpeedWEHandle(constants.VAR_MAXSPEED); + +%% POI AND POLYGON COMMANDS + +% traci.poi.add('mypoi', 550, 550, [255 255 0 0], '', 1); +% pois = traci.poi.getIDList(); +% fprintf('IDs of the pois in the simulation:\n') +% for i=1:length(pois) +% fprintf('%s\n',pois{i}); +% end +% traci.poi.subscribe('mypoi'); +% poiposition = traci.poi.getPosition('mypoi') +% poiColor = traci.poi.getColor('mypoi') +% traci.poi.setType('mypoi', 'mypoitype'); +% poitype = traci.poi.getType('mypoi') +% traci.poi.setPosition('mypoi', 550, 580); +% poiposition = traci.poi.getPosition('mypoi') +% traci.poi.setColor('mypoi', [255 255 255 0]); +% % traci.poi.remove('mypoi', 1); +% +% traci.polygon.add('mypolygon', {[440,440],[440,450],[450,440],[450,450]},... +% [0 255 255 0], false, '', 1); +% traci.polygon.add('my2ndpolygon', {[400,400],[400,420],[430,420],[430,400],[400,400]},... +% [255 0 0 0], true, '', 1); +% polygons = traci.polygon.getIDList(); +% fprintf('IDs of the polygons in the simulation:\n') +% for i=1:length(polygons) +% fprintf('%s\n',polygons{i}); +% end +% traci.polygon.subscribe('mypolygon'); +% polygonColor = traci.polygon.getColor('mypolygon') +% traci.polygon.setType('mypolygon', 'mypolygontype'); +% polygontype = traci.polygon.getType('mypolygon') +% traci.polygon.setShape('mypolygon', {[400,400],[400,420],[430,420],[430,400],[400,400]}); +% polygonshape = traci.polygon.getShape('mypolygon') +% traci.polygon.setColor('mypolygon', [255 255 255 0]); +% traci.polygon.remove('mypolygon', 1); + + +%% CONTEXT SUBSCRIPTIONS +% It's worth noting that, according to +% http://sumo-sim.org/userdoc/TraCI/Object_Context_Subscription.html, only +% the following SUMO objects are supported: inductive loops, lanes, +% vehicles, points-of-interest, polygons, junctions, edges. + +% traci.edge.subscribeContext('4i',constants.CMD_GET_LANE_VARIABLE,50); +% traci.inductionloop.subscribeContext('0',constants.CMD_GET_LANE_VARIABLE,20); +% traci.junction.subscribeContext('0',constants.CMD_GET_VEHICLE_VARIABLE,20); +% traci.lane.subscribeContext('4i_0',constants.CMD_GET_LANE_VARIABLE,50); +% traci.poi.subscribeContext('mypoi',constants.CMD_GET_VEHICLE_VARIABLE,50); +% traci.polygon.subscribeContext('mypolygon',constants.CMD_GET_POLYGON_VARIABLE,30); +% traci.vehicle.subscribeContext(testVehicle,constants.CMD_GET_VEHICLE_VARIABLE,10); +% +% WElaneoccupancy = zeros(1,800); +% NSlaneoccupancy = zeros(1,800); + +% getminexectednumber returns the number of expected vehicles to leave the +% network, which will be the condition to execute the simulation. +% MinExpectedNumber = traci.simulation.getMinExpectedNumber(); + +%% GUI SET COMMANDS +% traci.gui.setZoom('View #0', 1000); +% traci.gui.setOffset('View #0', 523.7211, 525.9342); +traci.gui.setSchema('View #0', 'real world'); +% traci.gui.setBoundary('View #0', 386.95, 485.88, 651.64, 589.01); +% traci.gui.trackVehicle('View #0', testVehicle); + +%% LANE SET COMMANDS +% traci.lane.setAllowed('1i_0',{'unknown'}); +% traci.lane.setDisallowed('1i_0',{'unknown'}); +% traci.lane.setMaxSpeed('1i_0',5); +% traci.lane.setLength('1i_0',450); + +%% ROUTE COMMANDS +% traci.route.add('up',{'53o','3i','4o','54i'}); +% routeUpEdges = traci.route.getEdges('up') + +%% VEHICLE SET COMMANDS +% traci.vehicle.setMaxSpeed(testVehicle,5); +% traci.vehicle.setStop(testVehicle,'1i',50,0,40000); +% traci.vehicle.changeLane(testVehicle,0,40000); +% traci.vehicle.slowDown(testVehicle,1,180000); +% traci.vehicle.changeTarget(testVehicle,'2o'); +% traci.vehicle.setRouteID(testVehicle,'down'); +% traci.vehicle.setRoute(testVehicle,{'51o' '1i' '2o'}); +% traci.vehicle.setAdaptedTraveltime(testVehicle,10000,50000,'1i',15000); +% % traci.vehicle.setEffort(testVehicle,10000,50000,'1i',0.125); %Not online +% % traci.vehicle.rerouteTraveltime(testVehicle); %Not online +% % traci.vehicle.rerouteEffort(testVehicle); %Not online +% traci.vehicle.setSignals(testVehicle,2); +% traci.vehicle.setSpeed(testVehicle,5); +% traci.vehicle.setColor(testVehicle,[0 0 255 0]); +% traci.vehicle.setLength(testVehicle,10); +% traci.vehicle.setVehicleClass(testVehicle,'unknown'); +% traci.vehicle.setSpeedFactor(testVehicle,0.6); +% % traci.vehicle.setSpeedDeviation(testVehicle,5); %Not online +% traci.vehicle.setEmissionClass(testVehicle,'unknown'); +% traci.vehicle.setWidth(testVehicle,3); +% traci.vehicle.setMinGap(testVehicle,10); +% traci.vehicle.setShapeClass(testVehicle,''); +% traci.vehicle.setAccel(testVehicle,2); +% traci.vehicle.setDecel(testVehicle,2); +% traci.vehicle.setImperfection(testVehicle,1); +% traci.vehicle.setTau(testVehicle,1); +% traci.vehicle.add('myvehicle','down'); +% traci.vehicle.remove('myvehicle'); +% traci.gui.trackVehicle('View #0', 'myvehicle'); +% traci.vehicle.moveToVTD('right_10','2o',0,608,509); + +%% VEHICLE TYPE COMMANDS + +% typeLength = traci.vehicletype.getLength('typeWE') +% typeMaxSpeed = traci.vehicletype.getMaxSpeed('typeWE') +% typeSpeedFactor = traci.vehicletype.getSpeedFactor('typeWE') +% typeSpeedDeviation = traci.vehicletype.getSpeedDeviation('typeWE') +% typeAccel = traci.vehicletype.getAccel('typeWE') +% typeDecel = traci.vehicletype.getDecel('typeWE') +% typeImperfection = traci.vehicletype.getImperfection('typeWE') +% typeTau = traci.vehicletype.getTau('typeWE') +% typeClass = traci.vehicletype.getVehicleClass('typeWE') +% typeEmissionClass = traci.vehicletype.getEmissionClass('typeWE') +% typeShapeClass = traci.vehicletype.getShapeClass('typeWE') +% typeMinGap = traci.vehicletype.getShapeClass('typeWE') +% typeWidth = traci.vehicletype.getWidth('typeWE') +% typeColor = traci.vehicletype.getColor('typeWE') +% +% traci.vehicletype.setLength('typeWE',8); +% traci.vehicletype.setMaxSpeed('typeWE',10); +% traci.vehicletype.setVehicleClass('typeWE','passenger'); +% traci.vehicletype.setSpeedFactor('typeWE',0.8); +% traci.vehicletype.setSpeedDeviation('typeWE',0.2); +% traci.vehicletype.setEmissionClass('typeWE','unknown'); +% traci.vehicletype.setWidth('typeWE',1); +% traci.vehicletype.setMinGap('typeWE',1); +% traci.vehicletype.setShapeClass('typeWE',''); +% traci.vehicletype.setAccel('typeWE',5); +% traci.vehicletype.setDecel('typeWE',3); +% traci.vehicletype.setImperfection('typeWE',0.6); +% traci.vehicletype.setTau('typeWE',0.1); +% traci.vehicletype.setColor('typeWE',[255 255 255 0]); + +step = 1; +% for i=1:length(steps) +while traci.simulation.getMinExpectedNumber()>0 + % Here, we demonstrate how to use the simulationStep command using an + % argument. In this case, the simulation is performed each 5 seconds, + % note the behavior when you increase the delay in the gui + traci.simulationStep(5000*step); + pause(1); + programPointer = min(programPointer+1, length(PROGRAM)); + + % Get the number of vehicles that passed through the induction loop in + % the last simulation step + numPriorityVehicles = traci.inductionloop.getLastStepVehicleNumber('0'); + + % SHOW THE VEHICLES IDS INSIDE THE NETWORK + vehicles = traci.vehicle.getIDList(); + % fprintf('IDs of the vehicles in the simulation\n') + % for j=1:length(vehicles) + % fprintf('%s\n',vehicles{j}); + % end + + % Subscribe to the vehicle with the id contained in the variable "testVehicle" + % when it is loaded in the network + % if ismember(testVehicle,vehicles) + % testVehicleHandle = traci.vehicle.getSubscriptionResults(testVehicle); + % testVehicleHandle = {testVehicleHandle(constants.VAR_ROAD_ID) testVehicleHandle(constants.VAR_LANEPOSITION)}; + % end + + %% GETSUBSCRIPTIONRESULTS COMMANDS: Note that you have to create the required detectors in the cross.det.xml file + +% occupancyEdge1Handle = traci.edge.getSubscriptionResults('1i'); +% WElaneoccupancy(i) = occupancyEdge1Handle(constants.LAST_STEP_VEHICLE_NUMBER); + % offsethandle = traci.gui.getSubscriptionResults('View #0'); + % offset = offsethandle(traci.constants.VAR_VIEW_OFFSET); + % indloopSubsResults = traci.inductionloop.getSubscriptionResults('0'); + % no = indloopSubsResults(constants.LAST_STEP_VEHICLE_NUMBER); + % junctionPositionHandle = traci.junction.getSubscriptionResults('0'); + % junctionPosition = junctionPositionHandle(constants.VAR_POSITION); +% occupancyLane1Handle = traci.lane.getSubscriptionResults('1i_0'); +% WElaneoccupancy(i) = occupancyLane1Handle(constants.LAST_STEP_VEHICLE_NUMBER); + % occupancyLane1Handle = traci.multientryexit.getSubscriptionResults('e3_0_1i'); +% WElaneoccupancy(i) = occupancyLane1Handle(constants.LAST_STEP_VEHICLE_NUMBER); + % poiPositionHandle = traci.poi.getSubscriptionResults('mypoi'); + % poiPosition = poiPositionHandle(constants.VAR_POSITION); + % polygonPositionHandle = traci.polygon.getSubscriptionResults('mypolygon'); + % polygonPosition = polygonPositionHandle(constants.VAR_SHAPE); + % routeListHandle = traci.route.getSubscriptionResults('down'); + % routeList = routeListHandle(constants.ID_LIST); + % departedVehicleIDsHandle = traci.simulation.getSubscriptionResults(); + % departedVehicleIDs = departedVehicleIDsHandle(constants.VAR_DEPARTED_VEHICLES_IDS); + + %% GET CONTEXT SUBSCRIPTION RESULTS COMMANDS + + % edge4i0ContextResults = traci.edge.getContextSubscriptionResults('4i'); + % occupancy4i0Handle1 = edge4i0ContextResults('4i_0'); + % occupancy4i0 = occupancy4i0Handle1(constants.LAST_STEP_VEHICLE_NUMBER); + % fprintf('%d\n',occupancy4i0); + + % loop0ContextResults = traci.inductionloop.getContextSubscriptionResults('0'); + % priorityVehiclesPassedHandle = loop0ContextResults('4i_0'); + % priorityVehiclesPassed = priorityVehiclesPassedHandle(constants.LAST_STEP_VEHICLE_NUMBER); + % fprintf('%d\n',priorityVehiclesPassed); + + % junctionContextResults = traci.junction.getContextSubscriptionResults('0'); + + % laneContextSubscriptionResults = traci.lane.getContextSubscriptionResults('4i_0'); + % poiContextSubscriptionResults = traci.poi.getContextSubscriptionResults('mypoi'); + % polygonContextSubscriptionResults = traci.polygon.getContextSubscriptionResults('mypolygon'); + % vehicleContextSubscriptionResults = traci.vehicle.getContextSubscriptionResults(testVehicle); + + %% AREAL DETECTOR COMMANDS: Note that you have to create the detector in the cross.det.xml file + % arealDetectorIDCount = traci.areal.getIDCount(); + % fprintf('Number of areal detectors in the simulation: %d\n',arealDetectorIDCount); + + % JamLengthVehicle = traci.areal.getJamLengthVehicle('0'); + % fprintf('Jam lenght in vehicles in the areal detector 0: %d\n',JamLengthVehicle); + + % JamLengthMeters = traci.areal.getJamLengthMeters('0'); + % fprintf('Jam lenght in meters in the areal detector 0: %d\n',JamLengthMeters); + + % vehicleMeanSpeedAreal0 = traci.areal.getLastStepMeanSpeed('0'); + % fprintf('Average speed in the areal detector 0: %d\n',vehicleMeanSpeedAreal0); + + % vehicleOccupancyAreal0 = traci.areal.getLastStepOccupancy('0'); + % fprintf('Occupancy in the areal detector 0 1i: %d\n',vehicleOccupancyAreal0); + + + %% EDGE COMMANDS + + % edgeIDCount = traci.edge.getIDCount(); + % fprintf('Number of edges in the simulation: %d\n',edgeIDCount); + + % travelTime = traci.edge.getAdaptedTraveltime('1i',10); + % fprintf('Travel time in 10 seconfs in the edge 1i: %d\n',travelTime); + + % effort = traci.edge.getEffort('1i',10); + % fprintf('Travel effort in 10 seconds in the edge 1i: %d\n',effort); + + % CO2EmissionEdge1i = traci.edge.getCO2Emission('1i'); + % fprintf('CO2 emission in the edge 1i: %d\n',CO2EmissionEdge1i); + + % COEmissionEdge1i = traci.edge.getCOEmission('1i'); + % fprintf('CO emission in the edge 1i: %d\n',COEmissionEdge1i); + + % HCEmissionEdge1i = traci.edge.getHCEmission('1i'); + % fprintf('HC emission in the edge 1i: %d\n',HCEmissionEdge1i); + + % PMxEmissionEdge1i = traci.edge.getPmxEmission('1i'); + % fprintf('PMx emission in the edge 1i: %d\n',PMxEmissionEdge1i); + + % NOxEmissionEdge1i = traci.edge.getNOxEmission('1i'); + % fprintf('NOx emission in the edge 1i: %d\n',NOxEmissionEdge1i); + + % fuelConsumptionEdge1i = traci.edge.getFuelConsumption('1i'); + % fprintf('Fuel consumption in the edge 1i: %d\n',fuelConsumptionEdge1i); + + % noiseEmissionEdge1i = traci.edge.getNoiseEmission('1i'); + % fprintf('Noise emission in the edge 1i: %d\n',noiseEmissionEdge1i); + + % vehicleMeanSpeedEdge1i = traci.edge.getLastStepMeanSpeed('1i'); + % fprintf('Average speed in the edge 1i: %d\n',vehicleMeanSpeedEdge1i); + + % vehicleOccupancyEdge1i = traci.edge.getLastStepOccupancy('1i'); + % fprintf('Occupancy in the edge 1i: %d\n',vehicleOccupancyEdge1i); + + % vehicleMeanLengthEdge1i = traci.edge.getLastStepLength('1i'); + % fprintf('Average length in the edge 1i: %d\n',vehicleMeanLengthEdge1i); + + % vehicleTravelTimeEdge1i = traci.edge.getTraveltime('1i'); + % fprintf('Average time of the vehicles in the edge 1i: %d\n',vehicleTravelTimeEdge1i); + + % vehicleHaltingEdge1i = traci.edge.getLastStepHaltingNumber('1i'); + % fprintf('Stopped vehicles in the edge 1i: %d\n',vehicleHaltingEdge1i); + + % vehicleIDsEdge1i = traci.edge.getLastStepVehicleIDs('1i'); + % fprintf('IDs of the vehicles in the edge 1i: \n'); + % disp(vehicleIDsEdge1i) + + % traci.edge.adaptTraveltime('1i',15); + + % traci.edge.setEffort('1i',1.343); + + % traci.edge.setMaxSpeed('1i',5); + + %% GUI GET COMMANDS + + % guizoom = traci.gui.getZoom() + % offset = traci.gui.getOffset() + % schema = traci.gui.getSchema() + % boundary = traci.gui.getBoundary() + + %% INDUCTION LOOP COMMANDS + + % loop0position = traci.inductionloop.getPosition('0'); + % loop0LaneID = traci.inductionloop.getLaneID('0') + % loop0MeanSpeed = traci.inductionloop.getLastStepMeanSpeed('0') + % loop0VehicleIDs = traci.inductionloop.getLastStepVehicleIDs('0') + % loop0Occupancy = traci.inductionloop.getLastStepOccupancy('0') + % loop0MeanLength = traci.inductionloop.getLastStepMeanLength('0') + % loop0TimeSinceDetection = traci.inductionloop.getTimeSinceDetection('0') + + %% JUNCTION COMMANDS + + % junctionPosition = traci.junction.getPosition('0'); + + %% LANE GET COMMANDS + + % lane1i0Length = traci.lane.getLength('1i_0'); + % lane1i0MaxSpeed = traci.lane.getMaxSpeed('1i_0'); + % lane1i0Width = traci.lane.getWidth('1i_0'); + % lane1i0AllowedVehicles = traci.lane.getAllowed('1i_0'); + % lane1i0DisallowedVehicles = traci.lane.getDisallowed('1i_0'); + % lane1i0LinkNumber = traci.lane.getLinkNumber('1i_0'); + % lane1i0Links = traci.lane.getLinks('1i_0'); + % lane1i0Shape = traci.lane.getShape('1i_0'); + % lane1i0EdgeID = traci.lane.getEdgeID('1i_0'); + % lane1i0CO2Emmision = traci.lane.getCO2Emission('1i_0') + % lane1i0COEmmision = traci.lane.getCOEmission('1i_0') + % lane1i0HCEmmision = traci.lane.getHCEmission('1i_0') + % lane1i0PMxEmmision = traci.lane.getPMxEmission('1i_0') + % lane1i0NOxEmmision = traci.lane.getNOxEmission('1i_0') + % lane1i0FuelConsumption = traci.lane.getFuelConsumption('1i_0') + % lane1i0NoiseEmission = traci.lane.getNoiseEmission('1i_0') + % lane1i0MeanSpeed = traci.lane.getLastStepMeanSpeed('1i_0') + % lane1i0Occupancy = traci.lane.getLastStepOccupancy('1i_0') + % lane1i0MeanVehicleLength = traci.lane.getLastStepLength('1i_0') + % lane1i0TravelTime = traci.lane.getTraveltime('1i_0') + % lane1i0HalringNumber = traci.lane.getLastStepHaltingNumber('1i_0') + % lane1i0VehicleIDs = traci.lane.getLastStepVehicleIDs('1i_0') + + %% MULTIENTRY=EXIT COMMANDS: Note that you have to create the detector in the cross.det.xml file + + % muiVehicleNumber = traci.multientryexit.getLastStepVehicleNumber('e3_0_1i') + % muiMeanSpeed = traci.multientryexit.getLastStepMeanSpeed('e3_0_1i') + % muiVehIDs = traci.multientryexit.getLastStepVehicleIDs('e3_0_1i') + % muiHaltingVehicles = traci.multientryexit.getLastStepHaltingNumber('e3_0_1i') + + %% SIMULATION COMMANDS + + % clc + % currentTime = traci.simulation.getCurrentTime() + % loadedNumber = traci.simulation.getLoadedNumber() + % loadedIDList = traci.simulation.getLoadedIDList(); + % departedNumber = traci.simulation.getDepartedNumber() + % departedIDList = traci.simulation.getDepartedIDList(); + % if ismember(testVehicle,departedIDList) + % traci.vehicle.moveTo(testVehicle,'1i_0',20); + % end + % arrivedNumber = traci.simulation.getArrivedNumber() + % arrivedIDList = traci.simulation.getArrivedIDList() + % startingTeleportNumber = traci.simulation.getStartingTeleportNumber() + % startingTeleportIDList = traci.simulation.getStartingTeleportIDList() + % endingTeleportNumber = traci.simulation.getEndingTeleportNumber() + % deltaT = traci.simulation.getDeltaT() + % netBoundary = traci.simulation.getNetBoundary() + % [x y] = traci.simulation.convert2D('1i',10) + % [roadID pos laneID] = traci.simulation.convertRoad(20, 508.35) + % [longitude latitude] = traci.simulation.convertGeo(20, 508.35) + % distance2D = traci.simulation.getDistance2D(20, 508.35, 30, 508.35) + % distanceRoad = traci.simulation.getDistanceRoad('1i', 10, '1i', 20) + + %% TRAFFIC LIGHTS COMMANDS + + % tlsRYGState = traci.trafficlights.getRedYellowGreenState('0') + % tlsRYGDefinition = traci.trafficlights.getCompleteRedYellowGreenDefinition('0') + % tlscontrolledLanes = traci.trafficlights.getControlledLanes('0') + % tlscontrolledLinks = traci.trafficlights.getControlledLinks('0') + % tlsProgram = traci.trafficlights.getProgram('0') + % tlsPhase = traci.trafficlights.getPhase('0') + % traci.trafficlights.setPhase('0',0); + % traci.trafficlights.setProgram('0','0'); + % traci.trafficlights.setPhaseDuration('0',5); +% myRYGDefinition = traci.trafficlights.Logic('0',0,0,0,... +% {traci.trafficlights.Phase(31000,31000,31000,'GrGr'),... +% traci.trafficlights.Phase(31000,31000,31000,'rGrG'),... +% traci.trafficlights.Phase(6000,6000,6000,'ryry')}); + % traci.trafficlights.setCompleteRedYellowGreenDefinition('0',tlsRYGDefinition{1}); + % tlsRYGDefinition = traci.trafficlights.getCompleteRedYellowGreenDefinition('0'); + + %% VEHICLE GET COMMANDS + + % vehSpeed = traci.vehicle.getSpeed(testVehicle) + % vehSpeedWOTraci = traci.vehicle.getSpeedWithoutTraCI(testVehicle) + % vehPosition = traci.vehicle.getPosition(testVehicle) + % vehAngle = traci.vehicle.getAngle(testVehicle) + % vehRoadID = traci.vehicle.getRoadID(testVehicle) + % vehLaneID = traci.vehicle.getLaneID(testVehicle) + % vehLaneIndex = traci.vehicle.getLaneIndex(testVehicle) + % vehTypeID = traci.vehicle.getTypeID(testVehicle) + % vehRouteID = traci.vehicle.getRouteID(testVehicle) + % vehRoute = traci.vehicle.getRoute(testVehicle) + % vehLanePos = traci.vehicle.getLanePosition(testVehicle) + % vehColor = traci.vehicle.getColor(testVehicle) + % vehCO2Emission = traci.vehicle.getCO2Emission(testVehicle) + % vehCOEmission = traci.vehicle.getCOEmission(testVehicle) + % vehPmxEmission = traci.vehicle.getPMxEmission(testVehicle) + % vehNOxEmission = traci.vehicle.getNOxEmission(testVehicle) + % vehFuelConsumption = traci.vehicle.getFuelConsumption(testVehicle) + % vehAdaptedTraveltime = traci.vehicle.getAdaptedTraveltime(testVehicle,10,'1i') + % vehEffort = traci.vehicle.getEffort(testVehicle,10,'1i') + % vehValidRoute = traci.vehicle.isRouteValid(testVehicle) + % vehSignals = traci.vehicle.getSignals(testVehicle) + % vehMaxSpeed = traci.vehicle.getMaxSpeed(testVehicle) + % vehClass = traci.vehicle.getVehicleClass(testVehicle) + % vehSpeedFactor = traci.vehicle.getSpeedFactor(testVehicle) + % vehSpeedDeviation = traci.vehicle.getSpeedDeviation(testVehicle) + % vehEmissionClass = traci.vehicle.getEmissionClass(testVehicle) + % vehWidth = traci.vehicle.getWidth(testVehicle) + % vehMinGap = traci.vehicle.getMinGap(testVehicle) + % vehShapeClass = traci.vehicle.getShapeClass(testVehicle) + % vehAccel = traci.vehicle.getAccel(testVehicle) + % vehDecel = traci.vehicle.getDecel(testVehicle) + % vehImperfection = traci.vehicle.getImperfection(testVehicle) + % vehTau = traci.vehicle.getTau(testVehicle) + if ismember(testVehicle,vehicles) + vehLeader = traci.vehicle.getLeader(testVehicle, 1) + end + % vehBestLanes = traci.vehicle.getBestLanes(testVehicle) + % vehDrivingDistance = traci.vehicle.getDrivingDistance(testVehicle,'2o',30) + % vehDrivingDistance2D = traci.vehicle.getDrivingDistance2D(testVehicle,620,510) + + + % Change the phase of the traffic light if a vehicle passed through the + % induction loop + if numPriorityVehicles > 0 + % traci.gui.screenshot('View #0','passedvehicle.bmp') + % loop0VehicleData = traci.inductionloop.getVehicleData('0') + if programPointer == length(PROGRAM) + programPointer = 1; + elseif ~strcmp(PROGRAM(programPointer), WEYELLOW) + programPointer = 4; + end + end + traci.trafficlights.setRedYellowGreenState('0', PROGRAM{programPointer}); + + % AN ADDITIONAL EVIDENCE OF THE TRAFFIC LIGHTS SUBSCRIPTION, DON'T + % FORGET TO SET THE SUBSCRIPTION BEFORE EXECUTING IT. + % if no > 0 + % tlsCurrentPhaseHandle = traci.trafficlights.getSubscriptionResults('0'); + % tlsCurrentPhase = tlsCurrentPhaseHandle(constants.TL_RED_YELLOW_GREEN_STATE); + % fprintf('The traffic lights'' phase changed to: %s\n', tlsCurrentPhase) + % end + + % AN ADDITIONAL EVIDENCE OF THE LANE SUBSCRIPTIONS, ENABLE THE PLOTTING + % FUNCTIONS BELOW TO VISUALIZE IT. +% WElaneoccupancy(i) = traci.lane.getLastStepVehicleNumber('1i_0')+... +% traci.lane.getLastStepVehicleNumber('2i_0'); +% NSlaneoccupancy(i) = traci.lane.getLastStepVehicleNumber('3i_0')+... +% traci.lane.getLastStepVehicleNumber('4i_0'); +% % +% steps(i) = i; +% MinExpectedNumber = traci.simulation.getMinExpectedNumber(); + step = step + 1; +end +traci.close() +% plot(steps, WElaneoccupancy) +% hold; +% plot(steps, NSlaneoccupancy, 'r') +% legend('WE lane occupancy', 'NS lane occupancy') +% title('Lane occupancy vs time') +% xlabel('t (seconds)') +% ylabel('number of vehicles') \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/examples/traci_test.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/examples/traci_test.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/examples/traci_test.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/examples/traci_test.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,19 @@ +%% SUMO TRACI TEST +% THIS FILE AIMS TO TEST THE TRACI PROTOCOL FOR SUMO. + +% Copyright 2013 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: traci_test.m 4 2014-03-03 15:18:05Z afacostag $ + +clear all +close all +clc + +%% MAIN +% HERE, WE START THE SUMO SIMULATOR AND INITIALIZE IT, ACCORDING TO +% THE EXAMPLE FOUND IN http://sumo-sim.org/userdoc/Tutorials/TraCI4Traffic_Lights.html +system(['sumo-gui -c ' getenv('SUMO_HOME') '\docs\tutorial\traci_tls\data\cross.sumocfg&']); +[traciVersion sumoVersion] = traci.init(); +traci.close(); +fprintf('SUMO version: %s\nTraCI version: %d\n',sumoVersion,traciVersion); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/license.txt sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/license.txt --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/license.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/license.txt 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,24 @@ +Copyright (c) 2015, Andres Acosta, Jairo Espinosa, Jorge Espinosa +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/src/co/edu/unalmed/gaunal/traci4matlab/utils/DataReader.java sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/src/co/edu/unalmed/gaunal/traci4matlab/utils/DataReader.java --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/src/co/edu/unalmed/gaunal/traci4matlab/utils/DataReader.java 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/src/co/edu/unalmed/gaunal/traci4matlab/utils/DataReader.java 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Thanks to Rodney Thomson for this code + * http://www.mathworks.com/matlabcentral/fileexchange/25249-tcp-ip-socket-communications-in-matlab-using-java-classes + * This class improves the TraCI4Matlab performance when reading from the server. + * + * Copyright 2015 Universidad Nacional de Colombia, + * Politecnico Jaime Isaza Cadavid. + * Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. + * $Id$ + */ + +package co.edu.unalmed.gaunal.traci4matlab.utils; + +import java.io.DataInput; +import java.io.EOFException; +import java.io.IOException; +import java.io.StreamCorruptedException; + +/** + * + * @author GaunalJD + */ +public class DataReader { + public DataReader(DataInput data_input) + { + m_data_input = data_input; + } + + public byte[] readBuffer(int length) throws IOException + { + byte[] buffer = new byte[length]; + + try + { + m_data_input.readFully(buffer, 0, length); + } + + catch (StreamCorruptedException e) + { + System.out.println("Stream Corrupted Exception Occured"); + buffer = new byte[0]; + } + catch (EOFException e) + { + System.out.println("EOF Reached"); + buffer = new byte[0]; + } + catch (IOException e) + { + System.out.println("IO Exception Occured"); + buffer = new byte[0]; + } + + return buffer; + } + + private DataInput m_data_input; +} diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function contextSubscriptionResults = getContextSubscriptionResults(detID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(DETID) +% Returns the context subscription results for the last time step and the +% given areal detector. If no areal detector id is given, all subscription results are +% returned in a containers.Map data struccure. If the areal detector id is unknown +% or the subscription did for any reason return no data, 'None' is +% returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global arealSubscriptionResults +if isempty(arealSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + detID=None; +end +contextSubscriptionResults = arealSubscriptionResults.getContext(detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getIDCount.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getIDCount.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getIDCount.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getIDCount.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,10 @@ +function IDCount = getIDCount() +%IDCount = getIDCount() Get the number of aeral detectors in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDCount.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDCount = traci.areal.getUniversal(constants.ID_COUNT, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function IDList = getIDList() +%getIDList Get the IDs of the areal detectors in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the areal detectors in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.areal.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthMeters.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthMeters.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthMeters.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthMeters.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function JamLengthMeters = getJamLengthMeters(detID) +%getJamLengthMeters Return the jam length in vehicles. +% JamLengthVehicle = getJamLengthVehicle(DETID) Returns the +% jam length in meters within the last simulation step on +% the given areal detector. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getJamLengthMeters.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +JamLengthMeters = traci.areal.getUniversal(constants.JAM_LENGTH_METERS, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthVehicle.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthVehicle.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthVehicle.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getJamLengthVehicle.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function JamLengthVehicle = getJamLengthVehicle(detID) +%getJamLengthVehicle Return the jam length in vehicles. +% JamLengthVehicle = getJamLengthVehicle(DETID) Returns the +% jam length in vehicles within the last simulation step on +% the given areal detector. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getJamLengthVehicle.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +JamLengthVehicle = traci.areal.getUniversal(constants.JAM_LENGTH_VEHICLE, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepMeanSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepMeanSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepMeanSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepMeanSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function lastStepMeanSpeed = getLastStepMeanSpeed(detID) +%getLastStepMeanSpeed Get the average speed on the areal detector. +% lastStepMeanSpeed = getLastStepMeanSpeed(DETID) Returns the average +% speed in m/s for the last time step on the given areal detector. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepMeanSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepMeanSpeed = traci.areal.getUniversal(constants.LAST_STEP_MEAN_SPEED, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepOccupancy.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepOccupancy.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepOccupancy.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getLastStepOccupancy.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function lastStepOccupancy = getLastStepOccupancy(detID) +%getLastStepOccupancy Get the percentage of occupation on the areal detector. +% lastStepOccupancy = getLastStepOccupancy(DETID) Returns the occupancy +% in percentage for the last time step on the given areal detector. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepOccupancy.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepOccupancy = traci.areal.getUniversal(constants.LAST_STEP_OCCUPANCY, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function subscriptionResults = getSubscriptionResults(detID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(DETID) Returns the +% subscription results for the last time step and the given areal detector. If no +% areal detector id is given, all subscription results are returned in a +% containers.Map data structure. +% If the areal detector id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global arealSubscriptionResults +if isempty(arealSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + detID = 'None'; +end + +subscriptionResults = arealSubscriptionResults.get(detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, detID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global arealSubscriptionResults + +if isempty(arealSubscriptionResults) + ReturnValueFunc = traci.RETURN_VALUE_FUNC.areal; +else + ReturnValueFunc = aeralSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_AREAL_DETECTOR_VARIABLE,varID,detID); +handleReturValueFunc = str2func(ReturnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,51 @@ +function subscribeContext(detID, domain, dist, varargin) +%subscribeContext Subscribe to an areal detector's context variable. +% subscribeContext(DETID,DOMAIN,DIST) Subscribe to the +% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the +% areal detector specified by DETID at a distance given by DIST, for the maximum +% allowed interval. The type of objets that surround the areal detector are defined +% in the DOMAIN parameter. Note that not all the SUMO object types +% support the variable LAST_STEP_VEHICLE_NUMBER. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global arealSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'areal.subscribeContext'; +p.addRequired('detID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(detID, domain, dist, varargin{:}) +detID = p.Results.detID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +% Construct the subscription results object +if isempty(arealSubscriptionResults) + arealSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.areal); +else + arealSubscriptionResults.reset(); +end + +% Call the traci subscribeContext function +traci.subscribeContext(constants.CMD_SUBSCRIBE_AREAL_DETECTOR_CONTEXT,... + subscriptionBegin, subscriptionEnd, detID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+areal/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+areal/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,43 @@ +function subscribe(detID, varargin) +%subscribe Subscribe to areal detector variable. +% subscribe(DETID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for +% the maximum allowed interval. +% subscribe(DETID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global arealSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'areal.subscribe'; +p.addRequired('detID',@ischar) +p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(detID, varargin{:}) +detID = p.Results.detID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +% Construct the subscription results object +if isempty(arealSubscriptionResults) + arealSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.areal); +else + arealSubscriptionResults.reset(); +end + +% Call the traci subscribe function +traci.subscribe(constants.CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE,... + subscriptionBegin, subscriptionEnd, detID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/beginMessage.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/beginMessage.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/beginMessage.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/beginMessage.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,29 @@ +function beginMessage(cmdID, varID, objID, len) +%beginMessage Internal function to build the TraCI message. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: beginMessage.m 20 2015-03-02 16:52:32Z afacostag $ + +global message +if nargin < 4 + len = 0; +end + +% Put the command in the queue +message.queue = [message.queue uint8(sscanf(cmdID,'%x'))]; + +% Compute the command length +len = len+1+1+1+4+length(objID); + +% Build the message string depending on the length of the message +if len <= 255 + message.string = [message.string uint8([len sscanf(cmdID,'%x') sscanf(varID,'%x')])... + traci.packInt32(length(objID)) uint8(objID)]; +else + message.string = [message.string uint8(0) traci.packInt32(len+4) ... + uint8([sscanf(cmdID,'%x') sscanf(varID,'%x')])... + traci.packInt32(length(objID)) uint8(objID)]; +end + diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/checkResult.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/checkResult.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/checkResult.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/checkResult.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,33 @@ +function result = checkResult(cmdID, varID, objID) +%checkResult Internal function to receive and parse the response from SUMO +%server. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: checkResult.m 20 2015-03-02 16:52:32Z afacostag $ + +% Send the message and read the result +result = traci.sendExact(); + +% Read the response length +result.readLength(); + +% Read the response and the id of the returned variable +response = result.read(1); +retVarID = result.read(1); + +% Read the acknowledged object ID +objectID = result.readString(); + +% Check whether the response corresponds to the requested command. The +% TraCI protocol is designed so that the response and the command ID +% difference is 16 +if response - uint8(sscanf(cmdID,'%x')) ~= 16 || retVarID ~= uint8(sscanf(varID,'%x'))... + || ~strcmp(objectID,objID) + fprintf('Received answer %s,%s,%s for command %s,%s,%s.'... + ,response, retVarID, objectID, cmdID, varID, objID); +end + +% Read the type of the variable +result.read(1); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/close.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/close.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/close.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/close.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,28 @@ +function close() +%CLOSE Close the connection with the SUMO server. +% CLOSE() Close the default connection with the SUMO server. If several +% connections have to be closed, they must be enabled through the +% traci.switch() command, and closed with CLOSE(). + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: close.m 20 2015-03-02 16:52:32Z afacostag $ + +global connections message +import traci.constants + +% Build the close command +command = uint8(sscanf(constants.CMD_CLOSE,'%x')); +message.queue = [message.queue command]; +message.string = [message.string uint8(1+1) command]; + +% Send the close command +traci.sendExact(); + +% Close and clear the tcp object +if isKey(connections,'') + activeConnection = connections(''); + activeConnection.socket.close(); + clear connections('') +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/constants.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/constants.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/constants.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/constants.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,676 @@ +classdef constants + %The SUMO hexadecimal constants. + + % Copyright 2014 Universidad Nacional de Colombia, + % Politecnico Jaime Isaza Cadavid. + % Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. + % $Id: constants.m 20 2015-03-02 16:52:32Z afacostag $ + + properties (Constant = true) + % **************************************** + % VERSION + % **************************************** + TRACI_VERSION = 6 + + + % **************************************** + % COMMANDS + % **************************************** + % command: get version + CMD_GETVERSION = '0x00' + + % command: simulation step + CMD_SIMSTEP2 = '0x02' + + % command: stop node + CMD_STOP = '0x12' + + % command: Resume from parking + CMD_RESUME = '0x19' + + % command: set lane + CMD_CHANGELANE = '0x13' + + % command: slow down + CMD_SLOWDOWN = '0x14' + + % command: change target + CMD_CHANGETARGET = '0x31' + + % command: add vehicle + CMD_ADDVEHICLE = '0x74' + + % 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 + RESPONSE_GET_INDUCTIONLOOP_VARIABLE = '0xb0' + % command: subscribe induction loop (e1) variable + CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = '0xd0' + % response: subscribe induction loop (e1) variable + RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = '0xe0' + + % command: subscribe areal detector (e2) context + CMD_SUBSCRIBE_AREAL_DETECTOR_CONTEXT = '0x8D' + % response: subscribe areal detector (e2) context + RESPONSE_SUBSCRIBE_AREAL_DETECTOR_CONTEXT = '0x9D' + % command: get areal detector (e2) variable + CMD_GET_AREAL_DETECTOR_VARIABLE = '0x8E' + % response: get areal detector (e2) variable + RESPONSE_GET_AREAL_DETECTOR_VARIABLE = '0x9E' + % command: subscribe areal detector (e2) variable + CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE = '0x8F' + % response: subscribe areal detector (e2) variable + RESPONSE_SUBSCRIBE_AREAL_DETECTOR_VARIABLE = '0x9F' + + % command: subscribe multi-entry/multi-exit detector (e3) context + CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT = '0x81' + % response: subscribe multi-entry/multi-exit 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 multi-entry/multi-exit detector (e3) variable + RESPONSE_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = '0xb1' + % command: subscribe multi-entry/multi-exit detector (e3) variable + CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = '0xd1' + % response: subscribe multi-entry/multi-exit 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 + RESPONSE_GET_TL_VARIABLE = '0xb2' + % command: set traffic lights variable + CMD_SET_TL_VARIABLE = '0xc2' + % command: subscribe traffic lights variable + CMD_SUBSCRIBE_TL_VARIABLE = '0xd2' + % 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 + RESPONSE_GET_LANE_VARIABLE = '0xb3' + % command: set lane variable + CMD_SET_LANE_VARIABLE = '0xc3' + % command: subscribe lane variable + CMD_SUBSCRIBE_LANE_VARIABLE = '0xd3' + % 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 + RESPONSE_GET_VEHICLE_VARIABLE = '0xb4' + % command: set vehicle variable + CMD_SET_VEHICLE_VARIABLE = '0xc4' + % command: subscribe vehicle variable + CMD_SUBSCRIBE_VEHICLE_VARIABLE = '0xd4' + % 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 + RESPONSE_GET_VEHICLETYPE_VARIABLE = '0xb5' + % command: set vehicle type variable + CMD_SET_VEHICLETYPE_VARIABLE = '0xc5' + % command: subscribe vehicle type variable + CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE = '0xd5' + % 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 + RESPONSE_GET_ROUTE_VARIABLE = '0xb6' + % command: set route variable + CMD_SET_ROUTE_VARIABLE = '0xc6' + % command: subscribe route variable + CMD_SUBSCRIBE_ROUTE_VARIABLE = '0xd6' + % 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 + RESPONSE_GET_POI_VARIABLE = '0xb7' + % command: set poi variable + CMD_SET_POI_VARIABLE = '0xc7' + % command: subscribe poi variable + CMD_SUBSCRIBE_POI_VARIABLE = '0xd7' + % 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 + RESPONSE_GET_POLYGON_VARIABLE = '0xb8' + % command: set polygon variable + CMD_SET_POLYGON_VARIABLE = '0xc8' + % command: subscribe polygon variable + CMD_SUBSCRIBE_POLYGON_VARIABLE = '0xd8' + % 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 + RESPONSE_GET_JUNCTION_VARIABLE = '0xb9' + % command: set junction variable + CMD_SET_JUNCTION_VARIABLE = '0xc9' + % command: subscribe junction variable + CMD_SUBSCRIBE_JUNCTION_VARIABLE = '0xd9' + % 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 + RESPONSE_GET_EDGE_VARIABLE = '0xba' + % command: set edge variable + CMD_SET_EDGE_VARIABLE = '0xca' + % command: subscribe edge variable + CMD_SUBSCRIBE_EDGE_VARIABLE = '0xda' + % 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 + RESPONSE_GET_SIM_VARIABLE = '0xbb' + % command: set simulation variable + CMD_SET_SIM_VARIABLE = '0xcb' + % command: subscribe simulation variable + CMD_SUBSCRIBE_SIM_VARIABLE = '0xdb' + % 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 + RESPONSE_GET_GUI_VARIABLE = '0xbc' + % command: set GUI variable + CMD_SET_GUI_VARIABLE = '0xcc' + % command: subscribe GUI variable + CMD_SUBSCRIBE_GUI_VARIABLE = '0xdc' + % response: subscribe GUI variable + RESPONSE_SUBSCRIBE_GUI_VARIABLE = '0xec' + + + % **************************************** + % POSITION REPRESENTATIONS + % **************************************** + % Position in geo-coordinates + POSITION_LON_LAT = '0x00' + % 2D cartesian coordinates + POSITION_2D = '0x01' + % Position in geo-coordinates with altitude + POSITION_LON_LAT_ALT = '0x02' + % 3D cartesian coordinates + POSITION_3D = '0x03' + % Position on road map + POSITION_ROADMAP = '0x04' + + + % **************************************** + % DATA TYPES + % **************************************** + % Boundary Box (4 doubles) + TYPE_BOUNDINGBOX = '0x05' + % Polygon (2*n doubles) + TYPE_POLYGON = '0x06' + % unsigned byte + TYPE_UBYTE = '0x07' + % signed byte + TYPE_BYTE = '0x08' + % 32 bit signed integer + TYPE_INTEGER = '0x09' + % float + TYPE_FLOAT = '0x0A' + % double + TYPE_DOUBLE = '0x0B' + % 8 bit ASCII string + TYPE_STRING = '0x0C' + % list of traffic light phases + TYPE_TLPHASELIST = '0x0D' + % list of strings + TYPE_STRINGLIST = '0x0E' + % compound object + TYPE_COMPOUND = '0x0F' + % color (four ubytes) + TYPE_COLOR = '0x11' + + + % **************************************** + % RESULT TYPES + % **************************************** + % result type: Ok + RTYPE_OK = '0x00' + % result type: not implemented + RTYPE_NOTIMPLEMENTED = '0x01' + % result type: error + RTYPE_ERR = '0xFF' + + % return value for invalid queries (especially vehicle is not on the road) + INVALID_DOUBLE_VALUE = -1001. + % return value for invalid queries (especially vehicle is not on the road) + INVALID_INT_VALUE = -1 + + + % **************************************** + % TRAFFIC LIGHT PHASES + % **************************************** + % red phase + TLPHASE_RED = '0x01' + % yellow phase + TLPHASE_YELLOW = '0x02' + % green phase + TLPHASE_GREEN = '0x03' + % tl is blinking + TLPHASE_BLINKING = '0x04' + % tl is off and not blinking + TLPHASE_NOSIGNAL = '0x05' + + + % **************************************** + % DIFFERENT DISTANCE REQUESTS + % **************************************** + % air distance + REQUEST_AIRDIST = '0x00' + % driving distance + 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) + % **************************************** + % list of instances' ids (get: all) + ID_LIST = '0x00' + + % 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' + + % last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges) + LAST_STEP_MEAN_SPEED = '0x11' + + % last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges) + LAST_STEP_VEHICLE_ID_LIST = '0x12' + + % last step occupancy (get: induction loops, lanes, edges) + LAST_STEP_OCCUPANCY = '0x13' + + % last step vehicle halting number (get: multi-entry/multi-exit detector, lanes, edges) + LAST_STEP_VEHICLE_HALTING_NUMBER = '0x14' + + % last step mean vehicle length (get: induction loops, lanes, edges) + LAST_STEP_LENGTH = '0x15' + + % last step time since last detection (get: induction loops) + LAST_STEP_TIME_SINCE_DETECTION = '0x16' + + % entry times + LAST_STEP_VEHICLE_DATA = '0x17' + + % last step jam length in vehicles + JAM_LENGTH_VEHICLE = '0x18' + + % last step jam length in meters + JAM_LENGTH_METERS = '0x19' + + % traffic light states, encoded as rRgGyYoO tuple (get: traffic lights) + TL_RED_YELLOW_GREEN_STATE = '0x20' + + % index of the phase (set: traffic lights) + TL_PHASE_INDEX = '0x22' + + % traffic light program (set: traffic lights) + TL_PROGRAM = '0x23' + + % phase duration (set: traffic lights) + TL_PHASE_DURATION = '0x24' + + % controlled lanes (get: traffic lights) + TL_CONTROLLED_LANES = '0x26' + + % controlled links (get: traffic lights) + TL_CONTROLLED_LINKS = '0x27' + + % index of the current phase (get: traffic lights) + TL_CURRENT_PHASE = '0x28' + + % name of the current program (get: traffic lights) + TL_CURRENT_PROGRAM = '0x29' + + % controlled junctions (get: traffic lights) + TL_CONTROLLED_JUNCTIONS = '0x2a' + + % complete definition (get: traffic lights) + TL_COMPLETE_DEFINITION_RYG = '0x2b' + + % complete program (set: traffic lights) + TL_COMPLETE_PROGRAM_RYG = '0x2c' + + % assumed time to next switch (get: traffic lights) + TL_NEXT_SWITCH = '0x2d' + + + + % outgoing link number (get: lanes) + LANE_LINK_NUMBER = '0x30' + + % id of parent edge (get: lanes) + LANE_EDGE_ID = '0x31' + + % outgoing link definitions (get: lanes) + LANE_LINKS = '0x33' + + % list of allowed vehicle classes (get&set: lanes) + LANE_ALLOWED = '0x34' + + % list of not allowed vehicle classes (get&set: lanes) + LANE_DISALLOWED = '0x35' + + + % speed (get: vehicle) + VAR_SPEED = '0x40' + + % maximum allowed/possible speed (get: vehicle types, lanes, set: edges, lanes) + VAR_MAXSPEED = '0x41' + + % position (2D) (get: vehicle, poi, set: poi) + VAR_POSITION = '0x42' + + % angle (get: vehicle) + VAR_ANGLE = '0x43' + + % angle (get: vehicle types, lanes, set: lanes) + VAR_LENGTH = '0x44' + + % color (get: vehicles, vehicle types, polygons, pois) + VAR_COLOR = '0x45' + + % max. acceleration (get: vehicle types) + VAR_ACCEL = '0x46' + + % max. deceleration (get: vehicle types) + VAR_DECEL = '0x47' + + % driver reaction time (get: vehicle types) + VAR_TAU = '0x48' + + % vehicle class (get: vehicle types) + VAR_VEHICLECLASS = '0x49' + + % emission class (get: vehicle types) + VAR_EMISSIONCLASS = '0x4a' + + % shape class (get: vehicle types) + VAR_SHAPECLASS = '0x4b' + + % minimum gap (get: vehicle types) + VAR_MINGAP = '0x4c' + + % width (get: vehicle types, lanes) + VAR_WIDTH = '0x4d' + + % shape (get: polygons) + VAR_SHAPE = '0x4e' + + % type id (get: vehicles, polygons, pois) + VAR_TYPE = '0x4f' + + % road id (get: vehicles) + VAR_ROAD_ID = '0x50' + + % lane id (get: vehicles) + VAR_LANE_ID = '0x51' + + % lane index (get: vehicles) + VAR_LANE_INDEX = '0x52' + + % route id (get & set: vehicles) + VAR_ROUTE_ID = '0x53' + + % edges (get: routes) + VAR_EDGES = '0x54' + + % filled? (get: polygons) + VAR_FILL = '0x55' + + % position (1D along lane) (get: vehicle) + VAR_LANEPOSITION = '0x56' + + % route (set: vehicles) + VAR_ROUTE = '0x57' + + % travel time information (get&set: vehicle) + VAR_EDGE_TRAVELTIME = '0x58' + + % effort information (get&set: vehicle) + VAR_EDGE_EFFORT = '0x59' + + % last step travel time (get: edge, lane) + VAR_CURRENT_TRAVELTIME = '0x5a' + + % signals state (get/set: vehicle) + VAR_SIGNALS = '0x5b' + + % new lane/position along (set: vehicle) + VAR_MOVE_TO = '0x5c' + + % driver imperfection (set: vehicle) + VAR_IMPERFECTION = '0x5d' + + % speed factor (set: vehicle) + VAR_SPEED_FACTOR = '0x5e' + + % speed deviation (set: vehicle) + VAR_SPEED_DEVIATION = '0x5f' + + % speed without TraCI influence (get: vehicle) + VAR_SPEED_WITHOUT_TRACI = '0xb1' + + % best lanes (get: vehicle) + VAR_BEST_LANES = '0xb2' + + % how speed is set (set: vehicle) + VAR_SPEEDSETMODE = '0xb3' + + % move vehicle, VTD version (set: vehicle) + VAR_MOVE_TO_VTD = '0xb4' + + % is the vehicle stopped, and if so parked and/or triggered? + % value = stopped + 2 * parking + 4 * triggered + VAR_STOPSTATE = '0xb5' + + % current CO2 emission of a node (get: vehicle, lane, edge) + VAR_CO2EMISSION = '0x60' + + % current CO emission of a node (get: vehicle, lane, edge) + VAR_COEMISSION = '0x61' + + % current HC emission of a node (get: vehicle, lane, edge) + VAR_HCEMISSION = '0x62' + + % current PMx emission of a node (get: vehicle, lane, edge) + VAR_PMXEMISSION = '0x63' + + % current NOx emission of a node (get: vehicle, lane, edge) + VAR_NOXEMISSION = '0x64' + + % current fuel consumption of a node (get: vehicle, lane, edge) + VAR_FUELCONSUMPTION = '0x65' + + % 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 leader together with gap (get: vehicle) + VAR_LEADER = '0x68' + + % current time step (get: simulation) + VAR_TIME_STEP = '0x70' + + % number of loaded vehicles (get: simulation) + VAR_LOADED_VEHICLES_NUMBER = '0x71' + + % loaded vehicle ids (get: simulation) + VAR_LOADED_VEHICLES_IDS = '0x72' + + % number of departed vehicle (get: simulation) + VAR_DEPARTED_VEHICLES_NUMBER = '0x73' + + % departed vehicle ids (get: simulation) + VAR_DEPARTED_VEHICLES_IDS = '0x74' + + % number of vehicles starting to teleport (get: simulation) + VAR_TELEPORT_STARTING_VEHICLES_NUMBER = '0x75' + + % ids of vehicles starting to teleport (get: simulation) + VAR_TELEPORT_STARTING_VEHICLES_IDS = '0x76' + + % number of vehicles ending to teleport (get: simulation) + VAR_TELEPORT_ENDING_VEHICLES_NUMBER = '0x77' + + % ids of vehicles ending to teleport (get: simulation) + VAR_TELEPORT_ENDING_VEHICLES_IDS = '0x78' + + % number of arrived vehicles (get: simulation) + VAR_ARRIVED_VEHICLES_NUMBER = '0x79' + + % ids of arrived vehicles (get: simulation) + VAR_ARRIVED_VEHICLES_IDS = '0x7a' + + % delta t (get: simulation) + VAR_DELTA_T = '0x7b' + + % bounding box (get: simulation) + VAR_NET_BOUNDING_BOX = '0x7c' + + % minimum number of expected vehicles (get: simulation) + VAR_MIN_EXPECTED_VEHICLES = '0x7d' + + + + % add an instance (poi, polygon, vehicle, route) + ADD = '0x80' + + % remove an instance (poi, polygon) + REMOVE = '0x81' + + % convert coordinates + POSITION_CONVERSION = '0x82' + + % distance between points or vehicles + DISTANCE_REQUEST = '0x83' + + + % force rerouting based on travel time (vehicles) + CMD_REROUTE_TRAVELTIME = '0x90' + + % force rerouting based on effort (vehicles) + CMD_REROUTE_EFFORT = '0x91' + + % validates current route (vehicles) + VAR_ROUTE_VALID = '0x92' + + + % zoom + VAR_VIEW_ZOOM = '0xa0' + + % view position + VAR_VIEW_OFFSET = '0xa1' + + % view schema + VAR_VIEW_SCHEMA = '0xa2' + + % view by boundary + VAR_VIEW_BOUNDARY = '0xa3' + + % screenshot + VAR_SCREENSHOT = '0xa5' + + % track vehicle + VAR_TRACK_VEHICLE = '0xa6' + + end +end diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/adaptTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/adaptTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/adaptTraveltime.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/adaptTraveltime.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,17 @@ +function adaptTraveltime(edgeID, time) +%adaptTraveltime Adapt the travel time value for the given edge. +% adaptTraveltime(EDGEID,TIME) Adapt the travel time value used for +% (re-) routing for the given edge in the SUMO server. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: adaptTraveltime.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_EDGE_VARIABLE, constants.VAR_EDGE_TRAVELTIME, edgeID, 1+4+1+8); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x'))... + traci.packInt32(1) uint8(sscanf(constants.TYPE_DOUBLE,'%x'))... + traci.packInt64(time)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getAdaptedTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getAdaptedTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getAdaptedTraveltime.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getAdaptedTraveltime.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,19 @@ +function adaptedTraveltime = getAdaptedTraveltime(edgeID, time) +%getAdaptedTraveltime Return the travel time value. +% adaptedTraveltime = getAdaptedTraveltime(EDGEID,TIME) Return the travel +% time value (in s) used for (re-)routing which is valid on the specified +% edge at the given time. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% $Id: getAdaptedTraveltime.m 20 2015-03-02 16:52:32Z afacostag $ + +global message +import traci.constants +traci.beginMessage(constants.CMD_GET_EDGE_VARIABLE,... + constants.VAR_EDGE_TRAVELTIME,edgeID, 1+4); +message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x'))... + traci.packInt32(traci.time2steps(time))]; +result = traci.checkResult(constants.CMD_GET_EDGE_VARIABLE,... + constants.VAR_EDGE_TRAVELTIME, edgeID); +adaptedTraveltime = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getCO2Emission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getCO2Emission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getCO2Emission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getCO2Emission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function CO2Emission = getCO2Emission(edgeID) +%getCO2Emission Returns the CO2 emission on the given edge. +% CO2Emission = getCO2Emission(EDGEID) Returns the CO2 emission in mg for +% the last time step on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getCO2Emission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +CO2Emission = traci.edge.getUniversal(constants.VAR_CO2EMISSION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getCOEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getCOEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getCOEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getCOEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function COEmission = getCOEmission(edgeID) +%getCOEmission Returns the CO emission on the given edge. +% COEmission = getCOEmission(EDGEID) Returns the CO emission in mg for +% the last time step on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getCOEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +COEmission = traci.edge.getUniversal(constants.VAR_COEMISSION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function contextSubscriptionResults = getContextSubscriptionResults(edgeID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(EDGEID) +% Returns the context subscription results for the last time step and the +% given edge. If no edge id is given, all subscription results are +% returned in a containers.Map data struccure. If the edge id is unknown +% or the subscription did for any reason return no data, 'None' is +% returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global edgeSubscriptionResults +if isempty(edgeSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + edgeID=None; +end +contextSubscriptionResults = edgeSubscriptionResults.getContext(edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getEffort.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getEffort.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getEffort.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getEffort.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,19 @@ +function effort = getEffort(edgeID, time) +%getEffort Get the effort used for (re-)routing. +% effort = getEffort(EDGEID,TIME) Returns the effort value used for +% (re-)routing which is valid on the edge at the given time. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getEffort.m 20 2015-03-02 16:52:32Z afacostag $ + +global message +import traci.constants +traci.beginMessage(constants.CMD_GET_EDGE_VARIABLE, constants.VAR_EDGE_EFFORT,... + edgeID, 1+4); +message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x'))... + traci.packInt32(traci.time2steps(time))]; +result = traci.checkResult(constants.CMD_GET_EDGE_VARIABLE,... + constants.VAR_EDGE_EFFORT, edgeID); +effort = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getFuelConsumption.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getFuelConsumption.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getFuelConsumption.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getFuelConsumption.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function fuelConsumption = getFuelConsumption(edgeID) +%getFuelConsumption Get the fuel consumption on the edge. +% fuelConsumption = getFuelConsumption(EDGEID) Returns the fuel +% consumption in ml for the last time step on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getFuelConsumption.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +fuelConsumption = traci.edge.getUniversal(constants.VAR_FUELCONSUMPTION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getHCEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getHCEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getHCEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getHCEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function HCEmission = getHCEmission(edgeID) +%getHCEmission Returns the HC emission on the given edge. +% HCEmission = getCOEmission(EDGEID) Returns the HC emission in mg for +% the last time step on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getHCEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +HCEmission = traci.edge.getUniversal(constants.VAR_HCEMISSION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getIDCount.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getIDCount.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getIDCount.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getIDCount.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,10 @@ +function IDCount = getIDCount() +%IDCount = getIDCount() Get the number of edges in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDCount.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDCount = traci.edge.getUniversal(constants.ID_COUNT, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function IDList = getIDList() +%getIDList Get the IDs of the edges in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the edges in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.edge.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepHaltingNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepHaltingNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepHaltingNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepHaltingNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function lastStepHaltingNumber = getLastStepHaltingNumber(edgeID) +%getLastStepHaltingNumber Get the number of halting vehicles. +% lastStepHaltingNumber = getLastStepHaltingNumber(EDGEID) Returns the +% total number of halting vehicles for the last time step on the given +% edge. A speed of less than 0.1 m/s is considered a halt. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepHaltingNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepHaltingNumber = traci.edge.getUniversal(constants.LAST_STEP_VEHICLE_HALTING_NUMBER, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepLength.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepLength.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function lastStepLength = getLastStepLength(edgeID) +%getLastStepLength Get the mean vehicle length on the edge. +% lastStepLength = getLastStepLength(EDGEID) Returns the mean vehicle +% length in m for the last time step on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepLength.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepLength = traci.edge.getUniversal(constants.LAST_STEP_LENGTH, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepMeanSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepMeanSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepMeanSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepMeanSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function lastStepMeanSpeed = getLastStepMeanSpeed(edgeID) +%getLastStepMeanSpeed Get the average speed on the edge. +% lastStepMeanSpeed = getLastStepMeanSpeed(EDGEID) Returns the average +% speed in m/s for the last time step on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepMeanSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepMeanSpeed = traci.edge.getUniversal(constants.LAST_STEP_MEAN_SPEED, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepOccupancy.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepOccupancy.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepOccupancy.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepOccupancy.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function lastStepOccupancy = getLastStepOccupancy(edgeID) +%getLastStepOccupancy Get the percentage of occupation on the edge. +% lastStepOccupancy = getLastStepOccupancy(EDGEID) Returns the occupancy +% in percentage for the last time step on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepOccupancy.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepOccupancy = traci.edge.getUniversal(constants.LAST_STEP_OCCUPANCY, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleIDs.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleIDs.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleIDs.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleIDs.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function lastStepVehicleIDs = getLastStepVehicleIDs(edgeID) +%getLastStepVehicleIDs Get the IDs of the vehicles in the edge. +% lastStepVehicleIDs = getLastStepVehicleIDs(EDGEID) Returns cell array +% of strings containing the IDs of the vehicles for the last time step +% on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepVehicleIDs.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepVehicleIDs = traci.edge.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getLastStepVehicleNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function lastStepVehicleNumber = getLastStepVehicleNumber(edgeID) +%getLastStepVehicleNumber Get the number vehicles in the edge. +% lastStepVehicleNumber = getLastStepVehicleNumber(EDGEID) Returns the +% total number of vehicles for the last time step on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepVehicleNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepVehicleNumber = traci.edge.getUniversal(... + constants.LAST_STEP_VEHICLE_NUMBER, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getNoiseEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getNoiseEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getNoiseEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getNoiseEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function noiseEmission = getNoiseEmission(edgeID) +%getNoiseEmission Get the noise emission in the edge. +% noiseEmission = getNoiseEmission(EDGEID) Returns the noise emission in +% db for the last time step on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getNoiseEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +noiseEmission = traci.edge.getUniversal(constants.VAR_NOISEEMISSION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getNOxEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getNOxEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getNOxEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getNOxEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function NOxEmission = getNOxEmission(edgeID) +import traci.constants +%getNOxEmission Get the NOx emission in the edge. +% NOxEmission = getNOxEmission(EDGEID) Returns the NOx emission in mg for +% the last time step on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getNOxEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +NOxEmission = traci.edge.getUniversal(constants.VAR_NOXEMISSION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getPmxEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getPmxEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getPmxEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getPmxEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function pmxEmission = getPmxEmission(edgeID) +%getPmxEmission Get the particular matter emission in the edge. +% pmxEmission = getPmxEmission(EDGEID) Returns the particular matter +% emission in mg for the last time step on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getPmxEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +pmxEmission = traci.edge.getUniversal(constants.VAR_PMXEMISSION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function subscriptionResults = getSubscriptionResults(edgeID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(EDGEID) Returns the +% subscription results for the last time step and the given edge. If no +% edge id is given, all subscription results are returned in a +% containers.Map data structure. +% If the edge id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global edgeSubscriptionResults +if isempty(edgeSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + edgeID = 'None'; +end + +subscriptionResults = edgeSubscriptionResults.get(edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getTraveltime.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getTraveltime.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function traveltime = getTraveltime(edgeID) +%getTraveltime Get estimated travel time in the edge. +% traveltime = getTraveltime(EDGEID) Returns the estimated travel time in +% seconds for the last time step on the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getTraveltime.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traveltime = traci.edge.getUniversal(constants.VAR_CURRENT_TRAVELTIME, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, edgeID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global edgeSubscriptionResults + +if isempty(edgeSubscriptionResults) + ReturnValueFunc = traci.RETURN_VALUE_FUNC.edge; +else + ReturnValueFunc = edgeSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_EDGE_VARIABLE,varID,edgeID); +handleReturValueFunc = str2func(ReturnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/setEffort.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/setEffort.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/setEffort.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/setEffort.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,17 @@ +function setEffort(edgeID, effort) +%setEffort Adapt the effort for (-re) routing. +% setEffort(EDGEID,EFFORT) Adapt the effort value used for (re-)routing +% for the given edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setEffort.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_EDGE_VARIABLE, constants.VAR_EDGE_EFFORT, edgeID, 1+4+1+8); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x'))... + traci.packInt32(1) uint8(sscanf(constants.TYPE_DOUBLE,'%x'))... + traci.packInt64(effort)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/setMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/setMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/setMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/setMaxSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setMaxSpeed(edgeID, speed) +%setMaxSpeed Set the maximum speed in the edge. +% setMaxSpeed(EDGEID,SPEED) Set a new maximum speed (in m/s) for all +% lanes of the edge. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_EDGE_VARIABLE, constants.VAR_MAXSPEED, edgeID, speed) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,51 @@ +function subscribeContext(edgeID, domain, dist, varargin) +%subscribeContext Subscribe to an edge's context variable. +% subscribeContext(EDGEID,DOMAIN,DIST) Subscribe to the +% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the +% edge specified by EDGEID at a distance given by DIST, for the maximum +% allowed interval. The type of objets that surround the edge are defined +% in the DOMAIN parameter. Note that not all the SUMO object types +% support the variable LAST_STEP_VEHICLE_NUMBER. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global edgeSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'edge.subscribeContext'; +p.addRequired('edgeID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(edgeID, domain, dist, varargin{:}) +edgeID = p.Results.edgeID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +% Construct the subscription results object +if isempty(edgeSubscriptionResults) + edgeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.edge); +else + edgeSubscriptionResults.reset(); +end + +% Call the traci subscribeContext function +traci.subscribeContext(constants.CMD_SUBSCRIBE_EDGE_CONTEXT,... + subscriptionBegin, subscriptionEnd, edgeID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+edge/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+edge/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,43 @@ +function subscribe(edgeID, varargin) +%subscribe Subscribe to edge variable. +% subscribe(EDGEID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for +% the maximum allowed interval. +% subscribe(EDGEID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global edgeSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'edge.subscribe'; +p.addRequired('edgeID',@ischar) +p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(edgeID, varargin{:}) +edgeID = p.Results.edgeID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +% Construct the subscription results object +if isempty(edgeSubscriptionResults) + edgeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.edge); +else + edgeSubscriptionResults.reset(); +end + +% Call the traci subscribe function +traci.subscribe(constants.CMD_SUBSCRIBE_EDGE_VARIABLE,... + subscriptionBegin, subscriptionEnd, edgeID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/getVersion.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/getVersion.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/getVersion.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/getVersion.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,33 @@ +function [traciversion, sumoversion] = getVersion() +%getVersion Get the TraCI and SUMO versions. +% [TRACIVERSION SUMOVERSION] = getVersion() Returns the current TraCI and +% SUMO versions. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getVersion.m 20 2015-03-02 16:52:32Z afacostag $ + +global message +import traci.constants +message = traci.Message(); +% Get the command ID from the traci Constants. +strcommand = constants.CMD_GETVERSION; +command = sscanf(strcommand,'%x'); + +% Prepare the outgoing message +message.queue = [message.queue command]; +message.string = uint8([message.string 1+1 command]); + +% Send the outgoing message and receive the result +result = traci.sendExact(); + +result.readLength(); +response = result.read(1); +if response~=command + throw(MException('traci:FatalTraciError','Received answer 0x%.2X for command 0x%.2X.\n',... + response, command)); +else + traciversion = result.readInt(); + sumoversion = result.readString(); +end diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getBoundary.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getBoundary.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getBoundary.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getBoundary.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,16 @@ +function boundary = getBoundary(viewID) +%getBoundary Get the coordinates of the view. +% boundary = getBoundary(VIEWID) Returns the coordinates of the lower +% left and the upper right corner of the currently visible view. If no +% view ID is given, the function return the results for the default view. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getBoundary.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +if nargin < 1 + viewID = 'View #0'; +end +boundary = traci.gui.getUniversal(constants.VAR_VIEW_BOUNDARY, viewID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function ContextSubscriptionResults = getContextSubscriptionResults(viewID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(VIEWID) +% Returns the context subscription results for the last time step and the +% given view. If no view id is given, all subscription results are +% returned in a containers.Map data struccure. If the view id is unknown +% or the subscription did for any reason return no data, 'None' is +% returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global guiSubscriptionResults +if isempty(guiSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + viewID=None; +end +ContextSubscriptionResults = guiSubscriptionResults.getContext(viewID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function IDList = getIDList() +%getIDList Get the IDs of the views in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the views in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.gui.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getOffset.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getOffset.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getOffset.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getOffset.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,16 @@ +function offset = getOffset(viewID) +%getOffset Get the offset of the view. +% offset = getOffset(VIEWID) Returns the x and y offset of the center of +% the current view. If no view ID is given, the function return the +% results for the default view. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getOffset.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +if nargin < 1 + viewID = 'View #0'; +end +offset = traci.gui.getUniversal(constants.VAR_VIEW_OFFSET, viewID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getSchema.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getSchema.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getSchema.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getSchema.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,16 @@ +function schema = getSchema(viewID) +%getSchema Get the color schema of the view. +% schema = getSchema(VIEWID) Returns the name of the current coloring +% scheme. If no view ID is given, the function return the results for the +% default view. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSchema.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +if nargin < 1 + viewID = 'View #0'; +end +schema = traci.gui.getUniversal(constants.VAR_VIEW_SCHEMA, viewID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function subscriptionResults = getSubscriptionResults(viewID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(VIEWID) Returns the +% subscription results for the last time step and the given view. If no +% view id is given, all subscription results are returned in a +% containers.Map data structure. +% If the view id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global guiSubscriptionResults +if isempty(guiSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + viewID = 'None'; +end + +subscriptionResults = guiSubscriptionResults.get(viewID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, viewID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global guiSubscriptionResults + +if isempty(guiSubscriptionResults) + returnValueFunc = traci.RETURN_VALUE_FUNC.gui; +else + returnValueFunc = guiSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_GUI_VARIABLE,varID,viewID); +handleReturValueFunc = str2func(returnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getZoom.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getZoom.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/getZoom.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/getZoom.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,16 @@ +function zoom = getZoom(viewID) +%getZoom Get the zoom of the view. +% zoom = getZoom(viewID) Returns the current zoom factor of the view. If +% no view ID is given, the function return the results for the default +% view. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getZoom.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +if nargin < 1 + viewID = 'View #0'; +end +zoom = traci.gui.getUniversal(constants.VAR_VIEW_ZOOM, viewID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/screenshot.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/screenshot.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/screenshot.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/screenshot.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function screenshot(viewID, filename) +%screenshot Save a screenshot of the SUMO gui. +% screenshot(VIEWID, FILENAME) Save a screenshot for the given view to +% the given filename. The fileformat is guessed from the extension, the +% available formats differ from platform to platform but should at least +% include ps, svg and pdf, on linux probably gif, png and jpg as well. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: screenshot.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_SCREENSHOT, viewID, filename); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/setBoundary.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/setBoundary.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/setBoundary.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/setBoundary.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,16 @@ +function setBoundary(viewID, xmin, ymin, xmax, ymax) +%setBoundary Set the coordinates of the view. +% setBoundary(VIEWID, XMIN, YMIN, XMAX, YMAX) Set the current boundary +% for the given view (see getBoundary). + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setBoundary.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_BOUNDARY, viewID, 1+8+8+8+8); +message.string = [message.string uint8(sscanf(constants.TYPE_BOUNDINGBOX,'%x'))... + traci.packInt64([ymax xmax ymin xmin])]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/setOffset.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/setOffset.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/setOffset.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/setOffset.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,15 @@ +function setOffset(viewID, x, y) +%setOffset Set the offset of the view. +% setOffset(VIEWID, X, Y) Set the current offset for the given view. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setOffset.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_OFFSET, viewID, 1+8+8); +message.string = [message.string uint8(sscanf(constants.POSITION_2D,'%x'))... + traci.packInt64([y x])]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/setSchema.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/setSchema.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/setSchema.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/setSchema.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setSchema(viewID, schemeName) +%setSchema Set the coloring scheme of the view. +% setSchema(VIEWID, SCHEMENAME) Set the current coloring scheme for the +% given view. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setSchema.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_SCHEMA, viewID, schemeName); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/setZoom.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/setZoom.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/setZoom.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/setZoom.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function setZoom(viewID, zoom) +%setZoom Set the zoom of the view. +% setZoom(VIEWID, ZOOM) Set the current zoom factor for the given view. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setZoom.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_ZOOM, viewID, zoom); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,46 @@ +function subscribeContext(viewID, domain, dist, varargin) +%subscribeContext Subscribe to a view's context variable. +% subscribeContext(VIEWID,DOMAIN,DIST) Subscribe to the VAR_VIEW_OFFSET +% value of the SUMO objects that surround the view specified by VIEWID at +% a distance given by DIST, for the maximum allowed interval. The type of +% objets that surround the view are defined in the DOMAIN parameter. Note +% that not all the SUMO object types support the variable +% VAR_VIEW. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global guiSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'gui.subscribeContext'; +p.addRequired('viewID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.VAR_VIEW_OFFSET}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(viewID, domain, dist, varargin{:}) +viewID = p.Results.viewID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +guiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.gui); + +guiSubscriptionResults.reset() +traci.subscribeContext(constants.CMD_SUBSCRIBE_GUI_CONTEXT,... + subscriptionBegin, subscriptionEnd, viewID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,37 @@ +function subscribe(viewID, varargin) +%subscribe Subscribe to view variable. +% subscribe(VIEWID) Subscribe to the VAR_VIEW_OFFSET value for the +% maximum allowed interval. +% subscribe(VIEWID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global guiSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'gui.subscribe'; +p.addRequired('viewID',@ischar) +p.addOptional('varIDs', {constants.VAR_VIEW_OFFSET}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(viewID, varargin{:}) +viewID = p.Results.viewID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +guiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.gui); +guiSubscriptionResults.reset() +traci.subscribe(constants.CMD_SUBSCRIBE_GUI_VARIABLE,... + subscriptionBegin, subscriptionEnd, viewID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/trackVehicle.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/trackVehicle.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+gui/trackVehicle.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+gui/trackVehicle.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function trackVehicle(viewID, vehID) +%trackVehicle Track vehicle in SUMO gui. +% trackVehicle(viewID, vehID) Start visually tracking the given vehicle +% on the given view. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: trackVehicle.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_TRACK_VEHICLE, viewID, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function ContextSubscriptionResults = getContextSubscriptionResults(loopID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(LOOPID) +% Returns the context subscription results for the last time step and the +% given induction loop. If no induction loop id is given, all +% subscription results are returned in a containers.Map data struccure. +% If the induction loop id is unknown or the subscription did for any +% reason return no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global loopSubscriptionResults +if isempty(loopSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + loopID=None; +end +ContextSubscriptionResults = loopSubscriptionResults.getContext(loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function IDList = getIDList() +%getIDList Get the IDs of the induction loops in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the induction loops in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.inductionloop.getUniversal(constants.ID_LIST, ''); + \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLaneID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLaneID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLaneID.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLaneID.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function laneID = getLaneID(loopID) +%getLaneID Get the id of the lane the loop is on. +% laneID = getLaneID(LOOPID) Returns the id of the lane the loop is on. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLaneID.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +laneID = traci.inductionloop.getUniversal(constants.VAR_LANE_ID, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanLength.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanLength.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function lastStepMeanLength = getLastStepMeanLength(loopID) +%getLastStepMeanLength Get the mean length of the vehicles in the lane. +% lastStepMeanLength = getLastStepMeanLength(LOOPID) Returns the mean +% length in m of vehicles which were on the detector in the last step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepMeanLength.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepMeanLength = traci.inductionloop.getUniversal(constants.LAST_STEP_LENGTH, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function lastStepMeanSpeed = getLastStepMeanSpeed(loopID) +%getLastStepMeanSpeed Get the mean speed of the vehicles in the lane. +% lastStepMeanSpeed = getLastStepMeanSpeed(LOOPID) Returns the mean +% speed in m/s of vehicles that were on the named induction loop within +% the last simulation step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepMeanSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepMeanSpeed = traci.inductionloop.getUniversal(constants.LAST_STEP_MEAN_SPEED, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepOccupancy.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepOccupancy.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepOccupancy.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepOccupancy.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function lastStepOccupancy = getLastStepOccupancy(loopID) +%getLastStepOccupancy Get the percentage of time the loop was occupied. +% lastStepOccupancy = getLastStepOccupancy(LOOPID) Returns the percentage +% of time the detector was occupied by a vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepOccupancy.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepOccupancy = traci.inductionloop.getUniversal(constants.LAST_STEP_OCCUPANCY, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleIDs.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleIDs.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleIDs.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleIDs.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function lastStepVehicleIDs = getLastStepVehicleIDs(loopID) +%getLastStepVehicleIDs Get the IDs of the vehicles that were in the loop. +% lastStepVehicleIDs = getLastStepVehicleIDs(LOOPID) Returns the list of +% ids of vehicles that were on the named induction loop in the last +% simulation step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepVehicleIDs.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepVehicleIDs = traci.inductionloop.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function lastStepVehicleNumber = getLastStepVehicleNumber(loopID) +%getLastStepVehicleNumber Get number of vehicles in the loop. +% lastStepVehicleNumber = getLastStepVehicleNumber(LOOPID) Returns the +% number of vehicles that were on the named induction loop within the last simulation step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepVehicleNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepVehicleNumber = traci.inductionloop.getUniversal(... + constants.LAST_STEP_VEHICLE_NUMBER, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getPosition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getPosition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getPosition.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getPosition.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function position = getPosition(loopID) +%getPosition Get the position of the loop. +% position = getPosition(LOOPID) Returns the position measured from the +% beginning of the lane in meters. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getPosition.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +position = traci.inductionloop.getUniversal(constants.VAR_POSITION, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function subscriptionResults = getSubscriptionResults(loopID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(LOOPID) Returns the +% subscription results for the last time step and the given induction loop. If no +% induction loop id is given, all subscription results are returned in a +% containers.Map data structure. +% If the induction loop id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global loopSubscriptionResults +if isempty(loopSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + loopID = 'None'; +end + +subscriptionResults = loopSubscriptionResults.get(loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getTimeSinceDetection.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getTimeSinceDetection.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getTimeSinceDetection.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getTimeSinceDetection.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function timeSinceDetection = getTimeSinceDetection(loopID) +%getTimeSinceDetection Get the time since the last detection. +% timeSinceDetection = getTimeSinceDetection(LOOPID) Returns the time in +% seconds since last detection. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getTimeSinceDetection.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +timeSinceDetection = traci.inductionloop.getUniversal(constants.LAST_STEP_TIME_SINCE_DETECTION, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, loopID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global inductionloopSubscriptionResults + +if isempty(inductionloopSubscriptionResults) + returnValueFunc = traci.RETURN_VALUE_FUNC.inductionloop; +else + returnValueFunc = inductionloopSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_INDUCTIONLOOP_VARIABLE,varID,loopID); +handleReturValueFunc = str2func(returnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getVehicleData.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getVehicleData.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getVehicleData.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/getVehicleData.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function vehicleData = getVehicleData(loopID) +%getVehicleData Get several data about passed vehicles. +% vehicleData = getVehicleData(LOOPID) Returns a cell structure +% containing several information about vehicles which passed the detector. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getVehicleData.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +vehicleData = traci.inductionloop.getUniversal(constants.LAST_STEP_VEHICLE_DATA, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/readVehicleData.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/readVehicleData.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/readVehicleData.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/readVehicleData.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,24 @@ +function data = readVehicleData(result) +%readVehicleData Internal function to read several vehicle information. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: readVehicleData.m 20 2015-03-02 16:52:32Z afacostag $ + +result.readLength(); +nbData = result.readInt(); +data = {}; +for i=1:nbData + result.read(1); + vehID = result.readString(); + result.read(1); + len = result.readDouble(); + result.read(1); + entryTime = result.readDouble(); + result.read(1); + leaveTime = result.readDouble(); + result.read(1); + typeID = result.readString(); + data = [data, vehID, len, entryTime, leaveTime, typeID]; +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,46 @@ +function subscribeContext(loopID, domain, dist, varargin) +%subscribeContext Subscribe to an induction loop's context variable. +% subscribeContext(LOOPID,DOMAIN,DIST) Subscribe to the +% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the +% induction loop specified by LOOPID at a distance given by DIST, for the +% maximum allowed interval. The type of objets that surround the +% induction loop are defined in the DOMAIN parameter. Note that not all +% the SUMO object types support the variable LAST_STEP_VEHICLE_NUMBER. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global loopSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'inductionloop.subscribeContext'; +p.addRequired('loopID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(loopID, domain, dist, varargin{:}) +loopID = p.Results.loopID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +loopSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.inductionloop); + +loopSubscriptionResults.reset() +traci.subscribeContext(constants.CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT,... + subscriptionBegin, subscriptionEnd, loopID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+inductionloop/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function subscribe(loopID, varargin) +%subscribe Subscribe to induction loop variable. +% subscribe(LOOPID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for +% the maximum allowed interval. +% subscribe(LOOPID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global loopSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'inductionloop.subscribe'; +p.addRequired('loopID',@ischar) +p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(loopID, varargin{:}) +loopID = p.Results.loopID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +loopSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.inductionloop); + +loopSubscriptionResults.reset() +traci.subscribe(constants.CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE,... + subscriptionBegin, subscriptionEnd, loopID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/init.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/init.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/init.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/init.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,70 @@ +function [traciVersion sumoVersion] = init(varargin) +%INIT Initialize the connection to the SUMO server. +% INIT() Initialize the connection to the SUMO server using the socket +% localhost:8813. The SUMO server must be listening on the same socket. +% The label of the connection is 'default'. The connection is attempted +% for a number of retries of ten. +% +% INIT(PORT) Initialize the connection to the SUMO server in the +% localhost:PORT socket. +% +% INIT(PORT,NUMRETRIES) Try the connection for the given number of +% retries. +% +% INIT(...,HOST) Specify the ip address of the SUMO server as a string +% e.g. '192.168.1.15'. +% +% INIT(...,LABEL) Specify a label for the connection. +% +% [TRACIVERSION,SUMOVERSION] = INIT(...) Returns the TRACIVERSION and the +% SUMOVERSION. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: init.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants + +% Add the DataReader class +[pathstr,~,~] = fileparts(which('traci.init')); +javaaddpath([pathstr '\..\traci4matlab.jar']); + +global connections + +% Parse the input +p = inputParser; +p.FunctionName = 'traci.init'; +p.addOptional('port', 8873, @(x)isnumeric(x) && length(x)==1) +p.addOptional('numRetries', 10, @(x)isnumeric(x) && length(x)==1) +p.addOptional('host', '127.0.0.1', @ischar) +p.addOptional('label', 'default', @ischar) +p.parse(varargin{:}) + +port = p.Results.port; +numRetries = p.Results.numRetries; +host = p.Results.host; +label = p.Results.label; + +% Create the tcp object +if isempty(connections) + connections = containers.Map(); + connections(label) = traci.Socket(); + connections('') = connections(label); +end + +% Connect to the SUMO server within the given number of retries +err = []; +for i=1:numRetries + try + connections(label).connect(host, port); + break + catch err + pause(i) + end +end +if ~isempty(err) + disp(err); +end + +[traciVersion sumoVersion] = traci.getVersion(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function ContextSubscriptionResults = getContextSubscriptionResults(junctionID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(JUNCTIONID) +% Returns the context subscription results for the last time step and the +% given junction. If no junction id is given, all subscription results are +% returned in a containers.Map data struccure. If the junction id is unknown +% or the subscription did for any reason return no data, 'None' is +% returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global junctionSubscriptionResults +if isempty(junctionSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + junctionID=None; +end +ContextSubscriptionResults = junctionSubscriptionResults.getContext(junctionID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function IDList = getIDList() +%getIDList Get the IDs of the junctions in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the junctions in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.junction.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/getPosition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/getPosition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/getPosition.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/getPosition.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function position = getPosition(junctionID) +%getPosition Get the position of the junction. +% position = getPosition(JUNCTIONID) Returns the coordinates of the +% center of the junction. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getPosition.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +position = traci.junction.getUniversal(constants.VAR_POSITION, junctionID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function subscriptionResults = getSubscriptionResults(junctionID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(JUNCTIONID) Returns the +% subscription results for the last time step and the given junction. If no +% junction id is given, all subscription results are returned in a +% containers.Map data structure. +% If the junction id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global junctionSubscriptionResults +if isempty(junctionSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + junctionID = 'None'; +end + +subscriptionResults = junctionSubscriptionResults.get(junctionID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, junctionID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global junctionSubscriptionResults + +if isempty(junctionSubscriptionResults) + returnValueFunc = traci.RETURN_VALUE_FUNC.junction; +else + returnValueFunc = junctionSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_JUNCTION_VARIABLE,varID,junctionID); +handleReturValueFunc = str2func(returnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,46 @@ +function subscribeContext(junctionID, domain, dist, varargin) +%subscribeContext Subscribe to a junction's context variable. +% subscribeContext(JUNCTIONID,DOMAIN,DIST) Subscribe to the +% VAR_POSITION value of the SUMO objects that surround the junction +% specified by JUNCTIONID at a distance given by DIST, for the maximum +% allowed interval. The type of objets that surround the junction are +% defined in the DOMAIN parameter. Note that not all the SUMO object +% types support the variable VAR_POSITION. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global junctionSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'junction.subscribeContext'; +p.addRequired('junctionID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(junctionID, domain, dist, varargin{:}) +junctionID = p.Results.junctionID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +junctionSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.junction); + +junctionSubscriptionResults.reset() +traci.subscribeContext(constants.CMD_SUBSCRIBE_JUNCTION_CONTEXT,... + subscriptionBegin, subscriptionEnd, junctionID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+junction/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+junction/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function subscribe(junctionID, varargin) +%subscribe Subscribe to junction variable. +% subscribe(JUNCTIONID) Subscribe to the VAR_POSITION value for the +% maximum allowed interval. +% subscribe(JUNCTIONID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global junctionSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'junction.subscribe'; +p.addRequired('junctionID',@ischar) +p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(junctionID, varargin{:}) +junctionID = p.Results.junctionID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +junctionSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.junction); + +junctionSubscriptionResults.reset() +traci.subscribe(constants.CMD_SUBSCRIBE_JUNCTION_VARIABLE,... + subscriptionBegin, subscriptionEnd, junctionID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getAllowed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getAllowed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getAllowed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getAllowed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function allowed = getAllowed(laneID) +%getAllowed Get the allowed vehicle classes in the lane. +% allowed = getAllowed(LANEID) Returns a cell array of strings containing +% the allowed vehicle classes. An empty cell array means all vehicles are +% allowed. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getAllowed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +allowed = traci.lane.getUniversal(constants.LANE_ALLOWED, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getCO2Emission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getCO2Emission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getCO2Emission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getCO2Emission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function CO2Emission = getCO2Emission(laneID) +%getCO2Emission Returns the CO2 emission on the given lane. +% CO2Emission = getCO2Emission(LANEID) Returns the CO2 emission in mg for +% the last time step on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getCO2Emission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +CO2Emission = traci.lane.getUniversal(constants.VAR_CO2EMISSION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getCOEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getCOEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getCOEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getCOEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function COEmission = getCOEmission(laneID) +%getCOEmission Returns the CO emission on the given lane. +% COEmission = getCOEmission(LANEID) Returns the CO emission in mg for +% the last time step on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getCOEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +COEmission = traci.lane.getUniversal(constants.VAR_COEMISSION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function ContextSubscriptionResults = getContextSubscriptionResults(laneID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(LANEID) +% Returns the context subscription results for the last time step and the +% given lane. If no lane id is given, all subscription results are +% returned in a containers.Map data struccure. If the lane id is unknown +% or the subscription did for any reason return no data, 'None' is +% returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global laneSubscriptionResults +if isempty(laneSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + laneID=None; +end +ContextSubscriptionResults = laneSubscriptionResults.getContext(laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getDisallowed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getDisallowed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getDisallowed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getDisallowed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function disallowed = getDisallowed(laneID) +%getDisallowed Get the disallowed vehicle classes in the lane. +% disallowed = getDisallowed(LANEID) Returns a cell array of strings containing +% the disallowed vehicle classes. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getDisallowed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +disallowed = traci.lane.getUniversal(constants.LANE_DISALLOWED, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getEdgeID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getEdgeID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getEdgeID.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getEdgeID.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function edgeID = getEdgeID(laneID) +%getEdgeID +% edgeID = getEdgeID(LANEID) Returns the id of the edge the lane belongs +% to. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getEdgeID.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +edgeID = traci.lane.getUniversal(constants.LANE_EDGE_ID, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getFuelConsumption.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getFuelConsumption.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getFuelConsumption.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getFuelConsumption.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function FuelConsumption = getFuelConsumption(laneID) +%getFuelConsumption Get the fuel consumption on the lane. +% fuelConsumption = getFuelConsumption(LANEID) Returns the fuel +% consumption in ml for the last time step on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getFuelConsumption.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +FuelConsumption = traci.lane.getUniversal(constants.VAR_FUELCONSUMPTION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getHCEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getHCEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getHCEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getHCEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function HCEmission = getHCEmission(laneID) +%getHCEmission Returns the HC emission on the given lane. +% HCEmission = getCOEmission(LANEID) Returns the HC emission in mg for +% the last time step on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getHCEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +HCEmission = traci.lane.getUniversal(constants.VAR_HCEMISSION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function IDList = getIDList() +%getIDList Get the IDs of the lanes in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the lanes in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.lane.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepHaltingNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepHaltingNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepHaltingNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepHaltingNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function lastStepHaltingNumber = getLastStepHaltingNumber(laneID) +%getLastStepHaltingNumber Get the number of halting vehicles. +% lastStepHaltingNumber = getLastStepHaltingNumber(LANEID) Returns the +% total number of halting vehicles for the last time step on the given +% lane. A speed of less than 0.1 m/s is considered a halt. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepHaltingNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepHaltingNumber = traci.lane.getUniversal(constants.LAST_STEP_VEHICLE_HALTING_NUMBER, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepLength.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepLength.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function lastStepLength = getLastStepLength(laneID) +%getLastStepLength Get the mean vehicle length on the lane. +% lastStepLength = getLastStepLength(LANEID) Returns the mean vehicle +% length in m for the last time step on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepLength.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepLength = traci.lane.getUniversal(constants.LAST_STEP_LENGTH, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepMeanSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepMeanSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepMeanSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepMeanSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function lastStepMeanSpeed = getLastStepMeanSpeed(laneID) +%getLastStepMeanSpeed Get the average speed on the lane. +% lastStepMeanSpeed = getLastStepMeanSpeed(LANEID) Returns the average +% speed in m/s for the last time step on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepMeanSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepMeanSpeed = traci.lane.getUniversal(constants.LAST_STEP_MEAN_SPEED, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepOccupancy.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepOccupancy.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepOccupancy.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepOccupancy.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function lastStepOccupancy = getLastStepOccupancy(laneID) +%getLastStepOccupancy Get the percentage of occupation on the lane. +% lastStepOccupancy = getLastStepOccupancy(LANEID) Returns the occupancy +% in percentage for the last time step on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepOccupancy.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepOccupancy = traci.lane.getUniversal(constants.LAST_STEP_OCCUPANCY, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleIDs.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleIDs.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleIDs.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleIDs.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function lastStepVehicleIDs = getLastStepVehicleIDs(laneID) +%getLastStepVehicleIDs Get the IDs of the vehicles in the lane. +% lastStepVehicleIDs = getLastStepVehicleIDs(LANEID) Returns cell array +% of strings containing the IDs of the vehicles for the last time step +% on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepVehicleIDs.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepVehicleIDs = traci.lane.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLastStepVehicleNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function lastStepVehicleNumber = getLastStepVehicleNumber(laneID) +%getLastStepVehicleNumber Get the number vehicles in the lane. +% lastStepVehicleNumber = getLastStepVehicleNumber(LANEID) Returns the +% total number of vehicles for the last time step on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepVehicleNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepVehicleNumber = traci.lane.getUniversal(... + constants.LAST_STEP_VEHICLE_NUMBER, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLength.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLength.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function length = getLength(laneID) +%getLength +% length = getLength(LANEID) Returns the length of the lane in m. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLength.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +length = traci.lane.getUniversal(constants.VAR_LENGTH, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLinkNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLinkNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLinkNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLinkNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function linkNumber = getLinkNumber(laneID) +%getLinkNumber +% linkNumber = getLinkNumber(LANEID) Returns the number of connections to +% successive lanes. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLinkNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +linkNumber = traci.lane.getUniversal(constants.LANE_LINK_NUMBER, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLinks.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLinks.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getLinks.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getLinks.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function links = getLinks(laneID) +%getLinks +% links = getLinks(LANEID) Returns a cell containing ids of successor +% lanes together with priority, open and foe. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLinks.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +links = traci.lane.getUniversal(constants.LANE_LINKS, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getMaxSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function maxSpeed = getMaxSpeed(laneID) +% getMaxSpeed Maximum allowed speed in the lane. +% maxSpeed = getMaxSpeed(LANEID) Returns the maximum allowed speed on the +% lane in m/s. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +maxSpeed = traci.lane.getUniversal(constants.VAR_MAXSPEED, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getNoiseEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getNoiseEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getNoiseEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getNoiseEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function noiseEmission = getNoiseEmission(laneID) +%getNoiseEmission Get the noise emission in the lane. +% noiseEmission = getNoiseEmission(LANEID) Returns the noise emission in +% db for the last time step on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getNoiseEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +noiseEmission = traci.lane.getUniversal(constants.VAR_NOISEEMISSION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getNOxEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getNOxEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getNOxEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getNOxEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function NOxEmission = getNOxEmission(laneID) +%getNOxEmission Get the NOx emission in the lane. +% NOxEmission = getNOxEmission(LANEID) Returns the NOx emission in mg for +% the last time step on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getNOxEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +NOxEmission = traci.lane.getUniversal(constants.VAR_NOXEMISSION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getPMxEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getPMxEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getPMxEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getPMxEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function PMxEmission = getPMxEmission(laneID) +%getPmxEmission Get the particular matter emission in the lane. +% pmxEmission = getPmxEmission(LANEID) Returns the particular matter +% emission in mg for the last time step on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getPMxEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +PMxEmission = traci.lane.getUniversal(constants.VAR_PMXEMISSION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getShape.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getShape.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getShape.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getShape.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function shape = getShape(laneID) +%getShape Get the shape of the lane. +% shape = getShape(LANEID) Returns a list of 2D positions (cartesian) +% describing the geometry of the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getShape.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +shape = traci.lane.getUniversal(constants.VAR_SHAPE, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function subscriptionResults = getSubscriptionResults(laneID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(LANEID) Returns the +% subscription results for the last time step and the given lane. If no +% lane id is given, all subscription results are returned in a +% containers.Map data structure. +% If the lane id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global laneSubscriptionResults +if isempty(laneSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + laneID = 'None'; +end + +subscriptionResults = laneSubscriptionResults.get(laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getTraveltime.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getTraveltime.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function traveltime = getTraveltime(laneID) +%getTraveltime Get estimated travel time in the lane. +% traveltime = getTraveltime(LANEID) Returns the estimated travel time in +% seconds for the last time step on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getTraveltime.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traveltime = traci.lane.getUniversal(constants.VAR_CURRENT_TRAVELTIME, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, laneID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global laneSubscriptionResults + +if isempty(laneSubscriptionResults) + returnValueFunc = traci.RETURN_VALUE_FUNC.lane; +else + returnValueFunc = laneSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_LANE_VARIABLE,varID,laneID); +handleReturValueFunc = str2func(returnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getWidth.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getWidth.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/getWidth.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/getWidth.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function width = getWidth(laneID) +%getWidth +% width = getWidth(LANEID) Returns the width of the lane in m. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getWidth.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +width = traci.lane.getUniversal(constants.VAR_WIDTH, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/readLinks.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/readLinks.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/readLinks.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/readLinks.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,30 @@ +function links = readLinks(result) +%readLinks Internal function to read information about the links. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: readLinks.m 20 2015-03-02 16:52:32Z afacostag $ + +result.read(5) % Type Compound, Length +nbLinks = result.readInt(); +links = {}; +for i=1:nbLinks + result.read(1); % Type String + approachedLane = result.readString(); + result.read(1); % Type String + approachedInternal = result.readString(); + result.read(1); % Type Byte + hasPrio = result.read(1); + result.read(1); % Type Byte + isOpen = result.read(1); + result.read(1); % Type Byte + hasFoe = result.read(1); + result.read(1); % Type String + state = result.readString(); + result.read(1); % Type String + direction = result.readString(); + result.read(1); % Type Float + len = result.readDouble(); + links = [links approachedLane, hasPrio, isOpen, hasFoe]; +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/setAllowed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/setAllowed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/setAllowed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/setAllowed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,22 @@ +function setAllowed(laneID, allowedClasses) +import traci.constants +%setAllowed Set the allowed vehicle classes in the lane. +% setAllowed(LANEID,ALLOWEDCLASSES) Sets a list of allowed vehicle +% classes contained in a cell array of strings. Setting an empty list +% means all vehicles are allowed. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setAllowed.m 20 2015-03-02 16:52:32Z afacostag $ + +global message +traci.beginMessage(constants.CMD_SET_LANE_VARIABLE, constants.LANE_ALLOWED,... +laneID, 1+4+sum(cellfun('length', allowedClasses))+4*length(allowedClasses)); +message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ... + traci.packInt32(length(allowedClasses))]; +for i=1:length(allowedClasses) + message.string = [message.string traci.packInt32(length(... + allowedClasses{i})) uint8(allowedClasses{i})]; +end +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/setDisallowed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/setDisallowed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/setDisallowed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/setDisallowed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,21 @@ +function setDisallowed(laneID, disallowedClasses) +%setDisallowed Set the disallowed vehicle classes in the lane. +% setDisallowed(LANEID,DISALLOWEDCLASSES) Sets a list of disallowed +% vehicle classes contained in a cell array of strings. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setDisallowed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_LANE_VARIABLE, constants.LANE_DISALLOWED,... +laneID, 1+4+sum(cellfun('length', disallowedClasses))+4*length(disallowedClasses)); +message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ... + traci.packInt32(length(disallowedClasses))]; +for i=1:length(disallowedClasses) + message.string = [message.string traci.packInt32(length(... + disallowedClasses{i})) uint8(disallowedClasses{i})]; +end +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/setLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/setLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/setLength.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/setLength.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function setLength(laneID, len) +%setLength +% setLength(LANEID,LENGTH) Sets the length of the lane in m. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setLength.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_LANE_VARIABLE, constants.VAR_LENGTH, laneID, len) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/setMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/setMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/setMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/setMaxSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setMaxSpeed(laneID, speed) +%setMaxSpeed +% setMaxSpeed(LANEID,SPEED) Sets a new maximum allowed speed on the lane +% in m/s. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_LANE_VARIABLE, constants.VAR_MAXSPEED, laneID, speed) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,47 @@ +function subscribeContext(laneID, domain, dist, varargin) +%subscribeContext Subscribe to a lane's context variable. +% subscribeContext(LANEID,DOMAIN,DIST) Subscribe to the +% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the +% lane specified by LANEID at a distance given by DIST, for the maximum +% allowed interval. The type of objets that surround the lane are defined +% in the DOMAIN parameter. Note that not all the SUMO object types +% support the variable LAST_STEP_VEHICLE_NUMBER. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global laneSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'lane.subscribeContext'; +p.addRequired('laneID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(laneID, domain, dist, varargin{:}) +laneID = p.Results.laneID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +laneSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.lane); + + +laneSubscriptionResults.reset() +traci.subscribeContext(constants.CMD_SUBSCRIBE_LANE_CONTEXT,... + subscriptionBegin, subscriptionEnd, laneID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+lane/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+lane/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function subscribe(laneID, varargin) +%subscribe Subscribe to lane variable. +% subscribe(LANEID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for +% the maximum allowed interval. +% subscribe(LANEID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global laneSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'lane.subscribe'; +p.addRequired('laneID',@ischar) +p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(laneID, varargin{:}) +laneID = p.Results.laneID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +laneSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.lane); + +laneSubscriptionResults.reset() +traci.subscribe(constants.CMD_SUBSCRIBE_LANE_VARIABLE,... + subscriptionBegin, subscriptionEnd, laneID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/Message.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/Message.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/Message.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/Message.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +classdef Message +%Message A container for outgoing TraCI messages. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: Message.m 20 2015-03-02 16:52:32Z afacostag $ + + properties + string + queue + end +end diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,27 @@ +function ContextSubscriptionResults = getContextSubscriptionResults(detID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(DETID) +% Returns the context subscription results for the last time step and the +% given multi-entry/multi-exit detector. If no multi-entry/multi-exit +% detector id is given, all subscription results are returned in a +% containers.Map data struccure. If the multi-entry/multi-exit detector +% id is unknown or the subscription did for any reason return no data, +% 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global detSubscriptionResults +if isempty(detSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the context variable')); +end +if nargin < 1 + detID=None; +end +ContextSubscriptionResults = detSubscriptionResults.getContext(detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function IDList = getIDList() +%getIDList Get the IDs of the multi-entry/multi-exit detectors in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the multi-entry/multi-exit detectors in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.multientryexit.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepHaltingNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepHaltingNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepHaltingNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepHaltingNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function lastStepHaltingNumber = getLastStepHaltingNumber(detID) +%getLastStepHaltingNumber Get the number of halting vehicles. +% lastStepHaltingNumber = getLastStepHaltingNumber(DETID) Returns the +% total number of halting vehicles for the last time step on the given +% multi-entry/multi-exit detector. A speed of less than 0.1 m/s is +% considered a halt. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepHaltingNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepHaltingNumber = traci.multientryexit.getUniversal(constants.LAST_STEP_VEHICLE_HALTING_NUMBER, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepMeanSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepMeanSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepMeanSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepMeanSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function lastStepMeanSpeed = getLastStepMeanSpeed(detID) +%getLastStepMeanSpeed Get the average speed. +% lastStepMeanSpeed = getLastStepMeanSpeed(DETID) Returns the average +% speed in m/s for the last time step on the given multi-entry/multi-exit +% detector. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepMeanSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepMeanSpeed = traci.multientryexit.getUniversal(constants.LAST_STEP_MEAN_SPEED, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleIDs.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleIDs.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleIDs.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleIDs.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function lastStepVehicleIDs = getLastStepVehicleIDs(detID) +%getLastStepVehicleIDs Get the IDs of the vehicles. +% lastStepVehicleIDs = getLastStepVehicleIDs(DETID) Returns cell array +% of strings containing the IDs of the vehicles for the last time step +% on the given multi-entry/multi-exit detector. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepVehicleIDs.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepVehicleIDs = traci.multientryexit.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function lastStepVehicleNumber = getLastStepVehicleNumber(detID) +%getLastStepVehicleNumber Get the number vehicles. +% lastStepVehicleNumber = getLastStepVehicleNumber(DETID) Returns the +% total number of vehicles for the last time step on the given +% multi-entry/multi-exit detector. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLastStepVehicleNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lastStepVehicleNumber = traci.multientryexit.getUniversal(constants.LAST_STEP_VEHICLE_NUMBER, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,27 @@ +function subscriptionResults = getSubscriptionResults(detID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(DETID) Returns the +% subscription results for the last time step and the given +% multi-entry/multi-exit detector. If no multi-entry/multi-exit detector +% id is given, all subscription results are returned in a containers.Map +% data structure. +% If the multi-entry/multi-exit detector id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global detSubscriptionResults +if isempty(detSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + detID = 'None'; +end + +subscriptionResults = detSubscriptionResults.get(detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, detID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global detSubscriptionResults + +if isempty(detSubscriptionResults) + returnValueFunc = traci.RETURN_VALUE_FUNC.multientryexit; +else + returnValueFunc = detSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,varID,detID); +handleReturValueFunc = str2func(returnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,48 @@ +function subscribeContext(detID, domain, dist, varargin) +%subscribeContext Subscribe to a multi-entry/multi-exit detector's context +% variable. +% subscribeContext(EDGEID,DOMAIN,DIST) Subscribe to the +% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the +% multi-entry/multi-exit detector specified by EDGEID at a distance given +% by DIST, for the maximum allowed interval. The type of objets that +% surround the multi-entry/multi-exit detector are defined in the DOMAIN +% parameter. Note that not all the SUMO object types support the variable +% LAST_STEP_VEHICLE_NUMBER. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global detSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'multientryexit.subscribeContext'; +p.addRequired('detID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(detID, domain, dist, varargin{:}) +detID = p.Results.detID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +detSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.multientryexit); + +detSubscriptionResults.reset() +traci.subscribeContext(constants.CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT,... + subscriptionBegin, subscriptionEnd, detID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+multientryexit/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,39 @@ +function subscribe(detID, varargin) +%subscribe Subscribe to multi-entry/multi-exit detector variable. +% subscribe(DETID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for +% the maximum allowed interval. +% subscribe(DETID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global detSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'det.subscribe'; +p.addRequired('detID',@ischar) +p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(detID, varargin{:}) +detID = p.Results.detID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +detSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.multientryexit); + + +detSubscriptionResults.reset() +traci.subscribe(constants.CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,... + subscriptionBegin, subscriptionEnd, detID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/packInt32.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/packInt32.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/packInt32.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/packInt32.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function packedData = packInt32(data) +%packInt32 Internal function to cast an int32 into +% an uint8 array + +% Copyright 2014 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: packInt32.m 19 2014-05-30 15:08:25Z afacostag $ + +if isa(data,'int32') + packedData = fliplr(typecast(data,'uint8')); +else + packedData = fliplr(typecast(int32(data),'uint8')); +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/packInt64.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/packInt64.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/packInt64.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/packInt64.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,10 @@ +function packedData = packInt64(data) +%packInt32 Internal function to cast an int64 into +% an uint8 array + +% Copyright 2014 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: packInt64.m 19 2014-05-30 15:08:25Z afacostag $ + +packedData = fliplr(typecast(data,'uint8')); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/add.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/add.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/add.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/add.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,36 @@ +function add(poiID, x, y, color, poiType, layer) +%add Add a point of interest (poi) to the SUMO network. +% add(POIID,X,Y,COLOR) Adds a poi with the id POIID to the coordinates +% X and Y, with the specified color. COLOR is a four-element vector whose +% elements range from 0 to 255, they represent the R, G, B and Alpha +% (unused) components of the color. +% add(...,POITYPE) Assigns a type POITYPE to the added poi. +% add(...,LAYER) Adds the poi to the given layer. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: add.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message + +if nargin < 6 + layer = 0; + if nargin < 5 + poiType = ''; + end +end +typeCompound = sscanf(constants.TYPE_COMPOUND,'%x'); +typeString = sscanf(constants.TYPE_STRING,'%x'); +typeColor = sscanf(constants.TYPE_COLOR,'%x'); +typeInteger = sscanf(constants.TYPE_INTEGER,'%x'); +position2D = sscanf(constants.POSITION_2D,'%x'); +traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.ADD, poiID,... + 1+4 + 1+4+length(poiType) + 1+1+1+1+1 + 1+4 + 1+8+8); +message.string = [message.string uint8(typeCompound) traci.packInt32(4)]; +message.string = [message.string uint8(typeString) traci.packInt32(length(poiType)) uint8(poiType)]; +message.string = [message.string uint8([typeColor color])]; +message.string = [message.string uint8(typeInteger) traci.packInt32(layer)]; +message.string = [message.string uint8(position2D) traci.packInt64([x y])]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getColor.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getColor.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function color = getColor(poiID) +%getColor Get the color of the poi. +% color = getColor(POIID) Returns the rgba color of the given poi. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getColor.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +color = traci.poi.getUniversal(constants.VAR_COLOR, poiID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function ContextSubscriptionResults = getContextSubscriptionResults(poiID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(POIID) +% Returns the context subscription results for the last time step and the +% given poi. If no poi id is given, all subscription results are +% returned in a containers.Map data struccure. If the poi id is unknown +% or the subscription did for any reason return no data, 'None' is +% returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global poiSubscriptionResults +if isempty(poiSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + poiID=None; +end +ContextSubscriptionResults = poiSubscriptionResults.getContext(poiID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function IDList = getIDList() +%getIDList Get the IDs of the pois in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the pois in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.poi.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getPosition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getPosition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getPosition.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getPosition.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function position = getPosition(poiID) +%getPosition Get the position of the poi. +% position = getPosition(POIID) Returns the position coordinates of +% the given poi. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getPosition.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +position = traci.poi.getUniversal(constants.VAR_POSITION, poiID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function subscriptionResults = getSubscriptionResults(poiID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(POIID) Returns the +% subscription results for the last time step and the given poi. If no +% poi id is given, all subscription results are returned in a +% containers.Map data structure. +% If the poi id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global poiSubscriptionResults +if isempty(poiSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + poiID = 'None'; +end + +subscriptionResults = poiSubscriptionResults.get(poiID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getType.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getType.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getType.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getType.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function type = getType(poiID) +%getType +% type = getType(POIID) Returns the (abstract) type of the poi. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getType.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +type = traci.poi.getUniversal(constants.VAR_TYPE, poiID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, poiID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global poiSubscriptionResults + +if isempty(poiSubscriptionResults) + returnValueFunc = traci.RETURN_VALUE_FUNC.poi; +else + returnValueFunc = poiSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_POI_VARIABLE,varID,poiID); +handleReturValueFunc = str2func(returnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/remove.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/remove.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/remove.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/remove.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,18 @@ +function remove(poiID, layer) +%remove Remove the poi from the SUMO network. +% remove(POIID,LAYER) Removes the poi identified with POIID and +% associated to the given layer. If no layer is given, it defaults to 0. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: remove.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +if nargin < 2 + layer = 0; +end +traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.REMOVE, poiID, 1+4); +message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(layer)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/setColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/setColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/setColor.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/setColor.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,16 @@ +function setColor(poiID, color) +%setColor +% setColor(POIID,COLOR) Sets the rgba color of the poi. COLOR is a +% four-element vector whose elements range from 0 to 255, they represent +% the R, G, B and Alpha (unused) components of the color. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setColor.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.VAR_COLOR, poiID, 1+1+1+1+1); +message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/setPosition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/setPosition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/setPosition.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/setPosition.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function setPosition(poiID, x, y) +%setPosition +% setPosition(POIID,X,Y) Sets the position coordinates of the poi. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setPosition.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.VAR_POSITION, poiID, 1+8+8); +message.string = [message.string uint8(sscanf(constants.POSITION_2D,'%x')) traci.packInt64([y x])]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/setType.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/setType.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/setType.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/setType.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,15 @@ +function setType(poiID, poiType) +%setType +% setType(POIID,POITYPE) Sets the (abstract) type of the poi. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setType.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.VAR_TYPE, poiID, 1+4+length(poiType)); +message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x'))... + traci.packInt32(length(poiType)) uint8(poiType)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,46 @@ +function subscribeContext(poiID, domain, dist, varargin) +%subscribeContext Subscribe to a poi's context variable. +% subscribeContext(POIID,DOMAIN,DIST) Subscribe to the +% VAR_POSITION value of the SUMO objects that surround the poi specified by +% POIID at a distance given by DIST, for the maximum allowed interval. +% The type of objets that surround the poi are defined in the DOMAIN +% parameter. Note that not all the SUMO object types support the variable +% VAR_POSITION. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global poiSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'poi.subscribeContext'; +p.addRequired('poiID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(poiID, domain, dist, varargin{:}) +poiID = p.Results.poiID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +poiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.poi); + +poiSubscriptionResults.reset() +traci.subscribeContext(constants.CMD_SUBSCRIBE_POI_CONTEXT,... + subscriptionBegin, subscriptionEnd, poiID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+poi/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+poi/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function subscribe(poiID, varargin) +%subscribe Subscribe to poi variable. +% subscribe(POIID) Subscribe to the VAR_POSITION value for the maximum +% allowed interval. +% subscribe(POIID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global poiSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'poi.subscribe'; +p.addRequired('poiID',@ischar) +p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(poiID, varargin{:}) +poiID = p.Results.poiID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +poiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.poi); + +poiSubscriptionResults.reset() +traci.subscribe(constants.CMD_SUBSCRIBE_POI_VARIABLE,... + subscriptionBegin, subscriptionEnd, poiID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/add.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/add.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/add.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/add.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,50 @@ +function add(polygonID, shape, color, fill, polygonType, layer) +%add Add a polygon to the SUMO network. +% add(POLYGONID,SHAPE,COLOR) Adds a polygon with the id POLYGONID to the +% with the given shape and color. SHAPE is a cell array whose elements +% are 2-dimensional vectors that represent the x and y coordinates of the +% points that define the shape of the polygon. COLOR is a four-element +% vector whose elements range from 0 to 255, they represent the R, G, B +% and Alpha (unused) components of the color. +% add(...,FILL) Is a boolean value which specifies if the polygon has to +% be filled. +% add(...,POLYGONTYPE) Assigns a type POLYGONTYPE to the added polygon. +% add(...,LAYER) Adds the poi to the given layer. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: add.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message + +if nargin < 6 + layer = 0; + if nargin < 5 + polygonType = ''; + if nargin < 4 + fill = false; + end + end +end + +typeCompound = sscanf(constants.TYPE_COMPOUND,'%x'); +typeString = sscanf(constants.TYPE_STRING,'%x'); +typeColor = sscanf(constants.TYPE_COLOR,'%x'); +typeInteger = sscanf(constants.TYPE_INTEGER,'%x'); +typeUbyte = sscanf(constants.TYPE_UBYTE,'%x'); +typePolygon = sscanf(constants.TYPE_POLYGON,'%x'); + +traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.ADD, polygonID,... + 1+4 + 1+4+length(polygonType) + 1+1+1+1+1 + 1+1 + 1+4 + 1+1+length(shape)*(8+8)); +message.string = [message.string uint8(typeCompound) traci.packInt32(4)]; +message.string = [message.string uint8(typeString) traci.packInt32(length(polygonType)) uint8(polygonType)]; +message.string = [message.string uint8([typeColor color])]; +message.string = [message.string uint8([typeUbyte fill])]; +message.string = [message.string uint8(typeInteger) traci.packInt32(layer)]; +message.string = [message.string uint8([typePolygon length(shape)])]; +for i=1:length(shape) + message.string = [message.string traci.packInt64(fliplr(shape{i}))]; +end +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getColor.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getColor.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function color = getColor(polygonID) +%getColor Get the color of the polygon. +% color = getColor(POLYGONID) Returns the rgba color of the given polygon. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getColor.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +color = traci.polygon.getUniversal(constants.VAR_COLOR, polygonID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function ContextSubscriptionResults = getContextSubscriptionResults(polygonID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(POLYGONID) +% Returns the context subscription results for the last time step and the +% given polygon. If no polygon id is given, all subscription results are +% returned in a containers.Map data struccure. If the polygon id is unknown +% or the subscription did for any reason return no data, 'None' is +% returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global polygonSubscriptionResults +if isempty(polygonSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + polygonID=None; +end +ContextSubscriptionResults = polygonSubscriptionResults.getContext(polygonID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function IDList = getIDList() +%getIDList Get the IDs of the polygons in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the polygons in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.polygon.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getShape.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getShape.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getShape.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getShape.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function shape = getShape(polygonID) +%getShape Get the shape of the polygon. +% shape = getShape(POLYGONID) Returns the shape of the given polygon, +% which is a cell array containing 2-dimensional vectors that represent +% the x and y coordinates of the points that define the shape of the +% polygon. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getShape.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +shape = traci.polygon.getUniversal(constants.VAR_SHAPE, polygonID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function subscriptionResults = getSubscriptionResults(polygonID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(POLYGONID) Returns the +% subscription results for the last time step and the given polygon. If no +% polygon id is given, all subscription results are returned in a +% containers.Map data structure. +% If the polygon id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global polygonSubscriptionResults +if isempty(polygonSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + polygonID = 'None'; +end + +subscriptionResults = polygonSubscriptionResults.get(polygonID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getType.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getType.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getType.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getType.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function type = getType(polygonID) +%getType +% type = getType(POLYGONID) Returns the (abstract) type of the polygon. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getType.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +type = traci.polygon.getUniversal(constants.VAR_TYPE, polygonID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, polygonID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global polygonSubscriptionResults + +if isempty(polygonSubscriptionResults) + returnValueFunc = traci.RETURN_VALUE_FUNC.polygon; +else + returnValueFunc = polygonSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_POLYGON_VARIABLE,varID,polygonID); +handleReturValueFunc = str2func(returnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/remove.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/remove.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/remove.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/remove.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,18 @@ +function remove(polygonID, layer) +%remove Remove the polygon from the SUMO network. +% remove(POLYGONID,LAYER) Removes the polygon identified with POLYGONID +% and associated to the given layer. If no layer is given, it defaults to 0. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: remove.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +if nargin < 2 + layer = 0; +end +traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.REMOVE, polygonID, 1+4); +message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(layer)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/setColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/setColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/setColor.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/setColor.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,16 @@ +function setColor(polygonID, color) +%setColor +% setColor(POLYGONID,COLOR) Sets the rgba color of the polygon. COLOR is +% a four-element vector whose elements range from 0 to 255, they represent +% the R, G, B and Alpha (unused) components of the color. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setColor.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.VAR_COLOR, polygonID, 1+1+1+1+1); +message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/setShape.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/setShape.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/setShape.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/setShape.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,20 @@ +function setShape(polygonID, shape) +%setShape Sets the shape of the polygon. +% setShape(POLYGONID,SHAPE) Sets the shape of the polygon to the given. +% SHAPE is a cell array whose elements are 2-dimensional vectors that +% represent the x and y coordinates of the points that define the shape +% of the polygon. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setShape.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.VAR_SHAPE, polygonID, 1+1+length(shape)*(8+8)); +message.string = [message.string uint8([sscanf(constants.TYPE_POLYGON,'%x') length(shape)])]; +for i=1:length(shape) + message.string = [message.string traci.packInt64(fliplr(shape{i}))]; +end +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/setType.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/setType.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/setType.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/setType.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,15 @@ +function setType(polygonID, polygonType) +%setType +% setType(POLYGONID,POLYGONTTYPE) Sets the (abstract) type of the polygon. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setType.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.VAR_TYPE, polygonID, 1+4+length(polygonType)); +message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... + traci.packInt32(length(polygonType)) uint8(polygonType)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,46 @@ +function subscribeContext(polygonID, domain, dist, varargin) +%subscribeContext Subscribe to a polygon's context variable. +% subscribeContext(POLYGONID,DOMAIN,DIST) Subscribe to the +% VAR_SHAPE value of the SUMO objects that surround the polygon specified +% by POLYGONID at a distance given by DIST, for the maximum allowed +% interval. The type of objets that surround the polygon are defined in +% the DOMAIN parameter. Note that not all the SUMO object types support +% the variable VAR_SHAPE. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global polygonSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'polygon.subscribeContext'; +p.addRequired('polygonID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.VAR_SHAPE}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(polygonID, domain, dist, varargin{:}) +polygonID = p.Results.polygonID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +polygonSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.polygon); + +polygonSubscriptionResults.reset() +traci.subscribeContext(constants.CMD_SUBSCRIBE_POLYGON_CONTEXT,... + subscriptionBegin, subscriptionEnd, polygonID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+polygon/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function subscribe(polygonID, varargin) +%subscribe Subscribe to polygon variable. +% subscribe(POLYGONID) Subscribe to the VAR_SHAPE value for the maximum +% allowed interval. +% subscribe(POLYGONID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global polygonSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'polygon.subscribe'; +p.addRequired('polygonID',@ischar) +p.addOptional('varIDs', {constants.VAR_SHAPE}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(polygonID, varargin{:}) +polygonID = p.Results.polygonID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +polygonSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.polygon); + +polygonSubscriptionResults.reset() +traci.subscribe(constants.CMD_SUBSCRIBE_POLYGON_VARIABLE,... + subscriptionBegin, subscriptionEnd, polygonID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/readSubscription.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/readSubscription.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/readSubscription.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/readSubscription.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,136 @@ +function [response, objectID] = readSubscription(result) +%readSubscription Internal function to read the TraCI subscriptions. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: readSubscription.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global edgeSubscriptionResults guiSubscriptionResults ... + loopSubscriptionResults junctionSubscriptionResults ... + laneSubscriptionResults detSubscriptionResults ... + poiSubscriptionResults polygonSubscriptionResults ... + routeSubscriptionResults simSubscriptionResults ... + tlSubscriptionResults vehSubscriptionResults ... + typeSubscriptionResults + +subscriptionResults = containers.Map({... + constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_TL_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_LANE_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_VEHICLE_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_VEHICLETYPE_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_ROUTE_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_POI_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_POLYGON_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_EDGE_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_SIM_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_GUI_VARIABLE,... + constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT,... + constants.RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT,... + constants.RESPONSE_SUBSCRIBE_TL_CONTEXT,... + constants.RESPONSE_SUBSCRIBE_LANE_CONTEXT,... + constants.RESPONSE_SUBSCRIBE_VEHICLE_CONTEXT,... + constants.RESPONSE_SUBSCRIBE_VEHICLETYPE_CONTEXT,... + constants.RESPONSE_SUBSCRIBE_ROUTE_CONTEXT,... + constants.RESPONSE_SUBSCRIBE_POI_CONTEXT,... + constants.RESPONSE_SUBSCRIBE_POLYGON_CONTEXT,... + constants.RESPONSE_SUBSCRIBE_JUNCTION_CONTEXT,... + constants.RESPONSE_SUBSCRIBE_EDGE_CONTEXT,... + constants.RESPONSE_SUBSCRIBE_SIM_CONTEXT,... + constants.RESPONSE_SUBSCRIBE_GUI_CONTEXT,... + constants.CMD_GET_INDUCTIONLOOP_VARIABLE,... + constants.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,... + constants.CMD_GET_TL_VARIABLE,... + constants.CMD_GET_LANE_VARIABLE,... + constants.CMD_GET_VEHICLE_VARIABLE,... + constants.CMD_GET_VEHICLETYPE_VARIABLE,... + constants.CMD_GET_ROUTE_VARIABLE,... + constants.CMD_GET_POI_VARIABLE,... + constants.CMD_GET_POLYGON_VARIABLE,... + constants.CMD_GET_JUNCTION_VARIABLE,... + constants.CMD_GET_EDGE_VARIABLE,... + constants.CMD_GET_SIM_VARIABLE,... + constants.CMD_GET_GUI_VARIABLE},... + {loopSubscriptionResults, detSubscriptionResults,... + tlSubscriptionResults, laneSubscriptionResults,... + vehSubscriptionResults, typeSubscriptionResults,... + routeSubscriptionResults, poiSubscriptionResults,... + polygonSubscriptionResults, junctionSubscriptionResults,... + edgeSubscriptionResults, simSubscriptionResults,... + guiSubscriptionResults,... + loopSubscriptionResults, detSubscriptionResults,... + tlSubscriptionResults, laneSubscriptionResults,... + vehSubscriptionResults, typeSubscriptionResults,... + routeSubscriptionResults, poiSubscriptionResults,... + polygonSubscriptionResults, junctionSubscriptionResults,... + edgeSubscriptionResults, simSubscriptionResults,... + guiSubscriptionResults,... + loopSubscriptionResults, detSubscriptionResults,... + tlSubscriptionResults, laneSubscriptionResults,... + vehSubscriptionResults, typeSubscriptionResults,... + routeSubscriptionResults, poiSubscriptionResults,... + polygonSubscriptionResults, junctionSubscriptionResults,... + edgeSubscriptionResults, simSubscriptionResults,... + guiSubscriptionResults,... + }); +result.readLength(); +response = result.read(1); +strresponse = ['0x' sprintf('%x',response)]; +% Determine if the subscription is context related. +isVariableSubscription = response>=sscanf(... + traci.constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE,'%x')... + && response<=sscanf(traci.constants.RESPONSE_SUBSCRIBE_GUI_VARIABLE,'%x'); +objectID = result.readString(); + +% Read the domain if the subscription was made to a context +if ~isVariableSubscription + domain = result.read(1); + strdomain = ['0x' sprintf('%.2x',domain)]; +end + +% Read the number of variables to which the client is subscribed +numVars = result.read(1); + +% Populate the global TraCI modules +if isVariableSubscription + while numVars > 0 + varID = result.read(1); + status = result.read(1); + result.read(1); + if status + traci.close(); + throw(MException('traci:FatalTraciError','Error %s', result.readString())); + elseif isKey(subscriptionResults, strresponse) + subsResultsHandle = subscriptionResults(strresponse); + subsResultsHandle.add(objectID,... + ['0x' sprintf('%.2x',varID)], result); + else + throw(MException('traci:FatalTraciError','Cannot handle subscription response %s for %s\n',... + num2str(response), objectID)); + end + numVars = numVars - 1; + end +else + objectNo = result.readInt(); + for o=1:objectNo + oid = result.readString(); + for v=1:numVars + varID = result.read(1); + status = result.read(1); + result.read(1); + if status + throw(MException('traci:FatalTraciError','Error %s', result.readString())); + elseif isKey(subscriptionResults, strresponse) + subsResultsHandle = subscriptionResults(strresponse); + domainHandle = subscriptionResults(strdomain); + subsResultsHandle.addContext(objectID, domainHandle, oid, ['0x' sprintf('%.2x',varID)], result); + else + throw(MException('traci:FatalTraciError','Cannot handle subscription response %.2x for %s.', num2str(response), objectID)); + end + end + end +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/recvExact.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/recvExact.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/recvExact.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/recvExact.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,52 @@ +function result = recvExact() +%recvExact Internal function to receive the response from SUMO server. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: recvExact.m 20 2015-03-02 16:52:32Z afacostag $ + +global connections + +% recvlength = []; +% connections('').BytesAvailable + +% Receive the total length of the response +% while length(recvlength) < 1 + +% We tried to address the issue that arises when the user closes +% the SUMO GUI without closing the connection from the client through +% this workaround. Unfortunately, it leads to an incredibly high +% slowdown. +% connClosed = strcmp(system('netstat | findstr 8813'),''); +% if connClosed +% result = []; +% break +% end +% t = connections('').readInt(); +% if isempty(t) +% result = []; +% return +% end +% recvlength = [recvlength t]; +% end + +activeConnection = connections(''); +recvLength = activeConnection.dis.readInt() - 4; + +% Receive the response + +result = typecast(activeConnection.dataReader.readBuffer(recvLength),'uint8'); + +% while length(result) < recvlength +% t = fread(connections(''),recvlength-length(result),'uint8'); +% % flushinput(connections('')); +% if isempty(t) +% result = []; +% return +% end +% result = [result t]; +% end + +% Construct the traci.Storage object containing the result +result = traci.Storage(uint8(result')); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/RETURN_VALUE_FUNC.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/RETURN_VALUE_FUNC.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/RETURN_VALUE_FUNC.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/RETURN_VALUE_FUNC.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,222 @@ +classdef RETURN_VALUE_FUNC + %RETURN_VALUE_FUNC A class to store the functions to read the TraCI + %results for each SUMO object. + + % Copyright 2015 Universidad Nacional de Colombia, + % Politecnico Jaime Isaza Cadavid. + % Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. + % $Id: RETURN_VALUE_FUNC.m 20 2015-03-02 16:52:32Z afacostag $ + + properties (Constant) + areal = containers.Map({... + traci.constants.ID_LIST... + traci.constants.ID_COUNT,... + traci.constants.JAM_LENGTH_METERS,... + traci.constants.JAM_LENGTH_VEHICLE,... + traci.constants.LAST_STEP_MEAN_SPEED,... + traci.constants.LAST_STEP_OCCUPANCY},... + {'readStringList','readInt','readDouble','readInt','readDouble','readDouble'}); + edge = containers.Map({... + traci.constants.ID_LIST,... + traci.constants.ID_COUNT,... + traci.constants.VAR_EDGE_TRAVELTIME,... + traci.constants.VAR_EDGE_EFFORT,... + traci.constants.VAR_CO2EMISSION,... + traci.constants.VAR_COEMISSION,... + traci.constants.VAR_HCEMISSION,... + traci.constants.VAR_PMXEMISSION,... + traci.constants.VAR_NOXEMISSION,... + traci.constants.VAR_FUELCONSUMPTION,... + traci.constants.VAR_NOISEEMISSION,... + traci.constants.LAST_STEP_MEAN_SPEED,... + traci.constants.LAST_STEP_OCCUPANCY,... + traci.constants.LAST_STEP_LENGTH,... + traci.constants.VAR_CURRENT_TRAVELTIME,... + traci.constants.LAST_STEP_VEHICLE_NUMBER,... + traci.constants.LAST_STEP_VEHICLE_HALTING_NUMBER,... + traci.constants.LAST_STEP_VEHICLE_ID_LIST},... + {'readStringList','readInt','readDouble','readDouble','readDouble',... + 'readDouble','readDouble','readDouble','readDouble','readDouble',... + 'readDouble','readDouble','readDouble','readDouble','readDouble',... + 'readInt','readInt','readStringList'}); + gui = containers.Map({... + traci.constants.ID_LIST,... + traci.constants.VAR_VIEW_ZOOM,... + traci.constants.VAR_VIEW_OFFSET,... + traci.constants.VAR_VIEW_SCHEMA,... + traci.constants.VAR_VIEW_BOUNDARY},... + {'readStringList','readDouble','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',... + 'readString','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8))],''double'')'}); + inductionloop = containers.Map({... + traci.constants.ID_LIST,... + traci.constants.VAR_POSITION,... + traci.constants.VAR_LANE_ID,... + traci.constants.LAST_STEP_VEHICLE_NUMBER,... + traci.constants.LAST_STEP_MEAN_SPEED,... + traci.constants.LAST_STEP_VEHICLE_ID_LIST,... + traci.constants.LAST_STEP_OCCUPANCY,... + traci.constants.LAST_STEP_LENGTH,... + traci.constants.LAST_STEP_TIME_SINCE_DETECTION,... + traci.constants.LAST_STEP_VEHICLE_DATA},... + {'readStringList','readDouble','readString',... + 'readInt','readDouble','readStringList',... + 'readDouble','readDouble','readDouble',... + 'traci.inductionloop.readVehicleData'}); + junction = containers.Map({... + traci.constants.ID_LIST,... + traci.constants.VAR_POSITION},... + {'readStringList','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')'}); + lane = containers.Map({... + traci.constants.ID_LIST,... + traci.constants.VAR_LENGTH,... + traci.constants.VAR_MAXSPEED,... + traci.constants.VAR_WIDTH,... + traci.constants.LANE_ALLOWED,... + traci.constants.LANE_DISALLOWED,... + traci.constants.LANE_LINK_NUMBER,... + traci.constants.LANE_LINKS,... + traci.constants.VAR_SHAPE,... + traci.constants.LANE_EDGE_ID,... + traci.constants.VAR_CO2EMISSION,... + traci.constants.VAR_COEMISSION,... + traci.constants.VAR_HCEMISSION,... + traci.constants.VAR_PMXEMISSION,... + traci.constants.VAR_NOXEMISSION,... + traci.constants.VAR_FUELCONSUMPTION,... + traci.constants.VAR_NOISEEMISSION,... + traci.constants.LAST_STEP_MEAN_SPEED,... + traci.constants.LAST_STEP_OCCUPANCY,... + traci.constants.LAST_STEP_LENGTH,... + traci.constants.VAR_CURRENT_TRAVELTIME,... + traci.constants.LAST_STEP_VEHICLE_NUMBER,... + traci.constants.LAST_STEP_VEHICLE_HALTING_NUMBER,... + traci.constants.LAST_STEP_VEHICLE_ID_LIST},... + {'readStringList','readDouble','readDouble','readDouble','readStringList',... + 'readStringList','@(result) result.read(1)','traci.lane.readLinks','readShape','readString',... + 'readDouble','readDouble','readDouble','readDouble','readDouble',... + 'readDouble','readDouble','readDouble','readDouble','readDouble',... + 'readDouble','readInt','readInt','readStringList'}); + multientryexit = containers.Map({... + traci.constants.ID_LIST,... + traci.constants.LAST_STEP_VEHICLE_NUMBER,... + traci.constants.LAST_STEP_MEAN_SPEED,... + traci.constants.LAST_STEP_VEHICLE_ID_LIST,... + traci.constants.LAST_STEP_VEHICLE_HALTING_NUMBER},... + {'readStringList','readInt','readDouble','readStringList','readInt'}); + poi = containers.Map({... + traci.constants.ID_LIST,... + traci.constants.VAR_TYPE,... + traci.constants.VAR_POSITION,... + traci.constants.VAR_COLOR},... + {'readStringList','readString','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',... + '@(result) result.read(4)'}); + polygon = containers.Map({... + traci.constants.ID_LIST,... + traci.constants.VAR_TYPE,... + traci.constants.VAR_SHAPE,... + traci.constants.VAR_COLOR},... + {'readStringList','readString','readShape','@(result) result.read(4)'}); + route = containers.Map({... + traci.constants.ID_LIST,... + traci.constants.VAR_EDGES},... + {'readStringList','readStringList'}); + simulation = containers.Map({... + traci.constants.VAR_TIME_STEP,... + traci.constants.VAR_LOADED_VEHICLES_NUMBER,... + traci.constants.VAR_LOADED_VEHICLES_IDS,... + traci.constants.VAR_DEPARTED_VEHICLES_NUMBER,... + traci.constants.VAR_DEPARTED_VEHICLES_IDS,... + traci.constants.VAR_ARRIVED_VEHICLES_NUMBER,... + traci.constants.VAR_ARRIVED_VEHICLES_IDS,... + traci.constants.VAR_MIN_EXPECTED_VEHICLES,... + traci.constants.VAR_TELEPORT_STARTING_VEHICLES_NUMBER,... + traci.constants.VAR_TELEPORT_STARTING_VEHICLES_IDS,... + traci.constants.VAR_TELEPORT_ENDING_VEHICLES_NUMBER,... + traci.constants.VAR_TELEPORT_ENDING_VEHICLES_IDS,... + traci.constants.VAR_DELTA_T,... + traci.constants.VAR_NET_BOUNDING_BOX},... + {'readInt','readInt','readStringList','readInt',... + 'readStringList','readInt','readStringList','readInt',... + 'readInt','readStringList','readInt','readStringList',... + 'readInt','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8))],''double'')'}); + trafficlights = containers.Map({... + traci.constants.ID_LIST,... + traci.constants.TL_RED_YELLOW_GREEN_STATE,... + traci.constants.TL_COMPLETE_DEFINITION_RYG,... + traci.constants.TL_CONTROLLED_LANES,... + traci.constants.TL_CONTROLLED_LINKS,... + traci.constants.TL_CURRENT_PROGRAM,... + traci.constants.TL_CURRENT_PHASE,... + traci.constants.TL_NEXT_SWITCH},... + {'readStringList','readString','traci.trafficlights.readLogics',... + 'readStringList','traci.trafficlights.readLinks','readString',... + 'readInt','readInt'}); + vehicle = containers.Map({... + traci.constants.ID_LIST,... + traci.constants.VAR_SPEED,... + traci.constants.VAR_SPEED_WITHOUT_TRACI,... + traci.constants.VAR_POSITION,... + traci.constants.VAR_ANGLE,... + traci.constants.VAR_ROAD_ID,... + traci.constants.VAR_LANE_ID,... + traci.constants.VAR_LANE_INDEX,... + traci.constants.VAR_TYPE,... + traci.constants.VAR_ROUTE_ID,... + traci.constants.VAR_COLOR,... + traci.constants.VAR_LANEPOSITION,... + traci.constants.VAR_CO2EMISSION,... + traci.constants.VAR_COEMISSION,... + traci.constants.VAR_HCEMISSION,... + traci.constants.VAR_PMXEMISSION,... + traci.constants.VAR_NOXEMISSION,... + traci.constants.VAR_FUELCONSUMPTION,... + traci.constants.VAR_NOISEEMISSION,... + traci.constants.VAR_EDGE_TRAVELTIME,... + traci.constants.VAR_EDGE_EFFORT,... + traci.constants.VAR_ROUTE_VALID,... + traci.constants.VAR_EDGES,... + traci.constants.VAR_SIGNALS,... + traci.constants.VAR_LENGTH,... + traci.constants.VAR_MAXSPEED,... + traci.constants.VAR_VEHICLECLASS,... + traci.constants.VAR_SPEED_FACTOR,... + traci.constants.VAR_SPEED_DEVIATION,... + traci.constants.VAR_EMISSIONCLASS,... + traci.constants.VAR_WIDTH,... + traci.constants.VAR_MINGAP,... + traci.constants.VAR_SHAPECLASS,... + traci.constants.VAR_ACCEL,... + traci.constants.VAR_DECEL,... + traci.constants.VAR_IMPERFECTION,... + traci.constants.VAR_TAU,... + traci.constants.VAR_BEST_LANES,... + traci.constants.DISTANCE_REQUEST},... + {'readStringList','readDouble','readDouble','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',... + 'readDouble','readString','readString','readInt','readString',... + 'readString','@(result) result.read(4)','readDouble','readDouble','readDouble',... + 'readDouble','readDouble','readDouble','readDouble','readDouble',... + 'readDouble','readDouble','@(result) result.read(1)','readStringList',... + 'readInt','readDouble','readDouble','readString','readDouble','readDouble',... + 'readString','readDouble','readDouble','readString','readDouble','readDouble',... + 'readDouble','readDouble','traci.vehicle.readBestLanes','readDouble'}); + vehicletype = containers.Map({... + traci.constants.ID_LIST,... + traci.constants.VAR_LENGTH,... + traci.constants.VAR_MAXSPEED,... + traci.constants.VAR_SPEED_FACTOR,... + traci.constants.VAR_SPEED_DEVIATION,... + traci.constants.VAR_ACCEL,... + traci.constants.VAR_DECEL,... + traci.constants.VAR_IMPERFECTION,... + traci.constants.VAR_TAU,... + traci.constants.VAR_VEHICLECLASS,... + traci.constants.VAR_EMISSIONCLASS,... + traci.constants.VAR_SHAPECLASS,... + traci.constants.VAR_MINGAP,... + traci.constants.VAR_WIDTH,... + traci.constants.VAR_COLOR},... + {'readStringList','readDouble','readDouble','readDouble','readDouble',... + 'readDouble','readDouble','readDouble','readDouble','readString',... + 'readString','readString','readDouble','readDouble','@(result) result.read(4)'}); + end +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/add.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/add.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/add.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/add.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,22 @@ +function add(routeID, edges) +%add Add a route to the SUMO simulation. +% add(ROUTEID,EDGES) Adds a route with the id ROUTEID comprised of the +% given edges. EDGES is a cell array of strings containing the IDs of the +% edges. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: add.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_ROUTE_VARIABLE, constants.ADD, routeID,... + 1+4+sum(cellfun('length', edges))+4*length(edges)); +message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ... + traci.packInt32(length(edges))]; +for i=1:length(edges) + message.string = [message.string traci.packInt32(length(edges{i})) ... + uint8(edges{i})]; +end +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function ContextSubscriptionResults = getContextSubscriptionResults(routeID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(ROUTEID) +% Returns the context subscription results for the last time step and the +% given route. If no route id is given, all subscription results are +% returned in a containers.Map data struccure. If the route id is unknown +% or the subscription did for any reason return no data, 'None' is +% returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global routeSubscriptionResults +if isempty(routeSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + routeID=None; +end +ContextSubscriptionResults = routeSubscriptionResults.getContext(routeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/getEdges.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/getEdges.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/getEdges.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/getEdges.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function edges = getEdges(routeID) +%getEdges Return the edges of the route. +% edges = getEdges(ROUTEID) Returns a list of all edges in the route. The +% list of edges is a cell array of strings whose elements are the IDs of +% the edges. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getEdges.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +edges = traci.route.getUniversal(constants.VAR_EDGES, routeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function IDList = getIDList() +%getIDList Get the IDs of the routes in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the routes in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.route.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function subscriptionResults = getSubscriptionResults(routeID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(ROUTEID) Returns the +% subscription results for the last time step and the given route. If no +% route id is given, all subscription results are returned in a +% containers.Map data structure. +% If the route id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global routeSubscriptionResults +if isempty(routeSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + routeID = 'None'; +end + +subscriptionResults = routeSubscriptionResults.get(routeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, routeID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global routeSubscriptionResults + +if isempty(routeSubscriptionResults) + returnValueFunc = traci.RETURN_VALUE_FUNC.route; +else + returnValueFunc = routeSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_ROUTE_VARIABLE,varID,routeID); +handleReturValueFunc = str2func(returnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,45 @@ +function subscribeContext(routeID, domain, dist, varargin) +%subscribeContext Subscribe to a route's context variable. +% subscribeContext(ROUTEID,DOMAIN,DIST) Subscribe to the ID_LIST value of +% the SUMO objects that surround the route specified by ROUTEID at a +% distance given by DIST, for the maximum allowed interval. The type of +% objets that surround the route are defined in the DOMAIN parameter. +% Note that not all the SUMO object types support the variable ID_LIST. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global routeSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'route.subscribeContext'; +p.addRequired('routeID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.ID_LIST}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(routeID, domain, dist, varargin{:}) +routeID = p.Results.routeID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +routeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.route); + +routeSubscriptionResults.reset() +traci.subscribeContext(constants.CMD_SUBSCRIBE_ROUTE_CONTEXT,... + subscriptionBegin, subscriptionEnd, routeID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+route/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+route/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function subscribe(routeID, varargin) +%subscribe Subscribe to route variable. +% subscribe(ROUTEID) Subscribe to the ID_LIST value for the maximum +% allowed interval. +% subscribe(ROUTEID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global routeSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'route.subscribe'; +p.addRequired('routeID',@ischar) +p.addOptional('varIDs', {constants.ID_LIST}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(routeID, varargin{:}) +routeID = p.Results.routeID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +routeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.route); + +routeSubscriptionResults.reset() +traci.subscribe(constants.CMD_SUBSCRIBE_ROUTE_VARIABLE,... + subscriptionBegin, subscriptionEnd, routeID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/sendByteCmd.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/sendByteCmd.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/sendByteCmd.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/sendByteCmd.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function sendByteCmd(cmdID, varID, objID, value) +%sendByteCmd An internal function to build a message which sends a byte. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: sendByteCmd.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(cmdID, varID, objID, 1+1); +message.string = [message.string uint8([sscanf(constants.TYPE_BYTE,'%x') value])]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/sendDoubleCmd.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/sendDoubleCmd.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/sendDoubleCmd.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/sendDoubleCmd.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function sendDoubleCmd(cmdID, varID, objID, value) +%sendDoubleCmd An internal function to build a message which sends a double. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: sendDoubleCmd.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(cmdID, varID, objID, 1+8); +message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... + traci.packInt64(value)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/sendExact.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/sendExact.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/sendExact.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/sendExact.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,62 @@ +function result = sendExact() +%sendExact An internal function to send a message to the SUMO server and +%parse the result. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: sendExact.m 20 2015-03-02 16:52:32Z afacostag $ + +global message connections +import traci.constants +% warning('off','instrument:fread:unsuccessfulRead'); + +% Length of the command +len = 4 + length(message.string); +activeConnection = connections(''); + +% Write the message to the tcp socket +activeConnection.dos.writeInt(len); +activeConnection.dos.write(message.string); + +% Read the result from the socket +result = traci.recvExact(); + +if isempty(result) + fclose(connections('')); + clear connections('') + throw(MException('traci:FatalTraciError','Connection closed by SUMO\n')) +end + +% Parse the result +for i= 1:length(message.queue) + prefix = result.read(3); + if prefix(3)==0 + strresult = 'OK'; + elseif prefix(3)==1 + strresult = 'Not Implemented'; + else + strresult = 'Error'; + end + err = result.readString(); + if prefix(3) || ~isempty(err) + message.string = []; + message.queue = []; + traci.close(); + throw(MException('traci:FatalTraciError','%s %s %s\n', num2str(prefix), strresult, err)); + elseif prefix(2) ~= message.queue(i) + traci.close(); + throw(MException('traci:FatalTraciError','Received answer 0x%.2X for command 0x%.2x.\n',... + prefix(2), message.queue(i))); + elseif strcmp(prefix(2),constants.CMD_STOP) + len = result.read(1) - 1; + result.read(len + 1); + end +end + +% Clear the message contents +message.string = []; +message.queue = []; + + + diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/sendIntCmd.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/sendIntCmd.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/sendIntCmd.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/sendIntCmd.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function sendIntCmd(cmdID, varID, objID, value) +%sendIntCmd An internal function to build a message which sends an int. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: sendIntCmd.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(cmdID, varID, objID, 1+4); +message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... + traci.packInt32(value)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/sendReadOneStringCmd.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/sendReadOneStringCmd.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/sendReadOneStringCmd.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/sendReadOneStringCmd.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function result = sendReadOneStringCmd(cmdID, varID, objID) +%sendReadOneStringCmd An internal function to build an outgoing message to +%the SUMO server and parse the response. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: sendReadOneStringCmd.m 20 2015-03-02 16:52:32Z afacostag $ + +traci.beginMessage(cmdID, varID, objID); +result = traci.checkResult(cmdID, varID, objID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/sendStringCmd.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/sendStringCmd.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/sendStringCmd.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/sendStringCmd.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,18 @@ +function sendStringCmd(cmdID, varID, objID, value) +%sendStringCmd An internal function to build a message which sends a string. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: sendStringCmd.m 20 2015-03-02 16:52:32Z afacostag $ + +global message +import traci.constants + +% Construct the TraCI message +traci.beginMessage(cmdID, varID, objID, 1+4+length(value)) +message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... + traci.packInt32(length(value)) uint8(value)]; + +% Send the TraCI message +traci.sendExact(); diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/convert2D.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/convert2D.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/convert2D.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/convert2D.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function [x y] = convert2D(edgeID, pos, laneIndex, toGeo) +%convert2D Convert to absolute coordinates from those relative to an edge. +% [X,Y] = convert2D(EDGEID,POS) Converts from the position POS relative +% to the edge EDGEID to absolute coordinates. +% [X,Y] = convert2D(...,LANEINDEX) Specify the index of the edge's lane. +% [X,Y] = convert2D(...,TOGEO) Specify if the conversion is made to +% geo-coordinates, in this case, X is the longitude and Y is the latitude. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: convert2D.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +if nargin < 4 + toGeo = false; + if nargin < 3 + laneIndex = 0; + end +end + +posType = sscanf(constants.POSITION_2D,'%x'); + +if toGeo + posType = sscanf(constants.POSITION_LON_LAT,'%x'); +end +traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION,... + '', 1+4 + 1+4+length(edgeID)+8+1 + 1+1); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(2)]; +message.string = [message.string uint8(sscanf(constants.POSITION_ROADMAP,'%x')) ... + traci.packInt32(length(edgeID)) uint8(edgeID)]; +message.string = [message.string traci.packInt64(pos) ... + uint8([laneIndex sscanf(constants.TYPE_UBYTE,'%x') posType])]; +result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION, ''); +x = result.readDouble; +y = result.readDouble; \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/convertGeo.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/convertGeo.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/convertGeo.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/convertGeo.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function [longitude latitude] = convertGeo(x, y, fromGeo) +%convertGeo Convert to geo-coordinates. +% [LONGITUDE,LATITUDE] = convertGeo(X,Y) Converts the position specified +% by X and Y to geo-coordinates. Cartesian coordinates are assumed for +% the input. +% [X Y] = convert2D(...,FROMGEO) Specify if the conversion is to be +% made from geo-coordinates, in this case, X is the longitude and Y is +% the latitude. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: convertGeo.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +if nargin < 3 + fromGeo = false; +end + +fromType = sscanf(constants.POSITION_2D,'%x'); +toType = sscanf(constants.POSITION_LON_LAT,'%x'); + +if fromGeo + fromType = sscanf(constants.POSITION_LON_LAT,'%x'); + toType = sscanf(constants.POSITION_2D,'%x'); +end + +traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION,... + '', 1+4 + 1+8+8 + 1+1); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(2)]; +message.string = [message.string uint8(fromType) ... + traci.packInt64([y x])]; +message.string = [message.string uint8([sscanf(constants.TYPE_UBYTE,'%x') toType])]; +result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION, ''); +longitude = result.readDouble; +latitude = result.readDouble; \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/convertRoad.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/convertRoad.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/convertRoad.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/convertRoad.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function [roadID pos laneID] = convertRoad(x, y, isGeo) +%convertRoad Convert to coordinates relative to a road from absolute coordinates. +% [ROADID POS LANEID] = convertRoad(X,Y) Converts from the absolute +% position defined by X and Y, to a position POS relative to the road +% ROADID and the lane LANEID. Cartesian coordinates are assumed for the +% input. +% [ROADID POS LANEID] = convertRoad(...,ISGEO) Specify if the absolute +% input position is in geo-coordinates. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: convertRoad.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +if nargin < 3 + isGeo = false; +end + +posType = sscanf(constants.POSITION_2D,'%x'); + +if isGeo + posType = sscanf(constants.POSITION_LON_LAT,'%x'); +end + +traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION,... + '', 1+4 + 1+8+8 + 1+1); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(2)]; +message.string = [message.string uint8(posType) ... + traci.packInt64([y x])]; +message.string = [message.string uint8([sscanf(constants.TYPE_UBYTE,'%x') ... + sscanf(constants.POSITION_ROADMAP,'%x')])]; +result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION, ''); +roadID = result.readString(); +pos = result.readDouble(); +laneID = result.read(1); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function arrivedIDList = getArrivedIDList() +%getArrivedIDList Get the list of arrived vehicles. +% arrivedIDList = getArrivedIDList() Returns a cell array of strings that +% contains the IDs of the vehicles which arrived (have reached their +% destination and are removed from the road network) in this time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getArrivedIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +arrivedIDList = traci.simulation.getUniversal(constants.VAR_ARRIVED_VEHICLES_IDS); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getArrivedNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function arrivedNumber = getArrivedNumber() +%getArrivedNumber Get the number of arrived vehicles. +% arrivedNumber = getArrivedNumber() Returns the number of vehicles which +% arrived (have reached their destination and are removed from the road +% network) in this time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getArrivedNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +arrivedNumber = traci.simulation.getUniversal(constants.VAR_ARRIVED_VEHICLES_NUMBER); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getCurrentTime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getCurrentTime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getCurrentTime.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getCurrentTime.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function currentTime = getCurrentTime() +%getCurrentTime +% currentTime = getCurrentTime() Returns the current simulation time in +% ms. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getCurrentTime.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +currentTime = traci.simulation.getUniversal(constants.VAR_TIME_STEP); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getDeltaT.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getDeltaT.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getDeltaT.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getDeltaT.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function deltaT = getDeltaT() +%getDeltaT +% deltaT = getDeltaT() Returns the time-step of the simulation in ms. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getDeltaT.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +deltaT = traci.simulation.getUniversal(constants.VAR_DELTA_T); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function departedIDList = getDepartedIDList() +%getDepartedIDList Get the IDs of departed vehicles. +% departedIDList = getDepartedIDList() Returns a cell array of strings +% containing the ids of vehicles which departed (were inserted into the +% road network) in this time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getDepartedIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +departedIDList = traci.simulation.getUniversal(constants.VAR_DEPARTED_VEHICLES_IDS); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getDepartedNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function departedNumber = getDepartedNumber() +%getDepartedNumber Get the number of departed vehicles. +% departedNumber = getDepartedNumber() Returns the number of vehicles +% which departed (were inserted into the road network) in this time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getDepartedNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +departedNumber = traci.simulation.getUniversal(constants.VAR_DEPARTED_VEHICLES_NUMBER); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistance2D.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistance2D.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistance2D.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistance2D.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,46 @@ +function distance2D = getDistance2D(x1, y1, x2, y2, isGeo, isDriving) +%getDistance2D Get the distance between two coordinates. +% distance2D = getDistance2D(X1,Y1,X2,Y2) Returns the distance between +% the points defined by the 2D coordinates (X1,Y1) and (X2,Y2). +% Cartesian coordinates are assumed. +% distance2D = getDistance2D(...,ISGEO) Specify wether the inputs are +% in geo-coordinates. +% distance2D = getDistance2D(...,ISDRIVING) Specify wether the air or the +% driving distance shall be computed. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getDistance2D.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +if nargin < 6 + isDriving = false; + if nargin < 5 + isGeo = false; + end +end + +posType = sscanf(constants.POSITION_2D,'%x'); + +if isGeo + posType = sscanf(constants.POSITION_LON_LAT,'%x'); +end + +distType = sscanf(constants.REQUEST_AIRDIST,'%x'); + +if isDriving + distType = sscanf(constants.REQUEST_DRIVINGDIST,'%x'); +end + +traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST,... + '', 1+4 + 1+8+8 + 1+8+8 + 1); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(3)]; +message.string = [message.string uint8(posType) ... + traci.packInt64([y1 x1])]; +message.string = [message.string uint8(posType) ... + traci.packInt64([y2 x2]) uint8(distType)]; +result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST, ''); +distance2D = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistanceRoad.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistanceRoad.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistanceRoad.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getDistanceRoad.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,36 @@ +function distanceRoad = getDistanceRoad(edgeID1, pos1, edgeID2, pos2, isDriving) +%getDistanceRoad Get the distance between two relative-to-edge positions. +% distanceRoad = getDistanceRoad(EDGEID1,POS1,EDGEID2,POS2) Returns the +% distance between the points defined by the relative-to-edge positions +% (EDGEID1,POS1) and (EDGEID2,POS2). +% distance2D = getDistance2D(...,ISDRIVING) Specify wether the air or the +% driving distance shall be computed. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getDistanceRoad.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +if nargin < 5 + isDriving = false; +end + +distType = sscanf(constants.REQUEST_AIRDIST,'%x'); + +if isDriving + distType = sscanf(constants.REQUEST_DRIVINGDIST,'%x'); +end + +traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST,... + '', 1+4 + 1+4+length(edgeID1)+8+1 + 1+4+length(edgeID2)+8+1 + 1); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(3)]; +message.string = [message.string uint8(sscanf(constants.POSITION_ROADMAP,'%x')) ... + traci.packInt32(length(edgeID1)) uint8(edgeID1)]; +message.string = [message.string traci.packInt64(pos1) uint8([0 sscanf(constants.POSITION_ROADMAP,'%x')]) ... + traci.packInt32(length(edgeID2)) uint8(edgeID2)]; +message.string = [message.string traci.packInt64(pos2) uint8([0 distType])]; +result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST, ''); +distanceRoad = result.readDouble; \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function endingTeleportIDList = getEndingTeleportIDList() +%getEndingTeleportIDList Get the IDs of teleported vehicles. +% endingTeleportIDList = getEndingTeleportIDList() Returns a cell array +% of strings containing the IDs of the vehicles which ended to be +% teleported in this time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getEndingTeleportIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +endingTeleportIDList = traci.simulation.getUniversal(constants.VAR_TELEPORT_ENDING_VEHICLES_IDS); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getEndingTeleportNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function endingTeleportNumber = getEndingTeleportNumber() +%getEndingTeleportNumber Get the number teleported vehicles. +% endingTeleportNumber = getEndingTeleportNumber() Returns the number of +% vehicles which ended to be teleported in this time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getEndingTeleportNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +endingTeleportNumber = traci.simulation.getUniversal(constants.VAR_TELEPORT_ENDING_VEHICLES_NUMBER); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function loadedIDList = getLoadedIDList() +%getLoadedIDList Get the IDs of loaded vehicles. +% loadedIDList = getLoadedIDList() Returns a cell array of strings +% cotaining the ids of the vehicles which were loaded in this time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLoadedIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +loadedIDList = traci.simulation.getUniversal(constants.VAR_LOADED_VEHICLES_IDS); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getLoadedNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function loadedNumber = getLoadedNumber() +%getLoadedNumber Get the number loaded vehicles. +% loadedNumber = getLoadedNumber() Returns the number of vehicles which +% were loaded in this time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLoadedNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +loadedNumber = traci.simulation.getUniversal(constants.VAR_LOADED_VEHICLES_NUMBER); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getMinExpectedNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getMinExpectedNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getMinExpectedNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getMinExpectedNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,17 @@ +function minExpectedNumber = getMinExpectedNumber() +%getMinExpectedNumber Get the number of non-arrived vehicles. +% minExpectedNumber = getMinExpectedNumber() Returns the number of +% vehicles which are in the net plus the ones still waiting to start. +% This number may be smaller than the actual number of vehicles still to +% come because of delayed route file parsing. If the number is 0 however, +% it is guaranteed that all route files have been parsed completely and +% all vehicles have left the network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getMinExpectedNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +minExpectedNumber = traci.simulation.getUniversal(... + constants.VAR_MIN_EXPECTED_VEHICLES); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getNetBoundary.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getNetBoundary.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getNetBoundary.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getNetBoundary.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function netBoundary = getNetBoundary() +%getNetBoundary Get the boundary box of the network. +% netBoundary = getNetBoundary() Returns the coordinates of the +% lower-left and the upper-right points that define the boundaries of the +% network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getNetBoundary.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +netBoundary = traci.simulation.getUniversal(constants.VAR_NET_BOUNDING_BOX); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function startingTeleportIDList = getStartingTeleportIDList() +%getStartingTeleportIDList Get the IDs of vehicles stsrting to teleport. +% startingTeleportIDList = getStartingTeleportIDList() Returns a cell +% array of strings containing the ids of vehicles which which started to +% teleport in this time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getStartingTeleportIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +startingTeleportIDList = traci.simulation.getUniversal(constants.VAR_TELEPORT_STARTING_VEHICLES_IDS); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportNumber.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getStartingTeleportNumber.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function startingTeleportNumber = getStartingTeleportNumber() +%getStartingTeleportNumber Get the number of vehicles stsrting to teleport. +% startingTeleportNumber = getStartingTeleportNumber() Returns the number +% of vehicles which started to teleport in this time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getStartingTeleportNumber.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +startingTeleportNumber = traci.simulation.getUniversal(constants.VAR_TELEPORT_STARTING_VEHICLES_NUMBER); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,19 @@ +function subscriptionResults = getSubscriptionResults() +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults() Returns the subscription +% results for the last time step. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global simSubscriptionResults +if isempty(simSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end + +subscriptionResults = simSubscriptionResults.get('x'); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global simSubscriptionResults + +if isempty(simSubscriptionResults) + returnValueFunc = traci.RETURN_VALUE_FUNC.simulation; +else + returnValueFunc = simSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_SIM_VARIABLE,varID,''); +handleReturValueFunc = str2func(returnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+simulation/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+simulation/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,36 @@ +function subscribe(varargin) +%subscribe Subscribe to simulation variable. +% subscribe() Subscribe to the VAR_DEPARTED_VEHICLES_IDS value for +% the maximum allowed interval. +% subscribe(VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global simSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'simulation.subscribe'; +p.addOptional('varIDs', {constants.VAR_DEPARTED_VEHICLES_IDS}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(varargin{:}) +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +simSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.simulation); + +simSubscriptionResults.reset() +traci.subscribe(constants.CMD_SUBSCRIBE_SIM_VARIABLE,... + subscriptionBegin, subscriptionEnd, 'x', varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/simulationStep.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/simulationStep.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/simulationStep.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/simulationStep.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,58 @@ +function responses = simulationStep(timeStep) +%simulationStep Perform a simulation step in the SUMO server. +% +% simulationStep() Perform a simulation step in the SUMO server with +% a time step of one second. +% +% simulationStep(STEP) Perform a simulation step in the SUMO server with +% a time step STEP. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: simulationStep.m 20 2015-03-02 16:52:32Z afacostag $ + + +global message edgeSubscriptionResults guiSubscriptionResults ... + loopSubscriptionResults junctionSubscriptionResults ... + laneSubscriptionResults detSubscriptionResults ... + poiSubscriptionResults polygonSubscriptionResults ... + routeSubscriptionResults simSubscriptionResults ... + tlSubscriptionResults vehSubscriptionResults ... + typeSubscriptionResults + +modules = {edgeSubscriptionResults guiSubscriptionResults ... + loopSubscriptionResults junctionSubscriptionResults ... + laneSubscriptionResults detSubscriptionResults ... + poiSubscriptionResults polygonSubscriptionResults ... + routeSubscriptionResults simSubscriptionResults ... + tlSubscriptionResults vehSubscriptionResults ... + typeSubscriptionResults}; + +if nargin < 1 + timeStep = 0; +end +import traci.constants + +% Prepare the message to be sent to the SUMO server +message.queue = [message.queue uint8(sscanf(constants.CMD_SIMSTEP2,'%x'))]; +message.string = [message.string uint8([1+1+4 sscanf(constants.CMD_SIMSTEP2,'%x')]) ... + traci.packInt32(timeStep)]; + +% Send the message +result = traci.sendExact(); + +% Clear the TraCI subscriptions +for i=1:length(modules) + if ~isempty(modules{i}) + modules{i}.reset(); + end +end + +% Get the number of subscriptions and populate them +numSubs = result.readInt(); +responses = cell(1,2*numSubs); +for i=1:numSubs + [response, objectID] = traci.readSubscription(result); + responses(2*i-1:2*i) = {response objectID}; +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/Socket.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/Socket.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/Socket.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/Socket.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,35 @@ +classdef Socket < handle +%Socket A class which wraps a Java socket to implement +% TCP/IP communications in Matlab. + +% Copyright 2014 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: Socket.m 20 2015-03-02 16:52:32Z afacostag $ + + properties + socket + dis + dos + dataReader + end + methods + function this = connect(this, host, port) + import co.edu.unalmed.gaunal.traci4matlab.utils.* + import java.net.* + import java.io.* + this.socket = Socket(); + inetSocketAddress = InetSocketAddress(... + InetAddress.getByName(host), port); + try + this.socket.connect(inetSocketAddress); + catch err + disp(err.getReport); +% throw(MException('Connection:ConnectionRefused', err.getReport)); + end + this.dis = DataInputStream(this.socket.getInputStream()); + this.dataReader = DataReader(this.dis); + this.dos = DataOutputStream(this.socket.getOutputStream()); + end + end +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/Storage.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/Storage.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/Storage.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/Storage.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,70 @@ +classdef Storage < handle +%Storage A container for responses from SUMO server. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: Storage.m 20 2015-03-02 16:52:32Z afacostag $ + + properties + content + pos + end + methods + function this = Storage(content) + this.content = content; + this.pos = 1; + end + function value = read(this,numbytes) + oldpos = this.pos; + this.pos = this.pos + numbytes; + value = this.content(oldpos:this.pos-1); + +% interval = round(numbytes/nargout); +% for i=1:nargout +% oldpos = this.pos; +% this.pos = this.pos + interval; +% varargout{i} = this.content(oldpos:this.pos-1); +% end + end + function value = readInt(this) + value = double(typecast(fliplr(uint8(this.read(4))),'int32')); + end + + function value = readDouble(this) + value = typecast(fliplr(this.read(8)),'double'); + end + + function len = readLength(this) + len = this.read(1); + if len > 0 + return + end + len = this.readInt(); + end + function value = readString(this) + len = typecast(fliplr(this.read(4)),'int32'); + if len == 0 + value = ''; + return + end + value = char(this.read(len)); + end + function stringList = readStringList(this) + n = this.readInt(); + stringList = cell(1,n); + for i=1:n + stringList{i} = this.readString(); + end + end + + function shape = readShape(this) + len = this.read(1); + shape = cell(1,len); + for i=1:len + shape{i} = typecast([fliplr(this.read(8)) fliplr(this.read(8))],'double'); + end + end + + end +end diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,51 @@ +function subscribeContext(cmdID, subscriptionBegin, subscriptionEnd, objID, domain, dist, varIDs) +%subscribeContext An internal function to build a context subscription +%command and parse the response. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global message +global loopSubscriptionResults laneSubscriptionResults vehSubscriptionResults ... + poiSubscriptionResults polygonSubscriptionResults junctionSubscriptionResults ... + edgeSubscriptionResults + +if strcmp(domain,'0xa0') + loopSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.inductionloop); +elseif strcmp(domain,'0xa3') + laneSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.lane); +elseif strcmp(domain,'0xa4') + vehSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicle); +elseif strcmp(domain,'0xa7') + poiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.poi); +elseif strcmp(domain,'0xa8') + polygonSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.polygon); +elseif strcmp(domain,'0xa9') + junctionSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.junction); +elseif strcmp(domain,'0xaa') + edgeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.edge); +end + +message.queue = [message.queue uint8(sscanf(cmdID,'%x'))]; +len = 1+1+4+4+4+length(objID)+1+8+1+length(varIDs); +if len<=255 + message.string = [message.string uint8(len)]; +else + message.string = [message.string uint8(0) traci.packInt64(len+4)]; +end +message.string = [message.string uint8(sscanf(cmdID,'%x')),... + traci.packInt32([length(objID)... + subscriptionEnd subscriptionBegin]) uint8(objID)]; +message.string = [message.string uint8(sscanf(domain,'%x')) ... + traci.packInt64(dist) uint8(length(varIDs))]; +for i=1:length(varIDs) + message.string = [message.string uint8(sscanf(varIDs{i},'%x'))]; +end +result = traci.sendExact(); +[response, objectID] = traci.readSubscription(result); +if response - uint8(sscanf(cmdID,'%x'))~=16 || ~strcmp(objectID,objID) + raise(MException('traci:FatalTraciError','Received answer %.2X,%s for context subscription command %.2X,%s\n',... + response, objectID, cmdID, objID)); +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,36 @@ +function subscribe(cmdID, subscriptionBegin, subscriptionEnd, objID, varIDs) +%subscribe An internal function to build a subscription message and parse +%the response. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global message + +% Construct the TraCI message +message.queue = [message.queue uint8(sscanf(cmdID,'%x'))]; +len = 1+1+4+4+4+length(objID)+1+length(varIDs); +if len <= 255 + message.string = [message.string uint8(len)]; +else + message.string = [message.string uint8(0) traci.packInt32(len+4)]; +end +message.string = [message.string uint8(sscanf(cmdID,'%x')),... + traci.packInt32([length(objID) subscriptionEnd ... + subscriptionBegin]) uint8(objID)]; +message.string = [message.string uint8(length(varIDs))]; +for v=1:length(varIDs) + message.string = [message.string sscanf(varIDs{v},'%x')]; +end + +% Send the TraCI message and receive the result +result = traci.sendExact(); + +% Populate the subsctiptions and parse the result +[response, objectID] = traci.readSubscription(result); +if response - uint8(sscanf(cmdID,'%x'))~=16 || ~strcmp(objectID,objID) + raise(MException('traci:FatalTraciError',['Received answer ' response ... + ', ' objectID 'for subscription command ' cmdID ', ' objID])); +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/SubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/SubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/SubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/SubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,87 @@ +classdef SubscriptionResults < handle +%SubscriptionResults A container for the subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: SubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + + properties + results + contextResults + valueFunc + end + + methods + function this = SubscriptionResults(valueFunc) + this.results = containers.Map; + this.contextResults = containers.Map; + this.valueFunc = valueFunc; + end + + function result = parse(this, varID, data) + if ~isKey(this.valueFunc, varID) + throw(MException('traci:FatalTraCIError', 'Unknown variable %.2x',varID)) + end + resultHandle = str2func(this.valueFunc(varID)); + result = resultHandle(data); + end + + function reset(this) + this.results = containers.Map; + this.contextResults = containers.Map; + end + + function add(this, refID, varID, data) + if ~isKey(this.results, refID) + this.results(refID) = containers.Map; + end + handle1results = this.results(refID); + handle1results(varID) = this.parse(varID, data); + end + + function subscriptionResults = get(this, refID) + refID = num2str(refID); + if nargin < 2 + refID = 'None'; + end + if strcmp(refID,'None') == 1 + subscriptionResults = this.results; + return + end + if isKey(this.results, refID) + subscriptionResults = this.results(refID); + else + subscriptionResults = 'None'; + end + end + + function addContext(this, refID, domain, objID, varID, data) + if ~isKey(this.contextResults, refID) + this.contextResults(refID) = containers.Map; + end + if ~isKey(this.contextResults(refID), objID) + this.contextResults(refID) = subsasgn(this.contextResults(refID),... + struct('type','()','subs',{objID}),containers.Map); + end + handle1ContextResults = this.contextResults(refID); + handle2ContextResults = handle1ContextResults(objID); + handle2ContextResults(varID) = domain.parse(varID, data); + end + + function context = getContext(this, refID) + if nargin < 2 + refID = 'None'; + end + if strcmp(refID, 'None') == 1 + context = this.contextResults; + return + end + if isKey(this.contextResults, refID) + context = this.contextResults(refID); + else + context = 'None'; + end + end + end +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/switchConnection.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/switchConnection.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/switchConnection.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/switchConnection.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function switchConnection(label) +%switchConnection Switch to another connection with SUMO. +% +% switchConnection(label) Switch to the connection specified in LABEL +% with the SUMO server. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: switchConnection.m 20 2015-03-02 16:52:32Z afacostag $ + +global connections +connections('') = connections(label); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/time2steps.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/time2steps.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/time2steps.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/time2steps.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,10 @@ +function timeInMiliseconds = time2steps(time) +%timeInMiliseconds An internal function to convert time in seconds to +%miliseconds. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: time2steps.m 20 2015-03-02 16:52:32Z afacostag $ + +timeInMiliseconds = int32(time*1000); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function completeRedYellowGreenDefinition = getCompleteRedYellowGreenDefinition(tlsID) +%getCompleteRedYellowGreenDefinition Get the complete traffic lights definition. +% completeRedYellowGreenDefinition = +% getCompleteRedYellowGreenDefinition(TLSID) Returns a +% traci.trafficlights.Logic object that describes the atributes of the +% traffic light definition including all the phase definitions. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getCompleteRedYellowGreenDefinition.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +completeRedYellowGreenDefinition = traci.trafficlights.getUniversal(constants.TL_COMPLETE_DEFINITION_RYG, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function ContextSubscriptionResults = getContextSubscriptionResults(tlsID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(TLSID) +% Returns the context subscription results for the last time step and the +% given traffic light. If no traffic light id is given, all subscription +% results are returned in a containers.Map data struccure. If the traffic +% light id is unknown or the subscription did for any reason return no +% data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global tlsSubscriptionResults +if isempty(tlsSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + tlsID=None; +end +ContextSubscriptionResults = tlsSubscriptionResults.getContext(tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLanes.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLanes.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLanes.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLanes.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function controlledLanes = getControlledLanes(tlsID) +%getControlledLanes Get the controlled lanes. +% controlledLanes = getControlledLanes(TLSID) Returns a cell array of +% strings containing the ids of the lanes controlled by the given traffic +% lights. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getControlledLanes.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +controlledLanes = traci.trafficlights.getUniversal(constants.TL_CONTROLLED_LANES, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLinks.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLinks.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLinks.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getControlledLinks.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function controlledLinks = getControlledLinks(tlsID) +%getControlledLinks Get the links controlled by the traffic light. +% controlledLinks = getControlledLinks(tlsID) Returns a cell array +% containing the links controlled by the traffic light, sorted by the +% signal index and described by giving the incoming, outgoing, and via +% lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getControlledLinks.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +controlledLinks = traci.trafficlights.getUniversal(constants.TL_CONTROLLED_LINKS, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function IDList = getIDList() +%getIDList Get the IDs of the traffic lights in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the traffic lights in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.trafficlights.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getNextSwitch.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getNextSwitch.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getNextSwitch.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getNextSwitch.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function nextSwitch = getNextSwitch(tlsID) +%getNextSwitch. +% nextSwitch = getNextSwitch(TLSID) Returns the time in ms at which the +% next phase change will be performed. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getNextSwitch.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +nextSwitch = traci.trafficlights.getUniversal(constants.TL_NEXT_SWITCH, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getPhase.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getPhase.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getPhase.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getPhase.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function phase = getPhase(tlsID) +%getPhase Get the phase index. +% phase = getPhase(TLSID) Returns the current phase index of +% given trafficlights. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getPhase.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +phase = traci.trafficlights.getUniversal(constants.TL_CURRENT_PHASE, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getProgram.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getProgram.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getProgram.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getProgram.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function program = getProgram(tlsID) +%getProgram +% program = getProgram(TLSID) Returns the id of the current program. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getProgram.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +program = traci.trafficlights.getUniversal(constants.TL_CURRENT_PROGRAM, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getRedYellowGreenState.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getRedYellowGreenState.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getRedYellowGreenState.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getRedYellowGreenState.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function redYellowGreenState = getRedYellowGreenState(tlsID) +%getRedYellowGreenState Get the traffic lights' state. +% redYellowGreenState = getRedYellowGreenState(TLSID) Returns the named +% tl's state as a string of light definitions from rRgGyYoO, for red, +% green, yellow, off, where lower case letters mean that the stream has +% to decelerate. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getRedYellowGreenState.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +redYellowGreenState = traci.trafficlights.getUniversal(constants.TL_RED_YELLOW_GREEN_STATE, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,27 @@ +function subscriptionResults = getSubscriptionResults(tlsID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(TLSID) Returns the +% subscription results for the last time step and the given traffic +% lights. If no traffic lights id is given, all subscription results are +% returned in a containers.Map data structure. +% If the traffic lights id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global tlSubscriptionResults +if isempty(tlSubscriptionResults) + traci.close(); + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + tlsID = 'None'; +end + +subscriptionResults = tlSubscriptionResults.get(tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, tlsID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global tlsSubscriptionResults + +if isempty(tlsSubscriptionResults) + returnValueFunc = traci.RETURN_VALUE_FUNC.trafficlights; +else + returnValueFunc = tlsSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_TL_VARIABLE,varID,tlsID); +handleReturValueFunc = str2func(returnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Logic.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Logic.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Logic.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Logic.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,43 @@ +classdef Logic +%Logic constructs a Logic object. +% myLogic = Logic(SUBID,TYPE,SUBPARAMETER,CURRENTPHASEINDEX,PHASES) +% constructs a Logic object myLogic containing an ID SUBID, astarting +% phase index CURRENTPHASEINDEX, and a cell array of traci.Phase objects, +% PHASES, which represent the phase definitions of trafic lights' program +% myLogic. TYPE and SUBPARAMETER are not currently implemented in SUMO +% server, therefore, the must be set to zero. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: Logic.m 20 2015-03-02 16:52:32Z afacostag $ + + properties + subID + type + subParameter + currentPhaseIndex + phases + end + methods + function this = Logic(subID, type, subParameter, currentPhaseIndex, phases) + this.subID = subID; + this.type = type; + this.subParameter = subParameter; + this.currentPhaseIndex = currentPhaseIndex; + this.phases = phases; + end + + function display(this) + disp('Logic:'); + disp(['subID: ' num2str(this.subID)]); + disp(['type: ' num2str(this.type)]); + disp(['subParameter: ' num2str(this.subParameter)]); + disp(['currentPhaseIndex: ' num2str(this.currentPhaseIndex)]); + for i=1:length(this.phases) + display(this.phases{i}); + end + end + + end +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Phase.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Phase.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Phase.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/Phase.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +classdef Phase +%Phase Construct a Phase object for TraCI traffic lights. +% myPhase = Phase(DURATION,DURATION1,DURATION2,PHASEDEF) Constructs a +% Phase object with the properties DURATION, DURATION1, which is the min +% duration in miliseconds; DURATION2, which is the max duration in +% miliseconds and PHASEDEF, which is a string of light definitions from +% rRgGyYoO for red, green, yellow, off, where lower case letters mean +% that the stream has to decelerate. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: Phase.m 20 2015-03-02 16:52:32Z afacostag $ + + properties + duration + duration1 + duration2 + phaseDef + end + methods + function this = Phase(duration, duration1, duration2, phaseDef) + this.duration = duration; + this.duration1 = duration1; + this.duration2 = duration2; + this.phaseDef = phaseDef; + end + + function display(this) + disp('Phase:'); + disp(['duration: ' num2str(this.duration)]); + disp(['duration1: ' num2str(this.duration1)]); + disp(['duration2: ' num2str(this.duration1)]); + disp(['phaseDef: ' num2str(this.phaseDef)]); + end + + end +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLinks.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLinks.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLinks.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLinks.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,22 @@ +function signals = readLinks(result) +%readLinks Internal function to read the links controlled by the traffic lights. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: readLinks.m 20 2015-03-02 16:52:32Z afacostag $ + +result.readLength(); +nbSignals = result.readInt(); % Length +signals = cell(1,nbSignals); +for i=1:nbSignals + result.read(1); % Type of Number of Controlled Links + nbControlledLinks = result.readInt(); % Number of Controlled Links + controlledLinks = cell(1,nbControlledLinks); + for j=1:nbControlledLinks + result.read(1); % Type of Link j + link = result.readStringList(); % Link j + controlledLinks{j} = link; + end + signals(i) = controlledLinks; +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLogics.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLogics.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLogics.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/readLogics.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function logics = readLogics(result) +%readLogics Internal function to read the complete program of the traffic lights. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: readLogics.m 20 2015-03-02 16:52:32Z afacostag $ + +result.readLength(); +nbLogics = result.readInt(); % Number of logics +logics = cell(1,nbLogics); +for i=1:nbLogics + result.read(1); % Type of SubID + subID = result.readString(); + result.read(1); % Type of Type + type = result.readInt(); % Type + result.read(1); % Type of SubParameter + subParameter = result.readInt(); % SubParameter + result.read(1); % Type of Current phase index + currentPhaseIndex = result.readInt(); % Current phase index + result.read(1); % Type of Number of phases + nbPhases = result.readInt(); % Number of phases + phases = cell(1,nbPhases); + for j=1:nbPhases + result.read(1); % Type of Duration + duration = result.readInt(); % Duration + result.read(1); % Type of Duration1 + duration1 = result.readInt(); % Duration1 + result.read(1); % Type of Duration2 + duration2 = result.readInt(); % Duration2 + result.read(1); % Type of Phase Definition + phaseDef = result.readString(); % Phase Definition + phase = traci.trafficlights.Phase(duration, duration1, duration2, phaseDef); + phases{j} = phase; + end + logic = traci.trafficlights.Logic(subID, type, subParameter, currentPhaseIndex, phases); + logics{i} = logic; +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,44 @@ +function setCompleteRedYellowGreenDefinition(tlsID, tls) +%setCompleteRedYellowGreenDefinition Set the complete definition of the traffic light. +% setCompleteRedYellowGreenDefinition(TLSID,TLS) Sets the attributes of +% trafic lights' definition including all the phase definitions. Those +% attributes are included in the TLS parameter, which is a +% traci.trafficlights.Logic object. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setCompleteRedYellowGreenDefinition.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +len = 1+4 + 1+4+length(tls.subID) + 1+4 + 1+4 + 1+4 + 1+4; % tls parameter +itemNo = 1+1+1+1+1; +for p=1:length(tls.phases) + len = len + 1+4 + 1+4 + 1+4 + 1+4+length(tls.phases{p}.phaseDef); + itemNo = itemNo + 4; +end +traci.beginMessage(constants.CMD_SET_TL_VARIABLE, constants.TL_COMPLETE_PROGRAM_RYG, tlsID, len); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(itemNo)]; +message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... + traci.packInt32(length(tls.subID)) uint8(tls.subID)]; % Program ID +message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... + traci.packInt32(0)]; % Type +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(0)]; % subitems +message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... + traci.packInt32(tls.currentPhaseIndex)]; +message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... + traci.packInt32(length(tls.phases))]; % phaseNo + +for i=1:length(tls.phases) + message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... + traci.packInt32(tls.phases{i}.duration) ... + uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(tls.phases{i}.duration1) ... + uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(tls.phases{i}.duration2)]; + message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... + traci.packInt32(length(tls.phases{i}.phaseDef)) ... + uint8(tls.phases{i}.phaseDef)]; +end +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhaseDuration.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhaseDuration.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhaseDuration.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhaseDuration.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function setPhaseDuration(tlsID, phaseDuration) +%setPhaseDuration Set the phase duration traffic light. +% setPhaseDuration(TLSID,PHASEDURATION) Sets the current phase's duration +% in miliseconds of the traffic lights with ID TLSID to the given in the +% PHASEDURATION parameter. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setPhaseDuration.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendIntCmd(constants.CMD_SET_TL_VARIABLE,... + constants.TL_PHASE_DURATION, tlsID, 1000*phaseDuration); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhase.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhase.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhase.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setPhase.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function setPhase(tlsID, index) +%setPhase Set the phase index of the traffic light. +% setPhase(TLSID,INDEX) Sets the index of the traffic lights with ID TLSID +% to the given in the INDEX parameter. There are as many tls indexes as +% phase definitions in the tls program. The tls index starts from zero. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setPhase.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendIntCmd(constants.CMD_SET_TL_VARIABLE,... + constants.TL_PHASE_INDEX, tlsID, index); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setProgram.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setProgram.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setProgram.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setProgram.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setProgram(tlsID, programID) +%setProgram +% setProgram(TLSID,PROGRAMID)Sets the id of the current program. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setProgram.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_TL_VARIABLE,... + constants.TL_PROGRAM, tlsID, programID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setRedYellowGreenState.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setRedYellowGreenState.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setRedYellowGreenState.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/setRedYellowGreenState.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function setRedYellowGreenState(tlsID, state) +%setRedYellowGreenState Set the state of the traffic lights. +% setRedYellowGreenState(TLSID,STATE) Sets the named tl's state as a +% string of light definitions from rRgGyYoO, for red, green, yellow, off, +% where lower case letters mean that the stream has to decelerate. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setRedYellowGreenState.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_TL_VARIABLE,... + constants.TL_RED_YELLOW_GREEN_STATE, tlsID, state); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,46 @@ +function subscribeContext(tlsID, domain, dist, varargin) +%subscribeContext Subscribe to a traffic lights's context variable. +% subscribeContext(TLSID,DOMAIN,DIST) Subscribe to the TL_CURRENT_PHASE +% value of the SUMO objects that surround the traffic lights specified by +% TLSID at a distance given by DIST, for the maximum allowed interval. +% The type of objets that surround the traffic lights are defined in the +% DOMAIN parameter. Note that not all the SUMO object types support the +% variable TL_CURRENT_PHASE. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global tlsSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'trafficlights.subscribeContext'; +p.addRequired('tlsID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.TL_CURRENT_PHASE}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(tlsID, domain, dist, varargin{:}) +tlsID = p.Results.tlsID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +tlsSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.trafficlights); + +tlsSubscriptionResults.reset() +traci.subscribeContext(constants.CMD_SUBSCRIBE_TL_CONTEXT,... + subscriptionBegin, subscriptionEnd, tlsID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+trafficlights/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function subscribe(tlsID, varargin) +%subscribe Subscribe to traffic lights variable. +% subscribe(TLSID) Subscribe to the TL_CURRENT_PHASE value for the +% maximum allowed interval. +% subscribe(TLSID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global tlSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'trafficlights.subscribe'; +p.addRequired('tlsID',@ischar) +p.addOptional('varIDs', {constants.TL_CURRENT_PHASE}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(tlsID, varargin{:}) +tlsID = p.Results.tlsID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +tlSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.trafficlights); + +tlSubscriptionResults.reset() +traci.subscribe(constants.CMD_SUBSCRIBE_TL_VARIABLE,... + subscriptionBegin, subscriptionEnd, tlsID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/add.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/add.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/add.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/add.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,57 @@ +function add(vehID, routeID, varargin) +%add Get the traffic lights' state. +% add(VEHID,ROUTEID) Adds a vehicle in the current time-step with ID +% VEHID and assigns the route with ID ROUTEID to it. +% add(...,DEPART) Specify the departure time in seconds. +% add(...,POS) Specify the position relative to the starting lane. +% add(...,SPEED) Specify the starting speed of the vehicle. +% add(...,LANE) Specify the lane number in which the vehicle will start. +% add(...,TYPEID) Specify the type of the vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: add.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message + +p = inputParser; +p.FunctionName = 'vehicle.add'; +p.addRequired('vehID',@ischar) +p.addRequired('routeID',@ischar) +p.addOptional('depart', -2, @isnumeric) % -2 = DEPART_NOW +p.addOptional('pos', 0, @isnumeric) +p.addOptional('speed', 0, @isnumeric) +p.addOptional('lane', 0, @isnumeric) +p.addOptional('typeID', 'DEFAULT_VEHTYPE', @ischar) +p.parse(vehID, routeID, varargin{:}) + +vehID = p.Results.vehID; +routeID = p.Results.routeID; +depart = p.Results.depart; +pos = p.Results.pos; +speed = p.Results.speed; +lane = p.Results.lane; +typeID = p.Results.typeID; + + +traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.ADD, vehID,... + 1+4 + 1+4+length(typeID) + 1+4+length(routeID) + 1+4 + 1+8 + 1+8 + 1+1); +if depart > 0 + depart = depart*1000; +end + +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(6)]; +message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... + traci.packInt32(length(typeID)) uint8(typeID)]; +message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... + traci.packInt32(length(routeID)) uint8(routeID)]; +message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... + traci.packInt32(depart)]; +message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... + traci.packInt64(pos) uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... + traci.packInt64(speed)]; +message.string = [message.string uint8([sscanf(constants.TYPE_BYTE,'%x') uint8(lane)])]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeLane.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeLane.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeLane.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeLane.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,20 @@ +function changeLane(vehID, laneIndex, duration) +%add Make the vehicle to switch the lane. +% changeLane(VEHID,LANEINDEX,DURATION) Makes the vehicle with ID VEHID to +% change the lane to the specified in the index LANEINDEX for the given +% time duration. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: changeLane.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_CHANGELANE,... + vehID, 1+4+1+1+1+4); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(2) uint8([sscanf(constants.TYPE_BYTE,'%x') ... + laneIndex sscanf(constants.TYPE_INTEGER,'%x')]) ... + traci.packInt32(duration)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeTarget.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeTarget.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeTarget.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/changeTarget.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function changeTarget(vehID, edgeID) +%changeTarget Change the vehicle's destination. +% changeTarget(VEHID,EDGEID) Changes the vehicle's destination edge to +% the given. The route is rebuilt. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: changeTarget.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_CHANGETARGET, vehID, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAccel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAccel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAccel.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAccel.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function accel = getAccel(vehID) +%getAccel Get the acceleration of the vehicle. +% accel = getAccel(VEHID) Returns the maximum acceleration possibility in +% m/s^2 of this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getAccel.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +accel = traci.vehicle.getUniversal(constants.VAR_ACCEL, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAdaptedTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAdaptedTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAdaptedTraveltime.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAdaptedTraveltime.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,21 @@ +function adaptedTraveltime = getAdaptedTraveltime(vehID, time, edgeID) +%getAdaptedTraveltime +% adaptedTraveltime = getAdaptedTraveltime(VEHID,TIME,EDGEID) Returns the +% edge travel time for the given time as stored in the vehicle's internal +% container. If such a value does not exist, -1 is returned. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getAdaptedTraveltime.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_TRAVELTIME,... + vehID, 1+4+1+4+1+4+length(edgeID)); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ... + uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(time) ... + uint8(sscanf(constants.TYPE_STRING,'%x')) traci.packInt32(length(edgeID)) ... + uint8(edgeID)]; +result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_TRAVELTIME, vehID); +adaptedTraveltime = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAngle.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAngle.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAngle.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getAngle.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function angle = getAngle(vehID) +%getAngle Get the angle of the vehicle. +% angle = getAngle(VEHID) Returns the angle in degrees of the named +% vehicle within the last step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getAngle.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +angle = traci.vehicle.getUniversal(constants.VAR_ANGLE, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getBestLanes.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getBestLanes.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getBestLanes.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getBestLanes.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,14 @@ +function bestLanes = getBestLanes(vehID) +%getBestLanes +% bestLanes = getBestLanes(VEHID) Returns information about the wish to +% use subsequent edges' lanes, which is stored in a cell array. The +% information includes laneID, length, occupation, offset, +% allowsContinuation and nextLanes. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getBestLanes.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +bestLanes = traci.vehicle.getUniversal(constants.VAR_BEST_LANES, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCO2Emission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCO2Emission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCO2Emission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCO2Emission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function CO2Emission = getCO2Emission(vehID) +%getCO2Emission Returns the CO2 emission of the vehicle. +% CO2Emission = getCO2Emission(VEHID) Returns the CO2 emission in mg for +% the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getCO2Emission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +CO2Emission = traci.vehicle.getUniversal(constants.VAR_CO2EMISSION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCOEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCOEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCOEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getCOEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function COEmission = getCOEmission(vehID) +%getCOEmission Returns the CO emission of the vehicle. +% COEmission = getCO2Emission(VEHID) Returns the CO emission in mg for +% the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getCOEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +COEmission = traci.vehicle.getUniversal(constants.VAR_COEMISSION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getColor.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getColor.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function color = getColor(vehID) +%getColor Get the color of the vehicle. +% color = getColor(VEHID) Returns the vehicle's rgba color. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getColor.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +color = traci.vehicle.getUniversal(constants.VAR_COLOR, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function ContextSubscriptionResults = getContextSubscriptionResults(vehID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(VEHICLEID) +% Returns the context subscription results for the last time step and the +% given vehicle. If no vehicle id is given, all subscription results are +% returned in a containers.Map data struccure. If the vehicle id is unknown +% or the subscription did for any reason return no data, 'None' is +% returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global vehSubscriptionResults +if isempty(vehSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + vehID=None; +end +ContextSubscriptionResults = vehSubscriptionResults.getContext(vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDecel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDecel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDecel.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDecel.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function decel = getDecel(vehID) +%getDecel Returns the deceleration of the vehicle. +% decel = getDecel(VEHID) Returns the maximum deceleration possibility +% in m/s^2 of this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getDecel.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +decel = traci.vehicle.getUniversal(constants.VAR_DECEL, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance2D.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance2D.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance2D.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance2D.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,19 @@ +function drivingDistance2D = getDrivingDistance2D(vehID, x, y) +%getDrivingDistance2D Returns the driving distance to an absolute coordinate. +% drivingDistance2D = getDrivingDistance2D(VEHID,X,Y) Returns +% the driving distance from the current position to that defined by the +% coordinates X and Y. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getDrivingDistance2D.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST,... + vehID, 1+4+1+8+8+1); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ... + uint8(sscanf(constants.POSITION_2D,'%x')) traci.packInt64([y x]) uint8(sscanf(constants.REQUEST_DRIVINGDIST,'%x'))]; +result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST, vehID); +drivingDistance2D = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getDrivingDistance.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,24 @@ +function drivingDistance = getDrivingDistance(vehID, edgeID, pos, laneID) +%getDrivingDistance Returns the driving distance to relative coordinate. +% drivingDistance = getDrivingDistance(VEHID,EDGEID,POS,LANEID) Returns +% the driving distance from the current position to the given in POS. POS +% is a position relative to the edge identified by EDGEID and the lane +% index specified in LANEID. If no LANEID is given, it defaults to zero. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getDrivingDistance.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +if nargin < 4 + laneID=0; +end +traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST,... + vehID, 1+4+1+4+length(edgeID) + 8+1+1); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ... + uint8(sscanf(constants.POSITION_ROADMAP,'%x')) traci.packInt32(length(edgeID)) uint8(edgeID)]; +message.string = [message.string traci.packInt64(pos) uint8([laneID sscanf(constants.REQUEST_DRIVINGDIST,'%x')])]; +result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST, vehID); +drivingDistance = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEffort.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEffort.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEffort.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEffort.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,21 @@ +function effort = getEffort(vehID, time, edgeID) +%getEffort +% effort = getEffort(VEHID,TIME,EDGEID) Returns the edge effort for the +% given time as stored in the vehicle's internal container. If such a +% value does not exist, -1 is returned. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getEffort.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_EFFORT,... + vehID, 1+4+1+4+1+4+length(edgeID)); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ... + uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(time) ... + uint8(sscanf(constants.TYPE_STRING,'%x')) traci.packInt32(length(edgeID)) ... + uint8(edgeID)]; +result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_EFFORT, vehID); +effort = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEmissionClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEmissionClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEmissionClass.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getEmissionClass.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function emissionClass = getEmissionClass(vehID) +%getEmissionClass +% emissionClass = getEmissionClass(VEHID) Returns the emission class of +% this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getEmissionClass.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +emissionClass = traci.vehicle.getUniversal(constants.VAR_EMISSIONCLASS, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getFuelConsumption.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getFuelConsumption.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getFuelConsumption.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getFuelConsumption.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function fuelConsumption = getFuelConsumption(vehID) +%getFuelConsumption Get the fuel consumption of the vehicle. +% fuelConsumption = getFuelConsumption(VEHID) Returns the fuel +% consumption in ml for the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getFuelConsumption.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +fuelConsumption = traci.vehicle.getUniversal(constants.VAR_FUELCONSUMPTION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getHCEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getHCEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getHCEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getHCEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function HCEmission = getHCEmission(vehID) +%getHCEmission Returns the HC emission of the vehicle. +% HCEmission = getHCEmission(VEHID) Returns the HC emission in mg for +% the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getHCEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +HCEmission = traci.vehicle.getUniversal(constants.VAR_HCEMISSION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function IDList = getIDList() +%getIDList Get the IDs of the vehicles in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the vehicles in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.vehicle.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getImperfection.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getImperfection.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getImperfection.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getImperfection.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function imperfection = getImperfection(vehID) +%getImperfection Returns driver's imperfection. +% imperfection = getImperfection(VEHID) Returns the driver's imperfection +% (dawdling) [0,1] + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getImperfection.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +imperfection = traci.vehicle.getUniversal(constants.VAR_IMPERFECTION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneID.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneID.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,15 @@ +function laneID = getLaneID(vehID) +%getLaneID +% laneID = getLaneID(VEHID) Returns the id of the lane the named vehicle +% was at within the last step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLaneID.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants + + +import traci.constants +laneID = traci.vehicle.getUniversal(constants.VAR_LANE_ID, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneIndex.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneIndex.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneIndex.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLaneIndex.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function laneIndex = getLaneIndex(vehID) +%getLaneIndex +% laneIndex = getLaneIndex(VEHID) Returns the index of the lane the named +% vehicle was at within the last step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLaneIndex.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +laneIndex = traci.vehicle.getUniversal(constants.VAR_LANE_INDEX, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLanePosition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLanePosition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLanePosition.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLanePosition.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function lanePosition = getLanePosition(vehID) +%getLanePosition Get the position of the vehicle along the lane. +% lanePosition = getLanePosition(VEHID) Returns the position of the +% vehicle along the lane measured in m. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLanePosition.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +lanePosition = traci.vehicle.getUniversal(constants.VAR_LANEPOSITION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLeader.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLeader.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLeader.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLeader.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,30 @@ +function [vehicleID, dist] = getLeader(vehID,dist) +% [vehicleID, dist] = getLeader(VEHID,DIST) Return the leading vehicle id +% together with the distance. +% The DIST parameter defines the maximum lookahead, 0 calculates a +% lookahead from the brake gap. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id$ + +if nargin < 2 + dist = 0; +end + +import traci.constants +global message +traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, '0x68',... + vehID, 1+8); +message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x'))... + traci.packInt64(dist)]; + +result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, '0x68', vehID); + +result.readInt(); +result.read(1); +vehicleID = result.readString(); +result.read(1); +dist = result.readDouble(); + \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLength.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getLength.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function length = getLength(vehID) +%getLength +% length = getLength(VEHID) Returns the length in m of the given vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLength.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +length = traci.vehicle.getUniversal(constants.VAR_LENGTH, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMaxSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function maxSpeed = getMaxSpeed(vehID) +%getMaxSpeed +% maxSpeed = getMaxSpeed(VEHID) Returns the maximum speed in m/s of this +% vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +maxSpeed = traci.vehicle.getUniversal(constants.VAR_MAXSPEED, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMinGap.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMinGap.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMinGap.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getMinGap.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function minGap = getMinGap(vehID) +%getMinGap +% minGap = getMinGap(VEHID) Returns the offset (gap to front vehicle if +% halting) of this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getMinGap.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +minGap = traci.vehicle.getUniversal(constants.VAR_MINGAP, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNoiseEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNoiseEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNoiseEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNoiseEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function noiseEmission = getNoiseEmission(vehID) +%getNoiseEmission Get the noise emission of the vehicle. +% noiseEmission = getNoiseEmission(VEHID) Returns the noise emission in +% db for the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getNoiseEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +noiseEmission = traci.vehicle.getUniversal(constants.VAR_NOISEEMISSION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNOxEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNOxEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNOxEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getNOxEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function NOxEmission = getNOxEmission(vehID) +%getNOxEmission Get the NOx emission of the vehicle. +% NOxEmission = getNOxEmission(VEHID) Returns the NOx emission in mg for +% the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getNOxEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +NOxEmission = traci.vehicle.getUniversal(constants.VAR_NOXEMISSION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPMxEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPMxEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPMxEmission.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPMxEmission.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function PMxEmission = getPMxEmission(vehID) +%getPmxEmission Get the particular matter emission of the vehicle. +% pmxEmission = getPmxEmission(VEHID) Returns the particular matter +% emission in mg for the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getPMxEmission.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +PMxEmission = traci.vehicle.getUniversal(constants.VAR_PMXEMISSION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPosition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPosition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPosition.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getPosition.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function position = getPosition(vehID) +%getPosition +% position = getPosition(VEHID) Returns the x,y position of the named +% vehicle within the last step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getPosition.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +position = traci.vehicle.getUniversal(constants.VAR_POSITION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoadID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoadID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoadID.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoadID.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function roadID = getRoadID(vehID) +%getRoadID +% roadID = getRoadID(VEHID) Returns the id of the edge the named vehicle +% was at within the last step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getRoadID.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +roadID = traci.vehicle.getUniversal(constants.VAR_ROAD_ID, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRouteID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRouteID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRouteID.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRouteID.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function routeID = getRouteID(vehID) +%getRouteID +% routeID = getRouteID(VEHID) Returns the id of the route of the named +% vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getRouteID.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +routeID = traci.vehicle.getUniversal(constants.VAR_ROUTE_ID, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoute.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoute.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoute.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getRoute.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function route = getRoute(vehID) +%getRoute Get the vehicle route. +% route = getRoute(VEHID) Returns a cell array of strings containing the +% ids of the edges the vehicle's route is made of. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getRoute.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +route = traci.vehicle.getUniversal(constants.VAR_EDGES, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getShapeClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getShapeClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getShapeClass.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getShapeClass.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function shapeClass = getShapeClass(vehID) +%getShapeClass +% shapeClass = getShapeClass(VEHID) Returns the shape class of this +% vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getShapeClass.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +shapeClass = traci.vehicle.getUniversal(constants.VAR_SHAPECLASS, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSignals.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSignals.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSignals.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSignals.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,30 @@ +function signals = getSignals(vehID) +%getSignals Get the vehicle route. +% signals = getSignals(VEHID) Returns an integer encoding the state of a +% vehicle's signals. +% The following table shows the defined signals. +% +% Name Bit +% VEH_SIGNAL_BLINKER_RIGHT 0 +% VEH_SIGNAL_BLINKER_LEFT 1 +% VEH_SIGNAL_BLINKER_EMERGENCY 2 +% VEH_SIGNAL_BRAKELIGHT 3 +% VEH_SIGNAL_FRONTLIGHT 4 +% VEH_SIGNAL_FOGLIGHT 5 +% VEH_SIGNAL_HIGHBEAM 6 +% VEH_SIGNAL_BACKDRIVE 7 +% VEH_SIGNAL_WIPER 8 +% VEH_SIGNAL_DOOR_OPEN_LEFT 9 +% VEH_SIGNAL_DOOR_OPEN_RIGHT 10 +% VEH_SIGNAL_EMERGENCY_BLUE 11 +% VEH_SIGNAL_EMERGENCY_RED 12 +% VEH_SIGNAL_EMERGENCY_YELLOW 13 + + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSignals.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +signals = traci.vehicle.getUniversal(constants.VAR_SIGNALS, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedDeviation.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedDeviation.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedDeviation.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedDeviation.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function speedDeviation = getSpeedDeviation(vehID) +%getSpeedDeviation +% speedDeviation = getSpeedDeviation(VEHID) Returns the maximum speed +% deviation of the vehicle type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSpeedDeviation.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +speedDeviation = traci.vehicle.getUniversal(constants.VAR_SPEED_DEVIATION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedFactor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedFactor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedFactor.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedFactor.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function speedFactor = getSpeedFactor(vehID) +%getSpeedFactor +% speedFactor = getSpeedFactor(VEHID) Returns the chosen speed factor for +% this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSpeedFactor.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +speedFactor = traci.vehicle.getUniversal(constants.VAR_SPEED_FACTOR, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function speed = getSpeed(vehID) +%getSpeed Get the vehicle speed. +% speed = getSpeed(VEHID) Returns the speed in m/s of the named vehicle +% within the last step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +speed = traci.vehicle.getUniversal(constants.VAR_SPEED, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedWithoutTraCI.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedWithoutTraCI.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedWithoutTraCI.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSpeedWithoutTraCI.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,8 @@ +function speedWithoutTraCI = getSpeedWithoutTraCI(vehID) +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSpeedWithoutTraCI.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +speedWithoutTraCI = traci.vehicle.getUniversal(constants.VAR_SPEED_WITHOUT_TRACI, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function subscriptionResults = getSubscriptionResults(vehID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(VEHICLEID) Returns the +% subscription results for the last time step and the given vehicle. If no +% vehicle id is given, all subscription results are returned in a +% containers.Map data structure. +% If the vehicle id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global vehSubscriptionResults +if isempty(vehSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + vehID = 'None'; +end + +subscriptionResults = vehSubscriptionResults.get(vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTau.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTau.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTau.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTau.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function tau = getTau(vehID) +%getTau +% tau = getTau(VEHID) Returns the driver's reaction time in s for this +% vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getTau.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +tau = traci.vehicle.getUniversal(constants.VAR_TAU, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTypeID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTypeID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTypeID.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getTypeID.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function typeID = getTypeID(vehID) +%getTypeID +% typeID = getTypeID(VEHID) Returns the id of the type of the named +% vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getTypeID.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +typeID = traci.vehicle.getUniversal(constants.VAR_TYPE, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, vehID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global vehSubscriptionResults + +if isempty(vehSubscriptionResults) + returnValueFunc = traci.RETURN_VALUE_FUNC.vehicle; +else + returnValueFunc = vehSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_VEHICLE_VARIABLE,varID,vehID); +handleReturValueFunc = str2func(returnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getVehicleClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getVehicleClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getVehicleClass.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getVehicleClass.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function vehicleClass = getVehicleClass(vehID) +%getVehicleClass +% vehicleClass = getVehicleClass(VEHID) Returns the vehicle class of this +% vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getVehicleClass.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +vehicleClass = traci.vehicle.getUniversal(constants.VAR_VEHICLECLASS, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getWidth.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getWidth.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/getWidth.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/getWidth.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function width = getWidth(vehID) +%getWidth +% width = getWidth(VEHID) Returns the width in m of this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getWidth.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +width = traci.vehicle.getUniversal(constants.VAR_WIDTH, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/isRouteValid.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/isRouteValid.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/isRouteValid.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/isRouteValid.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function isvalid = isRouteValid(vehID) +%isRouteValid +% isvalid = isRouteValid(VEHID) Determine whether the current route of the +% vehicle is valid (i.e. all the edges along the route are connected). + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: isRouteValid.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +isvalid = traci.vehicle.getUniversal(constants.VAR_ROUTE_VALID, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveTo.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveTo.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveTo.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveTo.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,21 @@ +function moveTo(vehID, laneID, pos) +%moveTo +% moveTo(VEHID,LANEID,POS) Commands the vehicle to move to the specified +% position on the given lane. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: moveTo.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MOVE_TO, vehID,... + 1+4+1+4+length(laneID)+1+8); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(2)]; +message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... + traci.packInt32(length(laneID)) uint8(laneID)]; +message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... + traci.packInt32(pos)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveToVTD.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveToVTD.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveToVTD.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/moveToVTD.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,22 @@ +function moveToVTD(vehID, edgeID, lane, x, y) +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: moveToVTD.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message + +traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MOVE_TO_VTD,... + vehID,1+4+1+4+length(edgeID)+1+4+1+8+1+8); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(4)]; +message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... + traci.packInt32(length(edgeID)) uint8(edgeID)]; +message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... + traci.packInt32(lane)]; +message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... + traci.packInt64(x)]; +message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... + traci.packInt64(y)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/readBestLanes.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/readBestLanes.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/readBestLanes.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/readBestLanes.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,31 @@ +function lanes = readBestLanes(result) +%readBestLanes Internal function to read information about the whish to use +%subsequent edge's lanes. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: readBestLanes.m 20 2015-03-02 16:52:32Z afacostag $ + +result.read(5); +nbLanes = result.readInt(); % Length +lanes = cell(1,nbLanes); +for i=1:nbLanes + result.read(1); + laneID = result.readString(); + result.read(1); + len = result.readDouble(); + result.read(1); + occupation = result.readDouble(); + result.read(1); + offset = result.read(1); + result.read(1); + allowsContinuation = result.read(1); + result.read(1); + nextLanesNo = result.readInt(); + nextLanes = cell(1,nextLanesNo); + for j=1:nextLanesNo + nextLanes{j} = result.readString(); + end + lanes{i} = {laneID, len, occupation, offset, allowsContinuation, nextLanes}; +end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/remove.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/remove.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/remove.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/remove.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,17 @@ +function remove(vehID, reason) +%remove Remove vehicle. +% remove(VEHID,REASON) Remove vehicle with the given ID for the given +% reason. Reasons are defined in traci.constants and start with REMOVE_ + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: remove.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants + +if nargin < 2 + reason = sscanf(constants.REMOVE_VAPORIZED,'%x'); +end + +traci.sendByteCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.REMOVE, vehID, reason); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteEffort.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteEffort.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteEffort.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteEffort.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,19 @@ +function rerouteEffort(vehID) +%rerouteEffort Compute new route based on the edges' assigned effort. +% rerouteEffort(VEHID) Computes a new route using the vehicle's internal +% and the global edge effort information. Replaces the current route by +% the found. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: rerouteEffort.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message + +traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_REROUTE_EFFORT, vehID,... + 1+4); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(0)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteTraveltime.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/rerouteTraveltime.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,19 @@ +function rerouteTraveltime(vehID) +%rerouteTraveltime Compute new route based on the edges' assigned travel time. +% rerouteTraveltime(VEHID) Computes a new route using the vehicle's +% internal and the global edge travel time information. Replaces the +% current route by the found. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: rerouteTraveltime.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message + +traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_REROUTE_TRAVELTIME, vehID,... + 1+4); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(0)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAccel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAccel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAccel.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAccel.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setAccel(vehID, accel) +%setAccel Set the acceleration of the vehicle. +% setAccel(VEHID,ACCEL) Sets the maximum acceleration in m/s^2 for this +% vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setAccel.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_ACCEL, vehID, accel); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAdaptedTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAdaptedTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAdaptedTraveltime.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setAdaptedTraveltime.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,24 @@ +function setAdaptedTraveltime(vehID, begTime, endTime, edgeID, time) +%setAdaptedTraveltime Assign edge's travel time to vehicle's container. +% setAdaptedTraveltime(VEHID,BEGTIME,ENDTIME,EDGEID,TIME) Inserts the +% information about the travel time of edge EDGEID valid from BEGTIME +% time to ENDTIME time into the vehicle's internal edge weights container. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setAdaptedTraveltime.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message + +traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_EDGE_TRAVELTIME, vehID,... + 1+4+1+4+1+4+1+4+length(edgeID)+1+8); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(4) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... + traci.packInt32(begTime) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... + traci.packInt32(endTime) uint8(sscanf(constants.TYPE_STRING,'%x')) ... + traci.packInt32(length(edgeID)) uint8(edgeID)]; +message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... + traci.packInt64(time)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setColor.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setColor.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,16 @@ +function setColor(vehID, color) +%setColor Set the color of the vehicle. +% setColor(VEHID,COLOR) Sets color for vehicle with the given ID, i.e. +% (255,0,0,0) for the color red. The fourth integer (alpha) is currently +% ignored + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setColor.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_COLOR, vehID, 1+1+1+1+1); +message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setDecel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setDecel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setDecel.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setDecel.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setDecel(vehID, decel) +%setDecel +% setDecel(VEHID,DECEL) Sets the maximum deceleration in m/s^2 for this +% vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setDecel.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_DECEL, vehID, decel); diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEffort.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEffort.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEffort.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEffort.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,24 @@ +function setEffort(vehID, begTime, endTime, edgeID, effort) +%setEffort +% setEffort(VEHID,BEGTIME,ENDTIME,EDGEID,EFFORT) Inserts the information +% about the effort of edge EDGEID valid from BEGTIME time to ENDTIME time +% into the vehicle's internal edge weights container. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setEffort.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message + +traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_EDGE_EFFORT, vehID,... + 1+4+1+4+1+4+1+4+length(edgeID)+1+4); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(int32(4)) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... + traci.packInt32(int32(begTime)) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... + traci.packInt32(int32(endTime)) uint8(sscanf(constants.TYPE_STRING,'%x')) ... + traci.packInt32(int32(length(uint8(edgeID)))) uint8(edgeID)]; +message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... + traci.packInt64(effort)]; +traci.sendExact() \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEmissionClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEmissionClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEmissionClass.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setEmissionClass.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function setEmissionClass(vehID, clazz) +%setEmissionClass +% setEmissionClass(VEHID,CLASS) Sets the emission class for this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setEmissionClass.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_EMISSIONCLASS, vehID, clazz); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setImperfection.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setImperfection.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setImperfection.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setImperfection.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function setImperfection(vehID, imperfection) +%setImperfection +% setImperfection(VEHID,IMPERFECTION) Sets the driver's imperfection +% (dawdling). IMPERFECTION is a double precision integer ranging from +% zero to one. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setImperfection.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_IMPERFECTION, vehID, imperfection); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLaneChangeMode.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLaneChangeMode.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLaneChangeMode.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLaneChangeMode.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,18 @@ +function setLaneChangeMode(vehID, lcm) + +% setLaneChangeMode(VEHID, LCM)Sets the vehicle's lane change mode as a +% bitset. For further details, see 'lane change mode' in +% http://sumo.dlr.de/wiki/TraCI/Change_Vehicle_State + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id$ + +import traci.constants +traci.sendIntCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_LANECHANGEMODE, vehID, lcm); + + + + + diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLength.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setLength.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function setLength(vehID, length) +%setLength +% setLength(VEHID,LENGTH) Sets the length in m for the given vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setLength.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_LENGTH, vehID, length); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMaxSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function setMaxSpeed(vehID, speed) +%setMaxSpeed +% setMaxSpeed(VEHID,SPEED) Sets the maximum speed in m/s for this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MAXSPEED, vehID, speed); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMinGap.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMinGap.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMinGap.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setMinGap.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setMinGap(vehID, minGap) +%setMinGap +% setMinGap(VEHID,MINGAP) Sets the offset (gap to front vehicle if +% halting) for this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setMinGap.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MINGAP, vehID, minGap); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRouteID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRouteID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRouteID.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRouteID.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setRouteID(vehID, routeID) +%setRouteID +% setRouteID(VEHID,ROUTEID) Sets the id of the route for the named +% vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setRouteID.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_ROUTE_ID, vehID, routeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRoute.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRoute.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRoute.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setRoute.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,28 @@ +function setRoute(vehID, edgeList) +%setRoute Set the route of the vehicle. +% setRoute(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: +% traci.vehicle.setRoute{'1', {'1', '2', '4', '6', '7'}} +% +% changes the route for vehicle id 1 to edges 1-2-4-6-7. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setRoute.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message + +traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_ROUTE, vehID,... + 1+4+sum(cellfun('length', edgeList))+4*length(edgeList)); +message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ... + traci.packInt32(length(edgeList))]; +for i=1:length(edgeList) + message.string = [message.string traci.packInt32(length(edgeList{i})) ... + uint8(edgeList{i})]; +end +traci.sendExact() \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setShapeClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setShapeClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setShapeClass.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setShapeClass.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function setShapeClass(vehID, clazz) +%setShapeClass +% setShapeClass(VEHID,CLASS) Sets the shape class for this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setShapeClass.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SHAPECLASS, vehID, clazz); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSignals.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSignals.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSignals.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSignals.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,29 @@ +function setSignals(vehID, signals) +%setSignals +% setSignalsVEHID,SIGNALS) Sets an integer encoding the state of the +% vehicle's signals. +% The following table shows the defined signals. +% +% Name Bit +% VEH_SIGNAL_BLINKER_RIGHT 0 +% VEH_SIGNAL_BLINKER_LEFT 1 +% VEH_SIGNAL_BLINKER_EMERGENCY 2 +% VEH_SIGNAL_BRAKELIGHT 3 +% VEH_SIGNAL_FRONTLIGHT 4 +% VEH_SIGNAL_FOGLIGHT 5 +% VEH_SIGNAL_HIGHBEAM 6 +% VEH_SIGNAL_BACKDRIVE 7 +% VEH_SIGNAL_WIPER 8 +% VEH_SIGNAL_DOOR_OPEN_LEFT 9 +% VEH_SIGNAL_DOOR_OPEN_RIGHT 10 +% VEH_SIGNAL_EMERGENCY_BLUE 11 +% VEH_SIGNAL_EMERGENCY_RED 12 +% VEH_SIGNAL_EMERGENCY_YELLOW 13 + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setSignals.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendIntCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SIGNALS, vehID, signals); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedDeviation.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedDeviation.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedDeviation.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedDeviation.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setSpeedDeviation(vehID, deviation) +%setSpeedDeviation +% setSpeedDeviation(VEHID,DEVIATION) Sets the maximum speed deviation for +% this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setSpeedDeviation.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEED_DEVIATION, vehID, deviation); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedFactor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedFactor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedFactor.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedFactor.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setSpeedFactor(vehID, factor) +%setSpeedFactor +% setSpeedFactor(VEHID,FACTOR) Sets the speed factor for the named +% vehicle within the last step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setSpeedFactor.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEED_FACTOR, vehID, factor); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setSpeed(vehID, speed) +%setSpeed +% setSpeed(VEHID,SPEED) Sets the speed in m/s for the named vehicle +% within the last step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEED, vehID, speed); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedMode.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedMode.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedMode.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setSpeedMode.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,19 @@ +function setSpeedMode(vehID, sm) + +% setSpeedMode(VEHID, SM) Sets the vehicle's speed mode as a bitset. For +% further details, see 'speed mode' in http://sumo.dlr.de/wiki/TraCI/Change_Vehicle_State + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id$ + + +import traci.constants +traci.sendIntCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEEDSETMODE, vehID, sm); + + + + + + diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setStop.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setStop.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setStop.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setStop.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function setStop(vehID, edgeID, pos, laneIndex, duration) +%setStop Set a stop for the vehicle. +% setStop(VEHID,EDGEID) Sets a stop for the vehicle VEHID in the edge +% EDGEID for the maximum allowed time. The position and the lane index +% default to one and zero respectively. +% setStop(...,POS) Specify the position of the stop in the lane. +% setStop(...,LANEINDEX) Specify the lane index in which the stop will be +% made. +% setStop(...,DURATION) Specify the duration of the stop. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setStop.m 20 2015-03-02 16:52:32Z afacostag $ + + +import traci.constants +global message +if nargin < 5 + duration = 2^31-1; + if nargin < 4 + laneIndex = 0; + if nargin < 3 + pos = 1; + end + end +end +traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_STOP,... + vehID, 1+4+1+4+length(edgeID)+1+8+1+1+1+4); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(4)]; +message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... + traci.packInt32(length(edgeID)) uint8(edgeID)]; +message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... + traci.packInt64(pos) uint8([sscanf(constants.TYPE_BYTE,'%x') ... + laneIndex sscanf(constants.TYPE_INTEGER,'%x')]) ... + traci.packInt32(duration)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setTau.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setTau.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setTau.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setTau.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function setTau(vehID, tau) +%setTau +% setTau(VEHID,TAU) Sets the driver's reaction time in s for this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setTau.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_TAU, vehID, tau); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setVehicleClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setVehicleClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setVehicleClass.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setVehicleClass.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setVehicleClass(vehID, clazz) +%setVehicleClass +% setVehicleClass(VEHID,CLASS) Sets the vehicle class for this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setVehicleClass.m 20 2015-03-02 16:52:32Z afacostag $ + + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_VEHICLECLASS, vehID, clazz); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setWidth.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setWidth.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/setWidth.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/setWidth.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function setWidth(vehID, width) +%setWidth +% setWidth(VEHID,WIDTH) Sets the width in m for this vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setWidth.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_WIDTH, vehID, width); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/slowDown.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/slowDown.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/slowDown.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/slowDown.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,19 @@ +function slowDown(vehID, speed, duration) +%slowDown +% slowDown(VEHID,SPEED,DURATION) Reduces the speed of the vehicle to the +% given for the given amount of time. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: slowDown.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_SLOWDOWN,... + vehID, 1+4+1+8+1+4); +message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... + traci.packInt32(2) uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... + traci.packInt64(speed) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... + traci.packInt32(duration)]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,46 @@ +function subscribeContext(vehID, domain, dist, varargin) +%subscribeContext Subscribe to a vehicle's context variable. +% subscribeContext(VEHID,DOMAIN,DIST) Subscribe to the VAR_ROAD_ID and +% VAR_LANEPOSITION value of the SUMO objects that surround the vehicle +% specified by VEHID at a distance given by DIST, for the maximum allowed +% interval. The type of objets that surround the vehicle are defined in +% the DOMAIN parameter. Note that not all the SUMO object types support +% the variables VAR_ROAD_ID and VAR_LANEPOSITION. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global vehSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'vehicle.subscribeContext'; +p.addRequired('vehID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.VAR_ROAD_ID, constants.VAR_LANEPOSITION}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(vehID, domain, dist, varargin{:}) +vehID = p.Results.vehID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +vehSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicle); + +vehSubscriptionResults.reset() +traci.subscribeContext(constants.CMD_SUBSCRIBE_VEHICLE_CONTEXT,... + subscriptionBegin, subscriptionEnd, vehID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicle/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function subscribe(vehID, varargin) +%subscribe Subscribe to vehicle variable. +% subscribe(VEHID) Subscribe to the VAR_ROAD_ID and VAR_LANEPOSITION +% values for the maximum allowed interval. +% subscribe(VEHID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global vehSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'vehicle.subscribe'; +p.addRequired('vehID',@ischar) +p.addOptional('varIDs', {constants.VAR_ROAD_ID, constants.VAR_LANEPOSITION}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(vehID, varargin{:}) +vehID = p.Results.vehID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +vehSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicle); + +vehSubscriptionResults.reset() +traci.subscribe(constants.CMD_SUBSCRIBE_VEHICLE_VARIABLE,... + subscriptionBegin, subscriptionEnd, vehID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getAccel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getAccel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getAccel.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getAccel.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function accel = getAccel(typeID) +%getAccel +% accel = getAccel(TYPEID) Returns the maximum acceleration in m/s^2 of +% vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getAccel.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +accel = traci.vehicletype.getUniversal(constants.VAR_ACCEL, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getColor.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getColor.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function color = getColor(typeID) +%getColor +% color = getColor(TYPEID)Returns the color of this type of vehicle. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getColor.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +color = traci.vehicletype.getUniversal(constants.VAR_COLOR, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getContextSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function ContextSubscriptionResults = getContextSubscriptionResults(typeID) +%getContextSubscriptionResults Get the context subscription results for the +% last time step. +% contextSubscriptionResults = getContextSubscriptionResults(TYPEID) +% Returns the context subscription results for the last time step and the +% given vehicle type. If no vehicle type id is given, all subscription +% results are returned in a containers.Map data struccure. If the vehicle +% type id is unknown or the subscription did for any reason return no +% data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getContextSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global typeSubscriptionResults +if isempty(typeSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + typeID=None; +end +ContextSubscriptionResults = typeSubscriptionResults.getContext(typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getDecel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getDecel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getDecel.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getDecel.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function decel = getDecel(typeID) +%getDecel +% decel = getDecel(TYPEID) Returns the maximum deceleration in m/s^2 of +% vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getDecel.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +decel = traci.vehicletype.getUniversal(constants.VAR_DECEL, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getEmissionClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getEmissionClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getEmissionClass.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getEmissionClass.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function emissionClass = getEmissionClass(typeID) +%getEmissionClass +% emissionClass = getEmissionClass(TYPEID) Returns the emission class of +% vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getEmissionClass.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +emissionClass = traci.vehicletype.getUniversal(constants.VAR_EMISSIONCLASS, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getIDList.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getIDList.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function IDList = getIDList() +%getIDList Get the IDs of the vehicle types in the network. +% IDList = getIDList() Returns a cell array of strings containing the IDs +% of the vehicle types in the SUMO network. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getIDList.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +IDList = traci.vehicletype.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getImperfection.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getImperfection.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getImperfection.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getImperfection.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function imperfection = getImperfection(typeID) +%getImperfection +% imperfection = getImperfection(TYPEID) Returns the driver's imperfection +% (dawdling) [0,1] of vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getImperfection.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +imperfection = traci.vehicletype.getUniversal(constants.VAR_IMPERFECTION, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getLength.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getLength.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function length = getLength(typeID) +%getLength +% length = getLength(TYPEID) Returns the length in m of the vehicles of +% this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getLength.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +length = traci.vehicletype.getUniversal(constants.VAR_LENGTH, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMaxSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function maxSpeed = getMaxSpeed(typeID) +%getMaxSpeed +% maxSpeed = getMaxSpeed(TYPEID) Returns the maximum speed in m/s of +% vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +maxSpeed = traci.vehicletype.getUniversal(constants.VAR_MAXSPEED, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMinGap.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMinGap.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMinGap.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getMinGap.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function minGap = getMinGap(typeID) +%getMinGap +% minGap = getMinGap(TYPEID) Returns the offset (gap to front vehicle if +% halting) of vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getMinGap.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +minGap = traci.vehicletype.getUniversal(constants.VAR_MINGAP, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getShapeClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getShapeClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getShapeClass.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getShapeClass.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function shapeClass = getShapeClass(typeID) +%getShapeClass +% shapeClass = getShapeClass(TYPEID) Returns the shape class of vehicles +% of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getShapeClass.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +shapeClass = traci.vehicletype.getUniversal(constants.VAR_SHAPECLASS, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedDeviation.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedDeviation.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedDeviation.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedDeviation.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function speedDeviation = getSpeedDeviation(typeID) +%getSpeedDeviation +% speedDeviation = getSpeedDeviation(TYPEID) Returns the maximum speed +% deviation of vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSpeedDeviation.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +speedDeviation = traci.vehicletype.getUniversal(constants.VAR_SPEED_DEVIATION, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedFactor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedFactor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedFactor.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSpeedFactor.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function speedFactor = getSpeedFactor(typeID) +%getSpeedFactor +% speedFactor = getSpeedFactor(TYPEID) Returns the chosen speed factor for +% vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSpeedFactor.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +speedFactor = traci.vehicletype.getUniversal(constants.VAR_SPEED_FACTOR, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getSubscriptionResults.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,26 @@ +function subscriptionResults = getSubscriptionResults(typeID) +%getSubscriptionResults Get the subscription results for the last time step. +% subscriptionResults = getSubscriptionResults(TYPEID) Returns the +% subscription results for the last time step and the given vehicle type. +% If no vehicle type id is given, all subscription results are returned +% in a containers.Map data structure. +% If the vehicle type id is unknown or the subscription did for any reason return +% no data, 'None' is returned. +% It is not possible to retrieve older subscription results than the ones +% from the last time step. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getSubscriptionResults.m 20 2015-03-02 16:52:32Z afacostag $ + +global typeSubscriptionResults +if isempty(typeSubscriptionResults) + throw(MException('traci:FatalTraCIError',... + 'You have to subscribe to the variable')); +end +if nargin < 1 + typeID = 'None'; +end + +subscriptionResults = typeSubscriptionResults.get(typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getTau.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getTau.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getTau.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getTau.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function tau = getTau(typeID) +%getTau +% tau = getTau(TYPEID) Returns the driver's reaction time in s for +% vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getTau.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +tau = traci.vehicletype.getUniversal(constants.VAR_TAU, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getUniversal.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,25 @@ +function returnedValue = getUniversal(varID, typeID) +%getUniversal An internal function to send the get command and read the +%variable value. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getUniversal.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global typeSubscriptionResults + +if isempty(typeSubscriptionResults) + returnValueFunc = traci.RETURN_VALUE_FUNC.vehicletype; +else + returnValueFunc = typeSubscriptionResults.valueFunc; +end + +% Prepare the outgoing message and read the response. The result variable +% is a traci.Storage object +result = traci.sendReadOneStringCmd(constants.CMD_GET_VEHICLETYPE_VARIABLE,varID,typeID); +handleReturValueFunc = str2func(returnValueFunc(varID)); + +% Use the proper method to read the variable of interest from the result +returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getVehicleClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getVehicleClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getVehicleClass.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getVehicleClass.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function vehicleClass = getVehicleClass(typeID) +%getVehicleClass +% vehicleClass = getVehicleClass(TYPEID) Returns the class of vehicles of +% this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getVehicleClass.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +vehicleClass = traci.vehicletype.getUniversal(constants.VAR_VEHICLECLASS, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getWidth.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getWidth.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getWidth.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/getWidth.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function width = getWidth(typeID) +%getVehicleClass +% vehicleClass = getVehicleClass(TYPEID) Returns the width in m of +% vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: getWidth.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +width = traci.vehicletype.getUniversal(constants.VAR_WIDTH, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setAccel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setAccel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setAccel.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setAccel.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setAccel(typeID, accel) +%setAccel +% setAccel(TYPEID,ACCEL) Sets the maximum acceleration in m/s^2 of +% vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setAccel.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_ACCEL, typeID, accel); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setColor.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setColor.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,16 @@ +function setColor(typeID, color) +%setColor Set the color of the vehicle. +% setColor(TYPEID,COLOR) Sets color for vehicle vehicles of this type, +% i.e. (255,0,0,0) for the color red. The fourth integer (alpha) is +% currently ignored + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setColor.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +global message +traci.beginMessage(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_COLOR, typeID, 1+1+1+1+1); +message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])]; +traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setDecel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setDecel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setDecel.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setDecel.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setDecel(typeID, decel) +%setDecel +% setDecel(TYPEID,DECEL) Sets the maximum deceleration in m/s^2 of +% vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setDecel.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_DECEL, typeID, decel); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setEmissionClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setEmissionClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setEmissionClass.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setEmissionClass.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setEmissionClass(typeID, clazz) +%setEmissionClass +% setEmissionClass(TYPEID,CLASS) Sets the emission class of vehicles of +% this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setEmissionClass.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_EMISSIONCLASS, typeID, clazz); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setImperfection.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setImperfection.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setImperfection.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setImperfection.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,13 @@ +function setImperfection(typeID, imperfection) +%setImperfection +% setImperfection(TYPEID,IMPERFECTION) Sets the driver's imperfection +% (dawdling) for vehicles of this class. IMPERFECTION is a double +% precision integer rnging from zero to one. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setImperfection.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_IMPERFECTION, typeID, imperfection); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setLength.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setLength.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setLength(typeID, length) +%setLength +% setLength(TYPEID,LENGTH) Sets the length in m of the vehicles of this +% type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setLength.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_LENGTH, typeID, length); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMaxSpeed.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setMaxSpeed(typeID, speed) +%setMaxSpeed +% setMaxSpeed(TYPEID,SPEED) Sets the maximum speed in m/s of vehicles of +% this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setMaxSpeed.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_MAXSPEED, typeID, speed); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMinGap.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMinGap.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMinGap.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setMinGap.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setMinGap(typeID, minGap) +%setMinGap +% setMinGap(TYPEID,MINGAP) Sets the offset (gap to front vehicle if +% halting) of vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setMinGap.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_MINGAP, typeID, minGap); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setShapeClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setShapeClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setShapeClass.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setShapeClass.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setShapeClass(typeID, clazz) +%setShapeClass +% setShapeClass(TYPEID,CLASS) Sets the shape class of vehicles of this +% type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setShapeClass.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_SHAPECLASS, typeID, clazz); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedDeviation.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedDeviation.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedDeviation.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedDeviation.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setSpeedDeviation(typeID, deviation) +%setSpeedDeviation +% setSpeedDeviation(TYPEID,DEVIATION) Sets the maximum speed deviation of +% vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setSpeedDeviation.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_SPEED_DEVIATION, typeID, deviation); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedFactor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedFactor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedFactor.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setSpeedFactor.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setSpeedFactor(typeID, factor) +%setSpeedFactor +% setSpeedFactor(TYPEID,FACTOR) Sets the speed factor for the vehicles of +% this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setSpeedFactor.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_SPEED_FACTOR, typeID, factor); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setTau.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setTau.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setTau.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setTau.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,12 @@ +function setTau(typeID, tau) +%setTau +% setTau(TYPEID,TAU) Sets the driver's reaction time in s for vehicles of +% this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setTau.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_TAU, typeID, tau); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setVehicleClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setVehicleClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setVehicleClass.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setVehicleClass.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function setVehicleClass(typeID, clazz) +%setVehicleClass +% setVehicleClass(TYPEID,CLASS) Sets the class of vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setVehicleClass.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendStringCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_VEHICLECLASS, typeID, clazz); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setWidth.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setWidth.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setWidth.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/setWidth.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,11 @@ +function setWidth(typeID, width) +%setWidth +% setWidth(TYPEID,WIDTH) Sets the width in m of vehicles of this type. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: setWidth.m 20 2015-03-02 16:52:32Z afacostag $ + +import traci.constants +traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_WIDTH, typeID, width); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribeContext.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,46 @@ +function subscribeContext(typeID, domain, dist, varargin) +%subscribeContext Subscribe to a vehicle type's context variable. +% subscribeContext(TYPEID,DOMAIN,DIST) Subscribe to the VAR_MAXSPEED +% value of the SUMO objects that surround the vehicle type specified by +% TYPEID at a distance given by DIST, for the maximum allowed interval. +% The type of objets that surround the vehicle type are defined in the +% DOMAIN parameter. Note that not all the SUMO object types support the +% variable VAR_MAXSPEED. +% subscribeContext(...,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS. +% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the +% maximum allowed end time. +% subscribeContext(...,END) Subscribe for the time interval defined by +% BEGIN and END. +% A call to this method clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribeContext.m 20 2015-03-02 16:52:32Z afacostag $ + +global typeSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'type.subscribeContext'; +p.addRequired('typeID',@ischar) +p.addRequired('domain',@ischar) +p.addRequired('dist',@isnumeric) +p.addOptional('varIDs', {constants.VAR_MAXSPEED}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(typeID, domain, dist, varargin{:}) +typeID = p.Results.typeID; +domain = p.Results.domain; +dist = p.Results.dist; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +typeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicletype); + +typeSubscriptionResults.reset() +traci.subscribeContext(constants.CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT,... + subscriptionBegin, subscriptionEnd, typeID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribe.m 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/+traci/+vehicletype/subscribe.m 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,38 @@ +function subscribe(typeID, varargin) +%subscribe Subscribe to vehicle type variable. +% subscribe(TYPEID) Subscribe to the VAR_MAXSPEED value for the maximum +% allowed interval. +% subscribe(TYPEID,VARIDS) Subscribe to the values given in the cell +% array of strings VARIDS for the maximum allowed interval. +% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum +% allowed end time. +% subscribe(...,END) Subscribe for the time interval defined by BEGIN and +% END. +% A call to this function clears all previous subscription results. + +% Copyright 2015 Universidad Nacional de Colombia, +% Politecnico Jaime Isaza Cadavid. +% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. +% $Id: subscribe.m 20 2015-03-02 16:52:32Z afacostag $ + +global typeSubscriptionResults +import traci.constants + +% Parse the input +p = inputParser; +p.FunctionName = 'vehicletype.subscribe'; +p.addRequired('typeID',@ischar) +p.addOptional('varIDs', {constants.VAR_MAXSPEED}, @iscell) +p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) +p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) +p.parse(typeID, varargin{:}) +typeID = p.Results.typeID; +varIDs = p.Results.varIDs; +subscriptionBegin = p.Results.subscriptionBegin; +subscriptionEnd = p.Results.subscriptionEnd; + +typeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicletype); + +typeSubscriptionResults.reset() +traci.subscribe(constants.CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE,... + subscriptionBegin, subscriptionEnd, typeID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/examples/traci_test2.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/examples/traci_test2.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/examples/traci_test2.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/examples/traci_test2.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,602 +0,0 @@ -%% TRACI TEST 2 -% This m-file shows how to use Traci4Matlab. -% This example uses the files of the SUMO traci tutorial, see -% http://sumo-sim.org/userdoc/Tutorials/TraCI4Traffic_Lights.html. If you -% want to test a TraCI command, just uncomment it. The commands are -% organized by SUMO object type, some of them needed to be included in -% the main loop of the script. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: traci_test2.m 17 2014-05-30 14:32:09Z afacostag $ - -clear all -close all -clc - -%% MAIN -% The scenario consists of a single intersection controlled by a traffic light -% whose phases are changed if vehicles pass through an induction loop. - -% Initialize SUMO from the system. note that it is initialized in graphical -% interface mode. You have to set the SUMO_HOME environment variable -% pointing to your SUMO root directory and modify the windows path to -% include the %SUMO_HOME%/bin directory. - -try - system(['sumo-gui -c ' getenv('SUMO_HOME') '\docs\tutorial\traci_tls\data\cross.sumocfg&']); -catch err -end - - -% To test sine vehicle commands, we have to check wether the sumo 0.20.0 -% version is installed, because in that version the prefix of the vehicle -% names has changed. -if isempty(strfind(getenv('SUMO_HOME'),'sumo-0.20.0')) - testVehicle = '10'; -else - testVehicle = 'right_10'; -end - -import traci.constants - -% Initialize TraCI -traci.init(); - -% Define the traffic light phases in a sumo-readable way -NSGREEN = 'GrGr'; -NSYELLOW = 'yryr'; -WEGREEN = 'rGrG'; -WEYELLOW = 'ryry'; - -% Define the traffic light program. The duration of the phases is based on -% the time required for a car to cross the traffic light from north to -% south -PROGRAM = {WEYELLOW,WEYELLOW,WEYELLOW,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSGREEN,NSYELLOW,NSYELLOW,WEGREEN}; - -programPointer = length(PROGRAM); -step = 0; -% steps = zeros(1,800); - - -%% GETIDLIST COMMANDS - - -% areal_dets = traci.areal.getIDList(); -% fprintf('IDs of the areal detectors in the simulation:\n') -% for i=1:length(areal_dets) -% fprintf('%s\n',areal_dets{i}); -% end -% edges = traci.edge.getIDList(); -% fprintf('IDs of the edges in the simulation:\n') -% for i=1:length(edges) -% fprintf('%s\n',edges{i}); -% end -% views = traci.gui.getIDList(); -% fprintf('IDs of the views in the simulacion:\n') -% for i=1:length(views) -% fprintf('%s\n',views{i}); -% end -% inductionloops = traci.inductionloop.getIDList(); -% fprintf('IDs of the induction loops in the simulation:\n') -% for i=1:length(inductionloops) -% fprintf('%s\n',inductionloops{i}); -% end -% junctions = traci.junction.getIDList(); -% fprintf('IDs of the junctions in the simulation:\n') -% for i=1:length(junctions) -% fprintf('%s\n',junctions{i}); -% end -% lanes = traci.lane.getIDList(); -% fprintf('IDs of the lanes in the simulation:\n') -% for i=1:length(lanes) -% fprintf('%s\n',lanes{i}); -% end -% detectors = traci.multientryexit.getIDList(); -% fprintf('IDs of the multi-entry/multi-exit detectors in the simulation:\n') -% for i=1:length(detectors) -% fprintf('%s\n',detectors{i}); -% end -% polygons = traci.polygon.getIDList(); -% fprintf('IDs of te polygons in the simulation:\n') -% for i=1:length(polygons) -% fprintf('%s\n',polygons{i}); -% end -% routes = traci.route.getIDList(); -% fprintf('IDs of the routes in the simulation:\n') -% for i=1:length(routes) -% fprintf('%s\n',routes{i}); -% end -% trafficlights = traci.trafficlights.getIDList(); -% fprintf('IDs of the traffic lights in the simulation:\n') -% for i=1:length(trafficlights) -% fprintf('%s\n',trafficlights{i}); -% end -% vehicletypes = traci.vehicletype.getIDList(); -% fprintf('IDs of the vehicle types in the simulation:\n') -% for i=1:length(vehicletypes) -% fprintf('%s\n',vehicletypes{i}); -% end - -% THE GETIDLIST COMMAND FOR POIS AND POLYGONS IS TESTED AFTER ADDING THOSE -% OBJECTS TO THE SIMULATION -% -% THE GETIDLIST COMMAND FOR VEHICLES IS PERFOMED ONCE THE VEHICLES ARE -% LOADED IN THE NETWORK, IN THE MAIN LOOP - - -%% SUBSCIBE COMMANDS: Note that you have to create the required detectors in the cross.det.xml file - -% traci.edge.subscribe('1i'); -% traci.gui.subscribe('View #0'); -% traci.inductionloop.subscribe('0'); -% traci.junction.subscribe('0'); -% traci.lane.subscribe('1i_0'); -% traci.multientryexit.subscribe('e3_0_1i'); -% traci.route.subscribe('down'); -% traci.simulation.subscribe(); -% traci.trafficlights.subscribe('0',{constants.TL_RED_YELLOW_GREEN_STATE}); -% tlsCurrentPhaseHandle = traci.trafficlights.getSubscriptionResults('0'); -% tlsCurrentPhase = tlsCurrentPhaseHandle(constants.TL_RED_YELLOW_GREEN_STATE); -% fprintf('Traffic lights phase: %s\n', tlsCurrentPhase) -% traci.vehicle.subscribe(testVehicle); -% traci.vehicletype.subscribe('typeWE'); -% maxSpeedWEHandle = traci.vehicletype.getSubscriptionResults('typeWE'); -% maxSpeedWE = maxSpeedWEHandle(constants.VAR_MAXSPEED); - -%% POI AND POLYGON COMMANDS - -% traci.poi.add('mypoi', 550, 550, [255 255 0 0], '', 1); -% pois = traci.poi.getIDList(); -% fprintf('IDs of the pois in the simulation:\n') -% for i=1:length(pois) -% fprintf('%s\n',pois{i}); -% end -% traci.poi.subscribe('mypoi'); -% poiposition = traci.poi.getPosition('mypoi') -% poiColor = traci.poi.getColor('mypoi') -% traci.poi.setType('mypoi', 'mypoitype'); -% poitype = traci.poi.getType('mypoi') -% traci.poi.setPosition('mypoi', 550, 580); -% poiposition = traci.poi.getPosition('mypoi') -% traci.poi.setColor('mypoi', [255 255 255 0]); -% % traci.poi.remove('mypoi', 1); -% -% traci.polygon.add('mypolygon', {[440,440],[440,450],[450,440],[450,450]},... -% [0 255 255 0], false, '', 1); -% traci.polygon.add('my2ndpolygon', {[400,400],[400,420],[430,420],[430,400],[400,400]},... -% [255 0 0 0], true, '', 1); -% polygons = traci.polygon.getIDList(); -% fprintf('IDs of the polygons in the simulation:\n') -% for i=1:length(polygons) -% fprintf('%s\n',polygons{i}); -% end -% traci.polygon.subscribe('mypolygon'); -% polygonColor = traci.polygon.getColor('mypolygon') -% traci.polygon.setType('mypolygon', 'mypolygontype'); -% polygontype = traci.polygon.getType('mypolygon') -% traci.polygon.setShape('mypolygon', {[400,400],[400,420],[430,420],[430,400],[400,400]}); -% polygonshape = traci.polygon.getShape('mypolygon') -% traci.polygon.setColor('mypolygon', [255 255 255 0]); -% traci.polygon.remove('mypolygon', 1); - - -%% CONTEXT SUBSCRIPTIONS -% It's worth noting that, according to -% http://sumo-sim.org/userdoc/TraCI/Object_Context_Subscription.html, only -% the following SUMO objects are supported: inductive loops, lanes, -% vehicles, points-of-interest, polygons, junctions, edges. - -% traci.edge.subscribeContext('4i',constants.CMD_GET_LANE_VARIABLE,50); -% traci.inductionloop.subscribeContext('0',constants.CMD_GET_LANE_VARIABLE,20); -% traci.junction.subscribeContext('0',constants.CMD_GET_VEHICLE_VARIABLE,20); -% traci.lane.subscribeContext('4i_0',constants.CMD_GET_LANE_VARIABLE,50); -% traci.poi.subscribeContext('mypoi',constants.CMD_GET_VEHICLE_VARIABLE,50); -% traci.polygon.subscribeContext('mypolygon',constants.CMD_GET_POLYGON_VARIABLE,30); -% traci.vehicle.subscribeContext(testVehicle,constants.CMD_GET_VEHICLE_VARIABLE,10); -% -% WElaneoccupancy = zeros(1,800); -% NSlaneoccupancy = zeros(1,800); - -% getminexectednumber returns the number of expected vehicles to leave the -% network, which will be the condition to execute the simulation. -% MinExpectedNumber = traci.simulation.getMinExpectedNumber(); - -%% GUI SET COMMANDS -% traci.gui.setZoom('View #0', 1000); -% traci.gui.setOffset('View #0', 523.7211, 525.9342); -% traci.gui.setSchema('View #0', 'real world'); -% traci.gui.setBoundary('View #0', 386.95, 485.88, 651.64, 589.01); -% traci.gui.trackVehicle('View #0', testVehicle); - -%% LANE SET COMMANDS -% traci.lane.setAllowed('1i_0',{'unknown'}); -% traci.lane.setDisallowed('1i_0',{'unknown'}); -% traci.lane.setMaxSpeed('1i_0',5); -% traci.lane.setLength('1i_0',450); - -%% ROUTE COMMANDS -% traci.route.add('up',{'53o','3i','4o','54i'}); -% routeUpEdges = traci.route.getEdges('up') - -%% VEHICLE SET COMMANDS -% traci.vehicle.setMaxSpeed(testVehicle,5); -% traci.vehicle.setStop(testVehicle,'1i',50,0,40000); -% traci.vehicle.changeLane(testVehicle,0,40000); -% traci.vehicle.slowDown(testVehicle,1,180000); -% traci.vehicle.changeTarget(testVehicle,'2o'); -% traci.vehicle.setRouteID(testVehicle,'down'); -% traci.vehicle.setRoute(testVehicle,{'51o' '1i' '2o'}); -% traci.vehicle.setAdaptedTraveltime(testVehicle,10000,50000,'1i',15000); -% % traci.vehicle.setEffort(testVehicle,10000,50000,'1i',0.125); %Not online -% % traci.vehicle.rerouteTraveltime(testVehicle); %Not online -% % traci.vehicle.rerouteEffort(testVehicle); %Not online -% traci.vehicle.setSignals(testVehicle,2); -% traci.vehicle.setSpeed(testVehicle,5); -% traci.vehicle.setColor(testVehicle,[0 0 255 0]); -% traci.vehicle.setLength(testVehicle,10); -% traci.vehicle.setVehicleClass(testVehicle,'unknown'); -% traci.vehicle.setSpeedFactor(testVehicle,0.6); -% % traci.vehicle.setSpeedDeviation(testVehicle,5); %Not online -% traci.vehicle.setEmissionClass(testVehicle,'unknown'); -% traci.vehicle.setWidth(testVehicle,3); -% traci.vehicle.setMinGap(testVehicle,10); -% traci.vehicle.setShapeClass(testVehicle,''); -% traci.vehicle.setAccel(testVehicle,2); -% traci.vehicle.setDecel(testVehicle,2); -% traci.vehicle.setImperfection(testVehicle,1); -% traci.vehicle.setTau(testVehicle,1); -% traci.vehicle.add('myvehicle','down'); -% traci.vehicle.remove('myvehicle'); -% traci.gui.trackVehicle('View #0', 'myvehicle'); -% traci.vehicle.moveToVTD('right_10','2o',0,608,509); - -%% VEHICLE TYPE COMMANDS - -% typeLength = traci.vehicletype.getLength('typeWE') -% typeMaxSpeed = traci.vehicletype.getMaxSpeed('typeWE') -% typeSpeedFactor = traci.vehicletype.getSpeedFactor('typeWE') -% typeSpeedDeviation = traci.vehicletype.getSpeedDeviation('typeWE') -% typeAccel = traci.vehicletype.getAccel('typeWE') -% typeDecel = traci.vehicletype.getDecel('typeWE') -% typeImperfection = traci.vehicletype.getImperfection('typeWE') -% typeTau = traci.vehicletype.getTau('typeWE') -% typeClass = traci.vehicletype.getVehicleClass('typeWE') -% typeEmissionClass = traci.vehicletype.getEmissionClass('typeWE') -% typeShapeClass = traci.vehicletype.getShapeClass('typeWE') -% typeMinGap = traci.vehicletype.getShapeClass('typeWE') -% typeWidth = traci.vehicletype.getWidth('typeWE') -% typeColor = traci.vehicletype.getColor('typeWE') -% -% traci.vehicletype.setLength('typeWE',8); -% traci.vehicletype.setMaxSpeed('typeWE',10); -% traci.vehicletype.setVehicleClass('typeWE','passenger'); -% traci.vehicletype.setSpeedFactor('typeWE',0.8); -% traci.vehicletype.setSpeedDeviation('typeWE',0.2); -% traci.vehicletype.setEmissionClass('typeWE','unknown'); -% traci.vehicletype.setWidth('typeWE',1); -% traci.vehicletype.setMinGap('typeWE',1); -% traci.vehicletype.setShapeClass('typeWE',''); -% traci.vehicletype.setAccel('typeWE',5); -% traci.vehicletype.setDecel('typeWE',3); -% traci.vehicletype.setImperfection('typeWE',0.6); -% traci.vehicletype.setTau('typeWE',0.1); -% traci.vehicletype.setColor('typeWE',[255 255 255 0]); - -%for i=1:length(steps) -while traci.simulation.getMinExpectedNumber()>0 - % Perform a simulation step (one second) - traci.simulationStep(); - programPointer = min(programPointer+1, length(PROGRAM)); - - % Get the number of vehicles that passed through the induction loop in - % the last simulation step - no = traci.inductionloop.getLastStepVehicleNumber('0'); - - % SHOW THE VEHICLES IDS INSIDE THE NETWORK - % vehicles = traci.vehicle.getIDList(); - % fprintf('IDs of the vehicles in the simulation\n') - % for j=1:length(vehicles) - % fprintf('%s\n',vehicles{j}); - % end - - % Subscribe to the vehicle with the id contained in the variable "testVehicle" - % when it is loaded in the network - % if ismember(testVehicle,vehicles) - % testVehicleHandle = traci.vehicle.getSubscriptionResults(testVehicle); - % testVehicleHandle = {testVehicleHandle(constants.VAR_ROAD_ID) testVehicleHandle(constants.VAR_LANEPOSITION)}; - % end - - %% GETSUBSCRIPTIONRESULTS COMMANDS: Note that you have to create the required detectors in the cross.det.xml file - - % occupancyEdge1Handle = traci.edge.getSubscriptionResults('1i'); - % WElaneoccupancy(i) = occupancyEdge1Handle(constants.LAST_STEP_VEHICLE_NUMBER); - % offsethandle = traci.gui.getSubscriptionResults('View #0'); - % offset = offsethandle(traci.constants.VAR_VIEW_OFFSET); - % indloopSubsResults = traci.inductionloop.getSubscriptionResults('0'); - % no = indloopSubsResults(constants.LAST_STEP_VEHICLE_NUMBER); - % junctionPositionHandle = traci.junction.getSubscriptionResults('0'); - % junctionPosition = junctionPositionHandle(constants.VAR_POSITION); - % occupancyLane1Handle = traci.lane.getSubscriptionResults('1i_0'); - % WElaneoccupancy(i) = occupancyLane1Handle(constants.LAST_STEP_VEHICLE_NUMBER); - % occupancyLane1Handle = traci.multientryexit.getSubscriptionResults('e3_0_1i'); - % WElaneoccupancy(i) = occupancyLane1Handle(constants.LAST_STEP_VEHICLE_NUMBER); - % poiPositionHandle = traci.poi.getSubscriptionResults('mypoi'); - % poiPosition = poiPositionHandle(constants.VAR_POSITION); - % polygonPositionHandle = traci.polygon.getSubscriptionResults('mypolygon'); - % polygonPosition = polygonPositionHandle(constants.VAR_SHAPE); - % routeListHandle = traci.route.getSubscriptionResults('down'); - % routeList = routeListHandle(constants.ID_LIST); - % departedVehicleIDsHandle = traci.simulation.getSubscriptionResults(); - % departedVehicleIDs = departedVehicleIDsHandle(constants.VAR_DEPARTED_VEHICLES_IDS); - - %% GET CONTEXT SUBSCRIPTION RESULTS COMMANDS - - % edge4i0ContextResults = traci.edge.getContextSubscriptionResults('4i'); - % occupancy4i0Handle1 = edge4i0ContextResults('4i_0'); - % occupancy4i0 = occupancy4i0Handle1(constants.LAST_STEP_VEHICLE_NUMBER); - % fprintf('%d\n',occupancy4i0); - - % loop0ContextResults = traci.inductionloop.getContextSubscriptionResults('0'); - % priorityVehiclesPassedHandle = loop0ContextResults('4i_0'); - % priorityVehiclesPassed = priorityVehiclesPassedHandle(constants.LAST_STEP_VEHICLE_NUMBER); - % fprintf('%d\n',priorityVehiclesPassed); - - % junctionContextResults = traci.junction.getContextSubscriptionResults('0'); - - % laneContextSubscriptionResults = traci.lane.getContextSubscriptionResults('4i_0'); - % poiContextSubscriptionResults = traci.poi.getContextSubscriptionResults('mypoi'); - % polygonContextSubscriptionResults = traci.polygon.getContextSubscriptionResults('mypolygon'); - % vehicleContextSubscriptionResults = traci.vehicle.getContextSubscriptionResults(testVehicle); - - %% AREAL DETECTOR COMMANDS: Note that you have to create the detector in the cross.det.xml file - % arealDetectorIDCount = traci.areal.getIDCount(); - % fprintf('Number of areal detectors in the simulation: %d\n',arealDetectorIDCount); - - % JamLengthVehicle = traci.areal.getJamLengthVehicle('0'); - % fprintf('Jam lenght in vehicles in the areal detector 0: %d\n',JamLengthVehicle); - - % JamLengthMeters = traci.areal.getJamLengthMeters('0'); - % fprintf('Jam lenght in meters in the areal detector 0: %d\n',JamLengthMeters); - - % vehicleMeanSpeedAreal0 = traci.areal.getLastStepMeanSpeed('0'); - % fprintf('Average speed in the areal detector 0: %d\n',vehicleMeanSpeedAreal0); - - % vehicleOccupancyAreal0 = traci.areal.getLastStepOccupancy('0'); - % fprintf('Occupancy in the areal detector 0 1i: %d\n',vehicleOccupancyAreal0); - - - %% EDGE COMMANDS - - % edgeIDCount = traci.edge.getIDCount(); - % fprintf('Number of edges in the simulation: %d\n',edgeIDCount); - - % travelTime = traci.edge.getAdaptedTraveltime('1i',10); - % fprintf('Travel time in 10 seconfs in the edge 1i: %d\n',travelTime); - - % effort = traci.edge.getEffort('1i',10); - % fprintf('Travel effort in 10 seconds in the edge 1i: %d\n',effort); - - % CO2EmissionEdge1i = traci.edge.getCO2Emission('1i'); - % fprintf('CO2 emission in the edge 1i: %d\n',CO2EmissionEdge1i); - - % COEmissionEdge1i = traci.edge.getCOEmission('1i'); - % fprintf('CO emission in the edge 1i: %d\n',COEmissionEdge1i); - - % HCEmissionEdge1i = traci.edge.getHCEmission('1i'); - % fprintf('HC emission in the edge 1i: %d\n',HCEmissionEdge1i); - - % PMxEmissionEdge1i = traci.edge.getPmxEmission('1i'); - % fprintf('PMx emission in the edge 1i: %d\n',PMxEmissionEdge1i); - - % NOxEmissionEdge1i = traci.edge.getNOxEmission('1i'); - % fprintf('NOx emission in the edge 1i: %d\n',NOxEmissionEdge1i); - - % fuelConsumptionEdge1i = traci.edge.getFuelConsumption('1i'); - % fprintf('Fuel consumption in the edge 1i: %d\n',fuelConsumptionEdge1i); - - % noiseEmissionEdge1i = traci.edge.getNoiseEmission('1i'); - % fprintf('Noise emission in the edge 1i: %d\n',noiseEmissionEdge1i); - - % vehicleMeanSpeedEdge1i = traci.edge.getLastStepMeanSpeed('1i'); - % fprintf('Average speed in the edge 1i: %d\n',vehicleMeanSpeedEdge1i); - - % vehicleOccupancyEdge1i = traci.edge.getLastStepOccupancy('1i'); - % fprintf('Occupancy in the edge 1i: %d\n',vehicleOccupancyEdge1i); - - % vehicleMeanLengthEdge1i = traci.edge.getLastStepLength('1i'); - % fprintf('Average length in the edge 1i: %d\n',vehicleMeanLengthEdge1i); - - % vehicleTravelTimeEdge1i = traci.edge.getTraveltime('1i'); - % fprintf('Average time of the vehicles in the edge 1i: %d\n',vehicleTravelTimeEdge1i); - - % vehicleHaltingEdge1i = traci.edge.getLastStepHaltingNumber('1i'); - % fprintf('Stopped vehicles in the edge 1i: %d\n',vehicleHaltingEdge1i); - - % vehicleIDsEdge1i = traci.edge.getLastStepVehicleIDs('1i'); - % fprintf('IDs of the vehicles in the edge 1i: \n'); - % disp(vehicleIDsEdge1i) - - % traci.edge.adaptTraveltime('1i',15); - - % traci.edge.setEffort('1i',1.343); - - % traci.edge.setMaxSpeed('1i',5); - - %% GUI GET COMMANDS - - % guizoom = traci.gui.getZoom() - % offset = traci.gui.getOffset() - % schema = traci.gui.getSchema() - % boundary = traci.gui.getBoundary() - - %% INDUCTION LOOP COMMANDS - - % loop0position = traci.inductionloop.getPosition('0'); - % loop0LaneID = traci.inductionloop.getLaneID('0') - % loop0MeanSpeed = traci.inductionloop.getLastStepMeanSpeed('0') - % loop0VehicleIDs = traci.inductionloop.getLastStepVehicleIDs('0') - % loop0Occupancy = traci.inductionloop.getLastStepOccupancy('0') - % loop0MeanLength = traci.inductionloop.getLastStepMeanLength('0') - % loop0TimeSinceDetection = traci.inductionloop.getTimeSinceDetection('0') - - %% JUNCTION COMMANDS - - % junctionPosition = traci.junction.getPosition('0'); - - %% LANE GET COMMANDS - - % lane1i0Length = traci.lane.getLength('1i_0'); - % lane1i0MaxSpeed = traci.lane.getMaxSpeed('1i_0'); - % lane1i0Width = traci.lane.getWidth('1i_0'); - % lane1i0AllowedVehicles = traci.lane.getAllowed('1i_0'); - % lane1i0DisallowedVehicles = traci.lane.getDisallowed('1i_0'); - % lane1i0LinkNumber = traci.lane.getLinkNumber('1i_0'); - % lane1i0Links = traci.lane.getLinks('1i_0'); - % lane1i0Shape = traci.lane.getShape('1i_0'); - % lane1i0EdgeID = traci.lane.getEdgeID('1i_0'); - % lane1i0CO2Emmision = traci.lane.getCO2Emission('1i_0') - % lane1i0COEmmision = traci.lane.getCOEmission('1i_0') - % lane1i0HCEmmision = traci.lane.getHCEmission('1i_0') - % lane1i0PMxEmmision = traci.lane.getPMxEmission('1i_0') - % lane1i0NOxEmmision = traci.lane.getNOxEmission('1i_0') - % lane1i0FuelConsumption = traci.lane.getFuelConsumption('1i_0') - % lane1i0NoiseEmission = traci.lane.getNoiseEmission('1i_0') - % lane1i0MeanSpeed = traci.lane.getLastStepMeanSpeed('1i_0') - % lane1i0Occupancy = traci.lane.getLastStepOccupancy('1i_0') - % lane1i0MeanVehicleLength = traci.lane.getLastStepLength('1i_0') - % lane1i0TravelTime = traci.lane.getTraveltime('1i_0') - % lane1i0HalringNumber = traci.lane.getLastStepHaltingNumber('1i_0') - % lane1i0VehicleIDs = traci.lane.getLastStepVehicleIDs('1i_0') - - %% MULTIENTRY=EXIT COMMANDS: Note that you have to create the detector in the cross.det.xml file - - % muiVehicleNumber = traci.multientryexit.getLastStepVehicleNumber('e3_0_1i') - % muiMeanSpeed = traci.multientryexit.getLastStepMeanSpeed('e3_0_1i') - % muiVehIDs = traci.multientryexit.getLastStepVehicleIDs('e3_0_1i') - % muiHaltingVehicles = traci.multientryexit.getLastStepHaltingNumber('e3_0_1i') - - %% SIMULATION COMMANDS - - % clc - % currentTime = traci.simulation.getCurrentTime() - % loadedNumber = traci.simulation.getLoadedNumber() - % loadedIDList = traci.simulation.getLoadedIDList(); - % departedNumber = traci.simulation.getDepartedNumber() - % departedIDList = traci.simulation.getDepartedIDList(); - % if ismember(testVehicle,departedIDList) - % traci.vehicle.moveTo(testVehicle,'1i_0',20); - % end - % arrivedNumber = traci.simulation.getArrivedNumber() - % arrivedIDList = traci.simulation.getArrivedIDList() - % startingTeleportNumber = traci.simulation.getStartingTeleportNumber() - % startingTeleportIDList = traci.simulation.getStartingTeleportIDList() - % endingTeleportNumber = traci.simulation.getEndingTeleportNumber() - % deltaT = traci.simulation.getDeltaT() - % netBoundary = traci.simulation.getNetBoundary() - % [x y] = traci.simulation.convert2D('1i',10) - % [roadID pos laneID] = traci.simulation.convertRoad(20, 508.35) - % [longitude latitude] = traci.simulation.convertGeo(20, 508.35) - % distance2D = traci.simulation.getDistance2D(20, 508.35, 30, 508.35) - % distanceRoad = traci.simulation.getDistanceRoad('1i', 10, '1i', 20) - - %% TRAFFIC LIGHTS COMMANDS - - % tlsRYGState = traci.trafficlights.getRedYellowGreenState('0') - % tlsRYGDefinition = traci.trafficlights.getCompleteRedYellowGreenDefinition('0') - % tlscontrolledLanes = traci.trafficlights.getControlledLanes('0') - % tlscontrolledLinks = traci.trafficlights.getControlledLinks('0') - % tlsProgram = traci.trafficlights.getProgram('0') - % tlsPhase = traci.trafficlights.getPhase('0') - % traci.trafficlights.setPhase('0',0); - % traci.trafficlights.setProgram('0','0'); - % traci.trafficlights.setPhaseDuration('0',5); -% myRYGDefinition = traci.trafficlights.Logic('0',0,0,0,... -% {traci.trafficlights.Phase(31000,31000,31000,'GrGr'),... -% traci.trafficlights.Phase(31000,31000,31000,'rGrG'),... -% traci.trafficlights.Phase(6000,6000,6000,'ryry')}); -% traci.trafficlights.setCompleteRedYellowGreenDefinition('0',myRYGDefinition); - % tlsRYGDefinition = traci.trafficlights.getCompleteRedYellowGreenDefinition('0'); - - %% VEHICLE GET COMMANDS - - % vehSpeed = traci.vehicle.getSpeed(testVehicle) - % vehSpeedWOTraci = traci.vehicle.getSpeedWithoutTraCI(testVehicle) - % vehPosition = traci.vehicle.getPosition(testVehicle) - % vehAngle = traci.vehicle.getAngle(testVehicle) - % vehRoadID = traci.vehicle.getRoadID(testVehicle) - % vehLaneID = traci.vehicle.getLaneID(testVehicle) - % vehLaneIndex = traci.vehicle.getLaneIndex(testVehicle) - % vehTypeID = traci.vehicle.getTypeID(testVehicle) - % vehRouteID = traci.vehicle.getRouteID(testVehicle) - % vehRoute = traci.vehicle.getRoute(testVehicle) - % vehLanePos = traci.vehicle.getLanePosition(testVehicle) - % vehColor = traci.vehicle.getColor(testVehicle) - % vehCO2Emission = traci.vehicle.getCO2Emission(testVehicle) - % vehCOEmission = traci.vehicle.getCOEmission(testVehicle) - % vehPmxEmission = traci.vehicle.getPMxEmission(testVehicle) - % vehNOxEmission = traci.vehicle.getNOxEmission(testVehicle) - % vehFuelConsumption = traci.vehicle.getFuelConsumption(testVehicle) - % vehAdaptedTraveltime = traci.vehicle.getAdaptedTraveltime(testVehicle,10,'1i') - % vehEffort = traci.vehicle.getEffort(testVehicle,10,'1i') - % vehValidRoute = traci.vehicle.isRouteValid(testVehicle) - % vehSignals = traci.vehicle.getSignals(testVehicle) - % vehMaxSpeed = traci.vehicle.getMaxSpeed(testVehicle) - % vehClass = traci.vehicle.getVehicleClass(testVehicle) - % vehSpeedFactor = traci.vehicle.getSpeedFactor(testVehicle) - % vehSpeedDeviation = traci.vehicle.getSpeedDeviation(testVehicle) - % vehEmissionClass = traci.vehicle.getEmissionClass(testVehicle) - % vehWidth = traci.vehicle.getWidth(testVehicle) - % vehMinGap = traci.vehicle.getMinGap(testVehicle) - % vehShapeClass = traci.vehicle.getShapeClass(testVehicle) - % vehAccel = traci.vehicle.getAccel(testVehicle) - % vehDecel = traci.vehicle.getDecel(testVehicle) - % vehImperfection = traci.vehicle.getImperfection(testVehicle) - % vehTau = traci.vehicle.getTau(testVehicle) - % vehBestLanes = traci.vehicle.getBestLanes(testVehicle) - % vehDrivingDistance = traci.vehicle.getDrivingDistance(testVehicle,'2o',30) - % vehDrivingDistance2D = traci.vehicle.getDrivingDistance2D(testVehicle,620,510) - - - % Change the phase of the traffic light if a vehicle passed through the - % induction loop - if no > 0 - % traci.gui.screenshot('View #0','passedvehicle.bmp') - % loop0VehicleData = traci.inductionloop.getVehicleData('0') - if programPointer == length(PROGRAM) - programPointer = 1; - elseif ~strcmp(PROGRAM(programPointer), WEYELLOW) - programPointer = 4; - else - continue - end - end - traci.trafficlights.setRedYellowGreenState('0', PROGRAM{programPointer}); - - % AN ADDITIONAL EVIDENCE OF THE TRAFFIC LIGHTS SUBSCRIPTION, DON'T - % FORGET TO SET THE SUBSCRIPTION BEFORE EXECUTING IT. - % if no > 0 - % tlsCurrentPhaseHandle = traci.trafficlights.getSubscriptionResults('0'); - % tlsCurrentPhase = tlsCurrentPhaseHandle(constants.TL_RED_YELLOW_GREEN_STATE); - % fprintf('The traffic lights'' phase changed to: %s\n', tlsCurrentPhase) - % end - - % AN ADDITIONAL EVIDENCE OF THE LANE SUBSCRIPTIONS, ENABLE THE PLOTTING - % FUNCTIONS BELOW TO VISUALIZE IT. -% WElaneoccupancy(i) = traci.lane.getLastStepVehicleNumber('1i_0')+... -% traci.lane.getLastStepVehicleNumber('2i_0'); -% NSlaneoccupancy(i) = traci.lane.getLastStepVehicleNumber('3i_0')+... -% traci.lane.getLastStepVehicleNumber('4i_0'); -% -% steps(i) = i; -% MinExpectedNumber = traci.simulation.getMinExpectedNumber(); -end -traci.close() -% plot(steps, WElaneoccupancy) -% hold; -% plot(steps, NSlaneoccupancy, 'r') -% legend('WE lane occupancy', 'NS lane occupancy') -% title('Lane occupancy vs time') -% xlabel('t (seconds)') -% ylabel('number of vehicles') \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/examples/traci_test.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/examples/traci_test.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/examples/traci_test.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/examples/traci_test.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -%% SUMO TRACI TEST -% THIS FILE AIMS TO TEST THE TRACI PROTOCOL FOR SUMO. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: traci_test.m 4 2014-03-03 15:18:05Z afacostag $ - -clear all -close all -clc - -%% MAIN -% HERE, WE START THE SUMO SIMULATOR AND INITIALIZE IT, ACCORDING TO -% THE EXAMPLE FOUND IN http://sumo-sim.org/userdoc/Tutorials/TraCI4Traffic_Lights.html -system(['sumo-gui -c ' getenv('SUMO_HOME') '\docs\tutorial\traci_tls\data\cross.sumocfg&']); -[traciVersion sumoVersion] = traci.init(); -traci.close(); -fprintf('SUMO version: %s\nTraCI version: %d\n',sumoVersion,traciVersion); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/license.txt sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/license.txt --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/license.txt 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/license.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -Copyright (c) 2014, Andres Acosta, Jairo Espinosa, Jorge Espinosa -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the distribution - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function contextSubscriptionResults = getContextSubscriptionResults(detID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(DETID) -% Returns the context subscription results for the last time step and the -% given areal detector. If no areal detector id is given, all subscription results are -% returned in a containers.Map data struccure. If the areal detector id is unknown -% or the subscription did for any reason return no data, 'None' is -% returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 14 2014-03-13 21:47:13Z afacostag $ - -global arealSubscriptionResults -if isempty(arealSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - detID=None; -end -contextSubscriptionResults = arealSubscriptionResults.getContext(detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getIDCount.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getIDCount.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getIDCount.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getIDCount.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -function IDCount = getIDCount() -%IDCount = getIDCount() Get the number of aeral detectors in the SUMO network. - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDCount.m 14 2014-03-13 21:47:13Z afacostag $ - -import traci.constants -IDCount = traci.areal.getUniversal(constants.ID_COUNT, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the areal detectors in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the areal detectors in the SUMO network. - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 14 2014-03-13 21:47:13Z afacostag $ - -import traci.constants -IDList = traci.areal.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getJamLengthMeters.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getJamLengthMeters.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getJamLengthMeters.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getJamLengthMeters.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function JamLengthMeters = getJamLengthMeters(detID) -%getJamLengthMeters Return the jam length in vehicles. -% JamLengthVehicle = getJamLengthVehicle(DETID) Returns the -% jam length in meters within the last simulation step on -% the given areal detector. - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getJamLengthMeters.m 14 2014-03-13 21:47:13Z afacostag $ - -import traci.constants -JamLengthMeters = traci.areal.getUniversal(constants.JAM_LENGTH_METERS, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getJamLengthVehicle.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getJamLengthVehicle.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getJamLengthVehicle.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getJamLengthVehicle.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function JamLengthVehicle = getJamLengthVehicle(detID) -%getJamLengthVehicle Return the jam length in vehicles. -% JamLengthVehicle = getJamLengthVehicle(DETID) Returns the -% jam length in vehicles within the last simulation step on -% the given areal detector. - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getJamLengthVehicle.m 14 2014-03-13 21:47:13Z afacostag $ - -import traci.constants -JamLengthVehicle = traci.areal.getUniversal(constants.JAM_LENGTH_VEHICLE, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getLastStepMeanSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getLastStepMeanSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getLastStepMeanSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getLastStepMeanSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function lastStepMeanSpeed = getLastStepMeanSpeed(detID) -%getLastStepMeanSpeed Get the average speed on the areal detector. -% lastStepMeanSpeed = getLastStepMeanSpeed(DETID) Returns the average -% speed in m/s for the last time step on the given areal detector. - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepMeanSpeed.m 14 2014-03-13 21:47:13Z afacostag $ - -import traci.constants -lastStepMeanSpeed = traci.areal.getUniversal(constants.LAST_STEP_MEAN_SPEED, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getLastStepOccupancy.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getLastStepOccupancy.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getLastStepOccupancy.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getLastStepOccupancy.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function lastStepOccupancy = getLastStepOccupancy(detID) -%getLastStepOccupancy Get the percentage of occupation on the areal detector. -% lastStepOccupancy = getLastStepOccupancy(DETID) Returns the occupancy -% in percentage for the last time step on the given areal detector. - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepOccupancy.m 14 2014-03-13 21:47:13Z afacostag $ - -import traci.constants -lastStepOccupancy = traci.areal.getUniversal(constants.LAST_STEP_OCCUPANCY, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function subscriptionResults = getSubscriptionResults(detID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(DETID) Returns the -% subscription results for the last time step and the given areal detector. If no -% areal detector id is given, all subscription results are returned in a -% containers.Map data structure. -% If the areal detector id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 14 2014-03-13 21:47:13Z afacostag $ - -global arealSubscriptionResults -if isempty(arealSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - detID = 'None'; -end - -subscriptionResults = arealSubscriptionResults.get(detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, detID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 14 2014-03-13 21:47:13Z afacostag $ - -import traci.constants -global arealSubscriptionResults - -if isempty(arealSubscriptionResults) - ReturnValueFunc = traci.RETURN_VALUE_FUNC.areal; -else - ReturnValueFunc = aeralSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_AREAL_DETECTOR_VARIABLE,varID,detID); -handleReturValueFunc = str2func(ReturnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -function subscribeContext(detID, domain, dist, varargin) -%subscribeContext Subscribe to an areal detector's context variable. -% subscribeContext(DETID,DOMAIN,DIST) Subscribe to the -% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the -% areal detector specified by DETID at a distance given by DIST, for the maximum -% allowed interval. The type of objets that surround the areal detector are defined -% in the DOMAIN parameter. Note that not all the SUMO object types -% support the variable LAST_STEP_VEHICLE_NUMBER. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 14 2014-03-13 21:47:13Z afacostag $ - -global arealSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'areal.subscribeContext'; -p.addRequired('detID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(detID, domain, dist, varargin{:}) -detID = p.Results.detID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -% Construct the subscription results object -if isempty(arealSubscriptionResults) - arealSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.areal); -else - arealSubscriptionResults.reset(); -end - -% Call the traci subscribeContext function -traci.subscribeContext(constants.CMD_SUBSCRIBE_AREAL_DETECTOR_CONTEXT,... - subscriptionBegin, subscriptionEnd, detID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+areal/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -function subscribe(detID, varargin) -%subscribe Subscribe to areal detector variable. -% subscribe(DETID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for -% the maximum allowed interval. -% subscribe(DETID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 14 2014-03-13 21:47:13Z afacostag $ - -global arealSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'areal.subscribe'; -p.addRequired('detID',@ischar) -p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(detID, varargin{:}) -detID = p.Results.detID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -% Construct the subscription results object -if isempty(arealSubscriptionResults) - arealSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.areal); -else - arealSubscriptionResults.reset(); -end - -% Call the traci subscribe function -traci.subscribe(constants.CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE,... - subscriptionBegin, subscriptionEnd, detID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/beginMessage.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/beginMessage.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/beginMessage.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/beginMessage.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -function beginMessage(cmdID, varID, objID, len) -%beginMessage Internal function to build the TraCI message. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: beginMessage.m 17 2014-05-30 14:32:09Z afacostag $ - -global message -if nargin < 4 - len = 0; -end - -% Put the command in the queue -message.queue = [message.queue uint8(sscanf(cmdID,'%x'))]; - -% Compute the command length -len = len+1+1+1+4+length(objID); - -% Build the message string depending on the length of the message -if len <= 255 - message.string = [message.string uint8([len sscanf(cmdID,'%x') sscanf(varID,'%x')])... - traci.packInt32(length(objID)) uint8(objID)]; -else - message.string = [message.string uint8(0) traci.packInt32(len+4) ... - uint8([sscanf(cmdID,'%x') sscanf(varID,'%x')])... - traci.packInt32(length(objID)) uint8(objID)]; -end - diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/checkResult.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/checkResult.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/checkResult.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/checkResult.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -function result = checkResult(cmdID, varID, objID) -%checkResult Internal function to receive and parse the response from SUMO -%server. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: checkResult.m 17 2014-05-30 14:32:09Z afacostag $ - -% Send the message and read the result -result = traci.sendExact(); - -% Read the response length -result.readLength(); - -% Read the response and the id of the returned variable -response = result.read(1); -retVarID = result.read(1); - -% Read the acknowledged object ID -objectID = result.readString(); - -% Check whether the response corresponds to the requested command. The -% TraCI protocol is designed so that the response and the command ID -% difference is 16 -if response - uint8(sscanf(cmdID,'%x')) ~= 16 || retVarID ~= uint8(sscanf(varID,'%x'))... - || ~strcmp(objectID,objID) - fprintf('Received answer %s,%s,%s for command %s,%s,%s.'... - ,response, retVarID, objectID, cmdID, varID, objID); -end - -% Read the type of the variable -result.read(1); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/close.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/close.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/close.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/close.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -function close() -%CLOSE Close the connection with the SUMO server. -% CLOSE() Close the default connection with the SUMO server. If several -% connections have to be closed, they must be enabled through the -% traci.switch() command, and closed with CLOSE(). - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: close.m 17 2014-05-30 14:32:09Z afacostag $ - -global connections message -import traci.constants - -% Build the close command -command = uint8(sscanf(constants.CMD_CLOSE,'%x')); -message.queue = [message.queue command]; -message.string = [message.string uint8(1+1) command]; - -% Send the close command -traci.sendExact(); - -% Close and clear the tcp object -if isKey(connections,'') - activeConnection = connections(''); - activeConnection.socket.close(); - clear connections('') -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/constants.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/constants.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/constants.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/constants.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,675 +0,0 @@ -classdef constants - %The SUMO hexadecimal constants. - - % Copyright 2014 Universidad Nacional de Colombia, - % Politecnico Jaime Isaza Cadavid. - % Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. - % $Id: constants.m 14 2014-03-13 21:47:13Z afacostag $ - - properties (Constant = true) - % **************************************** - % VERSION - % **************************************** - TRACI_VERSION = 6 - - - % **************************************** - % COMMANDS - % **************************************** - % command: get version - CMD_GETVERSION = '0x00' - - % command: simulation step - CMD_SIMSTEP2 = '0x02' - - % command: stop node - CMD_STOP = '0x12' - - % command: Resume from parking - CMD_RESUME = '0x19' - - % command: set lane - CMD_CHANGELANE = '0x13' - - % command: slow down - CMD_SLOWDOWN = '0x14' - - % command: change target - CMD_CHANGETARGET = '0x31' - - % command: add vehicle - CMD_ADDVEHICLE = '0x74' - - % 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 - RESPONSE_GET_INDUCTIONLOOP_VARIABLE = '0xb0' - % command: subscribe induction loop (e1) variable - CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = '0xd0' - % response: subscribe induction loop (e1) variable - RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = '0xe0' - - % command: subscribe areal detector (e2) context - CMD_SUBSCRIBE_AREAL_DETECTOR_CONTEXT = '0x8D' - % response: subscribe areal detector (e2) context - RESPONSE_SUBSCRIBE_AREAL_DETECTOR_CONTEXT = '0x9D' - % command: get areal detector (e2) variable - CMD_GET_AREAL_DETECTOR_VARIABLE = '0x8E' - % response: get areal detector (e2) variable - RESPONSE_GET_AREAL_DETECTOR_VARIABLE = '0x9E' - % command: subscribe areal detector (e2) variable - CMD_SUBSCRIBE_AREAL_DETECTOR_VARIABLE = '0x8F' - % response: subscribe areal detector (e2) variable - RESPONSE_SUBSCRIBE_AREAL_DETECTOR_VARIABLE = '0x9F' - - % command: subscribe multi-entry/multi-exit detector (e3) context - CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT = '0x81' - % response: subscribe multi-entry/multi-exit 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 multi-entry/multi-exit detector (e3) variable - RESPONSE_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = '0xb1' - % command: subscribe multi-entry/multi-exit detector (e3) variable - CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE = '0xd1' - % response: subscribe multi-entry/multi-exit 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 - RESPONSE_GET_TL_VARIABLE = '0xb2' - % command: set traffic lights variable - CMD_SET_TL_VARIABLE = '0xc2' - % command: subscribe traffic lights variable - CMD_SUBSCRIBE_TL_VARIABLE = '0xd2' - % 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 - RESPONSE_GET_LANE_VARIABLE = '0xb3' - % command: set lane variable - CMD_SET_LANE_VARIABLE = '0xc3' - % command: subscribe lane variable - CMD_SUBSCRIBE_LANE_VARIABLE = '0xd3' - % 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 - RESPONSE_GET_VEHICLE_VARIABLE = '0xb4' - % command: set vehicle variable - CMD_SET_VEHICLE_VARIABLE = '0xc4' - % command: subscribe vehicle variable - CMD_SUBSCRIBE_VEHICLE_VARIABLE = '0xd4' - % 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 - RESPONSE_GET_VEHICLETYPE_VARIABLE = '0xb5' - % command: set vehicle type variable - CMD_SET_VEHICLETYPE_VARIABLE = '0xc5' - % command: subscribe vehicle type variable - CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE = '0xd5' - % 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 - RESPONSE_GET_ROUTE_VARIABLE = '0xb6' - % command: set route variable - CMD_SET_ROUTE_VARIABLE = '0xc6' - % command: subscribe route variable - CMD_SUBSCRIBE_ROUTE_VARIABLE = '0xd6' - % 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 - RESPONSE_GET_POI_VARIABLE = '0xb7' - % command: set poi variable - CMD_SET_POI_VARIABLE = '0xc7' - % command: subscribe poi variable - CMD_SUBSCRIBE_POI_VARIABLE = '0xd7' - % 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 - RESPONSE_GET_POLYGON_VARIABLE = '0xb8' - % command: set polygon variable - CMD_SET_POLYGON_VARIABLE = '0xc8' - % command: subscribe polygon variable - CMD_SUBSCRIBE_POLYGON_VARIABLE = '0xd8' - % 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 - RESPONSE_GET_JUNCTION_VARIABLE = '0xb9' - % command: set junction variable - CMD_SET_JUNCTION_VARIABLE = '0xc9' - % command: subscribe junction variable - CMD_SUBSCRIBE_JUNCTION_VARIABLE = '0xd9' - % 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 - RESPONSE_GET_EDGE_VARIABLE = '0xba' - % command: set edge variable - CMD_SET_EDGE_VARIABLE = '0xca' - % command: subscribe edge variable - CMD_SUBSCRIBE_EDGE_VARIABLE = '0xda' - % 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 - RESPONSE_GET_SIM_VARIABLE = '0xbb' - % command: set simulation variable - CMD_SET_SIM_VARIABLE = '0xcb' - % command: subscribe simulation variable - CMD_SUBSCRIBE_SIM_VARIABLE = '0xdb' - % 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 - RESPONSE_GET_GUI_VARIABLE = '0xbc' - % command: set GUI variable - CMD_SET_GUI_VARIABLE = '0xcc' - % command: subscribe GUI variable - CMD_SUBSCRIBE_GUI_VARIABLE = '0xdc' - % response: subscribe GUI variable - RESPONSE_SUBSCRIBE_GUI_VARIABLE = '0xec' - - - % **************************************** - % POSITION REPRESENTATIONS - % **************************************** - % Position in geo-coordinates - POSITION_LON_LAT = '0x00' - % 2D cartesian coordinates - POSITION_2D = '0x01' - % Position in geo-coordinates with altitude - POSITION_LON_LAT_ALT = '0x02' - % 3D cartesian coordinates - POSITION_3D = '0x03' - % Position on road map - POSITION_ROADMAP = '0x04' - - - % **************************************** - % DATA TYPES - % **************************************** - % Boundary Box (4 doubles) - TYPE_BOUNDINGBOX = '0x05' - % Polygon (2*n doubles) - TYPE_POLYGON = '0x06' - % unsigned byte - TYPE_UBYTE = '0x07' - % signed byte - TYPE_BYTE = '0x08' - % 32 bit signed integer - TYPE_INTEGER = '0x09' - % float - TYPE_FLOAT = '0x0A' - % double - TYPE_DOUBLE = '0x0B' - % 8 bit ASCII string - TYPE_STRING = '0x0C' - % list of traffic light phases - TYPE_TLPHASELIST = '0x0D' - % list of strings - TYPE_STRINGLIST = '0x0E' - % compound object - TYPE_COMPOUND = '0x0F' - % color (four ubytes) - TYPE_COLOR = '0x11' - - - % **************************************** - % RESULT TYPES - % **************************************** - % result type: Ok - RTYPE_OK = '0x00' - % result type: not implemented - RTYPE_NOTIMPLEMENTED = '0x01' - % result type: error - RTYPE_ERR = '0xFF' - - % return value for invalid queries (especially vehicle is not on the road) - INVALID_DOUBLE_VALUE = -1001. - % return value for invalid queries (especially vehicle is not on the road) - INVALID_INT_VALUE = -1 - - - % **************************************** - % TRAFFIC LIGHT PHASES - % **************************************** - % red phase - TLPHASE_RED = '0x01' - % yellow phase - TLPHASE_YELLOW = '0x02' - % green phase - TLPHASE_GREEN = '0x03' - % tl is blinking - TLPHASE_BLINKING = '0x04' - % tl is off and not blinking - TLPHASE_NOSIGNAL = '0x05' - - - % **************************************** - % DIFFERENT DISTANCE REQUESTS - % **************************************** - % air distance - REQUEST_AIRDIST = '0x00' - % driving distance - 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) - % **************************************** - % list of instances' ids (get: all) - ID_LIST = '0x00' - - % 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' - - % last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges) - LAST_STEP_MEAN_SPEED = '0x11' - - % last step vehicle number (get: induction loops, multi-entry/multi-exit detector, lanes, edges) - LAST_STEP_VEHICLE_ID_LIST = '0x12' - - % last step occupancy (get: induction loops, lanes, edges) - LAST_STEP_OCCUPANCY = '0x13' - - % last step vehicle halting number (get: multi-entry/multi-exit detector, lanes, edges) - LAST_STEP_VEHICLE_HALTING_NUMBER = '0x14' - - % last step mean vehicle length (get: induction loops, lanes, edges) - LAST_STEP_LENGTH = '0x15' - - % last step time since last detection (get: induction loops) - LAST_STEP_TIME_SINCE_DETECTION = '0x16' - - % entry times - LAST_STEP_VEHICLE_DATA = '0x17' - - % last step jam length in vehicles - JAM_LENGTH_VEHICLE = '0x18' - - % last step jam length in meters - JAM_LENGTH_METERS = '0x19' - - % traffic light states, encoded as rRgGyYoO tuple (get: traffic lights) - TL_RED_YELLOW_GREEN_STATE = '0x20' - - % index of the phase (set: traffic lights) - TL_PHASE_INDEX = '0x22' - - % traffic light program (set: traffic lights) - TL_PROGRAM = '0x23' - - % phase duration (set: traffic lights) - TL_PHASE_DURATION = '0x24' - - % controlled lanes (get: traffic lights) - TL_CONTROLLED_LANES = '0x26' - - % controlled links (get: traffic lights) - TL_CONTROLLED_LINKS = '0x27' - - % index of the current phase (get: traffic lights) - TL_CURRENT_PHASE = '0x28' - - % name of the current program (get: traffic lights) - TL_CURRENT_PROGRAM = '0x29' - - % controlled junctions (get: traffic lights) - TL_CONTROLLED_JUNCTIONS = '0x2a' - - % complete definition (get: traffic lights) - TL_COMPLETE_DEFINITION_RYG = '0x2b' - - % complete program (set: traffic lights) - TL_COMPLETE_PROGRAM_RYG = '0x2c' - - % assumed time to next switch (get: traffic lights) - TL_NEXT_SWITCH = '0x2d' - - - - % outgoing link number (get: lanes) - LANE_LINK_NUMBER = '0x30' - - % id of parent edge (get: lanes) - LANE_EDGE_ID = '0x31' - - % outgoing link definitions (get: lanes) - LANE_LINKS = '0x33' - - % list of allowed vehicle classes (get&set: lanes) - LANE_ALLOWED = '0x34' - - % list of not allowed vehicle classes (get&set: lanes) - LANE_DISALLOWED = '0x35' - - - % speed (get: vehicle) - VAR_SPEED = '0x40' - - % maximum allowed/possible speed (get: vehicle types, lanes, set: edges, lanes) - VAR_MAXSPEED = '0x41' - - % position (2D) (get: vehicle, poi, set: poi) - VAR_POSITION = '0x42' - - % angle (get: vehicle) - VAR_ANGLE = '0x43' - - % angle (get: vehicle types, lanes, set: lanes) - VAR_LENGTH = '0x44' - - % color (get: vehicles, vehicle types, polygons, pois) - VAR_COLOR = '0x45' - - % max. acceleration (get: vehicle types) - VAR_ACCEL = '0x46' - - % max. deceleration (get: vehicle types) - VAR_DECEL = '0x47' - - % driver reaction time (get: vehicle types) - VAR_TAU = '0x48' - - % vehicle class (get: vehicle types) - VAR_VEHICLECLASS = '0x49' - - % emission class (get: vehicle types) - VAR_EMISSIONCLASS = '0x4a' - - % shape class (get: vehicle types) - VAR_SHAPECLASS = '0x4b' - - % minimum gap (get: vehicle types) - VAR_MINGAP = '0x4c' - - % width (get: vehicle types, lanes) - VAR_WIDTH = '0x4d' - - % shape (get: polygons) - VAR_SHAPE = '0x4e' - - % type id (get: vehicles, polygons, pois) - VAR_TYPE = '0x4f' - - % road id (get: vehicles) - VAR_ROAD_ID = '0x50' - - % lane id (get: vehicles) - VAR_LANE_ID = '0x51' - - % lane index (get: vehicles) - VAR_LANE_INDEX = '0x52' - - % route id (get & set: vehicles) - VAR_ROUTE_ID = '0x53' - - % edges (get: routes) - VAR_EDGES = '0x54' - - % filled? (get: polygons) - VAR_FILL = '0x55' - - % position (1D along lane) (get: vehicle) - VAR_LANEPOSITION = '0x56' - - % route (set: vehicles) - VAR_ROUTE = '0x57' - - % travel time information (get&set: vehicle) - VAR_EDGE_TRAVELTIME = '0x58' - - % effort information (get&set: vehicle) - VAR_EDGE_EFFORT = '0x59' - - % last step travel time (get: edge, lane) - VAR_CURRENT_TRAVELTIME = '0x5a' - - % signals state (get/set: vehicle) - VAR_SIGNALS = '0x5b' - - % new lane/position along (set: vehicle) - VAR_MOVE_TO = '0x5c' - - % driver imperfection (set: vehicle) - VAR_IMPERFECTION = '0x5d' - - % speed factor (set: vehicle) - VAR_SPEED_FACTOR = '0x5e' - - % speed deviation (set: vehicle) - VAR_SPEED_DEVIATION = '0x5f' - - % speed without TraCI influence (get: vehicle) - VAR_SPEED_WITHOUT_TRACI = '0xb1' - - % best lanes (get: vehicle) - VAR_BEST_LANES = '0xb2' - - % how speed is set (set: vehicle) - VAR_SPEEDSETMODE = '0xb3' - - % move vehicle, VTD version (set: vehicle) - VAR_MOVE_TO_VTD = '0xb4' - - % is the vehicle stopped, and if so parked and/or triggered? - % value = stopped + 2 * parking + 4 * triggered - VAR_STOPSTATE = '0xb5' - - % current CO2 emission of a node (get: vehicle, lane, edge) - VAR_CO2EMISSION = '0x60' - - % current CO emission of a node (get: vehicle, lane, edge) - VAR_COEMISSION = '0x61' - - % current HC emission of a node (get: vehicle, lane, edge) - VAR_HCEMISSION = '0x62' - - % current PMx emission of a node (get: vehicle, lane, edge) - VAR_PMXEMISSION = '0x63' - - % current NOx emission of a node (get: vehicle, lane, edge) - VAR_NOXEMISSION = '0x64' - - % current fuel consumption of a node (get: vehicle, lane, edge) - VAR_FUELCONSUMPTION = '0x65' - - % 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) - VAR_TIME_STEP = '0x70' - - % number of loaded vehicles (get: simulation) - VAR_LOADED_VEHICLES_NUMBER = '0x71' - - % loaded vehicle ids (get: simulation) - VAR_LOADED_VEHICLES_IDS = '0x72' - - % number of departed vehicle (get: simulation) - VAR_DEPARTED_VEHICLES_NUMBER = '0x73' - - % departed vehicle ids (get: simulation) - VAR_DEPARTED_VEHICLES_IDS = '0x74' - - % number of vehicles starting to teleport (get: simulation) - VAR_TELEPORT_STARTING_VEHICLES_NUMBER = '0x75' - - % ids of vehicles starting to teleport (get: simulation) - VAR_TELEPORT_STARTING_VEHICLES_IDS = '0x76' - - % number of vehicles ending to teleport (get: simulation) - VAR_TELEPORT_ENDING_VEHICLES_NUMBER = '0x77' - - % ids of vehicles ending to teleport (get: simulation) - VAR_TELEPORT_ENDING_VEHICLES_IDS = '0x78' - - % number of arrived vehicles (get: simulation) - VAR_ARRIVED_VEHICLES_NUMBER = '0x79' - - % ids of arrived vehicles (get: simulation) - VAR_ARRIVED_VEHICLES_IDS = '0x7a' - - % delta t (get: simulation) - VAR_DELTA_T = '0x7b' - - % bounding box (get: simulation) - VAR_NET_BOUNDING_BOX = '0x7c' - - % minimum number of expected vehicles (get: simulation) - VAR_MIN_EXPECTED_VEHICLES = '0x7d' - - - - % add an instance (poi, polygon, vehicle, route) - ADD = '0x80' - - % remove an instance (poi, polygon) - REMOVE = '0x81' - - % convert coordinates - POSITION_CONVERSION = '0x82' - - % distance between points or vehicles - DISTANCE_REQUEST = '0x83' - - - % force rerouting based on travel time (vehicles) - CMD_REROUTE_TRAVELTIME = '0x90' - - % force rerouting based on effort (vehicles) - CMD_REROUTE_EFFORT = '0x91' - - % validates current route (vehicles) - VAR_ROUTE_VALID = '0x92' - - - % zoom - VAR_VIEW_ZOOM = '0xa0' - - % view position - VAR_VIEW_OFFSET = '0xa1' - - % view schema - VAR_VIEW_SCHEMA = '0xa2' - - % view by boundary - VAR_VIEW_BOUNDARY = '0xa3' - - % screenshot - VAR_SCREENSHOT = '0xa5' - - % track vehicle - VAR_TRACK_VEHICLE = '0xa6' - - end -end diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/adaptTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/adaptTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/adaptTraveltime.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/adaptTraveltime.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -function adaptTraveltime(edgeID, time) -%adaptTraveltime Adapt the travel time value for the given edge. -% adaptTraveltime(EDGEID,TIME) Adapt the travel time value used for -% (re-) routing for the given edge in the SUMO server. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: adaptTraveltime.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_EDGE_VARIABLE, constants.VAR_EDGE_TRAVELTIME, edgeID, 1+4+1+8); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x'))... - traci.packInt32(1) uint8(sscanf(constants.TYPE_DOUBLE,'%x'))... - traci.packInt64(time)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getAdaptedTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getAdaptedTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getAdaptedTraveltime.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getAdaptedTraveltime.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -function adaptedTraveltime = getAdaptedTraveltime(edgeID, time) -%getAdaptedTraveltime Return the travel time value. -% adaptedTraveltime = getAdaptedTraveltime(EDGEID,TIME) Return the travel -% time value (in s) used for (re-)routing which is valid on the specified -% edge at the given time. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% $Id: getAdaptedTraveltime.m 17 2014-05-30 14:32:09Z afacostag $ - -global message -import traci.constants -traci.beginMessage(constants.CMD_GET_EDGE_VARIABLE,... - constants.VAR_EDGE_TRAVELTIME,edgeID, 1+4); -message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x'))... - traci.packInt32(traci.time2steps(time))]; -result = traci.checkResult(constants.CMD_GET_EDGE_VARIABLE,... - constants.VAR_EDGE_TRAVELTIME, edgeID); -adaptedTraveltime = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getCO2Emission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getCO2Emission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getCO2Emission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getCO2Emission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function CO2Emission = getCO2Emission(edgeID) -%getCO2Emission Returns the CO2 emission on the given edge. -% CO2Emission = getCO2Emission(EDGEID) Returns the CO2 emission in mg for -% the last time step on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getCO2Emission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -CO2Emission = traci.edge.getUniversal(constants.VAR_CO2EMISSION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getCOEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getCOEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getCOEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getCOEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function COEmission = getCOEmission(edgeID) -%getCOEmission Returns the CO emission on the given edge. -% COEmission = getCOEmission(EDGEID) Returns the CO emission in mg for -% the last time step on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getCOEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -COEmission = traci.edge.getUniversal(constants.VAR_COEMISSION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function contextSubscriptionResults = getContextSubscriptionResults(edgeID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(EDGEID) -% Returns the context subscription results for the last time step and the -% given edge. If no edge id is given, all subscription results are -% returned in a containers.Map data struccure. If the edge id is unknown -% or the subscription did for any reason return no data, 'None' is -% returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global edgeSubscriptionResults -if isempty(edgeSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - edgeID=None; -end -contextSubscriptionResults = edgeSubscriptionResults.getContext(edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getEffort.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getEffort.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getEffort.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getEffort.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -function effort = getEffort(edgeID, time) -%getEffort Get the effort used for (re-)routing. -% effort = getEffort(EDGEID,TIME) Returns the effort value used for -% (re-)routing which is valid on the edge at the given time. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getEffort.m 17 2014-05-30 14:32:09Z afacostag $ - -global message -import traci.constants -traci.beginMessage(constants.CMD_GET_EDGE_VARIABLE, constants.VAR_EDGE_EFFORT,... - edgeID, 1+4); -message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x'))... - traci.packInt32(traci.time2steps(time))]; -result = traci.checkResult(constants.CMD_GET_EDGE_VARIABLE,... - constants.VAR_EDGE_EFFORT, edgeID); -effort = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getFuelConsumption.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getFuelConsumption.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getFuelConsumption.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getFuelConsumption.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function fuelConsumption = getFuelConsumption(edgeID) -%getFuelConsumption Get the fuel consumption on the edge. -% fuelConsumption = getFuelConsumption(EDGEID) Returns the fuel -% consumption in ml for the last time step on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getFuelConsumption.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -fuelConsumption = traci.edge.getUniversal(constants.VAR_FUELCONSUMPTION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getHCEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getHCEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getHCEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getHCEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function HCEmission = getHCEmission(edgeID) -%getHCEmission Returns the HC emission on the given edge. -% HCEmission = getCOEmission(EDGEID) Returns the HC emission in mg for -% the last time step on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getHCEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -HCEmission = traci.edge.getUniversal(constants.VAR_HCEMISSION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getIDCount.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getIDCount.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getIDCount.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getIDCount.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -function IDCount = getIDCount() -%IDCount = getIDCount() Get the number of edges in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDCount.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDCount = traci.edge.getUniversal(constants.ID_COUNT, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the edges in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the edges in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDList = traci.edge.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepHaltingNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepHaltingNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepHaltingNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepHaltingNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function lastStepHaltingNumber = getLastStepHaltingNumber(edgeID) -%getLastStepHaltingNumber Get the number of halting vehicles. -% lastStepHaltingNumber = getLastStepHaltingNumber(EDGEID) Returns the -% total number of halting vehicles for the last time step on the given -% edge. A speed of less than 0.1 m/s is considered a halt. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepHaltingNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepHaltingNumber = traci.edge.getUniversal(constants.LAST_STEP_VEHICLE_HALTING_NUMBER, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepLength.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepLength.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function lastStepLength = getLastStepLength(edgeID) -%getLastStepLength Get the mean vehicle length on the edge. -% lastStepLength = getLastStepLength(EDGEID) Returns the mean vehicle -% length in m for the last time step on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepLength.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepLength = traci.edge.getUniversal(constants.LAST_STEP_LENGTH, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepMeanSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepMeanSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepMeanSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepMeanSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function lastStepMeanSpeed = getLastStepMeanSpeed(edgeID) -%getLastStepMeanSpeed Get the average speed on the edge. -% lastStepMeanSpeed = getLastStepMeanSpeed(EDGEID) Returns the average -% speed in m/s for the last time step on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepMeanSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepMeanSpeed = traci.edge.getUniversal(constants.LAST_STEP_MEAN_SPEED, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepOccupancy.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepOccupancy.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepOccupancy.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepOccupancy.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function lastStepOccupancy = getLastStepOccupancy(edgeID) -%getLastStepOccupancy Get the percentage of occupation on the edge. -% lastStepOccupancy = getLastStepOccupancy(EDGEID) Returns the occupancy -% in percentage for the last time step on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepOccupancy.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepOccupancy = traci.edge.getUniversal(constants.LAST_STEP_OCCUPANCY, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepVehicleIDs.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepVehicleIDs.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepVehicleIDs.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepVehicleIDs.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function lastStepVehicleIDs = getLastStepVehicleIDs(edgeID) -%getLastStepVehicleIDs Get the IDs of the vehicles in the edge. -% lastStepVehicleIDs = getLastStepVehicleIDs(EDGEID) Returns cell array -% of strings containing the IDs of the vehicles for the last time step -% on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepVehicleIDs.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepVehicleIDs = traci.edge.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepVehicleNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepVehicleNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepVehicleNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getLastStepVehicleNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function lastStepVehicleNumber = getLastStepVehicleNumber(edgeID) -%getLastStepVehicleNumber Get the number vehicles in the edge. -% lastStepVehicleNumber = getLastStepVehicleNumber(EDGEID) Returns the -% total number of vehicles for the last time step on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepVehicleNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepVehicleNumber = traci.edge.getUniversal(... - constants.LAST_STEP_VEHICLE_NUMBER, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getNoiseEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getNoiseEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getNoiseEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getNoiseEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function noiseEmission = getNoiseEmission(edgeID) -%getNoiseEmission Get the noise emission in the edge. -% noiseEmission = getNoiseEmission(EDGEID) Returns the noise emission in -% db for the last time step on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getNoiseEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -noiseEmission = traci.edge.getUniversal(constants.VAR_NOISEEMISSION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getNOxEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getNOxEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getNOxEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getNOxEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function NOxEmission = getNOxEmission(edgeID) -import traci.constants -%getNOxEmission Get the NOx emission in the edge. -% NOxEmission = getNOxEmission(EDGEID) Returns the NOx emission in mg for -% the last time step on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getNOxEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -NOxEmission = traci.edge.getUniversal(constants.VAR_NOXEMISSION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getPmxEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getPmxEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getPmxEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getPmxEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function pmxEmission = getPmxEmission(edgeID) -%getPmxEmission Get the particular matter emission in the edge. -% pmxEmission = getPmxEmission(EDGEID) Returns the particular matter -% emission in mg for the last time step on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getPmxEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -pmxEmission = traci.edge.getUniversal(constants.VAR_PMXEMISSION, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function subscriptionResults = getSubscriptionResults(edgeID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(EDGEID) Returns the -% subscription results for the last time step and the given edge. If no -% edge id is given, all subscription results are returned in a -% containers.Map data structure. -% If the edge id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global edgeSubscriptionResults -if isempty(edgeSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - edgeID = 'None'; -end - -subscriptionResults = edgeSubscriptionResults.get(edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getTraveltime.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getTraveltime.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function traveltime = getTraveltime(edgeID) -%getTraveltime Get estimated travel time in the edge. -% traveltime = getTraveltime(EDGEID) Returns the estimated travel time in -% seconds for the last time step on the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getTraveltime.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traveltime = traci.edge.getUniversal(constants.VAR_CURRENT_TRAVELTIME, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, edgeID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global edgeSubscriptionResults - -if isempty(edgeSubscriptionResults) - ReturnValueFunc = traci.RETURN_VALUE_FUNC.edge; -else - ReturnValueFunc = edgeSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_EDGE_VARIABLE,varID,edgeID); -handleReturValueFunc = str2func(ReturnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/setEffort.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/setEffort.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/setEffort.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/setEffort.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -function setEffort(edgeID, effort) -%setEffort Adapt the effort for (-re) routing. -% setEffort(EDGEID,EFFORT) Adapt the effort value used for (re-)routing -% for the given edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setEffort.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_EDGE_VARIABLE, constants.VAR_EDGE_EFFORT, edgeID, 1+4+1+8); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x'))... - traci.packInt32(1) uint8(sscanf(constants.TYPE_DOUBLE,'%x'))... - traci.packInt64(effort)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/setMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/setMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/setMaxSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/setMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setMaxSpeed(edgeID, speed) -%setMaxSpeed Set the maximum speed in the edge. -% setMaxSpeed(EDGEID,SPEED) Set a new maximum speed (in m/s) for all -% lanes of the edge. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setMaxSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_EDGE_VARIABLE, constants.VAR_MAXSPEED, edgeID, speed) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -function subscribeContext(edgeID, domain, dist, varargin) -%subscribeContext Subscribe to an edge's context variable. -% subscribeContext(EDGEID,DOMAIN,DIST) Subscribe to the -% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the -% edge specified by EDGEID at a distance given by DIST, for the maximum -% allowed interval. The type of objets that surround the edge are defined -% in the DOMAIN parameter. Note that not all the SUMO object types -% support the variable LAST_STEP_VEHICLE_NUMBER. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 2 2013-12-21 21:39:57Z aacosta $ - -global edgeSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'edge.subscribeContext'; -p.addRequired('edgeID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(edgeID, domain, dist, varargin{:}) -edgeID = p.Results.edgeID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -% Construct the subscription results object -if isempty(edgeSubscriptionResults) - edgeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.edge); -else - edgeSubscriptionResults.reset(); -end - -% Call the traci subscribeContext function -traci.subscribeContext(constants.CMD_SUBSCRIBE_EDGE_CONTEXT,... - subscriptionBegin, subscriptionEnd, edgeID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+edge/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -function subscribe(edgeID, varargin) -%subscribe Subscribe to edge variable. -% subscribe(EDGEID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for -% the maximum allowed interval. -% subscribe(EDGEID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global edgeSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'edge.subscribe'; -p.addRequired('edgeID',@ischar) -p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(edgeID, varargin{:}) -edgeID = p.Results.edgeID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -% Construct the subscription results object -if isempty(edgeSubscriptionResults) - edgeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.edge); -else - edgeSubscriptionResults.reset(); -end - -% Call the traci subscribe function -traci.subscribe(constants.CMD_SUBSCRIBE_EDGE_VARIABLE,... - subscriptionBegin, subscriptionEnd, edgeID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/getVersion.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/getVersion.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/getVersion.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/getVersion.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -function [traciversion, sumoversion] = getVersion() -%getVersion Get the TraCI and SUMO versions. -% [TRACIVERSION SUMOVERSION] = getVersion() Returns the current TraCI and -% SUMO versions. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getVersion.m 17 2014-05-30 14:32:09Z afacostag $ - -global message -import traci.constants -message = traci.Message(); -% Get the command ID from the traci Constants. -strcommand = constants.CMD_GETVERSION; -command = sscanf(strcommand,'%x'); - -% Prepare the outgoing message -message.queue = [message.queue command]; -message.string = uint8([message.string 1+1 command]); - -% Send the outgoing message and receive the result -result = traci.sendExact(); - -result.readLength(); -response = result.read(1); -if response~=command - throw(MException('traci:FatalTraciError','Received answer 0x%.2X for command 0x%.2X.\n',... - response, command)); -else - traciversion = result.readInt(); - sumoversion = result.readString(); -end diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getBoundary.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getBoundary.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getBoundary.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getBoundary.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -function boundary = getBoundary(viewID) -%getBoundary Get the coordinates of the view. -% boundary = getBoundary(VIEWID) Returns the coordinates of the lower -% left and the upper right corner of the currently visible view. If no -% view ID is given, the function return the results for the default view. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getBoundary.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -if nargin < 1 - viewID = 'View #0'; -end -boundary = traci.gui.getUniversal(constants.VAR_VIEW_BOUNDARY, viewID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function ContextSubscriptionResults = getContextSubscriptionResults(viewID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(VIEWID) -% Returns the context subscription results for the last time step and the -% given view. If no view id is given, all subscription results are -% returned in a containers.Map data struccure. If the view id is unknown -% or the subscription did for any reason return no data, 'None' is -% returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global guiSubscriptionResults -if isempty(guiSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - viewID=None; -end -ContextSubscriptionResults = guiSubscriptionResults.getContext(viewID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the views in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the views in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDList = traci.gui.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getOffset.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getOffset.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getOffset.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getOffset.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -function offset = getOffset(viewID) -%getOffset Get the offset of the view. -% offset = getOffset(VIEWID) Returns the x and y offset of the center of -% the current view. If no view ID is given, the function return the -% results for the default view. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getOffset.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -if nargin < 1 - viewID = 'View #0'; -end -offset = traci.gui.getUniversal(constants.VAR_VIEW_OFFSET, viewID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getSchema.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getSchema.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getSchema.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getSchema.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -function schema = getSchema(viewID) -%getSchema Get the color schema of the view. -% schema = getSchema(VIEWID) Returns the name of the current coloring -% scheme. If no view ID is given, the function return the results for the -% default view. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSchema.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -if nargin < 1 - viewID = 'View #0'; -end -schema = traci.gui.getUniversal(constants.VAR_VIEW_SCHEMA, viewID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function subscriptionResults = getSubscriptionResults(viewID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(VIEWID) Returns the -% subscription results for the last time step and the given view. If no -% view id is given, all subscription results are returned in a -% containers.Map data structure. -% If the view id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global guiSubscriptionResults -if isempty(guiSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - viewID = 'None'; -end - -subscriptionResults = guiSubscriptionResults.get(viewID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, viewID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global guiSubscriptionResults - -if isempty(guiSubscriptionResults) - returnValueFunc = traci.RETURN_VALUE_FUNC.gui; -else - returnValueFunc = guiSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_GUI_VARIABLE,varID,viewID); -handleReturValueFunc = str2func(returnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getZoom.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getZoom.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getZoom.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/getZoom.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -function zoom = getZoom(viewID) -%getZoom Get the zoom of the view. -% zoom = getZoom(viewID) Returns the current zoom factor of the view. If -% no view ID is given, the function return the results for the default -% view. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getZoom.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -if nargin < 1 - viewID = 'View #0'; -end -zoom = traci.gui.getUniversal(constants.VAR_VIEW_ZOOM, viewID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/screenshot.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/screenshot.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/screenshot.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/screenshot.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function screenshot(viewID, filename) -%screenshot Save a screenshot of the SUMO gui. -% screenshot(VIEWID, FILENAME) Save a screenshot for the given view to -% the given filename. The fileformat is guessed from the extension, the -% available formats differ from platform to platform but should at least -% include ps, svg and pdf, on linux probably gif, png and jpg as well. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: screenshot.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_SCREENSHOT, viewID, filename); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setBoundary.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setBoundary.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setBoundary.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setBoundary.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -function setBoundary(viewID, xmin, ymin, xmax, ymax) -%setBoundary Set the coordinates of the view. -% setBoundary(VIEWID, XMIN, YMIN, XMAX, YMAX) Set the current boundary -% for the given view (see getBoundary). - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setBoundary.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_BOUNDARY, viewID, 1+8+8+8+8); -message.string = [message.string uint8(sscanf(constants.TYPE_BOUNDINGBOX,'%x'))... - traci.packInt64([ymax xmax ymin xmin])]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setOffset.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setOffset.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setOffset.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setOffset.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -function setOffset(viewID, x, y) -%setOffset Set the offset of the view. -% setOffset(VIEWID, X, Y) Set the current offset for the given view. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setOffset.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_OFFSET, viewID, 1+8+8); -message.string = [message.string uint8(sscanf(constants.POSITION_2D,'%x'))... - traci.packInt64([y x])]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setSchema.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setSchema.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setSchema.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setSchema.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setSchema(viewID, schemeName) -%setSchema Set the coloring scheme of the view. -% setSchema(VIEWID, SCHEMENAME) Set the current coloring scheme for the -% given view. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setSchema.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_SCHEMA, viewID, schemeName); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setZoom.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setZoom.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setZoom.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/setZoom.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function setZoom(viewID, zoom) -%setZoom Set the zoom of the view. -% setZoom(VIEWID, ZOOM) Set the current zoom factor for the given view. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setZoom.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_VIEW_ZOOM, viewID, zoom); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -function subscribeContext(viewID, domain, dist, varargin) -%subscribeContext Subscribe to a view's context variable. -% subscribeContext(VIEWID,DOMAIN,DIST) Subscribe to the VAR_VIEW_OFFSET -% value of the SUMO objects that surround the view specified by VIEWID at -% a distance given by DIST, for the maximum allowed interval. The type of -% objets that surround the view are defined in the DOMAIN parameter. Note -% that not all the SUMO object types support the variable -% VAR_VIEW. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 2 2013-12-21 21:39:57Z aacosta $ - -global guiSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'gui.subscribeContext'; -p.addRequired('viewID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.VAR_VIEW_OFFSET}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(viewID, domain, dist, varargin{:}) -viewID = p.Results.viewID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -guiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.gui); - -guiSubscriptionResults.reset() -traci.subscribeContext(constants.CMD_SUBSCRIBE_GUI_CONTEXT,... - subscriptionBegin, subscriptionEnd, viewID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -function subscribe(viewID, varargin) -%subscribe Subscribe to view variable. -% subscribe(VIEWID) Subscribe to the VAR_VIEW_OFFSET value for the -% maximum allowed interval. -% subscribe(VIEWID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global guiSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'gui.subscribe'; -p.addRequired('viewID',@ischar) -p.addOptional('varIDs', {constants.VAR_VIEW_OFFSET}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(viewID, varargin{:}) -viewID = p.Results.viewID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -guiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.gui); -guiSubscriptionResults.reset() -traci.subscribe(constants.CMD_SUBSCRIBE_GUI_VARIABLE,... - subscriptionBegin, subscriptionEnd, viewID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/trackVehicle.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/trackVehicle.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/trackVehicle.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+gui/trackVehicle.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function trackVehicle(viewID, vehID) -%trackVehicle Track vehicle in SUMO gui. -% trackVehicle(viewID, vehID) Start visually tracking the given vehicle -% on the given view. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: trackVehicle.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_GUI_VARIABLE, constants.VAR_TRACK_VEHICLE, viewID, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function ContextSubscriptionResults = getContextSubscriptionResults(loopID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(LOOPID) -% Returns the context subscription results for the last time step and the -% given induction loop. If no induction loop id is given, all -% subscription results are returned in a containers.Map data struccure. -% If the induction loop id is unknown or the subscription did for any -% reason return no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global loopSubscriptionResults -if isempty(loopSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - loopID=None; -end -ContextSubscriptionResults = loopSubscriptionResults.getContext(loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the induction loops in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the induction loops in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDList = traci.inductionloop.getUniversal(constants.ID_LIST, ''); - \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLaneID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLaneID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLaneID.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLaneID.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function laneID = getLaneID(loopID) -%getLaneID Get the id of the lane the loop is on. -% laneID = getLaneID(LOOPID) Returns the id of the lane the loop is on. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLaneID.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -laneID = traci.inductionloop.getUniversal(constants.VAR_LANE_ID, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanLength.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanLength.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function lastStepMeanLength = getLastStepMeanLength(loopID) -%getLastStepMeanLength Get the mean length of the vehicles in the lane. -% lastStepMeanLength = getLastStepMeanLength(LOOPID) Returns the mean -% length in m of vehicles which were on the detector in the last step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepMeanLength.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepMeanLength = traci.inductionloop.getUniversal(constants.LAST_STEP_LENGTH, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepMeanSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function lastStepMeanSpeed = getLastStepMeanSpeed(loopID) -%getLastStepMeanSpeed Get the mean speed of the vehicles in the lane. -% lastStepMeanSpeed = getLastStepMeanSpeed(LOOPID) Returns the mean -% speed in m/s of vehicles that were on the named induction loop within -% the last simulation step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepMeanSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepMeanSpeed = traci.inductionloop.getUniversal(constants.LAST_STEP_MEAN_SPEED, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepOccupancy.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepOccupancy.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepOccupancy.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepOccupancy.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function lastStepOccupancy = getLastStepOccupancy(loopID) -%getLastStepOccupancy Get the percentage of time the loop was occupied. -% lastStepOccupancy = getLastStepOccupancy(LOOPID) Returns the percentage -% of time the detector was occupied by a vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepOccupancy.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepOccupancy = traci.inductionloop.getUniversal(constants.LAST_STEP_OCCUPANCY, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleIDs.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleIDs.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleIDs.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleIDs.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function lastStepVehicleIDs = getLastStepVehicleIDs(loopID) -%getLastStepVehicleIDs Get the IDs of the vehicles that were in the loop. -% lastStepVehicleIDs = getLastStepVehicleIDs(LOOPID) Returns the list of -% ids of vehicles that were on the named induction loop in the last -% simulation step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepVehicleIDs.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepVehicleIDs = traci.inductionloop.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getLastStepVehicleNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function lastStepVehicleNumber = getLastStepVehicleNumber(loopID) -%getLastStepVehicleNumber Get number of vehicles in the loop. -% lastStepVehicleNumber = getLastStepVehicleNumber(LOOPID) Returns the -% number of vehicles that were on the named induction loop within the last simulation step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepVehicleNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepVehicleNumber = traci.inductionloop.getUniversal(... - constants.LAST_STEP_VEHICLE_NUMBER, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getPosition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getPosition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getPosition.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getPosition.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function position = getPosition(loopID) -%getPosition Get the position of the loop. -% position = getPosition(LOOPID) Returns the position measured from the -% beginning of the lane in meters. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getPosition.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -position = traci.inductionloop.getUniversal(constants.VAR_POSITION, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function subscriptionResults = getSubscriptionResults(loopID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(LOOPID) Returns the -% subscription results for the last time step and the given induction loop. If no -% induction loop id is given, all subscription results are returned in a -% containers.Map data structure. -% If the induction loop id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global loopSubscriptionResults -if isempty(loopSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - loopID = 'None'; -end - -subscriptionResults = loopSubscriptionResults.get(loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getTimeSinceDetection.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getTimeSinceDetection.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getTimeSinceDetection.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getTimeSinceDetection.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function timeSinceDetection = getTimeSinceDetection(loopID) -%getTimeSinceDetection Get the time since the last detection. -% timeSinceDetection = getTimeSinceDetection(LOOPID) Returns the time in -% seconds since last detection. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getTimeSinceDetection.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -timeSinceDetection = traci.inductionloop.getUniversal(constants.LAST_STEP_TIME_SINCE_DETECTION, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, loopID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global inductionloopSubscriptionResults - -if isempty(inductionloopSubscriptionResults) - returnValueFunc = traci.RETURN_VALUE_FUNC.inductionloop; -else - returnValueFunc = inductionloopSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_INDUCTIONLOOP_VARIABLE,varID,loopID); -handleReturValueFunc = str2func(returnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getVehicleData.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getVehicleData.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getVehicleData.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/getVehicleData.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function vehicleData = getVehicleData(loopID) -%getVehicleData Get several data about passed vehicles. -% vehicleData = getVehicleData(LOOPID) Returns a cell structure -% containing several information about vehicles which passed the detector. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getVehicleData.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -vehicleData = traci.inductionloop.getUniversal(constants.LAST_STEP_VEHICLE_DATA, loopID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/readVehicleData.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/readVehicleData.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/readVehicleData.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/readVehicleData.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -function data = readVehicleData(result) -%readVehicleData Internal function to read several vehicle information. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: readVehicleData.m 2 2013-12-21 21:39:57Z aacosta $ - -result.readLength(); -nbData = result.readInt(); -data = {}; -for i=1:nbData - result.read(1); - vehID = result.readString(); - result.read(1); - len = result.readDouble(); - result.read(1); - entryTime = result.readDouble(); - result.read(1); - leaveTime = result.readDouble(); - result.read(1); - typeID = result.readString(); - data = [data, vehID, len, entryTime, leaveTime, typeID]; -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -function subscribeContext(loopID, domain, dist, varargin) -%subscribeContext Subscribe to an induction loop's context variable. -% subscribeContext(LOOPID,DOMAIN,DIST) Subscribe to the -% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the -% induction loop specified by LOOPID at a distance given by DIST, for the -% maximum allowed interval. The type of objets that surround the -% induction loop are defined in the DOMAIN parameter. Note that not all -% the SUMO object types support the variable LAST_STEP_VEHICLE_NUMBER. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 2 2013-12-21 21:39:57Z aacosta $ - -global loopSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'inductionloop.subscribeContext'; -p.addRequired('loopID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(loopID, domain, dist, varargin{:}) -loopID = p.Results.loopID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -loopSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.inductionloop); - -loopSubscriptionResults.reset() -traci.subscribeContext(constants.CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT,... - subscriptionBegin, subscriptionEnd, loopID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+inductionloop/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function subscribe(loopID, varargin) -%subscribe Subscribe to induction loop variable. -% subscribe(LOOPID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for -% the maximum allowed interval. -% subscribe(LOOPID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global loopSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'inductionloop.subscribe'; -p.addRequired('loopID',@ischar) -p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(loopID, varargin{:}) -loopID = p.Results.loopID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -loopSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.inductionloop); - -loopSubscriptionResults.reset() -traci.subscribe(constants.CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE,... - subscriptionBegin, subscriptionEnd, loopID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/init.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/init.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/init.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/init.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -function [traciVersion sumoVersion] = init(varargin) -%INIT Initialize the connection to the SUMO server. -% INIT() Initialize the connection to the SUMO server using the socket -% localhost:8813. The SUMO server must be listening on the same socket. -% The label of the connection is 'default'. The connection is attempted -% for a number of retries of ten. -% -% INIT(PORT) Initialize the connection to the SUMO server in the -% localhost:PORT socket. -% -% INIT(PORT,NUMRETRIES) Try the connection for the given number of -% retries. -% -% INIT(...,HOST) Specify the ip address of the SUMO server as a string -% e.g. '192.168.1.15'. -% -% INIT(...,LABEL) Specify a label for the connection. -% -% [TRACIVERSION,SUMOVERSION] = INIT(...) Returns the TRACIVERSION and the -% SUMOVERSION. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: init.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants - -% Add the DataReader class -[pathstr,~,~] = fileparts(which('traci.init')); -javaaddpath([pathstr '\..\traci4matlab.jar']); - -global connections - -% Parse the input -p = inputParser; -p.FunctionName = 'traci.init'; -p.addOptional('port', 8813, @(x)isnumeric(x) && length(x)==1) -p.addOptional('numRetries', 10, @(x)isnumeric(x) && length(x)==1) -p.addOptional('host', '127.0.0.1', @ischar) -p.addOptional('label', 'default', @ischar) -p.parse(varargin{:}) - -port = p.Results.port; -numRetries = p.Results.numRetries; -host = p.Results.host; -label = p.Results.label; - -% Create the tcp object -if isempty(connections) - connections = containers.Map(); - connections(label) = traci.Socket(); - connections('') = connections(label); -end - -% Connect to the SUMO server within the given number of retries -err = []; -for i=1:numRetries - try - connections(label).connect(host, port); - break - catch err - pause(i) - end -end -if ~isempty(err) - rethrow(err); -end - -[traciVersion sumoVersion] = traci.getVersion(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function ContextSubscriptionResults = getContextSubscriptionResults(junctionID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(JUNCTIONID) -% Returns the context subscription results for the last time step and the -% given junction. If no junction id is given, all subscription results are -% returned in a containers.Map data struccure. If the junction id is unknown -% or the subscription did for any reason return no data, 'None' is -% returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global junctionSubscriptionResults -if isempty(junctionSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - junctionID=None; -end -ContextSubscriptionResults = junctionSubscriptionResults.getContext(junctionID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the junctions in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the junctions in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDList = traci.junction.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getPosition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getPosition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getPosition.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getPosition.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function position = getPosition(junctionID) -%getPosition Get the position of the junction. -% position = getPosition(JUNCTIONID) Returns the coordinates of the -% center of the junction. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getPosition.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -position = traci.junction.getUniversal(constants.VAR_POSITION, junctionID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function subscriptionResults = getSubscriptionResults(junctionID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(JUNCTIONID) Returns the -% subscription results for the last time step and the given junction. If no -% junction id is given, all subscription results are returned in a -% containers.Map data structure. -% If the junction id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global junctionSubscriptionResults -if isempty(junctionSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - junctionID = 'None'; -end - -subscriptionResults = junctionSubscriptionResults.get(junctionID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, junctionID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global junctionSubscriptionResults - -if isempty(junctionSubscriptionResults) - returnValueFunc = traci.RETURN_VALUE_FUNC.junction; -else - returnValueFunc = junctionSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_JUNCTION_VARIABLE,varID,junctionID); -handleReturValueFunc = str2func(returnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -function subscribeContext(junctionID, domain, dist, varargin) -%subscribeContext Subscribe to a junction's context variable. -% subscribeContext(JUNCTIONID,DOMAIN,DIST) Subscribe to the -% VAR_POSITION value of the SUMO objects that surround the junction -% specified by JUNCTIONID at a distance given by DIST, for the maximum -% allowed interval. The type of objets that surround the junction are -% defined in the DOMAIN parameter. Note that not all the SUMO object -% types support the variable VAR_POSITION. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 2 2013-12-21 21:39:57Z aacosta $ - -global junctionSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'junction.subscribeContext'; -p.addRequired('junctionID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(junctionID, domain, dist, varargin{:}) -junctionID = p.Results.junctionID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -junctionSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.junction); - -junctionSubscriptionResults.reset() -traci.subscribeContext(constants.CMD_SUBSCRIBE_JUNCTION_CONTEXT,... - subscriptionBegin, subscriptionEnd, junctionID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+junction/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function subscribe(junctionID, varargin) -%subscribe Subscribe to junction variable. -% subscribe(JUNCTIONID) Subscribe to the VAR_POSITION value for the -% maximum allowed interval. -% subscribe(JUNCTIONID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global junctionSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'junction.subscribe'; -p.addRequired('junctionID',@ischar) -p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(junctionID, varargin{:}) -junctionID = p.Results.junctionID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -junctionSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.junction); - -junctionSubscriptionResults.reset() -traci.subscribe(constants.CMD_SUBSCRIBE_JUNCTION_VARIABLE,... - subscriptionBegin, subscriptionEnd, junctionID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getAllowed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getAllowed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getAllowed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getAllowed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function allowed = getAllowed(laneID) -%getAllowed Get the allowed vehicle classes in the lane. -% allowed = getAllowed(LANEID) Returns a cell array of strings containing -% the allowed vehicle classes. An empty cell array means all vehicles are -% allowed. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getAllowed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -allowed = traci.lane.getUniversal(constants.LANE_ALLOWED, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getCO2Emission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getCO2Emission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getCO2Emission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getCO2Emission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function CO2Emission = getCO2Emission(laneID) -%getCO2Emission Returns the CO2 emission on the given lane. -% CO2Emission = getCO2Emission(LANEID) Returns the CO2 emission in mg for -% the last time step on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getCO2Emission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -CO2Emission = traci.lane.getUniversal(constants.VAR_CO2EMISSION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getCOEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getCOEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getCOEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getCOEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function COEmission = getCOEmission(laneID) -%getCOEmission Returns the CO emission on the given lane. -% COEmission = getCOEmission(LANEID) Returns the CO emission in mg for -% the last time step on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getCOEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -COEmission = traci.lane.getUniversal(constants.VAR_COEMISSION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function ContextSubscriptionResults = getContextSubscriptionResults(laneID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(LANEID) -% Returns the context subscription results for the last time step and the -% given lane. If no lane id is given, all subscription results are -% returned in a containers.Map data struccure. If the lane id is unknown -% or the subscription did for any reason return no data, 'None' is -% returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global laneSubscriptionResults -if isempty(laneSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - laneID=None; -end -ContextSubscriptionResults = laneSubscriptionResults.getContext(laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getDisallowed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getDisallowed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getDisallowed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getDisallowed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function disallowed = getDisallowed(laneID) -%getDisallowed Get the disallowed vehicle classes in the lane. -% disallowed = getDisallowed(LANEID) Returns a cell array of strings containing -% the disallowed vehicle classes. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getDisallowed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -disallowed = traci.lane.getUniversal(constants.LANE_DISALLOWED, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getEdgeID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getEdgeID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getEdgeID.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getEdgeID.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function edgeID = getEdgeID(laneID) -%getEdgeID -% edgeID = getEdgeID(LANEID) Returns the id of the edge the lane belongs -% to. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getEdgeID.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -edgeID = traci.lane.getUniversal(constants.LANE_EDGE_ID, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getFuelConsumption.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getFuelConsumption.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getFuelConsumption.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getFuelConsumption.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function FuelConsumption = getFuelConsumption(laneID) -%getFuelConsumption Get the fuel consumption on the lane. -% fuelConsumption = getFuelConsumption(LANEID) Returns the fuel -% consumption in ml for the last time step on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getFuelConsumption.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -FuelConsumption = traci.lane.getUniversal(constants.VAR_FUELCONSUMPTION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getHCEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getHCEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getHCEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getHCEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function HCEmission = getHCEmission(laneID) -%getHCEmission Returns the HC emission on the given lane. -% HCEmission = getCOEmission(LANEID) Returns the HC emission in mg for -% the last time step on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getHCEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -HCEmission = traci.lane.getUniversal(constants.VAR_HCEMISSION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the lanes in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the lanes in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDList = traci.lane.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepHaltingNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepHaltingNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepHaltingNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepHaltingNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function lastStepHaltingNumber = getLastStepHaltingNumber(laneID) -%getLastStepHaltingNumber Get the number of halting vehicles. -% lastStepHaltingNumber = getLastStepHaltingNumber(LANEID) Returns the -% total number of halting vehicles for the last time step on the given -% lane. A speed of less than 0.1 m/s is considered a halt. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepHaltingNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepHaltingNumber = traci.lane.getUniversal(constants.LAST_STEP_VEHICLE_HALTING_NUMBER, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepLength.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepLength.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function lastStepLength = getLastStepLength(laneID) -%getLastStepLength Get the mean vehicle length on the lane. -% lastStepLength = getLastStepLength(LANEID) Returns the mean vehicle -% length in m for the last time step on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepLength.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepLength = traci.lane.getUniversal(constants.LAST_STEP_LENGTH, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepMeanSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepMeanSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepMeanSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepMeanSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function lastStepMeanSpeed = getLastStepMeanSpeed(laneID) -%getLastStepMeanSpeed Get the average speed on the lane. -% lastStepMeanSpeed = getLastStepMeanSpeed(LANEID) Returns the average -% speed in m/s for the last time step on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepMeanSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepMeanSpeed = traci.lane.getUniversal(constants.LAST_STEP_MEAN_SPEED, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepOccupancy.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepOccupancy.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepOccupancy.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepOccupancy.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function lastStepOccupancy = getLastStepOccupancy(laneID) -%getLastStepOccupancy Get the percentage of occupation on the lane. -% lastStepOccupancy = getLastStepOccupancy(LANEID) Returns the occupancy -% in percentage for the last time step on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepOccupancy.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepOccupancy = traci.lane.getUniversal(constants.LAST_STEP_OCCUPANCY, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepVehicleIDs.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepVehicleIDs.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepVehicleIDs.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepVehicleIDs.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function lastStepVehicleIDs = getLastStepVehicleIDs(laneID) -%getLastStepVehicleIDs Get the IDs of the vehicles in the lane. -% lastStepVehicleIDs = getLastStepVehicleIDs(LANEID) Returns cell array -% of strings containing the IDs of the vehicles for the last time step -% on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepVehicleIDs.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepVehicleIDs = traci.lane.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepVehicleNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepVehicleNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepVehicleNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLastStepVehicleNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function lastStepVehicleNumber = getLastStepVehicleNumber(laneID) -%getLastStepVehicleNumber Get the number vehicles in the lane. -% lastStepVehicleNumber = getLastStepVehicleNumber(LANEID) Returns the -% total number of vehicles for the last time step on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepVehicleNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepVehicleNumber = traci.lane.getUniversal(... - constants.LAST_STEP_VEHICLE_NUMBER, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLength.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLength.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function length = getLength(laneID) -%getLength -% length = getLength(LANEID) Returns the length of the lane in m. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLength.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -length = traci.lane.getUniversal(constants.VAR_LENGTH, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLinkNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLinkNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLinkNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLinkNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function linkNumber = getLinkNumber(laneID) -%getLinkNumber -% linkNumber = getLinkNumber(LANEID) Returns the number of connections to -% successive lanes. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLinkNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -linkNumber = traci.lane.getUniversal(constants.LANE_LINK_NUMBER, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLinks.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLinks.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLinks.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getLinks.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function links = getLinks(laneID) -%getLinks -% links = getLinks(LANEID) Returns a cell containing ids of successor -% lanes together with priority, open and foe. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLinks.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -links = traci.lane.getUniversal(constants.LANE_LINKS, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getMaxSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function maxSpeed = getMaxSpeed(laneID) -% getMaxSpeed Maximum allowed speed in the lane. -% maxSpeed = getMaxSpeed(LANEID) Returns the maximum allowed speed on the -% lane in m/s. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getMaxSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -maxSpeed = traci.lane.getUniversal(constants.VAR_MAXSPEED, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getNoiseEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getNoiseEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getNoiseEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getNoiseEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function noiseEmission = getNoiseEmission(laneID) -%getNoiseEmission Get the noise emission in the lane. -% noiseEmission = getNoiseEmission(LANEID) Returns the noise emission in -% db for the last time step on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getNoiseEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -noiseEmission = traci.lane.getUniversal(constants.VAR_NOISEEMISSION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getNOxEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getNOxEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getNOxEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getNOxEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function NOxEmission = getNOxEmission(laneID) -%getNOxEmission Get the NOx emission in the lane. -% NOxEmission = getNOxEmission(LANEID) Returns the NOx emission in mg for -% the last time step on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getNOxEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -NOxEmission = traci.lane.getUniversal(constants.VAR_NOXEMISSION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getPMxEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getPMxEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getPMxEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getPMxEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function PMxEmission = getPMxEmission(laneID) -%getPmxEmission Get the particular matter emission in the lane. -% pmxEmission = getPmxEmission(LANEID) Returns the particular matter -% emission in mg for the last time step on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getPMxEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -PMxEmission = traci.lane.getUniversal(constants.VAR_PMXEMISSION, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getShape.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getShape.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getShape.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getShape.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function shape = getShape(laneID) -%getShape Get the shape of the lane. -% shape = getShape(LANEID) Returns a list of 2D positions (cartesian) -% describing the geometry of the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getShape.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -shape = traci.lane.getUniversal(constants.VAR_SHAPE, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function subscriptionResults = getSubscriptionResults(laneID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(LANEID) Returns the -% subscription results for the last time step and the given lane. If no -% lane id is given, all subscription results are returned in a -% containers.Map data structure. -% If the lane id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global laneSubscriptionResults -if isempty(laneSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - laneID = 'None'; -end - -subscriptionResults = laneSubscriptionResults.get(laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getTraveltime.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getTraveltime.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function traveltime = getTraveltime(laneID) -%getTraveltime Get estimated travel time in the lane. -% traveltime = getTraveltime(LANEID) Returns the estimated travel time in -% seconds for the last time step on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getTraveltime.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traveltime = traci.lane.getUniversal(constants.VAR_CURRENT_TRAVELTIME, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, laneID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global laneSubscriptionResults - -if isempty(laneSubscriptionResults) - returnValueFunc = traci.RETURN_VALUE_FUNC.lane; -else - returnValueFunc = laneSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_LANE_VARIABLE,varID,laneID); -handleReturValueFunc = str2func(returnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getWidth.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getWidth.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getWidth.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/getWidth.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function width = getWidth(laneID) -%getWidth -% width = getWidth(LANEID) Returns the width of the lane in m. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getWidth.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -width = traci.lane.getUniversal(constants.VAR_WIDTH, laneID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/readLinks.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/readLinks.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/readLinks.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/readLinks.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -function links = readLinks(result) -%readLinks Internal function to read information about the links. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: readLinks.m 2 2013-12-21 21:39:57Z aacosta $ - -result.read(5) % Type Compound, Length -nbLinks = result.readInt(); -links = {}; -for i=1:nbLinks - result.read(1); % Type String - approachedLane = result.readString(); - result.read(1); % Type String - approachedInternal = result.readString(); - result.read(1); % Type Byte - hasPrio = result.read(1); - result.read(1); % Type Byte - isOpen = result.read(1); - result.read(1); % Type Byte - hasFoe = result.read(1); - result.read(1); % Type String - state = result.readString(); - result.read(1); % Type String - direction = result.readString(); - result.read(1); % Type Float - len = result.readDouble(); - links = [links approachedLane, hasPrio, isOpen, hasFoe]; -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setAllowed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setAllowed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setAllowed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setAllowed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -function setAllowed(laneID, allowedClasses) -import traci.constants -%setAllowed Set the allowed vehicle classes in the lane. -% setAllowed(LANEID,ALLOWEDCLASSES) Sets a list of allowed vehicle -% classes contained in a cell array of strings. Setting an empty list -% means all vehicles are allowed. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setAllowed.m 17 2014-05-30 14:32:09Z afacostag $ - -global message -traci.beginMessage(constants.CMD_SET_LANE_VARIABLE, constants.LANE_ALLOWED,... -laneID, 1+4+sum(cellfun('length', allowedClasses))+4*length(allowedClasses)); -message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ... - traci.packInt32(length(allowedClasses))]; -for i=1:length(allowedClasses) - message.string = [message.string traci.packInt32(length(... - allowedClasses{i})) uint8(allowedClasses{i})]; -end -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setDisallowed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setDisallowed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setDisallowed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setDisallowed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -function setDisallowed(laneID, disallowedClasses) -%setDisallowed Set the disallowed vehicle classes in the lane. -% setDisallowed(LANEID,DISALLOWEDCLASSES) Sets a list of disallowed -% vehicle classes contained in a cell array of strings. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setDisallowed.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_LANE_VARIABLE, constants.LANE_DISALLOWED,... -laneID, 1+4+sum(cellfun('length', disallowedClasses))+4*length(disallowedClasses)); -message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ... - traci.packInt32(length(disallowedClasses))]; -for i=1:length(disallowedClasses) - message.string = [message.string traci.packInt32(length(... - disallowedClasses{i})) uint8(disallowedClasses{i})]; -end -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setLength.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setLength.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function setLength(laneID, len) -%setLength -% setLength(LANEID,LENGTH) Sets the length of the lane in m. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setLength.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_LANE_VARIABLE, constants.VAR_LENGTH, laneID, len) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setMaxSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/setMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setMaxSpeed(laneID, speed) -%setMaxSpeed -% setMaxSpeed(LANEID,SPEED) Sets a new maximum allowed speed on the lane -% in m/s. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setMaxSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_LANE_VARIABLE, constants.VAR_MAXSPEED, laneID, speed) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -function subscribeContext(laneID, domain, dist, varargin) -%subscribeContext Subscribe to a lane's context variable. -% subscribeContext(LANEID,DOMAIN,DIST) Subscribe to the -% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the -% lane specified by LANEID at a distance given by DIST, for the maximum -% allowed interval. The type of objets that surround the lane are defined -% in the DOMAIN parameter. Note that not all the SUMO object types -% support the variable LAST_STEP_VEHICLE_NUMBER. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 2 2013-12-21 21:39:57Z aacosta $ - -global laneSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'lane.subscribeContext'; -p.addRequired('laneID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(laneID, domain, dist, varargin{:}) -laneID = p.Results.laneID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -laneSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.lane); - - -laneSubscriptionResults.reset() -traci.subscribeContext(constants.CMD_SUBSCRIBE_LANE_CONTEXT,... - subscriptionBegin, subscriptionEnd, laneID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+lane/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function subscribe(laneID, varargin) -%subscribe Subscribe to lane variable. -% subscribe(LANEID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for -% the maximum allowed interval. -% subscribe(LANEID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global laneSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'lane.subscribe'; -p.addRequired('laneID',@ischar) -p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(laneID, varargin{:}) -laneID = p.Results.laneID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -laneSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.lane); - -laneSubscriptionResults.reset() -traci.subscribe(constants.CMD_SUBSCRIBE_LANE_VARIABLE,... - subscriptionBegin, subscriptionEnd, laneID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/Message.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/Message.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/Message.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/Message.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -classdef Message -%Message A container for outgoing TraCI messages. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: Message.m 2 2013-12-21 21:39:57Z aacosta $ - - properties - string - queue - end -end diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -function ContextSubscriptionResults = getContextSubscriptionResults(detID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(DETID) -% Returns the context subscription results for the last time step and the -% given multi-entry/multi-exit detector. If no multi-entry/multi-exit -% detector id is given, all subscription results are returned in a -% containers.Map data struccure. If the multi-entry/multi-exit detector -% id is unknown or the subscription did for any reason return no data, -% 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global detSubscriptionResults -if isempty(detSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the context variable')); -end -if nargin < 1 - detID=None; -end -ContextSubscriptionResults = detSubscriptionResults.getContext(detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the multi-entry/multi-exit detectors in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the multi-entry/multi-exit detectors in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDList = traci.multientryexit.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepHaltingNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepHaltingNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepHaltingNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepHaltingNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function lastStepHaltingNumber = getLastStepHaltingNumber(detID) -%getLastStepHaltingNumber Get the number of halting vehicles. -% lastStepHaltingNumber = getLastStepHaltingNumber(DETID) Returns the -% total number of halting vehicles for the last time step on the given -% multi-entry/multi-exit detector. A speed of less than 0.1 m/s is -% considered a halt. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepHaltingNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepHaltingNumber = traci.multientryexit.getUniversal(constants.LAST_STEP_VEHICLE_HALTING_NUMBER, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepMeanSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepMeanSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepMeanSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepMeanSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function lastStepMeanSpeed = getLastStepMeanSpeed(detID) -%getLastStepMeanSpeed Get the average speed. -% lastStepMeanSpeed = getLastStepMeanSpeed(DETID) Returns the average -% speed in m/s for the last time step on the given multi-entry/multi-exit -% detector. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepMeanSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepMeanSpeed = traci.multientryexit.getUniversal(constants.LAST_STEP_MEAN_SPEED, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleIDs.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleIDs.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleIDs.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleIDs.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function lastStepVehicleIDs = getLastStepVehicleIDs(detID) -%getLastStepVehicleIDs Get the IDs of the vehicles. -% lastStepVehicleIDs = getLastStepVehicleIDs(DETID) Returns cell array -% of strings containing the IDs of the vehicles for the last time step -% on the given multi-entry/multi-exit detector. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepVehicleIDs.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepVehicleIDs = traci.multientryexit.getUniversal(constants.LAST_STEP_VEHICLE_ID_LIST, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getLastStepVehicleNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function lastStepVehicleNumber = getLastStepVehicleNumber(detID) -%getLastStepVehicleNumber Get the number vehicles. -% lastStepVehicleNumber = getLastStepVehicleNumber(DETID) Returns the -% total number of vehicles for the last time step on the given -% multi-entry/multi-exit detector. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLastStepVehicleNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lastStepVehicleNumber = traci.multientryexit.getUniversal(constants.LAST_STEP_VEHICLE_NUMBER, detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -function subscriptionResults = getSubscriptionResults(detID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(DETID) Returns the -% subscription results for the last time step and the given -% multi-entry/multi-exit detector. If no multi-entry/multi-exit detector -% id is given, all subscription results are returned in a containers.Map -% data structure. -% If the multi-entry/multi-exit detector id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global detSubscriptionResults -if isempty(detSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - detID = 'None'; -end - -subscriptionResults = detSubscriptionResults.get(detID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, detID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global detSubscriptionResults - -if isempty(detSubscriptionResults) - returnValueFunc = traci.RETURN_VALUE_FUNC.multientryexit; -else - returnValueFunc = detSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,varID,detID); -handleReturValueFunc = str2func(returnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,48 +0,0 @@ -function subscribeContext(detID, domain, dist, varargin) -%subscribeContext Subscribe to a multi-entry/multi-exit detector's context -% variable. -% subscribeContext(EDGEID,DOMAIN,DIST) Subscribe to the -% LAST_STEP_VEHICLE_NUMBER value of the SUMO objects that surround the -% multi-entry/multi-exit detector specified by EDGEID at a distance given -% by DIST, for the maximum allowed interval. The type of objets that -% surround the multi-entry/multi-exit detector are defined in the DOMAIN -% parameter. Note that not all the SUMO object types support the variable -% LAST_STEP_VEHICLE_NUMBER. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 2 2013-12-21 21:39:57Z aacosta $ - -global detSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'multientryexit.subscribeContext'; -p.addRequired('detID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(detID, domain, dist, varargin{:}) -detID = p.Results.detID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -detSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.multientryexit); - -detSubscriptionResults.reset() -traci.subscribeContext(constants.CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT,... - subscriptionBegin, subscriptionEnd, detID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+multientryexit/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -function subscribe(detID, varargin) -%subscribe Subscribe to multi-entry/multi-exit detector variable. -% subscribe(DETID) Subscribe to the LAST_STEP_VEHICLE_NUMBER value for -% the maximum allowed interval. -% subscribe(DETID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global detSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'det.subscribe'; -p.addRequired('detID',@ischar) -p.addOptional('varIDs', {constants.LAST_STEP_VEHICLE_NUMBER}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(detID, varargin{:}) -detID = p.Results.detID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -detSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.multientryexit); - - -detSubscriptionResults.reset() -traci.subscribe(constants.CMD_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,... - subscriptionBegin, subscriptionEnd, detID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/packInt32.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/packInt32.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/packInt32.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/packInt32.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function packedData = packInt32(data) -%packInt32 Internal function to cast an int32 into -% an uint8 array - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: packInt32.m 19 2014-05-30 15:08:25Z afacostag $ - -if isa(data,'int32') - packedData = fliplr(typecast(data,'uint8')); -else - packedData = fliplr(typecast(int32(data),'uint8')); -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/packInt64.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/packInt64.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/packInt64.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/packInt64.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -function packedData = packInt64(data) -%packInt32 Internal function to cast an int64 into -% an uint8 array - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: packInt64.m 19 2014-05-30 15:08:25Z afacostag $ - -packedData = fliplr(typecast(data,'uint8')); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/add.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/add.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/add.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/add.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -function add(poiID, x, y, color, poiType, layer) -%add Add a point of interest (poi) to the SUMO network. -% add(POIID,X,Y,COLOR) Adds a poi with the id POIID to the coordinates -% X and Y, with the specified color. COLOR is a four-element vector whose -% elements range from 0 to 255, they represent the R, G, B and Alpha -% (unused) components of the color. -% add(...,POITYPE) Assigns a type POITYPE to the added poi. -% add(...,LAYER) Adds the poi to the given layer. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: add.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message - -if nargin < 6 - layer = 0; - if nargin < 5 - poiType = ''; - end -end -typeCompound = sscanf(constants.TYPE_COMPOUND,'%x'); -typeString = sscanf(constants.TYPE_STRING,'%x'); -typeColor = sscanf(constants.TYPE_COLOR,'%x'); -typeInteger = sscanf(constants.TYPE_INTEGER,'%x'); -position2D = sscanf(constants.POSITION_2D,'%x'); -traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.ADD, poiID,... - 1+4 + 1+4+length(poiType) + 1+1+1+1+1 + 1+4 + 1+8+8); -message.string = [message.string uint8(typeCompound) traci.packInt32(4)]; -message.string = [message.string uint8(typeString) traci.packInt32(length(poiType)) uint8(poiType)]; -message.string = [message.string uint8([typeColor color])]; -message.string = [message.string uint8(typeInteger) traci.packInt32(layer)]; -message.string = [message.string uint8(position2D) traci.packInt64([x y])]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getColor.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getColor.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function color = getColor(poiID) -%getColor Get the color of the poi. -% color = getColor(POIID) Returns the rgba color of the given poi. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getColor.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -color = traci.poi.getUniversal(constants.VAR_COLOR, poiID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function ContextSubscriptionResults = getContextSubscriptionResults(poiID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(POIID) -% Returns the context subscription results for the last time step and the -% given poi. If no poi id is given, all subscription results are -% returned in a containers.Map data struccure. If the poi id is unknown -% or the subscription did for any reason return no data, 'None' is -% returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global poiSubscriptionResults -if isempty(poiSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - poiID=None; -end -ContextSubscriptionResults = poiSubscriptionResults.getContext(poiID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the pois in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the pois in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDList = traci.poi.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getPosition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getPosition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getPosition.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getPosition.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function position = getPosition(poiID) -%getPosition Get the position of the poi. -% position = getPosition(POIID) Returns the position coordinates of -% the given poi. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getPosition.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -position = traci.poi.getUniversal(constants.VAR_POSITION, poiID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function subscriptionResults = getSubscriptionResults(poiID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(POIID) Returns the -% subscription results for the last time step and the given poi. If no -% poi id is given, all subscription results are returned in a -% containers.Map data structure. -% If the poi id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global poiSubscriptionResults -if isempty(poiSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - poiID = 'None'; -end - -subscriptionResults = poiSubscriptionResults.get(poiID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getType.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getType.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getType.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getType.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function type = getType(poiID) -%getType -% type = getType(POIID) Returns the (abstract) type of the poi. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getType.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -type = traci.poi.getUniversal(constants.VAR_TYPE, poiID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, poiID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global poiSubscriptionResults - -if isempty(poiSubscriptionResults) - returnValueFunc = traci.RETURN_VALUE_FUNC.poi; -else - returnValueFunc = poiSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_POI_VARIABLE,varID,poiID); -handleReturValueFunc = str2func(returnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/remove.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/remove.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/remove.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/remove.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -function remove(poiID, layer) -%remove Remove the poi from the SUMO network. -% remove(POIID,LAYER) Removes the poi identified with POIID and -% associated to the given layer. If no layer is given, it defaults to 0. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: remove.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -if nargin < 2 - layer = 0; -end -traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.REMOVE, poiID, 1+4); -message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(layer)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/setColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/setColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/setColor.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/setColor.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -function setColor(poiID, color) -%setColor -% setColor(POIID,COLOR) Sets the rgba color of the poi. COLOR is a -% four-element vector whose elements range from 0 to 255, they represent -% the R, G, B and Alpha (unused) components of the color. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setColor.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.VAR_COLOR, poiID, 1+1+1+1+1); -message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/setPosition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/setPosition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/setPosition.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/setPosition.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function setPosition(poiID, x, y) -%setPosition -% setPosition(POIID,X,Y) Sets the position coordinates of the poi. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setPosition.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.VAR_POSITION, poiID, 1+8+8); -message.string = [message.string uint8(sscanf(constants.POSITION_2D,'%x')) traci.packInt64([y x])]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/setType.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/setType.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/setType.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/setType.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -function setType(poiID, poiType) -%setType -% setType(POIID,POITYPE) Sets the (abstract) type of the poi. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setType.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_POI_VARIABLE, constants.VAR_TYPE, poiID, 1+4+length(poiType)); -message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x'))... - traci.packInt32(length(poiType)) uint8(poiType)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -function subscribeContext(poiID, domain, dist, varargin) -%subscribeContext Subscribe to a poi's context variable. -% subscribeContext(POIID,DOMAIN,DIST) Subscribe to the -% VAR_POSITION value of the SUMO objects that surround the poi specified by -% POIID at a distance given by DIST, for the maximum allowed interval. -% The type of objets that surround the poi are defined in the DOMAIN -% parameter. Note that not all the SUMO object types support the variable -% VAR_POSITION. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 2 2013-12-21 21:39:57Z aacosta $ - -global poiSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'poi.subscribeContext'; -p.addRequired('poiID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(poiID, domain, dist, varargin{:}) -poiID = p.Results.poiID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -poiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.poi); - -poiSubscriptionResults.reset() -traci.subscribeContext(constants.CMD_SUBSCRIBE_POI_CONTEXT,... - subscriptionBegin, subscriptionEnd, poiID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+poi/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function subscribe(poiID, varargin) -%subscribe Subscribe to poi variable. -% subscribe(POIID) Subscribe to the VAR_POSITION value for the maximum -% allowed interval. -% subscribe(POIID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global poiSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'poi.subscribe'; -p.addRequired('poiID',@ischar) -p.addOptional('varIDs', {constants.VAR_POSITION}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(poiID, varargin{:}) -poiID = p.Results.poiID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -poiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.poi); - -poiSubscriptionResults.reset() -traci.subscribe(constants.CMD_SUBSCRIBE_POI_VARIABLE,... - subscriptionBegin, subscriptionEnd, poiID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/add.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/add.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/add.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/add.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -function add(polygonID, shape, color, fill, polygonType, layer) -%add Add a polygon to the SUMO network. -% add(POLYGONID,SHAPE,COLOR) Adds a polygon with the id POLYGONID to the -% with the given shape and color. SHAPE is a cell array whose elements -% are 2-dimensional vectors that represent the x and y coordinates of the -% points that define the shape of the polygon. COLOR is a four-element -% vector whose elements range from 0 to 255, they represent the R, G, B -% and Alpha (unused) components of the color. -% add(...,FILL) Is a boolean value which specifies if the polygon has to -% be filled. -% add(...,POLYGONTYPE) Assigns a type POLYGONTYPE to the added polygon. -% add(...,LAYER) Adds the poi to the given layer. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: add.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message - -if nargin < 6 - layer = 0; - if nargin < 5 - polygonType = ''; - if nargin < 4 - fill = false; - end - end -end - -typeCompound = sscanf(constants.TYPE_COMPOUND,'%x'); -typeString = sscanf(constants.TYPE_STRING,'%x'); -typeColor = sscanf(constants.TYPE_COLOR,'%x'); -typeInteger = sscanf(constants.TYPE_INTEGER,'%x'); -typeUbyte = sscanf(constants.TYPE_UBYTE,'%x'); -typePolygon = sscanf(constants.TYPE_POLYGON,'%x'); - -traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.ADD, polygonID,... - 1+4 + 1+4+length(polygonType) + 1+1+1+1+1 + 1+1 + 1+4 + 1+1+length(shape)*(8+8)); -message.string = [message.string uint8(typeCompound) traci.packInt32(4)]; -message.string = [message.string uint8(typeString) traci.packInt32(length(polygonType)) uint8(polygonType)]; -message.string = [message.string uint8([typeColor color])]; -message.string = [message.string uint8([typeUbyte fill])]; -message.string = [message.string uint8(typeInteger) traci.packInt32(layer)]; -message.string = [message.string uint8([typePolygon length(shape)])]; -for i=1:length(shape) - message.string = [message.string traci.packInt64(fliplr(shape{i}))]; -end -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getColor.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getColor.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function color = getColor(polygonID) -%getColor Get the color of the polygon. -% color = getColor(POLYGONID) Returns the rgba color of the given polygon. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getColor.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -color = traci.polygon.getUniversal(constants.VAR_COLOR, polygonID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function ContextSubscriptionResults = getContextSubscriptionResults(polygonID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(POLYGONID) -% Returns the context subscription results for the last time step and the -% given polygon. If no polygon id is given, all subscription results are -% returned in a containers.Map data struccure. If the polygon id is unknown -% or the subscription did for any reason return no data, 'None' is -% returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global polygonSubscriptionResults -if isempty(polygonSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - polygonID=None; -end -ContextSubscriptionResults = polygonSubscriptionResults.getContext(polygonID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the polygons in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the polygons in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDList = traci.polygon.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getShape.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getShape.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getShape.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getShape.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function shape = getShape(polygonID) -%getShape Get the shape of the polygon. -% shape = getShape(POLYGONID) Returns the shape of the given polygon, -% which is a cell array containing 2-dimensional vectors that represent -% the x and y coordinates of the points that define the shape of the -% polygon. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getShape.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -shape = traci.polygon.getUniversal(constants.VAR_SHAPE, polygonID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function subscriptionResults = getSubscriptionResults(polygonID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(POLYGONID) Returns the -% subscription results for the last time step and the given polygon. If no -% polygon id is given, all subscription results are returned in a -% containers.Map data structure. -% If the polygon id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global polygonSubscriptionResults -if isempty(polygonSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - polygonID = 'None'; -end - -subscriptionResults = polygonSubscriptionResults.get(polygonID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getType.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getType.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getType.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getType.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function type = getType(polygonID) -%getType -% type = getType(POLYGONID) Returns the (abstract) type of the polygon. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getType.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -type = traci.polygon.getUniversal(constants.VAR_TYPE, polygonID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, polygonID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global polygonSubscriptionResults - -if isempty(polygonSubscriptionResults) - returnValueFunc = traci.RETURN_VALUE_FUNC.polygon; -else - returnValueFunc = polygonSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_POLYGON_VARIABLE,varID,polygonID); -handleReturValueFunc = str2func(returnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/remove.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/remove.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/remove.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/remove.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -function remove(polygonID, layer) -%remove Remove the polygon from the SUMO network. -% remove(POLYGONID,LAYER) Removes the polygon identified with POLYGONID -% and associated to the given layer. If no layer is given, it defaults to 0. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: remove.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -if nargin < 2 - layer = 0; -end -traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.REMOVE, polygonID, 1+4); -message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(layer)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/setColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/setColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/setColor.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/setColor.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -function setColor(polygonID, color) -%setColor -% setColor(POLYGONID,COLOR) Sets the rgba color of the polygon. COLOR is -% a four-element vector whose elements range from 0 to 255, they represent -% the R, G, B and Alpha (unused) components of the color. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setColor.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.VAR_COLOR, polygonID, 1+1+1+1+1); -message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/setShape.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/setShape.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/setShape.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/setShape.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -function setShape(polygonID, shape) -%setShape Sets the shape of the polygon. -% setShape(POLYGONID,SHAPE) Sets the shape of the polygon to the given. -% SHAPE is a cell array whose elements are 2-dimensional vectors that -% represent the x and y coordinates of the points that define the shape -% of the polygon. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setShape.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.VAR_SHAPE, polygonID, 1+1+length(shape)*(8+8)); -message.string = [message.string uint8([sscanf(constants.TYPE_POLYGON,'%x') length(shape)])]; -for i=1:length(shape) - message.string = [message.string traci.packInt64(fliplr(shape{i}))]; -end -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/setType.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/setType.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/setType.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/setType.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -function setType(polygonID, polygonType) -%setType -% setType(POLYGONID,POLYGONTTYPE) Sets the (abstract) type of the polygon. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setType.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_POLYGON_VARIABLE, constants.VAR_TYPE, polygonID, 1+4+length(polygonType)); -message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... - traci.packInt32(length(polygonType)) uint8(polygonType)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -function subscribeContext(polygonID, domain, dist, varargin) -%subscribeContext Subscribe to a polygon's context variable. -% subscribeContext(POLYGONID,DOMAIN,DIST) Subscribe to the -% VAR_SHAPE value of the SUMO objects that surround the polygon specified -% by POLYGONID at a distance given by DIST, for the maximum allowed -% interval. The type of objets that surround the polygon are defined in -% the DOMAIN parameter. Note that not all the SUMO object types support -% the variable VAR_SHAPE. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 2 2013-12-21 21:39:57Z aacosta $ - -global polygonSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'polygon.subscribeContext'; -p.addRequired('polygonID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.VAR_SHAPE}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(polygonID, domain, dist, varargin{:}) -polygonID = p.Results.polygonID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -polygonSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.polygon); - -polygonSubscriptionResults.reset() -traci.subscribeContext(constants.CMD_SUBSCRIBE_POLYGON_CONTEXT,... - subscriptionBegin, subscriptionEnd, polygonID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+polygon/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function subscribe(polygonID, varargin) -%subscribe Subscribe to polygon variable. -% subscribe(POLYGONID) Subscribe to the VAR_SHAPE value for the maximum -% allowed interval. -% subscribe(POLYGONID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global polygonSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'polygon.subscribe'; -p.addRequired('polygonID',@ischar) -p.addOptional('varIDs', {constants.VAR_SHAPE}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(polygonID, varargin{:}) -polygonID = p.Results.polygonID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -polygonSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.polygon); - -polygonSubscriptionResults.reset() -traci.subscribe(constants.CMD_SUBSCRIBE_POLYGON_VARIABLE,... - subscriptionBegin, subscriptionEnd, polygonID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/readSubscription.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/readSubscription.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/readSubscription.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/readSubscription.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,136 +0,0 @@ -function [response, objectID] = readSubscription(result) -%readSubscription Internal function to read the TraCI subscriptions. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: readSubscription.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global edgeSubscriptionResults guiSubscriptionResults ... - loopSubscriptionResults junctionSubscriptionResults ... - laneSubscriptionResults detSubscriptionResults ... - poiSubscriptionResults polygonSubscriptionResults ... - routeSubscriptionResults simSubscriptionResults ... - tlSubscriptionResults vehSubscriptionResults ... - typeSubscriptionResults - -subscriptionResults = containers.Map({... - constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_TL_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_LANE_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_VEHICLE_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_VEHICLETYPE_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_ROUTE_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_POI_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_POLYGON_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_EDGE_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_SIM_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_GUI_VARIABLE,... - constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT,... - constants.RESPONSE_SUBSCRIBE_MULTI_ENTRY_EXIT_DETECTOR_CONTEXT,... - constants.RESPONSE_SUBSCRIBE_TL_CONTEXT,... - constants.RESPONSE_SUBSCRIBE_LANE_CONTEXT,... - constants.RESPONSE_SUBSCRIBE_VEHICLE_CONTEXT,... - constants.RESPONSE_SUBSCRIBE_VEHICLETYPE_CONTEXT,... - constants.RESPONSE_SUBSCRIBE_ROUTE_CONTEXT,... - constants.RESPONSE_SUBSCRIBE_POI_CONTEXT,... - constants.RESPONSE_SUBSCRIBE_POLYGON_CONTEXT,... - constants.RESPONSE_SUBSCRIBE_JUNCTION_CONTEXT,... - constants.RESPONSE_SUBSCRIBE_EDGE_CONTEXT,... - constants.RESPONSE_SUBSCRIBE_SIM_CONTEXT,... - constants.RESPONSE_SUBSCRIBE_GUI_CONTEXT,... - constants.CMD_GET_INDUCTIONLOOP_VARIABLE,... - constants.CMD_GET_MULTI_ENTRY_EXIT_DETECTOR_VARIABLE,... - constants.CMD_GET_TL_VARIABLE,... - constants.CMD_GET_LANE_VARIABLE,... - constants.CMD_GET_VEHICLE_VARIABLE,... - constants.CMD_GET_VEHICLETYPE_VARIABLE,... - constants.CMD_GET_ROUTE_VARIABLE,... - constants.CMD_GET_POI_VARIABLE,... - constants.CMD_GET_POLYGON_VARIABLE,... - constants.CMD_GET_JUNCTION_VARIABLE,... - constants.CMD_GET_EDGE_VARIABLE,... - constants.CMD_GET_SIM_VARIABLE,... - constants.CMD_GET_GUI_VARIABLE},... - {loopSubscriptionResults, detSubscriptionResults,... - tlSubscriptionResults, laneSubscriptionResults,... - vehSubscriptionResults, typeSubscriptionResults,... - routeSubscriptionResults, poiSubscriptionResults,... - polygonSubscriptionResults, junctionSubscriptionResults,... - edgeSubscriptionResults, simSubscriptionResults,... - guiSubscriptionResults,... - loopSubscriptionResults, detSubscriptionResults,... - tlSubscriptionResults, laneSubscriptionResults,... - vehSubscriptionResults, typeSubscriptionResults,... - routeSubscriptionResults, poiSubscriptionResults,... - polygonSubscriptionResults, junctionSubscriptionResults,... - edgeSubscriptionResults, simSubscriptionResults,... - guiSubscriptionResults,... - loopSubscriptionResults, detSubscriptionResults,... - tlSubscriptionResults, laneSubscriptionResults,... - vehSubscriptionResults, typeSubscriptionResults,... - routeSubscriptionResults, poiSubscriptionResults,... - polygonSubscriptionResults, junctionSubscriptionResults,... - edgeSubscriptionResults, simSubscriptionResults,... - guiSubscriptionResults,... - }); -result.readLength(); -response = result.read(1); -strresponse = ['0x' sprintf('%x',response)]; -% Determine if the subscription is context related. -isVariableSubscription = response>=sscanf(... - traci.constants.RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE,'%x')... - && response<=sscanf(traci.constants.RESPONSE_SUBSCRIBE_GUI_VARIABLE,'%x'); -objectID = result.readString(); - -% Read the domain if the subscription was made to a context -if ~isVariableSubscription - domain = result.read(1); - strdomain = ['0x' sprintf('%.2x',domain)]; -end - -% Read the number of variables to which the client is subscribed -numVars = result.read(1); - -% Populate the global TraCI modules -if isVariableSubscription - while numVars > 0 - varID = result.read(1); - status = result.read(1); - result.read(1); - if status - traci.close(); - throw(MException('traci:FatalTraciError','Error %s', result.readString())); - elseif isKey(subscriptionResults, strresponse) - subsResultsHandle = subscriptionResults(strresponse); - subsResultsHandle.add(objectID,... - ['0x' sprintf('%.2x',varID)], result); - else - throw(MException('traci:FatalTraciError','Cannot handle subscription response %s for %s\n',... - num2str(response), objectID)); - end - numVars = numVars - 1; - end -else - objectNo = result.readInt(); - for o=1:objectNo - oid = result.readString(); - for v=1:numVars - varID = result.read(1); - status = result.read(1); - result.read(1); - if status - throw(MException('traci:FatalTraciError','Error %s', result.readString())); - elseif isKey(subscriptionResults, strresponse) - subsResultsHandle = subscriptionResults(strresponse); - domainHandle = subscriptionResults(strdomain); - subsResultsHandle.addContext(objectID, domainHandle, oid, ['0x' sprintf('%.2x',varID)], result); - else - throw(MException('traci:FatalTraciError','Cannot handle subscription response %.2x for %s.', num2str(response), objectID)); - end - end - end -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/recvExact.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/recvExact.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/recvExact.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/recvExact.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -function result = recvExact() -%recvExact Internal function to receive the response from SUMO server. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: recvExact.m 17 2014-05-30 14:32:09Z afacostag $ - -global connections - -% recvlength = []; -% connections('').BytesAvailable - -% Receive the total length of the response -% while length(recvlength) < 1 - -% We tried to address the issue that arises when the user closes -% the SUMO GUI without closing the connection from the client through -% this workaround. Unfortunately, it leads to an incredibly high -% slowdown. -% connClosed = strcmp(system('netstat | findstr 8813'),''); -% if connClosed -% result = []; -% break -% end -% t = connections('').readInt(); -% if isempty(t) -% result = []; -% return -% end -% recvlength = [recvlength t]; -% end - -activeConnection = connections(''); -recvLength = activeConnection.dis.readInt() - 4; - -% Receive the response - -result = typecast(activeConnection.dataReader.readBuffer(recvLength),'uint8'); - -% while length(result) < recvlength -% t = fread(connections(''),recvlength-length(result),'uint8'); -% % flushinput(connections('')); -% if isempty(t) -% result = []; -% return -% end -% result = [result t]; -% end - -% Construct the traci.Storage object containing the result -result = traci.Storage(uint8(result')); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/RETURN_VALUE_FUNC.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/RETURN_VALUE_FUNC.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/RETURN_VALUE_FUNC.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/RETURN_VALUE_FUNC.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,222 +0,0 @@ -classdef RETURN_VALUE_FUNC - %RETURN_VALUE_FUNC A class to store the functions to read the TraCI - %results for each SUMO object. - - % Copyright 2013 Universidad Nacional de Colombia, - % Politecnico Jaime Isaza Cadavid. - % Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. - % $Id: RETURN_VALUE_FUNC.m 13 2014-03-13 21:41:33Z afacostag $ - - properties (Constant) - areal = containers.Map({... - traci.constants.ID_LIST... - traci.constants.ID_COUNT,... - traci.constants.JAM_LENGTH_METERS,... - traci.constants.JAM_LENGTH_VEHICLE,... - traci.constants.LAST_STEP_MEAN_SPEED,... - traci.constants.LAST_STEP_OCCUPANCY},... - {'readStringList','readInt','readDouble','readInt','readDouble','readDouble'}); - edge = containers.Map({... - traci.constants.ID_LIST,... - traci.constants.ID_COUNT,... - traci.constants.VAR_EDGE_TRAVELTIME,... - traci.constants.VAR_EDGE_EFFORT,... - traci.constants.VAR_CO2EMISSION,... - traci.constants.VAR_COEMISSION,... - traci.constants.VAR_HCEMISSION,... - traci.constants.VAR_PMXEMISSION,... - traci.constants.VAR_NOXEMISSION,... - traci.constants.VAR_FUELCONSUMPTION,... - traci.constants.VAR_NOISEEMISSION,... - traci.constants.LAST_STEP_MEAN_SPEED,... - traci.constants.LAST_STEP_OCCUPANCY,... - traci.constants.LAST_STEP_LENGTH,... - traci.constants.VAR_CURRENT_TRAVELTIME,... - traci.constants.LAST_STEP_VEHICLE_NUMBER,... - traci.constants.LAST_STEP_VEHICLE_HALTING_NUMBER,... - traci.constants.LAST_STEP_VEHICLE_ID_LIST},... - {'readStringList','readInt','readDouble','readDouble','readDouble',... - 'readDouble','readDouble','readDouble','readDouble','readDouble',... - 'readDouble','readDouble','readDouble','readDouble','readDouble',... - 'readInt','readInt','readStringList'}); - gui = containers.Map({... - traci.constants.ID_LIST,... - traci.constants.VAR_VIEW_ZOOM,... - traci.constants.VAR_VIEW_OFFSET,... - traci.constants.VAR_VIEW_SCHEMA,... - traci.constants.VAR_VIEW_BOUNDARY},... - {'readStringList','readDouble','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',... - 'readString','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8))],''double'')'}); - inductionloop = containers.Map({... - traci.constants.ID_LIST,... - traci.constants.VAR_POSITION,... - traci.constants.VAR_LANE_ID,... - traci.constants.LAST_STEP_VEHICLE_NUMBER,... - traci.constants.LAST_STEP_MEAN_SPEED,... - traci.constants.LAST_STEP_VEHICLE_ID_LIST,... - traci.constants.LAST_STEP_OCCUPANCY,... - traci.constants.LAST_STEP_LENGTH,... - traci.constants.LAST_STEP_TIME_SINCE_DETECTION,... - traci.constants.LAST_STEP_VEHICLE_DATA},... - {'readStringList','readDouble','readString',... - 'readInt','readDouble','readStringList',... - 'readDouble','readDouble','readDouble',... - 'traci.inductionloop.readVehicleData'}); - junction = containers.Map({... - traci.constants.ID_LIST,... - traci.constants.VAR_POSITION},... - {'readStringList','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')'}); - lane = containers.Map({... - traci.constants.ID_LIST,... - traci.constants.VAR_LENGTH,... - traci.constants.VAR_MAXSPEED,... - traci.constants.VAR_WIDTH,... - traci.constants.LANE_ALLOWED,... - traci.constants.LANE_DISALLOWED,... - traci.constants.LANE_LINK_NUMBER,... - traci.constants.LANE_LINKS,... - traci.constants.VAR_SHAPE,... - traci.constants.LANE_EDGE_ID,... - traci.constants.VAR_CO2EMISSION,... - traci.constants.VAR_COEMISSION,... - traci.constants.VAR_HCEMISSION,... - traci.constants.VAR_PMXEMISSION,... - traci.constants.VAR_NOXEMISSION,... - traci.constants.VAR_FUELCONSUMPTION,... - traci.constants.VAR_NOISEEMISSION,... - traci.constants.LAST_STEP_MEAN_SPEED,... - traci.constants.LAST_STEP_OCCUPANCY,... - traci.constants.LAST_STEP_LENGTH,... - traci.constants.VAR_CURRENT_TRAVELTIME,... - traci.constants.LAST_STEP_VEHICLE_NUMBER,... - traci.constants.LAST_STEP_VEHICLE_HALTING_NUMBER,... - traci.constants.LAST_STEP_VEHICLE_ID_LIST},... - {'readStringList','readDouble','readDouble','readDouble','readStringList',... - 'readStringList','@(result) result.read(1)','traci.lane.readLinks','readShape','readString',... - 'readDouble','readDouble','readDouble','readDouble','readDouble',... - 'readDouble','readDouble','readDouble','readDouble','readDouble',... - 'readDouble','readInt','readInt','readStringList'}); - multientryexit = containers.Map({... - traci.constants.ID_LIST,... - traci.constants.LAST_STEP_VEHICLE_NUMBER,... - traci.constants.LAST_STEP_MEAN_SPEED,... - traci.constants.LAST_STEP_VEHICLE_ID_LIST,... - traci.constants.LAST_STEP_VEHICLE_HALTING_NUMBER},... - {'readStringList','readInt','readDouble','readStringList','readInt'}); - poi = containers.Map({... - traci.constants.ID_LIST,... - traci.constants.VAR_TYPE,... - traci.constants.VAR_POSITION,... - traci.constants.VAR_COLOR},... - {'readStringList','readString','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',... - '@(result) result.read(4)'}); - polygon = containers.Map({... - traci.constants.ID_LIST,... - traci.constants.VAR_TYPE,... - traci.constants.VAR_SHAPE,... - traci.constants.VAR_COLOR},... - {'readStringList','readString','readShape','@(result) result.read(4)'}); - route = containers.Map({... - traci.constants.ID_LIST,... - traci.constants.VAR_EDGES},... - {'readStringList','readStringList'}); - simulation = containers.Map({... - traci.constants.VAR_TIME_STEP,... - traci.constants.VAR_LOADED_VEHICLES_NUMBER,... - traci.constants.VAR_LOADED_VEHICLES_IDS,... - traci.constants.VAR_DEPARTED_VEHICLES_NUMBER,... - traci.constants.VAR_DEPARTED_VEHICLES_IDS,... - traci.constants.VAR_ARRIVED_VEHICLES_NUMBER,... - traci.constants.VAR_ARRIVED_VEHICLES_IDS,... - traci.constants.VAR_MIN_EXPECTED_VEHICLES,... - traci.constants.VAR_TELEPORT_STARTING_VEHICLES_NUMBER,... - traci.constants.VAR_TELEPORT_STARTING_VEHICLES_IDS,... - traci.constants.VAR_TELEPORT_ENDING_VEHICLES_NUMBER,... - traci.constants.VAR_TELEPORT_ENDING_VEHICLES_IDS,... - traci.constants.VAR_DELTA_T,... - traci.constants.VAR_NET_BOUNDING_BOX},... - {'readInt','readInt','readStringList','readInt',... - 'readStringList','readInt','readStringList','readInt',... - 'readInt','readStringList','readInt','readStringList',... - 'readInt','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8)) fliplr(result.read(8))],''double'')'}); - trafficlights = containers.Map({... - traci.constants.ID_LIST,... - traci.constants.TL_RED_YELLOW_GREEN_STATE,... - traci.constants.TL_COMPLETE_DEFINITION_RYG,... - traci.constants.TL_CONTROLLED_LANES,... - traci.constants.TL_CONTROLLED_LINKS,... - traci.constants.TL_CURRENT_PROGRAM,... - traci.constants.TL_CURRENT_PHASE,... - traci.constants.TL_NEXT_SWITCH},... - {'readStringList','readString','traci.trafficlights.readLogics',... - 'readStringList','traci.trafficlights.readLinks','readString',... - 'readInt','readInt'}); - vehicle = containers.Map({... - traci.constants.ID_LIST,... - traci.constants.VAR_SPEED,... - traci.constants.VAR_SPEED_WITHOUT_TRACI,... - traci.constants.VAR_POSITION,... - traci.constants.VAR_ANGLE,... - traci.constants.VAR_ROAD_ID,... - traci.constants.VAR_LANE_ID,... - traci.constants.VAR_LANE_INDEX,... - traci.constants.VAR_TYPE,... - traci.constants.VAR_ROUTE_ID,... - traci.constants.VAR_COLOR,... - traci.constants.VAR_LANEPOSITION,... - traci.constants.VAR_CO2EMISSION,... - traci.constants.VAR_COEMISSION,... - traci.constants.VAR_HCEMISSION,... - traci.constants.VAR_PMXEMISSION,... - traci.constants.VAR_NOXEMISSION,... - traci.constants.VAR_FUELCONSUMPTION,... - traci.constants.VAR_NOISEEMISSION,... - traci.constants.VAR_EDGE_TRAVELTIME,... - traci.constants.VAR_EDGE_EFFORT,... - traci.constants.VAR_ROUTE_VALID,... - traci.constants.VAR_EDGES,... - traci.constants.VAR_SIGNALS,... - traci.constants.VAR_LENGTH,... - traci.constants.VAR_MAXSPEED,... - traci.constants.VAR_VEHICLECLASS,... - traci.constants.VAR_SPEED_FACTOR,... - traci.constants.VAR_SPEED_DEVIATION,... - traci.constants.VAR_EMISSIONCLASS,... - traci.constants.VAR_WIDTH,... - traci.constants.VAR_MINGAP,... - traci.constants.VAR_SHAPECLASS,... - traci.constants.VAR_ACCEL,... - traci.constants.VAR_DECEL,... - traci.constants.VAR_IMPERFECTION,... - traci.constants.VAR_TAU,... - traci.constants.VAR_BEST_LANES,... - traci.constants.DISTANCE_REQUEST},... - {'readStringList','readDouble','readDouble','@(result) typecast([fliplr(result.read(8)) fliplr(result.read(8))],''double'')',... - 'readDouble','readString','readString','readInt','readString',... - 'readString','@(result) result.read(4)','readDouble','readDouble','readDouble',... - 'readDouble','readDouble','readDouble','readDouble','readDouble',... - 'readDouble','readDouble','@(result) result.read(1)','readStringList',... - 'readInt','readDouble','readDouble','readString','readDouble','readDouble',... - 'readString','readDouble','readDouble','readString','readDouble','readDouble',... - 'readDouble','readDouble','traci.vehicle.readBestLanes','readDouble'}); - vehicletype = containers.Map({... - traci.constants.ID_LIST,... - traci.constants.VAR_LENGTH,... - traci.constants.VAR_MAXSPEED,... - traci.constants.VAR_SPEED_FACTOR,... - traci.constants.VAR_SPEED_DEVIATION,... - traci.constants.VAR_ACCEL,... - traci.constants.VAR_DECEL,... - traci.constants.VAR_IMPERFECTION,... - traci.constants.VAR_TAU,... - traci.constants.VAR_VEHICLECLASS,... - traci.constants.VAR_EMISSIONCLASS,... - traci.constants.VAR_SHAPECLASS,... - traci.constants.VAR_MINGAP,... - traci.constants.VAR_WIDTH,... - traci.constants.VAR_COLOR},... - {'readStringList','readDouble','readDouble','readDouble','readDouble',... - 'readDouble','readDouble','readDouble','readDouble','readString',... - 'readString','readString','readDouble','readDouble','@(result) result.read(4)'}); - end -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/add.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/add.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/add.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/add.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -function add(routeID, edges) -%add Add a route to the SUMO simulation. -% add(ROUTEID,EDGES) Adds a route with the id ROUTEID comprised of the -% given edges. EDGES is a cell array of strings containing the IDs of the -% edges. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: add.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_ROUTE_VARIABLE, constants.ADD, routeID,... - 1+4+sum(cellfun('length', edges))+4*length(edges)); -message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ... - traci.packInt32(length(edges))]; -for i=1:length(edges) - message.string = [message.string traci.packInt32(length(edges{i})) ... - uint8(edges{i})]; -end -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function ContextSubscriptionResults = getContextSubscriptionResults(routeID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(ROUTEID) -% Returns the context subscription results for the last time step and the -% given route. If no route id is given, all subscription results are -% returned in a containers.Map data struccure. If the route id is unknown -% or the subscription did for any reason return no data, 'None' is -% returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global routeSubscriptionResults -if isempty(routeSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - routeID=None; -end -ContextSubscriptionResults = routeSubscriptionResults.getContext(routeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getEdges.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getEdges.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getEdges.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getEdges.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function edges = getEdges(routeID) -%getEdges Return the edges of the route. -% edges = getEdges(ROUTEID) Returns a list of all edges in the route. The -% list of edges is a cell array of strings whose elements are the IDs of -% the edges. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getEdges.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -edges = traci.route.getUniversal(constants.VAR_EDGES, routeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the routes in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the routes in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDList = traci.route.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function subscriptionResults = getSubscriptionResults(routeID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(ROUTEID) Returns the -% subscription results for the last time step and the given route. If no -% route id is given, all subscription results are returned in a -% containers.Map data structure. -% If the route id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global routeSubscriptionResults -if isempty(routeSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - routeID = 'None'; -end - -subscriptionResults = routeSubscriptionResults.get(routeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, routeID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global routeSubscriptionResults - -if isempty(routeSubscriptionResults) - returnValueFunc = traci.RETURN_VALUE_FUNC.route; -else - returnValueFunc = routeSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_ROUTE_VARIABLE,varID,routeID); -handleReturValueFunc = str2func(returnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -function subscribeContext(routeID, domain, dist, varargin) -%subscribeContext Subscribe to a route's context variable. -% subscribeContext(ROUTEID,DOMAIN,DIST) Subscribe to the ID_LIST value of -% the SUMO objects that surround the route specified by ROUTEID at a -% distance given by DIST, for the maximum allowed interval. The type of -% objets that surround the route are defined in the DOMAIN parameter. -% Note that not all the SUMO object types support the variable ID_LIST. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 2 2013-12-21 21:39:57Z aacosta $ - -global routeSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'route.subscribeContext'; -p.addRequired('routeID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.ID_LIST}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(routeID, domain, dist, varargin{:}) -routeID = p.Results.routeID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -routeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.route); - -routeSubscriptionResults.reset() -traci.subscribeContext(constants.CMD_SUBSCRIBE_ROUTE_CONTEXT,... - subscriptionBegin, subscriptionEnd, routeID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+route/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function subscribe(routeID, varargin) -%subscribe Subscribe to route variable. -% subscribe(ROUTEID) Subscribe to the ID_LIST value for the maximum -% allowed interval. -% subscribe(ROUTEID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global routeSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'route.subscribe'; -p.addRequired('routeID',@ischar) -p.addOptional('varIDs', {constants.ID_LIST}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(routeID, varargin{:}) -routeID = p.Results.routeID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -routeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.route); - -routeSubscriptionResults.reset() -traci.subscribe(constants.CMD_SUBSCRIBE_ROUTE_VARIABLE,... - subscriptionBegin, subscriptionEnd, routeID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendByteCmd.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendByteCmd.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendByteCmd.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendByteCmd.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function sendByteCmd(cmdID, varID, objID, value) -%sendByteCmd An internal function to build a message which sends a byte. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: sendByteCmd.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global message -traci.beginMessage(cmdID, varID, objID, 1+1); -message.string = [message.string uint8([sscanf(constants.TYPE_BYTE,'%x') value])]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendDoubleCmd.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendDoubleCmd.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendDoubleCmd.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendDoubleCmd.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function sendDoubleCmd(cmdID, varID, objID, value) -%sendDoubleCmd An internal function to build a message which sends a double. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: sendDoubleCmd.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(cmdID, varID, objID, 1+8); -message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... - traci.packInt64(value)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendExact.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendExact.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendExact.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendExact.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -function result = sendExact() -%sendExact An internal function to send a message to the SUMO server and -%parse the result. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: sendExact.m 17 2014-05-30 14:32:09Z afacostag $ - -global message connections -import traci.constants -% warning('off','instrument:fread:unsuccessfulRead'); - -% Length of the command -len = 4 + length(message.string); -activeConnection = connections(''); - -% Write the message in the tcp socket -activeConnection.dos.writeInt(len); -activeConnection.dos.write(message.string); - -% Read the result from the socket -result = traci.recvExact(); - -if isempty(result) - fclose(connections('')); - clear connections('') - throw(MException('traci:FatalTraciError','Connection closed by SUMO\n')) -end - -% Parse the result -for i= 1:length(message.queue) - prefix = result.read(3); - if prefix(3)==0 - strresult = 'OK'; - elseif prefix(3)==1 - strresult = 'Not Implemented'; - else - strresult = 'Error'; - end - err = result.readString(); - if prefix(3) || ~isempty(err) - message.string = []; - message.queue = []; - traci.close(); - throw(MException('traci:FatalTraciError','%s %s %s\n', num2str(prefix), strresult, err)); - elseif prefix(2) ~= message.queue(i) - traci.close(); - throw(MException('traci:FatalTraciError','Received answer 0x%.2X for command 0x%.2x.\n',... - prefix(2), message.queue(i))); - elseif strcmp(prefix(2),constants.CMD_STOP) - len = result.read(1) - 1; - result.read(len + 1); - end -end - -% Clear the message contents -message.string = []; -message.queue = []; - - - diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendIntCmd.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendIntCmd.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendIntCmd.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendIntCmd.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function sendIntCmd(cmdID, varID, objID, value) -%sendIntCmd An internal function to build a message which sends an int. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: sendIntCmd.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(cmdID, varID, objID, 1+4); -message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... - traci.packInt32(value)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendReadOneStringCmd.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendReadOneStringCmd.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendReadOneStringCmd.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendReadOneStringCmd.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function result = sendReadOneStringCmd(cmdID, varID, objID) -%sendReadOneStringCmd An internal function to build an outgoing message to -%the SUMO server and parse the response. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: sendReadOneStringCmd.m 2 2013-12-21 21:39:57Z aacosta $ - -traci.beginMessage(cmdID, varID, objID); -result = traci.checkResult(cmdID, varID, objID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendStringCmd.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendStringCmd.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendStringCmd.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/sendStringCmd.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -function sendStringCmd(cmdID, varID, objID, value) -%sendStringCmd An internal function to build a message which sends a string. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: sendStringCmd.m 17 2014-05-30 14:32:09Z afacostag $ - -global message -import traci.constants - -% Construct the TraCI message -traci.beginMessage(cmdID, varID, objID, 1+4+length(value)) -message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... - traci.packInt32(length(value)) uint8(value)]; - -% Send the TraCI message -traci.sendExact(); diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/convert2D.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/convert2D.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/convert2D.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/convert2D.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function [x y] = convert2D(edgeID, pos, laneIndex, toGeo) -%convert2D Convert to absolute coordinates from those relative to an edge. -% [X,Y] = convert2D(EDGEID,POS) Converts from the position POS relative -% to the edge EDGEID to absolute coordinates. -% [X,Y] = convert2D(...,LANEINDEX) Specify the index of the edge's lane. -% [X,Y] = convert2D(...,TOGEO) Specify if the conversion is made to -% geo-coordinates, in this case, X is the longitude and Y is the latitude. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: convert2D.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -if nargin < 4 - toGeo = false; - if nargin < 3 - laneIndex = 0; - end -end - -posType = sscanf(constants.POSITION_2D,'%x'); - -if toGeo - posType = sscanf(constants.POSITION_LON_LAT,'%x'); -end -traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION,... - '', 1+4 + 1+4+length(edgeID)+8+1 + 1+1); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(2)]; -message.string = [message.string uint8(sscanf(constants.POSITION_ROADMAP,'%x')) ... - traci.packInt32(length(edgeID)) uint8(edgeID)]; -message.string = [message.string traci.packInt64(pos) ... - uint8([laneIndex sscanf(constants.TYPE_UBYTE,'%x') posType])]; -result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION, ''); -x = result.readDouble; -y = result.readDouble; \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/convertGeo.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/convertGeo.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/convertGeo.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/convertGeo.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function [longitude latitude] = convertGeo(x, y, fromGeo) -%convertGeo Convert to geo-coordinates. -% [LONGITUDE,LATITUDE] = convertGeo(X,Y) Converts the position specified -% by X and Y to geo-coordinates. Cartesian coordinates are assumed for -% the input. -% [X Y] = convert2D(...,FROMGEO) Specify if the conversion is to be -% made from geo-coordinates, in this case, X is the longitude and Y is -% the latitude. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: convertGeo.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -if nargin < 3 - fromGeo = false; -end - -fromType = sscanf(constants.POSITION_2D,'%x'); -toType = sscanf(constants.POSITION_LON_LAT,'%x'); - -if fromGeo - fromType = sscanf(constants.POSITION_LON_LAT,'%x'); - toType = sscanf(constants.POSITION_2D,'%x'); -end - -traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION,... - '', 1+4 + 1+8+8 + 1+1); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(2)]; -message.string = [message.string uint8(fromType) ... - traci.packInt64([y x])]; -message.string = [message.string uint8([sscanf(constants.TYPE_UBYTE,'%x') toType])]; -result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION, ''); -longitude = result.readDouble; -latitude = result.readDouble; \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/convertRoad.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/convertRoad.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/convertRoad.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/convertRoad.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function [roadID pos laneID] = convertRoad(x, y, isGeo) -%convertRoad Convert to coordinates relative to a road from absolute coordinates. -% [ROADID POS LANEID] = convertRoad(X,Y) Converts from the absolute -% position defined by X and Y, to a position POS relative to the road -% ROADID and the lane LANEID. Cartesian coordinates are assumed for the -% input. -% [ROADID POS LANEID] = convertRoad(...,ISGEO) Specify if the absolute -% input position is in geo-coordinates. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: convertRoad.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -if nargin < 3 - isGeo = false; -end - -posType = sscanf(constants.POSITION_2D,'%x'); - -if isGeo - posType = sscanf(constants.POSITION_LON_LAT,'%x'); -end - -traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION,... - '', 1+4 + 1+8+8 + 1+1); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(2)]; -message.string = [message.string uint8(posType) ... - traci.packInt64([y x])]; -message.string = [message.string uint8([sscanf(constants.TYPE_UBYTE,'%x') ... - sscanf(constants.POSITION_ROADMAP,'%x')])]; -result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.POSITION_CONVERSION, ''); -roadID = result.readString(); -pos = result.readDouble(); -laneID = result.read(1); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getArrivedIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getArrivedIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getArrivedIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getArrivedIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function arrivedIDList = getArrivedIDList() -%getArrivedIDList Get the list of arrived vehicles. -% arrivedIDList = getArrivedIDList() Returns a cell array of strings that -% contains the IDs of the vehicles which arrived (have reached their -% destination and are removed from the road network) in this time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getArrivedIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -arrivedIDList = traci.simulation.getUniversal(constants.VAR_ARRIVED_VEHICLES_IDS); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getArrivedNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getArrivedNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getArrivedNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getArrivedNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function arrivedNumber = getArrivedNumber() -%getArrivedNumber Get the number of arrived vehicles. -% arrivedNumber = getArrivedNumber() Returns the number of vehicles which -% arrived (have reached their destination and are removed from the road -% network) in this time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getArrivedNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -arrivedNumber = traci.simulation.getUniversal(constants.VAR_ARRIVED_VEHICLES_NUMBER); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getCurrentTime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getCurrentTime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getCurrentTime.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getCurrentTime.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function currentTime = getCurrentTime() -%getCurrentTime -% currentTime = getCurrentTime() Returns the current simulation time in -% ms. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getCurrentTime.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -currentTime = traci.simulation.getUniversal(constants.VAR_TIME_STEP); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDeltaT.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDeltaT.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDeltaT.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDeltaT.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function deltaT = getDeltaT() -%getDeltaT -% deltaT = getDeltaT() Returns the time-step of the simulation in ms. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getDeltaT.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -deltaT = traci.simulation.getUniversal(constants.VAR_DELTA_T); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDepartedIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDepartedIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDepartedIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDepartedIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function departedIDList = getDepartedIDList() -%getDepartedIDList Get the IDs of departed vehicles. -% departedIDList = getDepartedIDList() Returns a cell array of strings -% containing the ids of vehicles which departed (were inserted into the -% road network) in this time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getDepartedIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -departedIDList = traci.simulation.getUniversal(constants.VAR_DEPARTED_VEHICLES_IDS); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDepartedNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDepartedNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDepartedNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDepartedNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function departedNumber = getDepartedNumber() -%getDepartedNumber Get the number of departed vehicles. -% departedNumber = getDepartedNumber() Returns the number of vehicles -% which departed (were inserted into the road network) in this time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getDepartedNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -departedNumber = traci.simulation.getUniversal(constants.VAR_DEPARTED_VEHICLES_NUMBER); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDistance2D.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDistance2D.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDistance2D.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDistance2D.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -function distance2D = getDistance2D(x1, y1, x2, y2, isGeo, isDriving) -%getDistance2D Get the distance between two coordinates. -% distance2D = getDistance2D(X1,Y1,X2,Y2) Returns the distance between -% the points defined by the 2D coordinates (X1,Y1) and (X2,Y2). -% Cartesian coordinates are assumed. -% distance2D = getDistance2D(...,ISGEO) Specify wether the inputs are -% in geo-coordinates. -% distance2D = getDistance2D(...,ISDRIVING) Specify wether the air or the -% driving distance shall be computed. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getDistance2D.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -if nargin < 6 - isDriving = false; - if nargin < 5 - isGeo = false; - end -end - -posType = sscanf(constants.POSITION_2D,'%x'); - -if isGeo - posType = sscanf(constants.POSITION_LON_LAT,'%x'); -end - -distType = sscanf(constants.REQUEST_AIRDIST,'%x'); - -if isDriving - distType = sscanf(constants.REQUEST_DRIVINGDIST,'%x'); -end - -traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST,... - '', 1+4 + 1+8+8 + 1+8+8 + 1); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(3)]; -message.string = [message.string uint8(posType) ... - traci.packInt64([y1 x1])]; -message.string = [message.string uint8(posType) ... - traci.packInt64([y2 x2]) uint8(distType)]; -result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST, ''); -distance2D = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDistanceRoad.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDistanceRoad.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDistanceRoad.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getDistanceRoad.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -function distanceRoad = getDistanceRoad(edgeID1, pos1, edgeID2, pos2, isDriving) -%getDistanceRoad Get the distance between two relative-to-edge positions. -% distanceRoad = getDistanceRoad(EDGEID1,POS1,EDGEID2,POS2) Returns the -% distance between the points defined by the relative-to-edge positions -% (EDGEID1,POS1) and (EDGEID2,POS2). -% distance2D = getDistance2D(...,ISDRIVING) Specify wether the air or the -% driving distance shall be computed. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getDistanceRoad.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -if nargin < 5 - isDriving = false; -end - -distType = sscanf(constants.REQUEST_AIRDIST,'%x'); - -if isDriving - distType = sscanf(constants.REQUEST_DRIVINGDIST,'%x'); -end - -traci.beginMessage(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST,... - '', 1+4 + 1+4+length(edgeID1)+8+1 + 1+4+length(edgeID2)+8+1 + 1); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(3)]; -message.string = [message.string uint8(sscanf(constants.POSITION_ROADMAP,'%x')) ... - traci.packInt32(length(edgeID1)) uint8(edgeID1)]; -message.string = [message.string traci.packInt64(pos1) uint8([0 sscanf(constants.POSITION_ROADMAP,'%x')]) ... - traci.packInt32(length(edgeID2)) uint8(edgeID2)]; -message.string = [message.string traci.packInt64(pos2) uint8([0 distType])]; -result = traci.checkResult(constants.CMD_GET_SIM_VARIABLE, constants.DISTANCE_REQUEST, ''); -distanceRoad = result.readDouble; \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getEndingTeleportIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getEndingTeleportIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getEndingTeleportIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getEndingTeleportIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function endingTeleportIDList = getEndingTeleportIDList() -%getEndingTeleportIDList Get the IDs of teleported vehicles. -% endingTeleportIDList = getEndingTeleportIDList() Returns a cell array -% of strings containing the IDs of the vehicles which ended to be -% teleported in this time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getEndingTeleportIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -endingTeleportIDList = traci.simulation.getUniversal(constants.VAR_TELEPORT_ENDING_VEHICLES_IDS); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getEndingTeleportNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getEndingTeleportNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getEndingTeleportNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getEndingTeleportNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function endingTeleportNumber = getEndingTeleportNumber() -%getEndingTeleportNumber Get the number teleported vehicles. -% endingTeleportNumber = getEndingTeleportNumber() Returns the number of -% vehicles which ended to be teleported in this time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getEndingTeleportNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -endingTeleportNumber = traci.simulation.getUniversal(constants.VAR_TELEPORT_ENDING_VEHICLES_NUMBER); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getLoadedIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getLoadedIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getLoadedIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getLoadedIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function loadedIDList = getLoadedIDList() -%getLoadedIDList Get the IDs of loaded vehicles. -% loadedIDList = getLoadedIDList() Returns a cell array of strings -% cotaining the ids of the vehicles which were loaded in this time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLoadedIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -loadedIDList = traci.simulation.getUniversal(constants.VAR_LOADED_VEHICLES_IDS); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getLoadedNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getLoadedNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getLoadedNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getLoadedNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function loadedNumber = getLoadedNumber() -%getLoadedNumber Get the number loaded vehicles. -% loadedNumber = getLoadedNumber() Returns the number of vehicles which -% were loaded in this time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLoadedNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -loadedNumber = traci.simulation.getUniversal(constants.VAR_LOADED_VEHICLES_NUMBER); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getMinExpectedNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getMinExpectedNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getMinExpectedNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getMinExpectedNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -function minExpectedNumber = getMinExpectedNumber() -%getMinExpectedNumber Get the number of non-arrived vehicles. -% minExpectedNumber = getMinExpectedNumber() Returns the number of -% vehicles which are in the net plus the ones still waiting to start. -% This number may be smaller than the actual number of vehicles still to -% come because of delayed route file parsing. If the number is 0 however, -% it is guaranteed that all route files have been parsed completely and -% all vehicles have left the network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getMinExpectedNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -minExpectedNumber = traci.simulation.getUniversal(... - constants.VAR_MIN_EXPECTED_VEHICLES); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getNetBoundary.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getNetBoundary.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getNetBoundary.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getNetBoundary.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function netBoundary = getNetBoundary() -%getNetBoundary Get the boundary box of the network. -% netBoundary = getNetBoundary() Returns the coordinates of the -% lower-left and the upper-right points that define the boundaries of the -% network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getNetBoundary.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -netBoundary = traci.simulation.getUniversal(constants.VAR_NET_BOUNDING_BOX); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getStartingTeleportIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getStartingTeleportIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getStartingTeleportIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getStartingTeleportIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function startingTeleportIDList = getStartingTeleportIDList() -%getStartingTeleportIDList Get the IDs of vehicles stsrting to teleport. -% startingTeleportIDList = getStartingTeleportIDList() Returns a cell -% array of strings containing the ids of vehicles which which started to -% teleport in this time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getStartingTeleportIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -startingTeleportIDList = traci.simulation.getUniversal(constants.VAR_TELEPORT_STARTING_VEHICLES_IDS); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getStartingTeleportNumber.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getStartingTeleportNumber.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getStartingTeleportNumber.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getStartingTeleportNumber.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function startingTeleportNumber = getStartingTeleportNumber() -%getStartingTeleportNumber Get the number of vehicles stsrting to teleport. -% startingTeleportNumber = getStartingTeleportNumber() Returns the number -% of vehicles which started to teleport in this time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getStartingTeleportNumber.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -startingTeleportNumber = traci.simulation.getUniversal(constants.VAR_TELEPORT_STARTING_VEHICLES_NUMBER); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -function subscriptionResults = getSubscriptionResults() -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults() Returns the subscription -% results for the last time step. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global simSubscriptionResults -if isempty(simSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end - -subscriptionResults = simSubscriptionResults.get('x'); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global simSubscriptionResults - -if isempty(simSubscriptionResults) - returnValueFunc = traci.RETURN_VALUE_FUNC.simulation; -else - returnValueFunc = simSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_SIM_VARIABLE,varID,''); -handleReturValueFunc = str2func(returnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+simulation/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -function subscribe(varargin) -%subscribe Subscribe to simulation variable. -% subscribe() Subscribe to the VAR_DEPARTED_VEHICLES_IDS value for -% the maximum allowed interval. -% subscribe(VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global simSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'simulation.subscribe'; -p.addOptional('varIDs', {constants.VAR_DEPARTED_VEHICLES_IDS}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(varargin{:}) -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -simSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.simulation); - -simSubscriptionResults.reset() -traci.subscribe(constants.CMD_SUBSCRIBE_SIM_VARIABLE,... - subscriptionBegin, subscriptionEnd, 'x', varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/simulationStep.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/simulationStep.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/simulationStep.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/simulationStep.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -function responses = simulationStep(timeStep) -%simulationStep Perform a simulation step in the SUMO server. -% -% simulationStep() Perform a simulation step in the SUMO server with -% a time step of one second. -% -% simulationStep(STEP) Perform a simulation step in the SUMO server with -% a time step STEP. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: simulationStep.m 17 2014-05-30 14:32:09Z afacostag $ - - -global message edgeSubscriptionResults guiSubscriptionResults ... - loopSubscriptionResults junctionSubscriptionResults ... - laneSubscriptionResults detSubscriptionResults ... - poiSubscriptionResults polygonSubscriptionResults ... - routeSubscriptionResults simSubscriptionResults ... - tlSubscriptionResults vehSubscriptionResults ... - typeSubscriptionResults - -modules = {edgeSubscriptionResults guiSubscriptionResults ... - loopSubscriptionResults junctionSubscriptionResults ... - laneSubscriptionResults detSubscriptionResults ... - poiSubscriptionResults polygonSubscriptionResults ... - routeSubscriptionResults simSubscriptionResults ... - tlSubscriptionResults vehSubscriptionResults ... - typeSubscriptionResults}; - -if nargin < 1 - timeStep = 0; -end -import traci.constants - -% Prepare the message to be sent to the SUMO server -message.queue = [message.queue uint8(sscanf(constants.CMD_SIMSTEP2,'%x'))]; -message.string = [message.string uint8([1+1+4 sscanf(constants.CMD_SIMSTEP2,'%x')]) ... - traci.packInt32(timeStep)]; - -% Send the message -result = traci.sendExact(); - -% Clear the TraCI subscriptions -for i=1:length(modules) - if ~isempty(modules{i}) - modules{i}.reset(); - end -end - -% Get the number of subscriptions and populate them -numSubs = result.readInt(); -responses = cell(1,2*numSubs); -for i=1:numSubs - [response, objectID] = traci.readSubscription(result); - responses(2*i-1:2*i) = {response objectID}; -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/Socket.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/Socket.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/Socket.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/Socket.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -classdef Socket < handle -%Socket A class which wraps a Java socket to implement -% TCP/IP communications in Matlab. - -% Copyright 2014 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: Socket.m 19 2014-05-30 15:08:25Z afacostag $ - - properties - socket - dis - dos - dataReader - end - methods - function this = connect(this, host, port) - import co.edu.unalmed.gaunal.traci4matlab.utils.* - import java.net.* - import java.io.* - this.socket = Socket(); - inetSocketAddress = InetSocketAddress(... - InetAddress.getByName(host), port); - try - this.socket.connect(inetSocketAddress); - catch err - end - this.dis = DataInputStream(this.socket.getInputStream()); - this.dataReader = DataReader(this.dis); - this.dos = DataOutputStream(this.socket.getOutputStream()); - end - end -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/Storage.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/Storage.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/Storage.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/Storage.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -classdef Storage < handle -%Storage A container for responses from SUMO server. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: Storage.m 17 2014-05-30 14:32:09Z afacostag $ - - properties - content - pos - end - methods - function this = Storage(content) - this.content = content; - this.pos = 1; - end - function value = read(this,numbytes) - oldpos = this.pos; - this.pos = this.pos + numbytes; - value = this.content(oldpos:this.pos-1); - -% interval = round(numbytes/nargout); -% for i=1:nargout -% oldpos = this.pos; -% this.pos = this.pos + interval; -% varargout{i} = this.content(oldpos:this.pos-1); -% end - end - function value = readInt(this) - value = typecast(fliplr(uint8(this.read(4))),'int32'); - end - - function value = readDouble(this) - value = typecast(fliplr(this.read(8)),'double'); - end - - function len = readLength(this) - len = this.read(1); - if len > 0 - return - end - len = this.readInt(); - end - function value = readString(this) - len = typecast(fliplr(this.read(4)),'int32'); - if len == 0 - value = ''; - return - end - value = char(this.read(len)); - end - function stringList = readStringList(this) - n = this.readInt(); - stringList = cell(1,n); - for i=1:n - stringList{i} = this.readString(); - end - end - - function shape = readShape(this) - len = this.read(1); - shape = cell(1,len); - for i=1:len - shape{i} = typecast([fliplr(this.read(8)) fliplr(this.read(8))],'double'); - end - end - - end -end diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -function subscribeContext(cmdID, subscriptionBegin, subscriptionEnd, objID, domain, dist, varIDs) -%subscribeContext An internal function to build a context subscription -%command and parse the response. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 17 2014-05-30 14:32:09Z afacostag $ - -global message -global loopSubscriptionResults laneSubscriptionResults vehSubscriptionResults ... - poiSubscriptionResults polygonSubscriptionResults junctionSubscriptionResults ... - edgeSubscriptionResults - -if strcmp(domain,'0xa0') - loopSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.inductionloop); -elseif strcmp(domain,'0xa3') - laneSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.lane); -elseif strcmp(domain,'0xa4') - vehSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicle); -elseif strcmp(domain,'0xa7') - poiSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.poi); -elseif strcmp(domain,'0xa8') - polygonSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.polygon); -elseif strcmp(domain,'0xa9') - junctionSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.junction); -elseif strcmp(domain,'0xaa') - edgeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.edge); -end - -message.queue = [message.queue uint8(sscanf(cmdID,'%x'))]; -len = 1+1+4+4+4+length(objID)+1+8+1+length(varIDs); -if len<=255 - message.string = [message.string uint8(len)]; -else - message.string = [message.string uint8(0) traci.packInt64(len+4)]; -end -message.string = [message.string uint8(sscanf(cmdID,'%x')),... - traci.packInt32([length(objID)... - subscriptionEnd subscriptionBegin]) uint8(objID)]; -message.string = [message.string uint8(sscanf(domain,'%x')) ... - traci.packInt64(dist) uint8(length(varIDs))]; -for i=1:length(varIDs) - message.string = [message.string uint8(sscanf(varIDs{i},'%x'))]; -end -result = traci.sendExact(); -[response, objectID] = traci.readSubscription(result); -if response - uint8(sscanf(cmdID,'%x'))~=16 || ~strcmp(objectID,objID) - raise(MException('traci:FatalTraciError','Received answer %.2X,%s for context subscription command %.2X,%s\n',... - response, objectID, cmdID, objID)); -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -function subscribe(cmdID, subscriptionBegin, subscriptionEnd, objID, varIDs) -%subscribe An internal function to build a subscription message and parse -%the response. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 17 2014-05-30 14:32:09Z afacostag $ - -global message - -% Construct the TraCI message -message.queue = [message.queue uint8(sscanf(cmdID,'%x'))]; -len = 1+1+4+4+4+length(objID)+1+length(varIDs); -if len <= 255 - message.string = [message.string uint8(len)]; -else - message.string = [message.string uint8(0) traci.packInt32(len+4)]; -end -message.string = [message.string uint8(sscanf(cmdID,'%x')),... - traci.packInt32([length(objID) subscriptionEnd ... - subscriptionBegin]) uint8(objID)]; -message.string = [message.string uint8(length(varIDs))]; -for v=1:length(varIDs) - message.string = [message.string sscanf(varIDs{v},'%x')]; -end - -% Send the TraCI message and receive the result -result = traci.sendExact(); - -% Populate the subsctiptions and parse the result -[response, objectID] = traci.readSubscription(result); -if response - uint8(sscanf(cmdID,'%x'))~=16 || ~strcmp(objectID,objID) - raise(MException('traci:FatalTraciError',['Received answer ' response ... - ', ' objectID 'for subscription command ' cmdID ', ' objID])); -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/SubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/SubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/SubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/SubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -classdef SubscriptionResults < handle -%SubscriptionResults A container for the subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: SubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - - properties - results - contextResults - valueFunc - end - - methods - function this = SubscriptionResults(valueFunc) - this.results = containers.Map; - this.contextResults = containers.Map; - this.valueFunc = valueFunc; - end - - function result = parse(this, varID, data) - if ~isKey(this.valueFunc, varID) - throw(MException('traci:FatalTraCIError', 'Unknown variable %.2x',varID)) - end - resultHandle = str2func(this.valueFunc(varID)); - result = resultHandle(data); - end - - function reset(this) - this.results = containers.Map; - this.contextResults = containers.Map; - end - - function add(this, refID, varID, data) - if ~isKey(this.results, refID) - this.results(refID) = containers.Map; - end - handle1results = this.results(refID); - handle1results(varID) = this.parse(varID, data); - end - - function subscriptionResults = get(this, refID) - refID = num2str(refID); - if nargin < 2 - refID = 'None'; - end - if strcmp(refID,'None') == 1 - subscriptionResults = this.results; - return - end - if isKey(this.results, refID) - subscriptionResults = this.results(refID); - else - subscriptionResults = 'None'; - end - end - - function addContext(this, refID, domain, objID, varID, data) - if ~isKey(this.contextResults, refID) - this.contextResults(refID) = containers.Map; - end - if ~isKey(this.contextResults(refID), objID) - this.contextResults(refID) = subsasgn(this.contextResults(refID),... - struct('type','()','subs',{objID}),containers.Map); - end - handle1ContextResults = this.contextResults(refID); - handle2ContextResults = handle1ContextResults(objID); - handle2ContextResults(varID) = domain.parse(varID, data); - end - - function context = getContext(this, refID) - if nargin < 2 - refID = 'None'; - end - if strcmp(refID, 'None') == 1 - context = this.contextResults; - return - end - if isKey(this.contextResults, refID) - context = this.contextResults(refID); - else - context = 'None'; - end - end - end -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/switchConnection.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/switchConnection.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/switchConnection.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/switchConnection.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function switchConnection(label) -%switchConnection Switch to another connection with SUMO. -% -% switchConnection(label) Switch to the connection specified in LABEL -% with the SUMO server. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: switchConnection.m 2 2013-12-21 21:39:57Z aacosta $ - -global connections -connections('') = connections(label); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/time2steps.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/time2steps.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/time2steps.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/time2steps.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -function timeInMiliseconds = time2steps(time) -%timeInMiliseconds An internal function to convert time in seconds to -%miliseconds. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: time2steps.m 2 2013-12-21 21:39:57Z aacosta $ - -timeInMiliseconds = int32(time*1000); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getCompleteRedYellowGreenDefinition.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function completeRedYellowGreenDefinition = getCompleteRedYellowGreenDefinition(tlsID) -%getCompleteRedYellowGreenDefinition Get the complete traffic lights definition. -% completeRedYellowGreenDefinition = -% getCompleteRedYellowGreenDefinition(TLSID) Returns a -% traci.trafficlights.Logic object that describes the atributes of the -% traffic light definition including all the phase definitions. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getCompleteRedYellowGreenDefinition.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -completeRedYellowGreenDefinition = traci.trafficlights.getUniversal(constants.TL_COMPLETE_DEFINITION_RYG, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function ContextSubscriptionResults = getContextSubscriptionResults(tlsID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(TLSID) -% Returns the context subscription results for the last time step and the -% given traffic light. If no traffic light id is given, all subscription -% results are returned in a containers.Map data struccure. If the traffic -% light id is unknown or the subscription did for any reason return no -% data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global tlsSubscriptionResults -if isempty(tlsSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - tlsID=None; -end -ContextSubscriptionResults = tlsSubscriptionResults.getContext(tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getControlledLanes.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getControlledLanes.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getControlledLanes.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getControlledLanes.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function controlledLanes = getControlledLanes(tlsID) -%getControlledLanes Get the controlled lanes. -% controlledLanes = getControlledLanes(TLSID) Returns a cell array of -% strings containing the ids of the lanes controlled by the given traffic -% lights. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getControlledLanes.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -controlledLanes = traci.trafficlights.getUniversal(constants.TL_CONTROLLED_LANES, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getControlledLinks.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getControlledLinks.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getControlledLinks.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getControlledLinks.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function controlledLinks = getControlledLinks(tlsID) -%getControlledLinks Get the links controlled by the traffic light. -% controlledLinks = getControlledLinks(tlsID) Returns a cell array -% containing the links controlled by the traffic light, sorted by the -% signal index and described by giving the incoming, outgoing, and via -% lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getControlledLinks.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -controlledLinks = traci.trafficlights.getUniversal(constants.TL_CONTROLLED_LINKS, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the traffic lights in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the traffic lights in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDList = traci.trafficlights.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getNextSwitch.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getNextSwitch.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getNextSwitch.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getNextSwitch.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function nextSwitch = getNextSwitch(tlsID) -%getNextSwitch. -% nextSwitch = getNextSwitch(TLSID) Returns the time in ms at which the -% next phase change will be performed. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getNextSwitch.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -nextSwitch = traci.trafficlights.getUniversal(constants.TL_NEXT_SWITCH, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getPhase.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getPhase.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getPhase.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getPhase.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function phase = getPhase(tlsID) -%getPhase Get the phase index. -% phase = getPhase(TLSID) Returns the current phase index of -% given trafficlights. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getPhase.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -phase = traci.trafficlights.getUniversal(constants.TL_CURRENT_PHASE, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getProgram.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getProgram.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getProgram.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getProgram.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function program = getProgram(tlsID) -%getProgram -% program = getProgram(TLSID) Returns the id of the current program. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getProgram.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -program = traci.trafficlights.getUniversal(constants.TL_CURRENT_PROGRAM, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getRedYellowGreenState.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getRedYellowGreenState.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getRedYellowGreenState.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getRedYellowGreenState.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function redYellowGreenState = getRedYellowGreenState(tlsID) -%getRedYellowGreenState Get the traffic lights' state. -% redYellowGreenState = getRedYellowGreenState(TLSID) Returns the named -% tl's state as a string of light definitions from rRgGyYoO, for red, -% green, yellow, off, where lower case letters mean that the stream has -% to decelerate. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getRedYellowGreenState.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -redYellowGreenState = traci.trafficlights.getUniversal(constants.TL_RED_YELLOW_GREEN_STATE, tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -function subscriptionResults = getSubscriptionResults(tlsID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(TLSID) Returns the -% subscription results for the last time step and the given traffic -% lights. If no traffic lights id is given, all subscription results are -% returned in a containers.Map data structure. -% If the traffic lights id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 17 2014-05-30 14:32:09Z afacostag $ - -global tlSubscriptionResults -if isempty(tlSubscriptionResults) - traci.close(); - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - tlsID = 'None'; -end - -subscriptionResults = tlSubscriptionResults.get(tlsID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, tlsID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global tlsSubscriptionResults - -if isempty(tlsSubscriptionResults) - returnValueFunc = traci.RETURN_VALUE_FUNC.trafficlights; -else - returnValueFunc = tlsSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_TL_VARIABLE,varID,tlsID); -handleReturValueFunc = str2func(returnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/Logic.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/Logic.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/Logic.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/Logic.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -classdef Logic -%Logic constructs a Logic object. -% myLogic = Logic(SUBID,TYPE,SUBPARAMETER,CURRENTPHASEINDEX,PHASES) -% constructs a Logic object myLogic containing an ID SUBID, astarting -% phase index CURRENTPHASEINDEX, and a cell array of traci.Phase objects, -% PHASES, which represent the phase definitions of trafic lights' program -% myLogic. TYPE and SUBPARAMETER are not currently implemented in SUMO -% server, therefore, the must be set to zero. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: Logic.m 2 2013-12-21 21:39:57Z aacosta $ - - properties - subID - type - subParameter - currentPhaseIndex - phases - end - methods - function this = Logic(subID, type, subParameter, currentPhaseIndex, phases) - this.subID = subID; - this.type = type; - this.subParameter = subParameter; - this.currentPhaseIndex = currentPhaseIndex; - this.phases = phases; - end - - function display(this) - disp('Logic:'); - disp(['subID: ' num2str(this.subID)]); - disp(['type: ' num2str(this.type)]); - disp(['subParameter: ' num2str(this.subParameter)]); - disp(['currentPhaseIndex: ' num2str(this.currentPhaseIndex)]); - for i=1:length(this.phases) - display(this.phases{i}); - end - end - - end -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/Phase.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/Phase.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/Phase.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/Phase.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -classdef Phase -%Phase Construct a Phase object for TraCI traffic lights. -% myPhase = Phase(DURATION,DURATION1,DURATION2,PHASEDEF) Constructs a -% Phase object with the properties DURATION, DURATION1, which is the min -% duration in miliseconds; DURATION2, which is the max duration in -% miliseconds and PHASEDEF, which is a string of light definitions from -% rRgGyYoO for red, green, yellow, off, where lower case letters mean -% that the stream has to decelerate. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: Phase.m 2 2013-12-21 21:39:57Z aacosta $ - - properties - duration - duration1 - duration2 - phaseDef - end - methods - function this = Phase(duration, duration1, duration2, phaseDef) - this.duration = duration; - this.duration1 = duration1; - this.duration2 = duration2; - this.phaseDef = phaseDef; - end - - function display(this) - disp('Phase:'); - disp(['duration: ' num2str(this.duration)]); - disp(['duration1: ' num2str(this.duration1)]); - disp(['duration2: ' num2str(this.duration1)]); - disp(['phaseDef: ' num2str(this.phaseDef)]); - end - - end -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/readLinks.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/readLinks.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/readLinks.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/readLinks.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -function signals = readLinks(result) -%readLinks Internal function to read the links controlled by the traffic lights. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: readLinks.m 2 2013-12-21 21:39:57Z aacosta $ - -result.readLength(); -nbSignals = result.readInt(); % Length -signals = cell(1,nbSignals); -for i=1:nbSignals - result.read(1); % Type of Number of Controlled Links - nbControlledLinks = result.readInt(); % Number of Controlled Links - controlledLinks = cell(1,nbControlledLinks); - for j=1:nbControlledLinks - result.read(1); % Type of Link j - link = result.readStringList(); % Link j - controlledLinks{j} = link; - end - signals(i) = controlledLinks; -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/readLogics.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/readLogics.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/readLogics.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/readLogics.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function logics = readLogics(result) -%readLogics Internal function to read the complete program of the traffic lights. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: readLogics.m 2 2013-12-21 21:39:57Z aacosta $ - -result.readLength(); -nbLogics = result.readInt(); % Number of logics -logics = cell(1,nbLogics); -for i=1:nbLogics - result.read(1); % Type of SubID - subID = result.readString(); - result.read(1); % Type of Type - type = result.readInt(); % Type - result.read(1); % Type of SubParameter - subParameter = result.readInt(); % SubParameter - result.read(1); % Type of Current phase index - currentPhaseIndex = result.readInt(); % Current phase index - result.read(1); % Type of Number of phases - nbPhases = result.readInt(); % Number of phases - phases = cell(1,nbPhases); - for j=1:nbPhases - result.read(1); % Type of Duration - duration = result.readInt(); % Duration - result.read(1); % Type of Duration1 - duration1 = result.readInt(); % Duration1 - result.read(1); % Type of Duration2 - duration2 = result.readInt(); % Duration2 - result.read(1); % Type of Phase Definition - phaseDef = result.readString(); % Phase Definition - phase = traci.trafficlights.Phase(duration, duration1, duration2, phaseDef); - phases{j} = phase; - end - logic = traci.trafficlights.Logic(subID, type, subParameter, currentPhaseIndex, phases); - logics{i} = logic; -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setCompleteRedYellowGreenDefinition.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -function setCompleteRedYellowGreenDefinition(tlsID, tls) -%setCompleteRedYellowGreenDefinition Set the complete definition of the traffic light. -% setCompleteRedYellowGreenDefinition(TLSID,TLS) Sets the attributes of -% trafic lights' definition including all the phase definitions. Those -% attributes are included in the TLS parameter, which is a -% traci.trafficlights.Logic object. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setCompleteRedYellowGreenDefinition.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -len = 1+4 + 1+4+length(tls.subID) + 1+4 + 1+4 + 1+4 + 1+4; % tls parameter -itemNo = 1+1+1+1+1; -for p=1:length(tls.phases) - len = len + 1+4 + 1+4 + 1+4 + 1+4+length(tls.phases{p}.phaseDef); - itemNo = itemNo + 4; -end -traci.beginMessage(constants.CMD_SET_TL_VARIABLE, constants.TL_COMPLETE_PROGRAM_RYG, tlsID, len); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(itemNo)]; -message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... - traci.packInt32(length(tls.subID)) uint8(tls.subID)]; % Program ID -message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... - traci.packInt32(0)]; % Type -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(0)]; % subitems -message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... - traci.packInt32(tls.currentPhaseIndex)]; -message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... - traci.packInt32(length(tls.phases))]; % phaseNo - -for i=1:length(tls.phases) - message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... - traci.packInt32(tls.phases{i}.duration) ... - uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(tls.phases{i}.duration1) ... - uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(tls.phases{i}.duration2)]; - message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... - traci.packInt32(length(tls.phases{i}.phaseDef)) ... - uint8(tls.phases{i}.phaseDef)]; -end -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setPhaseDuration.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setPhaseDuration.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setPhaseDuration.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setPhaseDuration.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function setPhaseDuration(tlsID, phaseDuration) -%setPhaseDuration Set the phase duration traffic light. -% setPhaseDuration(TLSID,PHASEDURATION) Sets the current phase's duration -% in miliseconds of the traffic lights with ID TLSID to the given in the -% PHASEDURATION parameter. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setPhaseDuration.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendIntCmd(constants.CMD_SET_TL_VARIABLE,... - constants.TL_PHASE_DURATION, tlsID, 1000*phaseDuration); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setPhase.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setPhase.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setPhase.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setPhase.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function setPhase(tlsID, index) -%setPhase Set the phase index of the traffic light. -% setPhase(TLSID,INDEX) Sets the index of the traffic lights with ID TLSID -% to the given in the INDEX parameter. There are as many tls indexes as -% phase definitions in the tls program. The tls index starts from zero. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setPhase.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendIntCmd(constants.CMD_SET_TL_VARIABLE,... - constants.TL_PHASE_INDEX, tlsID, index); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setProgram.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setProgram.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setProgram.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setProgram.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setProgram(tlsID, programID) -%setProgram -% setProgram(TLSID,PROGRAMID)Sets the id of the current program. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setProgram.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_TL_VARIABLE,... - constants.TL_PROGRAM, tlsID, programID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setRedYellowGreenState.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setRedYellowGreenState.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setRedYellowGreenState.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/setRedYellowGreenState.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function setRedYellowGreenState(tlsID, state) -%setRedYellowGreenState Set the state of the traffic lights. -% setRedYellowGreenState(TLSID,STATE) Sets the named tl's state as a -% string of light definitions from rRgGyYoO, for red, green, yellow, off, -% where lower case letters mean that the stream has to decelerate. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setRedYellowGreenState.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_TL_VARIABLE,... - constants.TL_RED_YELLOW_GREEN_STATE, tlsID, state); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -function subscribeContext(tlsID, domain, dist, varargin) -%subscribeContext Subscribe to a traffic lights's context variable. -% subscribeContext(TLSID,DOMAIN,DIST) Subscribe to the TL_CURRENT_PHASE -% value of the SUMO objects that surround the traffic lights specified by -% TLSID at a distance given by DIST, for the maximum allowed interval. -% The type of objets that surround the traffic lights are defined in the -% DOMAIN parameter. Note that not all the SUMO object types support the -% variable TL_CURRENT_PHASE. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 2 2013-12-21 21:39:57Z aacosta $ - -global tlsSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'trafficlights.subscribeContext'; -p.addRequired('tlsID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.TL_CURRENT_PHASE}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(tlsID, domain, dist, varargin{:}) -tlsID = p.Results.tlsID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -tlsSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.trafficlights); - -tlsSubscriptionResults.reset() -traci.subscribeContext(constants.CMD_SUBSCRIBE_TL_CONTEXT,... - subscriptionBegin, subscriptionEnd, tlsID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+trafficlights/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function subscribe(tlsID, varargin) -%subscribe Subscribe to traffic lights variable. -% subscribe(TLSID) Subscribe to the TL_CURRENT_PHASE value for the -% maximum allowed interval. -% subscribe(TLSID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global tlSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'trafficlights.subscribe'; -p.addRequired('tlsID',@ischar) -p.addOptional('varIDs', {constants.TL_CURRENT_PHASE}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(tlsID, varargin{:}) -tlsID = p.Results.tlsID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -tlSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.trafficlights); - -tlSubscriptionResults.reset() -traci.subscribe(constants.CMD_SUBSCRIBE_TL_VARIABLE,... - subscriptionBegin, subscriptionEnd, tlsID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/add.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/add.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/add.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/add.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -function add(vehID, routeID, varargin) -%add Get the traffic lights' state. -% add(VEHID,ROUTEID) Adds a vehicle in the current time-step with ID -% VEHID and assigns the route with ID ROUTEID to it. -% add(...,DEPART) Specify the departure time in miliseconds. -% add(...,POS) Specify the position relative to the starting lane. -% add(...,SPEED) Specify the starting speed of the vehicle. -% add(...,LANE) Specify the lane number in which the vehicle will start. -% add(...,TYPEID) Specify the type of the vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: add.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message - -p = inputParser; -p.FunctionName = 'vehicle.add'; -p.addRequired('vehID',@ischar) -p.addRequired('routeID',@ischar) -p.addOptional('depart', -2, @numeric) % -2 = DEPART_NOW -p.addOptional('pos', 0, @isnumeric) -p.addOptional('speed', 0, @isnumeric) -p.addOptional('lane', 0, @isnumeric) -p.addOptional('typeID', 'DEFAULT_VEHTYPE', @ischar) -p.parse(vehID, routeID, varargin{:}) - -vehID = p.Results.vehID; -routeID = p.Results.routeID; -depart = p.Results.depart; -pos = p.Results.pos; -speed = p.Results.speed; -lane = p.Results.lane; -typeID = p.Results.typeID; - - -traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.ADD, vehID,... - 1+4 + 1+4+length(typeID) + 1+4+length(routeID) + 1+4 + 1+8 + 1+8 + 1+1); -if depart > 0 - depart = depart*1000; -end - -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(6)]; -message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... - traci.packInt32(length(typeID)) uint8(typeID)]; -message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... - traci.packInt32(length(routeID)) uint8(routeID)]; -message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... - traci.packInt32(depart)]; -message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... - traci.packInt64(pos) uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... - traci.packInt64(speed)]; -message.string = [message.string uint8([sscanf(constants.TYPE_BYTE,'%x') uint8(lane)])]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/changeLane.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/changeLane.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/changeLane.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/changeLane.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -function changeLane(vehID, laneIndex, duration) -%add Make the vehicle to switch the lane. -% changeLane(VEHID,LANEINDEX,DURATION) Makes the vehicle with ID VEHID to -% change the lane to the specified in the index LANEINDEX for the given -% time duration. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: changeLane.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_CHANGELANE,... - vehID, 1+4+1+1+1+4); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(2) uint8([sscanf(constants.TYPE_BYTE,'%x') ... - laneIndex sscanf(constants.TYPE_INTEGER,'%x')]) ... - traci.packInt32(duration)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/changeTarget.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/changeTarget.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/changeTarget.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/changeTarget.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function changeTarget(vehID, edgeID) -%changeTarget Change the vehicle's destination. -% changeTarget(VEHID,EDGEID) Changes the vehicle's destination edge to -% the given. The route is rebuilt. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: changeTarget.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_CHANGETARGET, vehID, edgeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getAccel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getAccel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getAccel.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getAccel.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function accel = getAccel(vehID) -%getAccel Get the acceleration of the vehicle. -% accel = getAccel(VEHID) Returns the maximum acceleration possibility in -% m/s^2 of this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getAccel.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -accel = traci.vehicle.getUniversal(constants.VAR_ACCEL, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getAdaptedTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getAdaptedTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getAdaptedTraveltime.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getAdaptedTraveltime.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -function adaptedTraveltime = getAdaptedTraveltime(vehID, time, edgeID) -%getAdaptedTraveltime -% adaptedTraveltime = getAdaptedTraveltime(VEHID,TIME,EDGEID) Returns the -% edge travel time for the given time as stored in the vehicle's internal -% container. If such a value does not exist, -1 is returned. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getAdaptedTraveltime.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_TRAVELTIME,... - vehID, 1+4+1+4+1+4+length(edgeID)); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ... - uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(time) ... - uint8(sscanf(constants.TYPE_STRING,'%x')) traci.packInt32(length(edgeID)) ... - uint8(edgeID)]; -result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_TRAVELTIME, vehID); -adaptedTraveltime = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getAngle.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getAngle.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getAngle.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getAngle.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function angle = getAngle(vehID) -%getAngle Get the angle of the vehicle. -% angle = getAngle(VEHID) Returns the angle in degrees of the named -% vehicle within the last step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getAngle.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -angle = traci.vehicle.getUniversal(constants.VAR_ANGLE, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getBestLanes.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getBestLanes.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getBestLanes.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getBestLanes.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -function bestLanes = getBestLanes(vehID) -%getBestLanes -% bestLanes = getBestLanes(VEHID) Returns information about the wish to -% use subsequent edges' lanes, which is stored in a cell array. The -% information includes laneID, length, occupation, offset, -% allowsContinuation and nextLanes. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getBestLanes.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -bestLanes = traci.vehicle.getUniversal(constants.VAR_BEST_LANES, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getCO2Emission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getCO2Emission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getCO2Emission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getCO2Emission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function CO2Emission = getCO2Emission(vehID) -%getCO2Emission Returns the CO2 emission of the vehicle. -% CO2Emission = getCO2Emission(VEHID) Returns the CO2 emission in mg for -% the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getCO2Emission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -CO2Emission = traci.vehicle.getUniversal(constants.VAR_CO2EMISSION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getCOEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getCOEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getCOEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getCOEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function COEmission = getCOEmission(vehID) -%getCOEmission Returns the CO emission of the vehicle. -% COEmission = getCO2Emission(VEHID) Returns the CO emission in mg for -% the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getCOEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -COEmission = traci.vehicle.getUniversal(constants.VAR_COEMISSION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getColor.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getColor.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function color = getColor(vehID) -%getColor Get the color of the vehicle. -% color = getColor(VEHID) Returns the vehicle's rgba color. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getColor.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -color = traci.vehicle.getUniversal(constants.VAR_COLOR, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function ContextSubscriptionResults = getContextSubscriptionResults(vehID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(VEHICLEID) -% Returns the context subscription results for the last time step and the -% given vehicle. If no vehicle id is given, all subscription results are -% returned in a containers.Map data struccure. If the vehicle id is unknown -% or the subscription did for any reason return no data, 'None' is -% returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global vehSubscriptionResults -if isempty(vehSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - vehID=None; -end -ContextSubscriptionResults = vehSubscriptionResults.getContext(vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getDecel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getDecel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getDecel.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getDecel.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function decel = getDecel(vehID) -%getDecel Returns the deceleration of the vehicle. -% decel = getDecel(VEHID) Returns the maximum deceleration possibility -% in m/s^2 of this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getDecel.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -decel = traci.vehicle.getUniversal(constants.VAR_DECEL, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getDrivingDistance2D.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getDrivingDistance2D.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getDrivingDistance2D.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getDrivingDistance2D.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -function drivingDistance2D = getDrivingDistance2D(vehID, x, y) -%getDrivingDistance2D Returns the driving distance to an absolute coordinate. -% drivingDistance2D = getDrivingDistance2D(VEHID,X,Y) Returns -% the driving distance from the current position to that defined by the -% coordinates X and Y. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getDrivingDistance2D.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST,... - vehID, 1+4+1+8+8+1); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ... - uint8(sscanf(constants.POSITION_2D,'%x')) traci.packInt64([y x]) uint8(sscanf(constants.REQUEST_DRIVINGDIST,'%x'))]; -result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST, vehID); -drivingDistance2D = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getDrivingDistance.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getDrivingDistance.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getDrivingDistance.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getDrivingDistance.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -function drivingDistance = getDrivingDistance(vehID, edgeID, pos, laneID) -%getDrivingDistance Returns the driving distance to relative coordinate. -% drivingDistance = getDrivingDistance(VEHID,EDGEID,POS,LANEID) Returns -% the driving distance from the current position to the given in POS. POS -% is a position relative to the edge identified by EDGEID and the lane -% index specified in LANEID. If no LANEID is given, it defaults to zero. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getDrivingDistance.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -if nargin < 4 - laneID=0; -end -traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST,... - vehID, 1+4+1+4+length(edgeID) + 8+1+1); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ... - uint8(sscanf(constants.POSITION_ROADMAP,'%x')) traci.packInt32(length(edgeID)) uint8(edgeID)]; -message.string = [message.string traci.packInt64(pos) uint8([laneID sscanf(constants.REQUEST_DRIVINGDIST,'%x')])]; -result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.DISTANCE_REQUEST, vehID); -drivingDistance = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getEffort.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getEffort.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getEffort.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getEffort.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -function effort = getEffort(vehID, time, edgeID) -%getEffort -% effort = getEffort(VEHID,TIME,EDGEID) Returns the edge effort for the -% given time as stored in the vehicle's internal container. If such a -% value does not exist, -1 is returned. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getEffort.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_EFFORT,... - vehID, 1+4+1+4+1+4+length(edgeID)); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) traci.packInt32(2) ... - uint8(sscanf(constants.TYPE_INTEGER,'%x')) traci.packInt32(time) ... - uint8(sscanf(constants.TYPE_STRING,'%x')) traci.packInt32(length(edgeID)) ... - uint8(edgeID)]; -result = traci.checkResult(constants.CMD_GET_VEHICLE_VARIABLE, constants.VAR_EDGE_EFFORT, vehID); -effort = result.readDouble(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getEmissionClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getEmissionClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getEmissionClass.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getEmissionClass.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function emissionClass = getEmissionClass(vehID) -%getEmissionClass -% emissionClass = getEmissionClass(VEHID) Returns the emission class of -% this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getEmissionClass.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -emissionClass = traci.vehicle.getUniversal(constants.VAR_EMISSIONCLASS, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getFuelConsumption.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getFuelConsumption.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getFuelConsumption.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getFuelConsumption.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function fuelConsumption = getFuelConsumption(vehID) -%getFuelConsumption Get the fuel consumption of the vehicle. -% fuelConsumption = getFuelConsumption(VEHID) Returns the fuel -% consumption in ml for the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getFuelConsumption.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -fuelConsumption = traci.vehicle.getUniversal(constants.VAR_FUELCONSUMPTION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getHCEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getHCEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getHCEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getHCEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function HCEmission = getHCEmission(vehID) -%getHCEmission Returns the HC emission of the vehicle. -% HCEmission = getHCEmission(VEHID) Returns the HC emission in mg for -% the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getHCEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -HCEmission = traci.vehicle.getUniversal(constants.VAR_HCEMISSION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the vehicles in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the vehicles in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDList = traci.vehicle.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getImperfection.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getImperfection.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getImperfection.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getImperfection.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function imperfection = getImperfection(vehID) -%getImperfection Returns driver's imperfection. -% imperfection = getImperfection(VEHID) Returns the driver's imperfection -% (dawdling) [0,1] - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getImperfection.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -imperfection = traci.vehicle.getUniversal(constants.VAR_IMPERFECTION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLaneID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLaneID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLaneID.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLaneID.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -function laneID = getLaneID(vehID) -%getLaneID -% laneID = getLaneID(VEHID) Returns the id of the lane the named vehicle -% was at within the last step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLaneID.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants - - -import traci.constants -laneID = traci.vehicle.getUniversal(constants.VAR_LANE_ID, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLaneIndex.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLaneIndex.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLaneIndex.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLaneIndex.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function laneIndex = getLaneIndex(vehID) -%getLaneIndex -% laneIndex = getLaneIndex(VEHID) Returns the index of the lane the named -% vehicle was at within the last step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLaneIndex.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -laneIndex = traci.vehicle.getUniversal(constants.VAR_LANE_INDEX, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLanePosition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLanePosition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLanePosition.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLanePosition.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function lanePosition = getLanePosition(vehID) -%getLanePosition Get the position of the vehicle along the lane. -% lanePosition = getLanePosition(VEHID) Returns the position of the -% vehicle along the lane measured in m. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLanePosition.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -lanePosition = traci.vehicle.getUniversal(constants.VAR_LANEPOSITION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLength.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getLength.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function length = getLength(vehID) -%getLength -% length = getLength(VEHID) Returns the length in m of the given vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLength.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -length = traci.vehicle.getUniversal(constants.VAR_LENGTH, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getMaxSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function maxSpeed = getMaxSpeed(vehID) -%getMaxSpeed -% maxSpeed = getMaxSpeed(VEHID) Returns the maximum speed in m/s of this -% vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getMaxSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -maxSpeed = traci.vehicle.getUniversal(constants.VAR_MAXSPEED, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getMinGap.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getMinGap.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getMinGap.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getMinGap.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function minGap = getMinGap(vehID) -%getMinGap -% minGap = getMinGap(VEHID) Returns the offset (gap to front vehicle if -% halting) of this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getMinGap.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -minGap = traci.vehicle.getUniversal(constants.VAR_MINGAP, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getNoiseEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getNoiseEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getNoiseEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getNoiseEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function noiseEmission = getNoiseEmission(vehID) -%getNoiseEmission Get the noise emission of the vehicle. -% noiseEmission = getNoiseEmission(VEHID) Returns the noise emission in -% db for the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getNoiseEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -noiseEmission = traci.vehicle.getUniversal(constants.VAR_NOISEEMISSION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getNOxEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getNOxEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getNOxEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getNOxEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function NOxEmission = getNOxEmission(vehID) -%getNOxEmission Get the NOx emission of the vehicle. -% NOxEmission = getNOxEmission(VEHID) Returns the NOx emission in mg for -% the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getNOxEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -NOxEmission = traci.vehicle.getUniversal(constants.VAR_NOXEMISSION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getPMxEmission.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getPMxEmission.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getPMxEmission.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getPMxEmission.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function PMxEmission = getPMxEmission(vehID) -%getPmxEmission Get the particular matter emission of the vehicle. -% pmxEmission = getPmxEmission(VEHID) Returns the particular matter -% emission in mg for the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getPMxEmission.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -PMxEmission = traci.vehicle.getUniversal(constants.VAR_PMXEMISSION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getPosition.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getPosition.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getPosition.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getPosition.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function position = getPosition(vehID) -%getPosition -% position = getPosition(VEHID) Returns the x,y position of the named -% vehicle within the last step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getPosition.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -position = traci.vehicle.getUniversal(constants.VAR_POSITION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getRoadID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getRoadID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getRoadID.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getRoadID.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function roadID = getRoadID(vehID) -%getRoadID -% roadID = getRoadID(VEHID) Returns the id of the edge the named vehicle -% was at within the last step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getRoadID.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -roadID = traci.vehicle.getUniversal(constants.VAR_ROAD_ID, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getRouteID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getRouteID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getRouteID.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getRouteID.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function routeID = getRouteID(vehID) -%getRouteID -% routeID = getRouteID(VEHID) Returns the id of the route of the named -% vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getRouteID.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -routeID = traci.vehicle.getUniversal(constants.VAR_ROUTE_ID, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getRoute.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getRoute.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getRoute.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getRoute.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function route = getRoute(vehID) -%getRoute Get the vehicle route. -% route = getRoute(VEHID) Returns a cell array of strings containing the -% ids of the edges the vehicle's route is made of. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getRoute.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -route = traci.vehicle.getUniversal(constants.VAR_EDGES, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getShapeClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getShapeClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getShapeClass.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getShapeClass.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function shapeClass = getShapeClass(vehID) -%getShapeClass -% shapeClass = getShapeClass(VEHID) Returns the shape class of this -% vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getShapeClass.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -shapeClass = traci.vehicle.getUniversal(constants.VAR_SHAPECLASS, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSignals.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSignals.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSignals.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSignals.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -function signals = getSignals(vehID) -%getSignals Get the vehicle route. -% signals = getSignals(VEHID) Returns an integer encoding the state of a -% vehicle's signals. -% The following table shows the defined signals. -% -% Name Bit -% VEH_SIGNAL_BLINKER_RIGHT 0 -% VEH_SIGNAL_BLINKER_LEFT 1 -% VEH_SIGNAL_BLINKER_EMERGENCY 2 -% VEH_SIGNAL_BRAKELIGHT 3 -% VEH_SIGNAL_FRONTLIGHT 4 -% VEH_SIGNAL_FOGLIGHT 5 -% VEH_SIGNAL_HIGHBEAM 6 -% VEH_SIGNAL_BACKDRIVE 7 -% VEH_SIGNAL_WIPER 8 -% VEH_SIGNAL_DOOR_OPEN_LEFT 9 -% VEH_SIGNAL_DOOR_OPEN_RIGHT 10 -% VEH_SIGNAL_EMERGENCY_BLUE 11 -% VEH_SIGNAL_EMERGENCY_RED 12 -% VEH_SIGNAL_EMERGENCY_YELLOW 13 - - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSignals.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -signals = traci.vehicle.getUniversal(constants.VAR_SIGNALS, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeedDeviation.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeedDeviation.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeedDeviation.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeedDeviation.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function speedDeviation = getSpeedDeviation(vehID) -%getSpeedDeviation -% speedDeviation = getSpeedDeviation(VEHID) Returns the maximum speed -% deviation of the vehicle type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSpeedDeviation.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -speedDeviation = traci.vehicle.getUniversal(constants.VAR_SPEED_DEVIATION, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeedFactor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeedFactor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeedFactor.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeedFactor.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function speedFactor = getSpeedFactor(vehID) -%getSpeedFactor -% speedFactor = getSpeedFactor(VEHID) Returns the chosen speed factor for -% this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSpeedFactor.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -speedFactor = traci.vehicle.getUniversal(constants.VAR_SPEED_FACTOR, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function speed = getSpeed(vehID) -%getSpeed Get the vehicle speed. -% speed = getSpeed(VEHID) Returns the speed in m/s of the named vehicle -% within the last step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -speed = traci.vehicle.getUniversal(constants.VAR_SPEED, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeedWithoutTraCI.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeedWithoutTraCI.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeedWithoutTraCI.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSpeedWithoutTraCI.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -function speedWithoutTraCI = getSpeedWithoutTraCI(vehID) -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSpeedWithoutTraCI.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -speedWithoutTraCI = traci.vehicle.getUniversal(constants.VAR_SPEED_WITHOUT_TRACI, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function subscriptionResults = getSubscriptionResults(vehID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(VEHICLEID) Returns the -% subscription results for the last time step and the given vehicle. If no -% vehicle id is given, all subscription results are returned in a -% containers.Map data structure. -% If the vehicle id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global vehSubscriptionResults -if isempty(vehSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - vehID = 'None'; -end - -subscriptionResults = vehSubscriptionResults.get(vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getTau.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getTau.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getTau.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getTau.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function tau = getTau(vehID) -%getTau -% tau = getTau(VEHID) Returns the driver's reaction time in s for this -% vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getTau.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -tau = traci.vehicle.getUniversal(constants.VAR_TAU, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getTypeID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getTypeID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getTypeID.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getTypeID.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function typeID = getTypeID(vehID) -%getTypeID -% typeID = getTypeID(VEHID) Returns the id of the type of the named -% vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getTypeID.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -typeID = traci.vehicle.getUniversal(constants.VAR_TYPE, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, vehID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global vehSubscriptionResults - -if isempty(vehSubscriptionResults) - returnValueFunc = traci.RETURN_VALUE_FUNC.vehicle; -else - returnValueFunc = vehSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_VEHICLE_VARIABLE,varID,vehID); -handleReturValueFunc = str2func(returnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getVehicleClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getVehicleClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getVehicleClass.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getVehicleClass.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function vehicleClass = getVehicleClass(vehID) -%getVehicleClass -% vehicleClass = getVehicleClass(VEHID) Returns the vehicle class of this -% vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getVehicleClass.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -vehicleClass = traci.vehicle.getUniversal(constants.VAR_VEHICLECLASS, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getWidth.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getWidth.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getWidth.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/getWidth.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function width = getWidth(vehID) -%getWidth -% width = getWidth(VEHID) Returns the width in m of this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getWidth.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -width = traci.vehicle.getUniversal(constants.VAR_WIDTH, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/isRouteValid.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/isRouteValid.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/isRouteValid.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/isRouteValid.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function isvalid = isRouteValid(vehID) -%isRouteValid -% isvalid = isRouteValid(VEHID) Determine whether the current route of the -% vehicle is valid (i.e. all the edges along the route are connected). - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: isRouteValid.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -isvalid = traci.vehicle.getUniversal(constants.VAR_ROUTE_VALID, vehID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/moveTo.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/moveTo.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/moveTo.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/moveTo.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -function moveTo(vehID, laneID, pos) -%moveTo -% moveTo(VEHID,LANEID,POS) Commands the vehicle to move to the specified -% position on the given lane. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: moveTo.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MOVE_TO, vehID,... - 1+4+1+4+length(laneID)+1+8); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(2)]; -message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... - traci.packInt32(length(laneID)) uint8(laneID)]; -message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... - traci.packInt32(pos)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/moveToVTD.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/moveToVTD.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/moveToVTD.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/moveToVTD.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -function moveToVTD(vehID, edgeID, lane, x, y) -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: moveToVTD.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message - -traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MOVE_TO_VTD,... - vehID,1+4+1+4+length(edgeID)+1+4+1+8+1+8); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(4)]; -message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... - traci.packInt32(length(edgeID)) uint8(edgeID)]; -message.string = [message.string uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... - traci.packInt32(lane)]; -message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... - traci.packInt64(x)]; -message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... - traci.packInt64(y)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/readBestLanes.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/readBestLanes.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/readBestLanes.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/readBestLanes.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -function lanes = readBestLanes(result) -%readBestLanes Internal function to read information about the whish to use -%subsequent edge's lanes. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: readBestLanes.m 2 2013-12-21 21:39:57Z aacosta $ - -result.read(5); -nbLanes = result.readInt(); % Length -lanes = cell(1,nbLanes); -for i=1:nbLanes - result.read(1); - laneID = result.readString(); - result.read(1); - len = result.readDouble(); - result.read(1); - occupation = result.readDouble(); - result.read(1); - offset = result.read(1); - result.read(1); - allowsContinuation = result.read(1); - result.read(1); - nextLanesNo = result.readInt(); - nextLanes = cell(1,nextLanesNo); - for j=1:nextLanesNo - nextLanes{j} = result.readString(); - end - lanes{i} = {laneID, len, occupation, offset, allowsContinuation, nextLanes}; -end \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/remove.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/remove.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/remove.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/remove.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -function remove(vehID, reason) -%remove Remove vehicle. -% remove(VEHID,REASON) Remove vehicle with the given ID for the given -% reason. Reasons are defined in traci.constants and start with REMOVE_ - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: remove.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants - -if nargin < 2 - reason = sscanf(constants.REMOVE_VAPORIZED,'%x'); -end - -traci.sendByteCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.REMOVE, vehID, reason); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/rerouteEffort.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/rerouteEffort.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/rerouteEffort.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/rerouteEffort.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -function rerouteEffort(vehID) -%rerouteEffort Compute new route based on the edges' assigned effort. -% rerouteEffort(VEHID) Computes a new route using the vehicle's internal -% and the global edge effort information. Replaces the current route by -% the found. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: rerouteEffort.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message - -traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_REROUTE_EFFORT, vehID,... - 1+4); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(0)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/rerouteTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/rerouteTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/rerouteTraveltime.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/rerouteTraveltime.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -function rerouteTraveltime(vehID) -%rerouteTraveltime Compute new route based on the edges' assigned travel time. -% rerouteTraveltime(VEHID) Computes a new route using the vehicle's -% internal and the global edge travel time information. Replaces the -% current route by the found. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: rerouteTraveltime.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message - -traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_REROUTE_TRAVELTIME, vehID,... - 1+4); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(0)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setAccel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setAccel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setAccel.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setAccel.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setAccel(vehID, accel) -%setAccel Set the acceleration of the vehicle. -% setAccel(VEHID,ACCEL) Sets the maximum acceleration in m/s^2 for this -% vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setAccel.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_ACCEL, vehID, accel); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setAdaptedTraveltime.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setAdaptedTraveltime.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setAdaptedTraveltime.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setAdaptedTraveltime.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -function setAdaptedTraveltime(vehID, begTime, endTime, edgeID, time) -%setAdaptedTraveltime Assign edge's travel time to vehicle's container. -% setAdaptedTraveltime(VEHID,BEGTIME,ENDTIME,EDGEID,TIME) Inserts the -% information about the travel time of edge EDGEID valid from BEGTIME -% time to ENDTIME time into the vehicle's internal edge weights container. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setAdaptedTraveltime.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message - -traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_EDGE_TRAVELTIME, vehID,... - 1+4+1+4+1+4+1+4+length(edgeID)+1+8); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(4) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... - traci.packInt32(begTime) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... - traci.packInt32(endTime) uint8(sscanf(constants.TYPE_STRING,'%x')) ... - traci.packInt32(length(edgeID)) uint8(edgeID)]; -message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... - traci.packInt64(time)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setColor.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setColor.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -function setColor(vehID, color) -%setColor Set the color of the vehicle. -% setColor(VEHID,COLOR) Sets color for vehicle with the given ID, i.e. -% (255,0,0,0) for the color red. The fourth integer (alpha) is currently -% ignored - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setColor.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_COLOR, vehID, 1+1+1+1+1); -message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setDecel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setDecel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setDecel.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setDecel.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setDecel(vehID, decel) -%setDecel -% setDecel(VEHID,DECEL) Sets the maximum deceleration in m/s^2 for this -% vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setDecel.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_DECEL, vehID, decel); diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setEffort.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setEffort.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setEffort.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setEffort.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -function setEffort(vehID, begTime, endTime, edgeID, effort) -%setEffort -% setEffort(VEHID,BEGTIME,ENDTIME,EDGEID,EFFORT) Inserts the information -% about the effort of edge EDGEID valid from BEGTIME time to ENDTIME time -% into the vehicle's internal edge weights container. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setEffort.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message - -traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_EDGE_EFFORT, vehID,... - 1+4+1+4+1+4+1+4+length(edgeID)+1+4); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(int32(4)) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... - traci.packInt32(int32(begTime)) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... - traci.packInt32(int32(endTime)) uint8(sscanf(constants.TYPE_STRING,'%x')) ... - traci.packInt32(int32(length(uint8(edgeID)))) uint8(edgeID)]; -message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... - traci.packInt64(effort)]; -traci.sendExact() \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setEmissionClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setEmissionClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setEmissionClass.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setEmissionClass.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function setEmissionClass(vehID, clazz) -%setEmissionClass -% setEmissionClass(VEHID,CLASS) Sets the emission class for this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setEmissionClass.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_EMISSIONCLASS, vehID, clazz); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setImperfection.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setImperfection.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setImperfection.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setImperfection.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function setImperfection(vehID, imperfection) -%setImperfection -% setImperfection(VEHID,IMPERFECTION) Sets the driver's imperfection -% (dawdling). IMPERFECTION is a double precision integer ranging from -% zero to one. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setImperfection.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_IMPERFECTION, vehID, imperfection); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setLength.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setLength.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function setLength(vehID, length) -%setLength -% setLength(VEHID,LENGTH) Sets the length in m for the given vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setLength.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_LENGTH, vehID, length); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setMaxSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function setMaxSpeed(vehID, speed) -%setMaxSpeed -% setMaxSpeed(VEHID,SPEED) Sets the maximum speed in m/s for this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setMaxSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MAXSPEED, vehID, speed); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setMinGap.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setMinGap.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setMinGap.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setMinGap.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setMinGap(vehID, minGap) -%setMinGap -% setMinGap(VEHID,MINGAP) Sets the offset (gap to front vehicle if -% halting) for this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setMinGap.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_MINGAP, vehID, minGap); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setRouteID.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setRouteID.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setRouteID.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setRouteID.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setRouteID(vehID, routeID) -%setRouteID -% setRouteID(VEHID,ROUTEID) Sets the id of the route for the named -% vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setRouteID.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_ROUTE_ID, vehID, routeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setRoute.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setRoute.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setRoute.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setRoute.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -function setRoute(vehID, edgeList) -%setRoute Set the route of the vehicle. -% setRoute(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: -% traci.vehicle.setRoute{'1', {'1', '2', '4', '6', '7'}} -% -% changes the route for vehicle id 1 to edges 1-2-4-6-7. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setRoute.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message - -traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_ROUTE, vehID,... - 1+4+sum(cellfun('length', edgeList))+4*length(edgeList)); -message.string = [message.string uint8(sscanf(constants.TYPE_STRINGLIST,'%x')) ... - traci.packInt32(length(edgeList))]; -for i=1:length(edgeList) - message.string = [message.string traci.packInt32(length(edgeList{i})) ... - uint8(edgeList{i})]; -end -traci.sendExact() \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setShapeClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setShapeClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setShapeClass.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setShapeClass.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function setShapeClass(vehID, clazz) -%setShapeClass -% setShapeClass(VEHID,CLASS) Sets the shape class for this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setShapeClass.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SHAPECLASS, vehID, clazz); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSignals.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSignals.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSignals.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSignals.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -function setSignals(vehID, signals) -%setSignals -% setSignalsVEHID,SIGNALS) Sets an integer encoding the state of the -% vehicle's signals. -% The following table shows the defined signals. -% -% Name Bit -% VEH_SIGNAL_BLINKER_RIGHT 0 -% VEH_SIGNAL_BLINKER_LEFT 1 -% VEH_SIGNAL_BLINKER_EMERGENCY 2 -% VEH_SIGNAL_BRAKELIGHT 3 -% VEH_SIGNAL_FRONTLIGHT 4 -% VEH_SIGNAL_FOGLIGHT 5 -% VEH_SIGNAL_HIGHBEAM 6 -% VEH_SIGNAL_BACKDRIVE 7 -% VEH_SIGNAL_WIPER 8 -% VEH_SIGNAL_DOOR_OPEN_LEFT 9 -% VEH_SIGNAL_DOOR_OPEN_RIGHT 10 -% VEH_SIGNAL_EMERGENCY_BLUE 11 -% VEH_SIGNAL_EMERGENCY_RED 12 -% VEH_SIGNAL_EMERGENCY_YELLOW 13 - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setSignals.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendIntCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SIGNALS, vehID, signals); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSpeedDeviation.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSpeedDeviation.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSpeedDeviation.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSpeedDeviation.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setSpeedDeviation(vehID, deviation) -%setSpeedDeviation -% setSpeedDeviation(VEHID,DEVIATION) Sets the maximum speed deviation for -% this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setSpeedDeviation.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEED_DEVIATION, vehID, deviation); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSpeedFactor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSpeedFactor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSpeedFactor.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSpeedFactor.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setSpeedFactor(vehID, factor) -%setSpeedFactor -% setSpeedFactor(VEHID,FACTOR) Sets the speed factor for the named -% vehicle within the last step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setSpeedFactor.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEED_FACTOR, vehID, factor); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setSpeed(vehID, speed) -%setSpeed -% setSpeed(VEHID,SPEED) Sets the speed in m/s for the named vehicle -% within the last step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_SPEED, vehID, speed); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setStop.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setStop.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setStop.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setStop.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function setStop(vehID, edgeID, pos, laneIndex, duration) -%setStop Set a stop for the vehicle. -% setStop(VEHID,EDGEID) Sets a stop for the vehicle VEHID in the edge -% EDGEID for the maximum allowed time. The position and the lane index -% default to one and zero respectively. -% setStop(...,POS) Specify the position of the stop in the lane. -% setStop(...,LANEINDEX) Specify the lane index in which the stop will be -% made. -% setStop(...,DURATION) Specify the duration of the stop. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setStop.m 17 2014-05-30 14:32:09Z afacostag $ - - -import traci.constants -global message -if nargin < 5 - duration = 2^31-1; - if nargin < 4 - laneIndex = 0; - if nargin < 3 - pos = 1; - end - end -end -traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_STOP,... - vehID, 1+4+1+4+length(edgeID)+1+8+1+1+1+4); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(4)]; -message.string = [message.string uint8(sscanf(constants.TYPE_STRING,'%x')) ... - traci.packInt32(length(edgeID)) uint8(edgeID)]; -message.string = [message.string uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... - traci.packInt64(pos) uint8([sscanf(constants.TYPE_BYTE,'%x') ... - laneIndex sscanf(constants.TYPE_INTEGER,'%x')]) ... - traci.packInt32(duration)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setTau.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setTau.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setTau.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setTau.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function setTau(vehID, tau) -%setTau -% setTau(VEHID,TAU) Sets the driver's reaction time in s for this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setTau.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_TAU, vehID, tau); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setVehicleClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setVehicleClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setVehicleClass.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setVehicleClass.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setVehicleClass(vehID, clazz) -%setVehicleClass -% setVehicleClass(VEHID,CLASS) Sets the vehicle class for this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setVehicleClass.m 2 2013-12-21 21:39:57Z aacosta $ - - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_VEHICLECLASS, vehID, clazz); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setWidth.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setWidth.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setWidth.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/setWidth.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function setWidth(vehID, width) -%setWidth -% setWidth(VEHID,WIDTH) Sets the width in m for this vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setWidth.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLE_VARIABLE, constants.VAR_WIDTH, vehID, width); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/slowDown.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/slowDown.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/slowDown.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/slowDown.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -function slowDown(vehID, speed, duration) -%slowDown -% slowDown(VEHID,SPEED,DURATION) Reduces the speed of the vehicle to the -% given for the given amount of time. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: slowDown.m 17 2014-05-30 14:32:09Z afacostag $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_VEHICLE_VARIABLE, constants.CMD_SLOWDOWN,... - vehID, 1+4+1+8+1+4); -message.string = [message.string uint8(sscanf(constants.TYPE_COMPOUND,'%x')) ... - traci.packInt32(2) uint8(sscanf(constants.TYPE_DOUBLE,'%x')) ... - traci.packInt64(speed) uint8(sscanf(constants.TYPE_INTEGER,'%x')) ... - traci.packInt32(duration)]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -function subscribeContext(vehID, domain, dist, varargin) -%subscribeContext Subscribe to a vehicle's context variable. -% subscribeContext(VEHID,DOMAIN,DIST) Subscribe to the VAR_ROAD_ID and -% VAR_LANEPOSITION value of the SUMO objects that surround the vehicle -% specified by VEHID at a distance given by DIST, for the maximum allowed -% interval. The type of objets that surround the vehicle are defined in -% the DOMAIN parameter. Note that not all the SUMO object types support -% the variables VAR_ROAD_ID and VAR_LANEPOSITION. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 2 2013-12-21 21:39:57Z aacosta $ - -global vehSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'vehicle.subscribeContext'; -p.addRequired('vehID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.VAR_ROAD_ID, constants.VAR_LANEPOSITION}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(vehID, domain, dist, varargin{:}) -vehID = p.Results.vehID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -vehSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicle); - -vehSubscriptionResults.reset() -traci.subscribeContext(constants.CMD_SUBSCRIBE_VEHICLE_CONTEXT,... - subscriptionBegin, subscriptionEnd, vehID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicle/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function subscribe(vehID, varargin) -%subscribe Subscribe to vehicle variable. -% subscribe(VEHID) Subscribe to the VAR_ROAD_ID and VAR_LANEPOSITION -% values for the maximum allowed interval. -% subscribe(VEHID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global vehSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'vehicle.subscribe'; -p.addRequired('vehID',@ischar) -p.addOptional('varIDs', {constants.VAR_ROAD_ID, constants.VAR_LANEPOSITION}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(vehID, varargin{:}) -vehID = p.Results.vehID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -vehSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicle); - -vehSubscriptionResults.reset() -traci.subscribe(constants.CMD_SUBSCRIBE_VEHICLE_VARIABLE,... - subscriptionBegin, subscriptionEnd, vehID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getAccel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getAccel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getAccel.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getAccel.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function accel = getAccel(typeID) -%getAccel -% accel = getAccel(TYPEID) Returns the maximum acceleration in m/s^2 of -% vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getAccel.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -accel = traci.vehicletype.getUniversal(constants.VAR_ACCEL, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getColor.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getColor.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function color = getColor(typeID) -%getColor -% color = getColor(TYPEID)Returns the color of this type of vehicle. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getColor.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -color = traci.vehicletype.getUniversal(constants.VAR_COLOR, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getContextSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getContextSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getContextSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getContextSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function ContextSubscriptionResults = getContextSubscriptionResults(typeID) -%getContextSubscriptionResults Get the context subscription results for the -% last time step. -% contextSubscriptionResults = getContextSubscriptionResults(TYPEID) -% Returns the context subscription results for the last time step and the -% given vehicle type. If no vehicle type id is given, all subscription -% results are returned in a containers.Map data struccure. If the vehicle -% type id is unknown or the subscription did for any reason return no -% data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getContextSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global typeSubscriptionResults -if isempty(typeSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - typeID=None; -end -ContextSubscriptionResults = typeSubscriptionResults.getContext(typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getDecel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getDecel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getDecel.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getDecel.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function decel = getDecel(typeID) -%getDecel -% decel = getDecel(TYPEID) Returns the maximum deceleration in m/s^2 of -% vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getDecel.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -decel = traci.vehicletype.getUniversal(constants.VAR_DECEL, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getEmissionClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getEmissionClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getEmissionClass.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getEmissionClass.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function emissionClass = getEmissionClass(typeID) -%getEmissionClass -% emissionClass = getEmissionClass(TYPEID) Returns the emission class of -% vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getEmissionClass.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -emissionClass = traci.vehicletype.getUniversal(constants.VAR_EMISSIONCLASS, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getIDList.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getIDList.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getIDList.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getIDList.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function IDList = getIDList() -%getIDList Get the IDs of the vehicle types in the network. -% IDList = getIDList() Returns a cell array of strings containing the IDs -% of the vehicle types in the SUMO network. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getIDList.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -IDList = traci.vehicletype.getUniversal(constants.ID_LIST, ''); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getImperfection.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getImperfection.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getImperfection.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getImperfection.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function imperfection = getImperfection(typeID) -%getImperfection -% imperfection = getImperfection(TYPEID) Returns the driver's imperfection -% (dawdling) [0,1] of vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getImperfection.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -imperfection = traci.vehicletype.getUniversal(constants.VAR_IMPERFECTION, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getLength.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getLength.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function length = getLength(typeID) -%getLength -% length = getLength(TYPEID) Returns the length in m of the vehicles of -% this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getLength.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -length = traci.vehicletype.getUniversal(constants.VAR_LENGTH, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getMaxSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function maxSpeed = getMaxSpeed(typeID) -%getMaxSpeed -% maxSpeed = getMaxSpeed(TYPEID) Returns the maximum speed in m/s of -% vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getMaxSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -maxSpeed = traci.vehicletype.getUniversal(constants.VAR_MAXSPEED, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getMinGap.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getMinGap.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getMinGap.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getMinGap.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function minGap = getMinGap(typeID) -%getMinGap -% minGap = getMinGap(TYPEID) Returns the offset (gap to front vehicle if -% halting) of vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getMinGap.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -minGap = traci.vehicletype.getUniversal(constants.VAR_MINGAP, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getShapeClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getShapeClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getShapeClass.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getShapeClass.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function shapeClass = getShapeClass(typeID) -%getShapeClass -% shapeClass = getShapeClass(TYPEID) Returns the shape class of vehicles -% of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getShapeClass.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -shapeClass = traci.vehicletype.getUniversal(constants.VAR_SHAPECLASS, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getSpeedDeviation.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getSpeedDeviation.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getSpeedDeviation.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getSpeedDeviation.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function speedDeviation = getSpeedDeviation(typeID) -%getSpeedDeviation -% speedDeviation = getSpeedDeviation(TYPEID) Returns the maximum speed -% deviation of vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSpeedDeviation.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -speedDeviation = traci.vehicletype.getUniversal(constants.VAR_SPEED_DEVIATION, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getSpeedFactor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getSpeedFactor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getSpeedFactor.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getSpeedFactor.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function speedFactor = getSpeedFactor(typeID) -%getSpeedFactor -% speedFactor = getSpeedFactor(TYPEID) Returns the chosen speed factor for -% vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSpeedFactor.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -speedFactor = traci.vehicletype.getUniversal(constants.VAR_SPEED_FACTOR, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getSubscriptionResults.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getSubscriptionResults.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getSubscriptionResults.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getSubscriptionResults.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -function subscriptionResults = getSubscriptionResults(typeID) -%getSubscriptionResults Get the subscription results for the last time step. -% subscriptionResults = getSubscriptionResults(TYPEID) Returns the -% subscription results for the last time step and the given vehicle type. -% If no vehicle type id is given, all subscription results are returned -% in a containers.Map data structure. -% If the vehicle type id is unknown or the subscription did for any reason return -% no data, 'None' is returned. -% It is not possible to retrieve older subscription results than the ones -% from the last time step. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getSubscriptionResults.m 2 2013-12-21 21:39:57Z aacosta $ - -global typeSubscriptionResults -if isempty(typeSubscriptionResults) - throw(MException('traci:FatalTraCIError',... - 'You have to subscribe to the variable')); -end -if nargin < 1 - typeID = 'None'; -end - -subscriptionResults = typeSubscriptionResults.get(typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getTau.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getTau.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getTau.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getTau.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function tau = getTau(typeID) -%getTau -% tau = getTau(TYPEID) Returns the driver's reaction time in s for -% vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getTau.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -tau = traci.vehicletype.getUniversal(constants.VAR_TAU, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getUniversal.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getUniversal.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getUniversal.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getUniversal.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -function returnedValue = getUniversal(varID, typeID) -%getUniversal An internal function to send the get command and read the -%variable value. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getUniversal.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global typeSubscriptionResults - -if isempty(typeSubscriptionResults) - returnValueFunc = traci.RETURN_VALUE_FUNC.vehicletype; -else - returnValueFunc = typeSubscriptionResults.valueFunc; -end - -% Prepare the outgoing message and read the response. The result variable -% is a traci.Storage object -result = traci.sendReadOneStringCmd(constants.CMD_GET_VEHICLETYPE_VARIABLE,varID,typeID); -handleReturValueFunc = str2func(returnValueFunc(varID)); - -% Use the proper method to read the variable of interest from the result -returnedValue = handleReturValueFunc(result); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getVehicleClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getVehicleClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getVehicleClass.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getVehicleClass.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function vehicleClass = getVehicleClass(typeID) -%getVehicleClass -% vehicleClass = getVehicleClass(TYPEID) Returns the class of vehicles of -% this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getVehicleClass.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -vehicleClass = traci.vehicletype.getUniversal(constants.VAR_VEHICLECLASS, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getWidth.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getWidth.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getWidth.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/getWidth.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function width = getWidth(typeID) -%getVehicleClass -% vehicleClass = getVehicleClass(TYPEID) Returns the width in m of -% vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: getWidth.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -width = traci.vehicletype.getUniversal(constants.VAR_WIDTH, typeID); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setAccel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setAccel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setAccel.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setAccel.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setAccel(typeID, accel) -%setAccel -% setAccel(TYPEID,ACCEL) Sets the maximum acceleration in m/s^2 of -% vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setAccel.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_ACCEL, typeID, accel); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setColor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setColor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setColor.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setColor.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -function setColor(typeID, color) -%setColor Set the color of the vehicle. -% setColor(TYPEID,COLOR) Sets color for vehicle vehicles of this type, -% i.e. (255,0,0,0) for the color red. The fourth integer (alpha) is -% currently ignored - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setColor.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -global message -traci.beginMessage(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_COLOR, typeID, 1+1+1+1+1); -message.string = [message.string uint8([sscanf(constants.TYPE_COLOR,'%x') color])]; -traci.sendExact(); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setDecel.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setDecel.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setDecel.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setDecel.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setDecel(typeID, decel) -%setDecel -% setDecel(TYPEID,DECEL) Sets the maximum deceleration in m/s^2 of -% vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setDecel.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_DECEL, typeID, decel); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setEmissionClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setEmissionClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setEmissionClass.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setEmissionClass.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setEmissionClass(typeID, clazz) -%setEmissionClass -% setEmissionClass(TYPEID,CLASS) Sets the emission class of vehicles of -% this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setEmissionClass.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_EMISSIONCLASS, typeID, clazz); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setImperfection.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setImperfection.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setImperfection.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setImperfection.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -function setImperfection(typeID, imperfection) -%setImperfection -% setImperfection(TYPEID,IMPERFECTION) Sets the driver's imperfection -% (dawdling) for vehicles of this class. IMPERFECTION is a double -% precision integer rnging from zero to one. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setImperfection.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_IMPERFECTION, typeID, imperfection); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setLength.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setLength.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setLength.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setLength.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setLength(typeID, length) -%setLength -% setLength(TYPEID,LENGTH) Sets the length in m of the vehicles of this -% type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setLength.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_LENGTH, typeID, length); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setMaxSpeed.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setMaxSpeed.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setMaxSpeed.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setMaxSpeed.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setMaxSpeed(typeID, speed) -%setMaxSpeed -% setMaxSpeed(TYPEID,SPEED) Sets the maximum speed in m/s of vehicles of -% this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setMaxSpeed.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_MAXSPEED, typeID, speed); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setMinGap.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setMinGap.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setMinGap.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setMinGap.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setMinGap(typeID, minGap) -%setMinGap -% setMinGap(TYPEID,MINGAP) Sets the offset (gap to front vehicle if -% halting) of vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setMinGap.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_MINGAP, typeID, minGap); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setShapeClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setShapeClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setShapeClass.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setShapeClass.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setShapeClass(typeID, clazz) -%setShapeClass -% setShapeClass(TYPEID,CLASS) Sets the shape class of vehicles of this -% type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setShapeClass.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_SHAPECLASS, typeID, clazz); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setSpeedDeviation.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setSpeedDeviation.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setSpeedDeviation.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setSpeedDeviation.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setSpeedDeviation(typeID, deviation) -%setSpeedDeviation -% setSpeedDeviation(TYPEID,DEVIATION) Sets the maximum speed deviation of -% vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setSpeedDeviation.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_SPEED_DEVIATION, typeID, deviation); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setSpeedFactor.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setSpeedFactor.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setSpeedFactor.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setSpeedFactor.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setSpeedFactor(typeID, factor) -%setSpeedFactor -% setSpeedFactor(TYPEID,FACTOR) Sets the speed factor for the vehicles of -% this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setSpeedFactor.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_SPEED_FACTOR, typeID, factor); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setTau.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setTau.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setTau.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setTau.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -function setTau(typeID, tau) -%setTau -% setTau(TYPEID,TAU) Sets the driver's reaction time in s for vehicles of -% this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setTau.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_TAU, typeID, tau); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setVehicleClass.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setVehicleClass.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setVehicleClass.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setVehicleClass.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function setVehicleClass(typeID, clazz) -%setVehicleClass -% setVehicleClass(TYPEID,CLASS) Sets the class of vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setVehicleClass.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendStringCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_VEHICLECLASS, typeID, clazz); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setWidth.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setWidth.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setWidth.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/setWidth.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -function setWidth(typeID, width) -%setWidth -% setWidth(TYPEID,WIDTH) Sets the width in m of vehicles of this type. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: setWidth.m 2 2013-12-21 21:39:57Z aacosta $ - -import traci.constants -traci.sendDoubleCmd(constants.CMD_SET_VEHICLETYPE_VARIABLE, constants.VAR_WIDTH, typeID, width); \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/subscribeContext.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/subscribeContext.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/subscribeContext.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/subscribeContext.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -function subscribeContext(typeID, domain, dist, varargin) -%subscribeContext Subscribe to a vehicle type's context variable. -% subscribeContext(TYPEID,DOMAIN,DIST) Subscribe to the VAR_MAXSPEED -% value of the SUMO objects that surround the vehicle type specified by -% TYPEID at a distance given by DIST, for the maximum allowed interval. -% The type of objets that surround the vehicle type are defined in the -% DOMAIN parameter. Note that not all the SUMO object types support the -% variable VAR_MAXSPEED. -% subscribeContext(...,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS. -% subscribeContext(...,BEGIN) Subscribe from the time BEGIN to the -% maximum allowed end time. -% subscribeContext(...,END) Subscribe for the time interval defined by -% BEGIN and END. -% A call to this method clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribeContext.m 2 2013-12-21 21:39:57Z aacosta $ - -global typeSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'type.subscribeContext'; -p.addRequired('typeID',@ischar) -p.addRequired('domain',@ischar) -p.addRequired('dist',@isnumeric) -p.addOptional('varIDs', {constants.VAR_MAXSPEED}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(typeID, domain, dist, varargin{:}) -typeID = p.Results.typeID; -domain = p.Results.domain; -dist = p.Results.dist; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -typeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicletype); - -typeSubscriptionResults.reset() -traci.subscribeContext(constants.CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT,... - subscriptionBegin, subscriptionEnd, typeID, domain, dist, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/subscribe.m sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/subscribe.m --- sumo-0.21.0+dfsg/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/subscribe.m 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/contributed/TraCI4Matlab/TraCI4Matlab/+traci/+vehicletype/subscribe.m 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -function subscribe(typeID, varargin) -%subscribe Subscribe to vehicle type variable. -% subscribe(TYPEID) Subscribe to the VAR_MAXSPEED value for the maximum -% allowed interval. -% subscribe(TYPEID,VARIDS) Subscribe to the values given in the cell -% array of strings VARIDS for the maximum allowed interval. -% subscribe(...,BEGIN) Subscribe from the time BEGIN to the maximum -% allowed end time. -% subscribe(...,END) Subscribe for the time interval defined by BEGIN and -% END. -% A call to this function clears all previous subscription results. - -% Copyright 2013 Universidad Nacional de Colombia, -% Politecnico Jaime Isaza Cadavid. -% Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa. -% $Id: subscribe.m 2 2013-12-21 21:39:57Z aacosta $ - -global typeSubscriptionResults -import traci.constants - -% Parse the input -p = inputParser; -p.FunctionName = 'vehicletype.subscribe'; -p.addRequired('typeID',@ischar) -p.addOptional('varIDs', {constants.VAR_MAXSPEED}, @iscell) -p.addOptional('subscriptionBegin', 0, @(x)isnumeric(x) && length(x)==1) -p.addOptional('subscriptionEnd', 2^31-1, @(x)isnumeric(x) && length(x)==1) -p.parse(typeID, varargin{:}) -typeID = p.Results.typeID; -varIDs = p.Results.varIDs; -subscriptionBegin = p.Results.subscriptionBegin; -subscriptionEnd = p.Results.subscriptionEnd; - -typeSubscriptionResults = traci.SubscriptionResults(traci.RETURN_VALUE_FUNC.vehicletype); - -typeSubscriptionResults.reset() -traci.subscribe(constants.CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE,... - subscriptionBegin, subscriptionEnd, typeID, varIDs) \ No newline at end of file diff -Nru sumo-0.21.0+dfsg/tools/detector/aggregateFlows.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/detector/aggregateFlows.py --- sumo-0.21.0+dfsg/tools/detector/aggregateFlows.py 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/detector/aggregateFlows.py 2015-04-17 05:44:20.000000000 +0000 @@ -3,7 +3,7 @@ @file aggregateFlows.py @author Michael Behrisch @date 2007-06-28 -@version $Id: aggregateFlows.py 15692 2014-02-22 09:17:02Z behrisch $ +@version $Id: aggregateFlows.py 18096 2015-03-17 09:50:59Z behrisch $ This script aggregates flows as they come from the Datenverteiler into files suitable for the dfrouter. @@ -11,8 +11,8 @@ interest (one per line, additional whitespace separated entries do not hurt, for instance a bab_map.txt will do) -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -20,11 +20,14 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import os, sys, zipfile +import os +import sys +import zipfile from optparse import OptionParser + class Entry: - + def __init__(self): self.carFlow = 0 self.truckFlow = 0 @@ -33,14 +36,16 @@ def add(self, qCar, qTruck, vCar, vTruck): if qCar > 0: - self.carSpeed = (self.carFlow * self.carSpeed + qCar * vCar) / (self.carFlow + qCar) + self.carSpeed = ( + self.carFlow * self.carSpeed + qCar * vCar) / (self.carFlow + qCar) self.carFlow += qCar if qTruck > 0: - self.truckSpeed = (self.truckFlow * self.truckSpeed + qTruck * vTruck) / (self.truckFlow + qTruck) + self.truckSpeed = ( + self.truckFlow * self.truckSpeed + qTruck * vTruck) / (self.truckFlow + qTruck) self.truckFlow += qTruck def __repr__(self): - return str(self.carFlow)+";"+str(self.truckFlow)+";"+str(self.carSpeed)+";"+str(self.truckSpeed) + return str(self.carFlow) + ";" + str(self.truckFlow) + ";" + str(self.carSpeed) + ";" + str(self.truckSpeed) def readLines(lines): @@ -49,7 +54,8 @@ if not cityDets or flowDef[0] in cityDets: if not flowDef[0] in totalFlow: totalFlow[flowDef[0]] = Entry() - totalFlow[flowDef[0]].add(int(flowDef[1]), int(flowDef[2]), float(flowDef[3]), float(flowDef[4])) + totalFlow[flowDef[0]].add( + int(flowDef[1]), int(flowDef[2]), float(flowDef[3]), float(flowDef[4])) optParser = OptionParser(usage="usage: %prog [options] [flow.txt|flows.zip]+") optParser.add_option("-d", "--det-file", dest="detfile", @@ -67,7 +73,7 @@ totalFlow = {} for f in args: if os.access(f, os.R_OK): - if f.endswith(".zip"): + if f.endswith(".zip"): zipf = zipfile.ZipFile(f) for fileName in zipf.namelist(): readLines(zipf.read(fileName).splitlines()) @@ -78,4 +84,4 @@ print >> sys.stderr, "Cannot read", f print "Detector;Time;qPKW;qLKW;vPKW;vLKW" for det, flow in totalFlow.iteritems(): - print det+";0;"+str(flow) + print det + ";0;" + str(flow) diff -Nru sumo-0.21.0+dfsg/tools/detector/deleteUnusedDetectors.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/detector/deleteUnusedDetectors.py --- sumo-0.21.0+dfsg/tools/detector/deleteUnusedDetectors.py 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/detector/deleteUnusedDetectors.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,14 +5,14 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2010-03-03 -@version $Id: deleteUnusedDetectors.py 15853 2014-03-06 11:41:41Z behrisch $ +@version $Id: deleteUnusedDetectors.py 18096 2015-03-17 09:50:59Z behrisch $ 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 with detectors which are actually used in the given network. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -22,28 +22,35 @@ """ -import os, string, sys, StringIO +import os +import string +import sys +import StringIO from xml.dom.minidom import * sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import sumolib.net + def writeDetectors(usedDet): """ Writes the detectors which are used in the network in a xml file. """ fd = open("detectors.xml", "w") - fd.write('<additional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.sf.net/xsd/additional_file.xsd">\n') + fd.write( + '<additional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/additional_file.xsd">\n') for det in usedDet: - fd.write(" <e1Detector id= \"" + det.getAttribute('id') + "\" lane=\"" + det.getAttribute('lane') + "\" pos=\"" + det.getAttribute('pos')) - fd.write("\" freq=\"" + det.getAttribute('freq') + "\" file=\"" + det.getAttribute('file')) + fd.write(" <e1Detector id= \"" + det.getAttribute('id') + "\" lane=\"" + + det.getAttribute('lane') + "\" pos=\"" + det.getAttribute('pos')) + fd.write("\" freq=\"" + det.getAttribute('freq') + + "\" file=\"" + det.getAttribute('file')) # the position of some detectors are over the end of an edge. # the tag friendlyPos corrects the position if det.hasAttribute('friendlyPos'): fd.write("\" friendlyPos=\"" + det.getAttribute('friendlyPos')) - + fd.write("\"") fd.write("/>\n") fd.write("</additional>\n") - + def deleteUnused(detectors, net): """ This method gets all edges from a network and tests whether @@ -60,16 +67,17 @@ for i in detAttributes: laneID = i.getAttribute('lane') # the id from lanes have as preffix the id from edges - # the last two characters are not important they describe the position within the edge - if laneID[: len(laneID)-2] in edgelist: + # the last two characters are not important they describe the position + # within the edge + if laneID[: len(laneID) - 2] in edgelist: usedDet.append(i) - return usedDet + return usedDet if len(sys.argv) < 3: print "Usage: " + sys.argv[0] + " <net> <detectors>" sys.exit() - + print "Reading net..." net = sumolib.net.readNet(sys.argv[1]) diff -Nru sumo-0.21.0+dfsg/tools/detector/detector.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/detector/detector.py --- sumo-0.21.0+dfsg/tools/detector/detector.py 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/detector/detector.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-06-28 -@version $Id: detector.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: detector.py 18096 2015-03-17 09:50:59Z behrisch $ <documentation missing> -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -23,6 +23,7 @@ MAX_POS_DEVIATION = 10 + class DetectorGroupData: def __init__(self, pos, isValid, id=None): @@ -40,7 +41,8 @@ self.totalFlow += flow count = self.entryCount if flow > 0: - self.avgSpeed = (self.avgSpeed * oldFlow + speed * flow) / self.totalFlow + self.avgSpeed = ( + self.avgSpeed * oldFlow + speed * flow) / self.totalFlow self.entryCount += 1 def clearFlow(self): @@ -78,7 +80,8 @@ haveGroup = True break if not haveGroup: - self._edge2DetData[edge].append(DetectorGroupData(pos, True, id)) + self._edge2DetData[edge].append( + DetectorGroupData(pos, True, id)) self._det2edge[id] = edge def startElement(self, name, attrs): @@ -132,7 +135,9 @@ if timeIdx == -1 or timeVal is None or float(flowDef[timeIdx]) == timeVal: hadFlow = True if speedIdx != -1: - self.addFlow(flowDef[detIdx], float(flowDef[flowIdx]), float(flowDef[speedIdx])) + self.addFlow( + flowDef[detIdx], float(flowDef[flowIdx]), float(flowDef[speedIdx])) else: - self.addFlow(flowDef[detIdx], float(flowDef[flowIdx])) + self.addFlow( + flowDef[detIdx], float(flowDef[flowIdx])) return hadFlow diff -Nru sumo-0.21.0+dfsg/tools/detector/flowFromRoutes.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/detector/flowFromRoutes.py --- sumo-0.21.0+dfsg/tools/detector/flowFromRoutes.py 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/detector/flowFromRoutes.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ @author Jakob Erdmann @author Michael Behrisch @date 2007-06-28 -@version $Id: flowFromRoutes.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: flowFromRoutes.py 18096 2015-03-17 09:50:59Z behrisch $ This script recreates a flow file from routes and emitters. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -18,17 +18,22 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import math, string, sys +import math +import string +import sys from xml.sax import saxutils, make_parser, handler from optparse import OptionParser import detector + class LaneMap: + def get(self, key, default): return key[0:-2] + class DetectorRouteEmitterReader(handler.ContentHandler): def __init__(self, detFile): @@ -37,7 +42,7 @@ self._edgeFlow = {} self._parser = make_parser() self._parser.setContentHandler(self) - + def addEdgeFlow(self, edge, flow): if not edge in self._edgeFlow: self._edgeFlow[edge] = 0 @@ -76,7 +81,7 @@ sumSquaredPercent += dev * dev / dFlow / dFlow n += 1 print '# avgRouteFlow avgDetFlow avgDev RMSE RMSPE' - print '#', rSum/n, dSum/n, sumAbsDev/n, math.sqrt(sumSquaredDev/n), math.sqrt(sumSquaredPercent/n) + print '#', rSum / n, dSum / n, sumAbsDev / n, math.sqrt(sumSquaredDev / n), math.sqrt(sumSquaredPercent / n) def printFlows(self, includeDets): if includeDets: diff -Nru sumo-0.21.0+dfsg/tools/detector/flowrouter.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/detector/flowrouter.py --- sumo-0.21.0+dfsg/tools/detector/flowrouter.py 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/detector/flowrouter.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,7 +4,7 @@ @author Michael Behrisch @author Daniel Krajzewicz @date 2007-06-28 -@version $Id: flowrouter.py 15853 2014-03-06 11:41:41Z behrisch $ +@version $Id: flowrouter.py 18096 2015-03-17 09:50:59Z behrisch $ This script does flow routing similar to the dfrouter. It has three mandatory parameters, the SUMO net (.net.xml), a file @@ -12,8 +12,8 @@ of the detectors (source, sink, inbetween) itself or read it from the detectors file. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -21,7 +21,10 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import os, random, string, sys +import os +import random +import string +import sys from xml.sax import saxutils, make_parser, handler from optparse import OptionParser @@ -33,6 +36,8 @@ # Vertex class which stores incoming and outgoing edges as well as # auxiliary data for the flow computation. The members are accessed # directly. + + class Vertex: def __init__(self): @@ -77,7 +82,7 @@ self.length = 0.0 self.detGroup = [] self.reset() - + def reset(self): self.capacity = sys.maxint self.startCapacity = sys.maxint @@ -88,7 +93,7 @@ cap = str(self.capacity) if self.capacity == sys.maxint: cap = "inf" - return self.kind+"_"+self.label+"<"+str(self.flow)+"|"+cap+">" + return self.kind + "_" + self.label + "<" + str(self.flow) + "|" + cap + ">" # Route class storing the list of edges and the frequency of a route. @@ -155,12 +160,12 @@ "real")) def addSourceEdge(self, edgeObj): - newEdge = Edge("s_"+edgeObj.label, self._source, edgeObj.source, + newEdge = Edge("s_" + edgeObj.label, self._source, edgeObj.source, "source") self.addEdge(newEdge) def addSinkEdge(self, edgeObj): - newEdge = Edge("t_"+edgeObj.label, edgeObj.target, self._sink, + newEdge = Edge("t_" + edgeObj.label, edgeObj.target, self._sink, "sink") self.addEdge(newEdge) @@ -187,7 +192,7 @@ if options.trimfile: trimOut = open(options.trimfile, 'w') for edge in self._edges.values(): - print >> trimOut, "edge:"+edge.label + print >> trimOut, "edge:" + edge.label trimOut.close() def detectSourceSink(self, sources, sinks): @@ -253,7 +258,7 @@ for edge in newRoute.edges: edge.routes.append(newRoute) newStubs.append(Route(newRoute.frequency, - route.edges[edgePos+1:])) + route.edges[edgePos + 1:])) route.frequency -= newRoute.frequency if route.frequency == 0: for edge in route.edges: @@ -328,7 +333,7 @@ print "Trying to increase flow on", unsatEdge for vertex in self._vertices: vertex.reset() - pred = {unsatEdge.target:unsatEdge, unsatEdge.source:unsatEdge} + pred = {unsatEdge.target: unsatEdge, unsatEdge.source: unsatEdge} unsatEdge.target.inPathEdge = unsatEdge unsatEdge.source.flowDelta = unsatEdge.capacity - unsatEdge.flow queue = [unsatEdge.source] @@ -341,12 +346,14 @@ if edge.source not in pred and edge.flow < edge.capacity: queue.append(edge.source) pred[edge.source] = edge - edge.source.flowDelta = min(currVertex.flowDelta, edge.capacity - edge.flow) + edge.source.flowDelta = min( + currVertex.flowDelta, edge.capacity - edge.flow) for edge in currVertex.outEdges: if edge.target not in pred and edge.flow > 0: queue.append(edge.target) pred[edge.target] = edge - edge.target.flowDelta = min(currVertex.flowDelta, edge.flow) + edge.target.flowDelta = min( + currVertex.flowDelta, edge.flow) return False def calcRoutes(self): @@ -392,7 +399,8 @@ for redge in route.edges: if redge.kind == "real": if options.lanebased: - routeString += redge.label[:redge.label.rfind("_")] + " " + routeString += redge.label[: + redge.label.rfind("_")] + " " else: routeString += redge.label + " " if firstReal == '': @@ -400,7 +408,8 @@ lastReal = redge assert firstReal != '' and lastReal != None routeID = "%s.%s%s" % (firstReal, id, suffix) - print >> routeOut, ' <route id="%s" edges="%s"/>' % (routeID, routeString.strip()) + print >> routeOut, ' <route id="%s" edges="%s"/>' % ( + routeID, routeString.strip()) def writeEmitters(self, emitOut, begin=0, end=3600, suffix=""): if not emitOut: @@ -412,12 +421,17 @@ edge = srcEdge.target.outEdges[0] vtype = ' type="%s"' % options.vtype if options.vtype else "" if len(srcEdge.routes) == 1: - print >> emitOut, ' <flow id="src_%s%s"%s route="%s.0%s" number="%s" begin="%s" end="%s"/>' % (edge.label, suffix, vtype, edge.label, suffix, srcEdge.flow, begin, end) + print >> emitOut, ' <flow id="src_%s%s"%s route="%s.0%s" number="%s" begin="%s" end="%s"/>' % ( + edge.label, suffix, vtype, edge.label, suffix, srcEdge.flow, begin, end) else: - ids = " ".join(["%s.%s%s" % (edge.label, id, suffix) for id in range(len(srcEdge.routes))]) - probs = " ".join([str(route.frequency) for route in srcEdge.routes]) - print >> emitOut, ' <flow id="src_%s%s"%s number="%s" begin="%s" end="%s">' % (edge.label, suffix, vtype, srcEdge.flow, begin, end) - print >> emitOut, ' <routeDistribution routes="%s" probabilities="%s"/>' % (ids, probs) + ids = " ".join(["%s.%s%s" % (edge.label, id, suffix) + for id in range(len(srcEdge.routes))]) + probs = " ".join([str(route.frequency) + for route in srcEdge.routes]) + print >> emitOut, ' <flow id="src_%s%s"%s number="%s" begin="%s" end="%s">' % ( + edge.label, suffix, vtype, srcEdge.flow, begin, end) + print >> emitOut, ' <routeDistribution routes="%s" probabilities="%s"/>' % ( + ids, probs) print >> emitOut, ' </flow>' def writeFlowPOIs(self, poiOut, suffix=""): @@ -431,16 +445,18 @@ break for sink in edge.target.outEdges: if sink.target == self._sink: - color = "1,"+color[2]+",0" + color = "1," + color[2] + ",0" break label = edge.label flow = str(edge.flow) cap = str(edge.startCapacity) if edge.startCapacity == sys.maxint: cap = "inf" - print >> poiOut, ' <poi id="' + label + '_f' + flow + 'c' + cap + suffix + '"', + print >> poiOut, ' <poi id="' + label + \ + '_f' + flow + 'c' + cap + suffix + '"', print >> poiOut, 'color = "' + color + '" lane="' + label + '_0"', - print >> poiOut, ' pos="' + str(random.random()*edge.length) + '"/>' + print >> poiOut, ' pos="' + \ + str(random.random() * edge.length) + '"/>' # The class for parsing the XML and CSV input files. The data parsed is @@ -465,7 +481,7 @@ if options.lanebased: fromEdgeID += "_" + attrs["fromLane"] toEdgeID += "_" + attrs["toLane"] - newEdge = Edge(fromEdgeID+"_"+toEdgeID, self._net.getEdge(fromEdgeID).target, + newEdge = Edge(fromEdgeID + "_" + toEdgeID, self._net.getEdge(fromEdgeID).target, self._net.getEdge(toEdgeID).source) self._net.addEdge(newEdge) elif name == 'lane' and self._edge != '': @@ -507,7 +523,7 @@ if t is None: return self._detReader.readFlows(flowFile, flow=options.flowcol) else: - return self._detReader.readFlows(flowFile, flow=options.flowcol, time="Time", timeVal=t) + return self._detReader.readFlows(flowFile, flow=options.flowcol, time="Time", timeVal=t) def clearFlows(self): self._detReader.clearFlows() @@ -517,6 +533,7 @@ if not options.quiet: print >> sys.stderr, msg + def addFlowFile(option, opt_str, value, parser): if not getattr(parser.values, option.dest, None): setattr(parser.values, option.dest, []) @@ -555,7 +572,8 @@ 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("-i", "--interval", type="int", help="aggregation interval in minutes") +optParser.add_option( + "-i", "--interval", type="int", help="aggregation interval in minutes") 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", @@ -610,7 +628,8 @@ for edge in net._source.outEdges: for route in edge.routes: print route - net.writeEmitters(emitOut, 60*start, 60*(start+options.interval), suffix) + net.writeEmitters( + emitOut, 60 * start, 60 * (start + options.interval), suffix) net.writeFlowPOIs(poiOut, suffix) reader.clearFlows() start += options.interval diff -Nru sumo-0.21.0+dfsg/tools/detector/validate.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/detector/validate.py --- sumo-0.21.0+dfsg/tools/detector/validate.py 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/detector/validate.py 2015-04-17 05:44:20.000000000 +0000 @@ -3,13 +3,13 @@ @file validate.py @author Michael Behrisch @date 2013-06-12 -@version $Id: validate.py 16088 2014-03-31 08:58:52Z behrisch $ +@version $Id: validate.py 18096 2015-03-17 09:50:59Z behrisch $ This script validates detector data resulting from dfrouter validation detectors against the original data fed into dfrouter -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -18,7 +18,9 @@ (at your option) any later version. """ from __future__ import print_function -import sys, os, collections +import sys +import os +import collections from optparse import OptionParser import matplotlib matplotlib.use('Agg') @@ -27,10 +29,14 @@ import sumolib optParser = OptionParser(usage="usage: %prog [options] <input_flows.csv>") -optParser.add_option("-d", "--detectorfile", help="read detector list from file") -optParser.add_option("-v", "--validation", help="read validation data from file") -optParser.add_option("-i", "--interval", default=15, help="aggregation interval in minutes (default: %default)") -optParser.add_option("-l", "--legacy", action="store_true", default=False, help="legacy style, input file is whitespace separated, detector_definition") +optParser.add_option( + "-d", "--detectorfile", help="read detector list from file") +optParser.add_option( + "-v", "--validation", help="read validation data from file") +optParser.add_option("-i", "--interval", default=15, + help="aggregation interval in minutes (default: %default)") +optParser.add_option("-l", "--legacy", action="store_true", default=False, + help="legacy style, input file is whitespace separated, detector_definition") (options, args) = optParser.parse_args() sources = set() @@ -76,7 +82,8 @@ totalSpeed = float(item[2]) if total > 0 else 0. else: total = int(item[2]) + int(item[3]) - totalSpeed = int(item[2]) * float(item[4]) + int(item[3]) * float(item[5]) + totalSpeed = int(item[2]) * float(item[4]) + \ + int(item[3]) * float(item[5]) c[detId] += total v[detId] += totalSpeed totals[detId] += total @@ -94,9 +101,9 @@ start = 0 end = options.interval # <interval begin="0.00" end="60.00" id="validation_MQ11O_DS_FS1_ERU" nVehContrib="1" flow="60.00" occupancy="1.35" speed="6.19" length="5.00" nVehEntered="1"/> - for interval in sumolib.output.parse_fast(options.validation, "interval", ["begin", "id", "speed", "nVehEntered" ]): + for interval in sumolib.output.parse_fast(options.validation, "interval", ["begin", "id", "speed", "nVehEntered"]): detId = interval.id[11:] - time = int(float(interval.begin)/60) + time = int(float(interval.begin) / 60) if time >= end: start = end end += options.interval @@ -113,27 +120,29 @@ if detId in sinks: countOut += int(interval.nVehEntered) print("simIn: %s simOut: %s" % (countIn, countOut)) - + for det, vals in dets.iteritems(): - print ("Plotting", det,'totaldet', totals[det],'totalSim', totalSim[det]) - plt.bar(*(zip(*vals)[:2])) # select first and second entry (time and flow) + print ("Plotting", det, 'totaldet', totals[det], 'totalSim', totalSim[det]) + plt.bar(*(zip(*vals)[:2])) # select first and second entry (time and flow) if det in sims: plt.plot(*(zip(*sims[det])[:2])) - plt.suptitle('%s flow, totalDet: %s, totalSim: %s'% (det,totals[det],totalSim[det])) + plt.suptitle('%s flow, totalDet: %s, totalSim: %s' % + (det, totals[det], totalSim[det])) plt.xlabel('time') plt.ylabel('flow') - plt.ylim(0,600) - plt.legend(["simulation","measured value"]) + plt.ylim(0, 600) + plt.legend(["simulation", "measured value"]) plt.savefig('%s_flow.png' % det) plt.close() - plt.bar(*(zip(*vals)[::2])) # select first and third entry (time and speed) + # select first and third entry (time and speed) + plt.bar(*(zip(*vals)[::2])) if det in sims: plt.plot(*(zip(*sims[det])[::2])) - plt.suptitle('%s_speed'% det) + plt.suptitle('%s_speed' % det) plt.xlabel('time') plt.ylabel('speed') - plt.ylim(0,200) - plt.legend(["simulation","measured value"]) + plt.ylim(0, 200) + plt.legend(["simulation", "measured value"]) plt.savefig('%s_speed.png' % det) plt.close() plt.bar(counts.keys(), counts.values()) diff -Nru sumo-0.21.0+dfsg/tools/district/countConnectionsInDistricts.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/district/countConnectionsInDistricts.py --- sumo-0.21.0+dfsg/tools/district/countConnectionsInDistricts.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/district/countConnectionsInDistricts.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Daniel Krajzewicz @author Michael Behrisch @date 2007-07-26 -@version $Id: countConnectionsInDistricts.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: countConnectionsInDistricts.py 18096 2015-03-17 09:50:59Z behrisch $ <documentation missing> -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -24,33 +24,35 @@ # 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 == 'taz': + 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 + 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 + 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.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", @@ -68,4 +70,3 @@ print "Reading net '" + options.netfile + "'" parser.parse(options.netfile) reader.writeResults(options.output) - diff -Nru sumo-0.21.0+dfsg/tools/district/districtMapper.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/district/districtMapper.py --- sumo-0.21.0+dfsg/tools/district/districtMapper.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/district/districtMapper.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,14 +5,14 @@ @author Michael Behrisch @author Jakob Erdmann @date 2007-07-26 -@version $Id: districtMapper.py 16103 2014-04-02 09:27:32Z behrisch $ +@version $Id: districtMapper.py 18096 2015-03-17 09:50:59Z behrisch $ Maps the geometry of the districts of two networks by calculating translation and scale parameters from junctions which have been identified by the user as reference points. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -36,6 +36,7 @@ # All members are "private". class JunctionPositionsReader(handler.ContentHandler): + def __init__(self): self._xPos = {} self._yPos = {} @@ -58,9 +59,9 @@ return ret - # All members are "private". class DistrictMapper(handler.ContentHandler): + def __init__(self): self._haveDistrict = False self._parsingDistrictShape = False @@ -69,7 +70,7 @@ self._shape = "" def startElement(self, name, attrs): - if name == 'taz': + if name == 'taz': self._haveDistrict = True self._currentID = attrs['id'] if attrs.has_key('shape'): @@ -82,7 +83,7 @@ self._shape += content def endElement(self, name): - if name == 'taz': + if name == 'taz': self._haveDistrict = False if self._shape != '': self._districtShapes[self._currentID] = parseShape(self._shape) @@ -95,8 +96,8 @@ 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) + nx = ((shape[i][0] - xoff1) * xscale + xoff2) + ny = ((shape[i][1] - yoff1) * yscale + yoff2) nshape.append((nx, ny)) self._districtShapes[district] = nshape @@ -115,12 +116,12 @@ for district in self._districtShapes: shape = self._districtShapes[district] shapeStr = " ".join(["%s,%s" % s for s in shape]) - fd.write(' <poly id="%s" color="%s" shape="%s"/>\n' % (district, color, shapeStr)) + fd.write(' <poly id="%s" color="%s" shape="%s"/>\n' % + (district, color, shapeStr)) fd.write("</shapes>\n") fd.close() - if __name__ == "__main__": optParser = OptionParser() optParser.add_option("-v", "--verbose", action="store_true", @@ -142,7 +143,8 @@ (options, args) = optParser.parse_args() if not options.netfile1 or not options.netfile2 or not options.junctions1 or not options.junctions2: optParser.print_help() - optParser.exit("Error! Providing two networks and junction lists is mandatory") + optParser.exit( + "Error! Providing two networks and junction lists is mandatory") parser = make_parser() if options.verbose: print "Reading net#1" @@ -179,5 +181,6 @@ reader = DistrictMapper() parser.setContentHandler(reader) parser.parse(options.netfile1) - reader.convertShapes(xmin1, xmin2, width1/width2, ymin1, ymin2, height1/height2) + reader.convertShapes( + xmin1, xmin2, width1 / width2, ymin1, ymin2, height1 / height2) reader.writeResults(options.output, options.color, options.polyoutput) diff -Nru sumo-0.21.0+dfsg/tools/district/edgesInDistricts.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/district/edgesInDistricts.py --- sumo-0.21.0+dfsg/tools/district/edgesInDistricts.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/district/edgesInDistricts.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,14 +5,14 @@ @author Michael Behrisch @author Jakob Erdmann @date 2007-07-26 -@version $Id: edgesInDistricts.py 16438 2014-05-28 08:06:28Z behrisch $ +@version $Id: edgesInDistricts.py 18096 2015-03-17 09:50:59Z behrisch $ Parsing a number of networks and taz (district) files with shapes this script writes a taz file with all the edges which are inside the relevant taz. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2007-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2007-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -20,7 +20,8 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import sys, math +import sys +import math from xml.sax import parse, handler from optparse import OptionParser @@ -47,31 +48,32 @@ def angle2D(p1, p2): - theta1 = math.atan2(p1[1], p1[0]); - theta2 = math.atan2(p2[1], p2[0]); - dtheta = theta2 - theta1; + theta1 = math.atan2(p1[1], p1[0]) + theta2 = math.atan2(p2[1], p2[0]) + dtheta = theta2 - theta1 while dtheta > math.pi: - dtheta -= 2.0*math.pi + dtheta -= 2.0 * math.pi while dtheta < -math.pi: - dtheta += 2.0*math.pi + dtheta += 2.0 * math.pi 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]) ) + 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]) ) + 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) >= math.pi # written into the net. All members are "private". class NetDistrictEdgeHandler(handler.ContentHandler): + def __init__(self): self._haveDistrict = False self._parsingDistrictShape = False @@ -89,7 +91,7 @@ self._numLanes = {} def startElement(self, name, attrs): - if name == 'taz' or name == 'poly': + if name == 'taz' or name == 'poly': self._haveDistrict = True self._currentID = attrs['id'] self._districtEdges[self._currentID] = [] @@ -118,11 +120,12 @@ self._shape += content def endElement(self, name): - if name == 'taz' or name == 'poly': + if name == 'taz' or name == 'poly': self._haveDistrict = False if self._shape != '': self._districtShapes[self._currentID] = parseShape(self._shape) - self._districtBoxes[self._currentID] = getBoundingBox(self._districtShapes[self._currentID]) + self._districtBoxes[self._currentID] = getBoundingBox( + self._districtShapes[self._currentID]) self._shape = "" elif name == 'shape' and self._haveDistrict: self._parsingDistrictShape = False @@ -183,17 +186,20 @@ if edge not in self._invalidatedEdges: weight = 1. if weighted: - weight = self._edgeSpeeds[edge] * self._edgeLengths[edge] - fd.write(" <tazSource id=\"" + edge + "\" weight=\"" + str(weight) + "\"/>\n") - fd.write(" <tazSink id=\"" + edge + "\" weight=\"" + str(weight) + "\"/>\n") + weight = self._edgeSpeeds[ + edge] * self._edgeLengths[edge] + fd.write( + " <tazSource id=\"" + edge + "\" weight=\"" + str(weight) + "\"/>\n") + fd.write( + " <tazSink id=\"" + edge + "\" weight=\"" + str(weight) + "\"/>\n") fd.write(" </taz>\n") fd.write("</tazs>\n") fd.close() - + def getTotalLength(self, edge): return self._edgeLengths[edge] * self._numLanes[edge] - - + + if __name__ == "__main__": optParser = OptionParser() optParser.add_option("-v", "--verbose", action="store_true", @@ -222,7 +228,8 @@ parse(netfile, reader) if options.verbose: print "Calculating" - reader.computeWithin(options.complete, options.maxspeed, options.assign_from, options.verbose) + reader.computeWithin( + options.complete, options.maxspeed, options.assign_from, options.verbose) if options.verbose: print "Writing results" reader.writeResults(options.output, options.weighted) diff -Nru sumo-0.21.0+dfsg/tools/docs/buildHTMLDocs.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/docs/buildHTMLDocs.py --- sumo-0.21.0+dfsg/tools/docs/buildHTMLDocs.py 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/docs/buildHTMLDocs.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,301 +0,0 @@ -#!/usr/bin/env python -""" -@file buildHTMLDocs.py -@author Daniel Krajzewicz -@author Michael Behrisch -@date 2011-10-20 -@version $Id: buildHTMLDocs.py 16005 2014-03-24 12:46:02Z cschmidt87 $ - -Converts wiki-documentation into HTML pages. - -Determines what to convert, first: if a command line argument is given, -it is interpreted as the page to convert. Otherwise, "Special:AllPages" is -downloaded and parsed for obtaining the list of all pages which will be -converted in subsequent steps. - -For each of the pages to convert, the HTML-representation of the -page is downloaded and stripped from wiki-header/footer, first. -Then, the image-links are extracted from the HTML page and stored -temporarily, the links themselves are patched to point to local pages/images -(if the page behind the link exists). -The page is saved into options.mirror/<PAGE_PATH>. - -After parsing all pages, the images are downloaded and stored into -options.mirror/images. - -After downloading all data, the title page is extracted and the content -included in this page is extracted. This content is embedded into "index.html" -between the <!-- nav begins --> / <!-- nav ends --> markers. -All pages downloaded earlier are loaded, and embedded into the index.html -between the <!-- content begins --> / <!-- content ends --> markers. Then, -the page is saved into options.output/<PAGE_PATH>. All images are copied -from options.mirror/images to options.output/images. - -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2011-2014 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. -""" -import urllib, os, sys, shutil, datetime -from optparse import OptionParser - -from mirrorWiki import readParsePage, readParseEditPage - -def patchLinks(page, name): - images = set() - level = len(name.split("/"))-1 - level = "../" * level - b = page.find("<a href") - while b>=0: - # images/files - if page[b+9:].startswith("/wiki/File:") or page[b+9:].startswith("/wiki/Image:"): - b2 = b - b = page.find(":", b)+1 - images.add(page[b2+9:page.find("\"",b)]) - page = page[:b2+9] + level + "images/" + page[b:] - # pages (HTML) - elif page[b+9:].startswith("/wiki/"): - e = b+9+6 - e2 = page.find("\"", b+9) - link = page[e:e2] - if link.find("action=edit")<0: - if link.find("#")>0: - link = level + link.replace("#", ".html#") - elif link.find("#")<0 and not (link.endswith(".png") or link.endswith(".jpg") or link.endswith(".svg")): - link = level + link + ".html" - page = page[:b+9] + link + page[e2:] - else: - page = page[:b+9] + "http://sourceforge.net/" + page[b+10:] - b = page.find("<a href", b+1) - return page, images, level - -def patchImages(page, name): - images = set() - level = len(name.split("/"))-1 - level = "../" * level - b = page.find("<img ") - b = page.find("src", b) - while b>=0: - b += 5 - e = page.find("\"", b+2) - add = page[b:e] - l = add[add.rfind("/"):] - if add.find("thumb")>=0: - l = l[l.find("-")+1:] - images.add(add) - page = page[:b] + level + "images/" + l + page[e:] - b = page.find("<img", b+1) - b = page.find("src", b) - page = page.replace(".svg.png", ".svg") - return page, images - -def parseWikiLink(l): - if l.find("[[")>=0: - # internal link - b = l.find("[")+2 - e = l.find("]", b) - t = l[b:e] - if t.find("|")<0: - link = t - text = t - else: - link, text = t.split("|") - link = link.replace(" ", "_") - if link.find("#")>=0: - link = link.replace("#", ".html#") - else: - link = link + ".html" - # external link - elif l.find("[")>=0: - b = l.find("[")+1 - e = l.find("]", b) - t = l[b:e] - link = t[:t.find(" ")] - text = t[t.find(" ")+1:] - else: - # text - text = l[l.find(" ")+1:] - link = "" - return text, link - -optParser = OptionParser() -optParser.add_option("-m", "--mirror", default="mirror", help="mirror folder") -optParser.add_option("-o", "--output", default="docs", help="output folder") -optParser.add_option("-i", "--index", default=os.path.join(os.path.dirname(__file__), "..", "..", "docs", "wiki", "index.html"), help="index template file") -optParser.add_option("-r", "--version", help="add version info") -(options, args) = optParser.parse_args() - -try: os.mkdir(options.mirror) -except: pass -try: os.mkdir(options.mirror + "/images") -except: pass -images = set() -if len(args) == 0: - p = readParsePage("Special:AllPages") - p = p[p.find("<input type=\"submit\" value=\"Go\" />"):] - p = p[p.find("<table "):] - pages = p.split("<a ") -else: - pages = ['href="/wiki/%s"' % a for a in args] -for p in pages: - if not p.startswith("href"): - continue - b = p.find("/wiki/") - e = p.find("\"", b) - name = p[b+6:e] - if name.endswith(".css"): - print "Skipping css-file %s" % name - continue - print "Fetching %s" % name - c = readParsePage(name) - if name.find("/")>0: - try: - os.makedirs(os.path.join(options.mirror, name[:name.rfind("/")])) - except: pass - if True:#name.find(".")<0: - c, pi, level = patchLinks(c, name) - for i in pi: - images.add(i) - c, pi = patchImages(c, name) - for i in pi: - images.add(i) - name = name + ".html" - fd = open(os.path.join(options.mirror, name), "w") - fd.write(c) - fd.close() - -imageFiles = [] -for i in images: - print "Fetching image %s" % i - if i.find(":")>=0: - f = urllib.urlopen("http://sumo-sim.org%s" % i) - c = f.read() - b = c.find("<div class=\"fullImageLink\" id=\"file\">") - b = c.find("href=", b)+6 - e = c.find("\"", b+1) - f = urllib.urlopen("http://sumo-sim.org/%s" % c[b:e]) - i = i[i.find(":")+1:] - else: - f = urllib.urlopen("http://sumo-sim.org/%s" % i) - i = i[i.rfind("/")+1:] - if i.find("px-")>=0: - i = i[:i.find('-')+1] - fd = open(os.path.join(options.mirror, "images", i), "wb") - fd.write(f.read()) - fd.close() - imageFiles.append(os.path.join("images", i)) - -# build navigation -nav = readParseEditPage("SUMO_User_Documentation") -lines = nav[nav.find("="):].split("\n") -level = 0 -c = "" -hadHeader = False -for l in lines: - if len(l)==0: - continue - if l[0]=='=': - text, link = parseWikiLink(" " + l.replace("=", "")) - if hadHeader: - if level > 0: - c += "</ul></li>\n" * level - spc = ' ' * (level+1) - c = c + spc + "<li>"; - if link!="": - c = c + "<a href=\"" + link + "\">"; - c = c + text; - if link!="": - c = c + "</a>"; - c = c + "</li>\n"; - hadHeader = True - level = 0 - continue - if l[0].find('*') < 0: - continue - text, link = parseWikiLink(l) - nLevel = l.count('*') - if level > nLevel: - c = c + ("</ul></li>\n" * (level-nLevel)) - if level < nLevel: - c = c + ('<li style="list-style: none; display: inline"><ul>\n' * (nLevel-level)) - spc = ' ' * (nLevel+1) - #+ str(level) + "-" + str(nLevel) - c = c + spc + "<li>"; - if link !="": - c = c + '<a href="' + link + '">' + text + '</a>'; - else: - c = c + text; - c = c + "</li>\n"; - level = nLevel -if level > 0: - c += "</ul></li>\n" * level - -# get template and embed navigation -fd = open(options.index) -tpl = fd.read() -fd.close() -b = tpl.find("<!-- nav begins -->") -b = tpl.find(">", b)+1 -e = tpl.find("<!-- nav ends -->") -tpl = tpl[:b] + c + tpl[e:] - -# build HTML pages -try: os.mkdir(options.output) -except: pass -try: os.mkdir(options.output + "/images") -except: pass -for p in pages: - if not p.startswith("href"): - continue - b = p.find("/wiki/") - e = p.find("\"", b) - name = p[b+6:e] - if name.endswith(".css"): - print "Skipping css-file %s" % name - continue - fromStr = 'generated on %s from <a href="http://sumo-sim.org/wiki/%s">the wiki page for %s</a>' % (datetime.datetime.now(), name, name) - name = name + ".html" - t = os.path.join(options.output, name) - fd = open(os.path.join(options.mirror, name)) - c = fd.read() - if options.version: - fromStr += " for SUMO %s" % options.version - c = c.replace('<div id="siteSub">From Sumo</div>', '<div id="siteSub">%s</div>' % fromStr) - fd.close() - # - if name.find('/')>=0: - level = name.count("/") - else: - level = name.count("\\") - level = "../" * level - # title - cc = tpl.replace("<title>", "<title>" + name[:name.rfind(".html")] + " - ") - # css inclusion - cc = cc.replace("sumo.css", level + "sumo.css") - cc = cc.replace("logo.png", level + "logo.png") - # links - b = cc.find("<a href=") - while b>=0: - b = cc.find('"', b) - if not cc[b+1:].startswith("http"): - cc = cc[:b+1] + level + cc[b+1:] - b = cc.find("<a href=", b) - # content - b = cc.find("<!-- content begins -->") - e = cc.find("<!-- content ends -->", b) - e = cc.find("<", e+1) - 1 - cc = cc[:b] + c + cc[e:] - - try: os.makedirs(os.path.split(t)[0]) - except: pass - fd = open(t, "w") - fd.write(cc) - fd.close() -for i in imageFiles: - shutil.copy(os.path.join(options.mirror, i), os.path.join(options.output, i)) -if os.path.exists(os.path.join(options.output, 'SUMO_User_Documentation.html')): - shutil.copy(os.path.join(options.output, 'SUMO_User_Documentation.html'), os.path.join(options.output, 'index.html')) diff -Nru sumo-0.21.0+dfsg/tools/docs/configTemplateToWiki.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/docs/configTemplateToWiki.py --- sumo-0.21.0+dfsg/tools/docs/configTemplateToWiki.py 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/docs/configTemplateToWiki.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -#!/usr/bin/env python -""" -@file configTemplateToWiki.py -@author Michael Behrisch -@date 2012-01-26 -@version $Id: configTemplateToWiki.py 15959 2014-03-17 16:58:35Z cschmidt87 $ - -Generate Wiki table from configuration template. - -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 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. -""" -import os, sys -from xml.sax import parse, handler - -from mirrorWiki import readParseEditPage - -class ConfigReader(handler.ContentHandler): - - def __init__(self, mergeWikiTxt): - self._level = 0 - self._mergeWiki = mergeWikiTxt - self._intro = {} - self._end = len(mergeWikiTxt) - active = False - currSect = "" - for idx, line in enumerate(mergeWikiTxt): - line = line.strip('\n\r') - if line == "==Options==": - active = True - if active: - if line[:3] == "===": - start = idx - currSect = line - elif line[:2] == "{|": - self._intro[currSect] = (start, idx) - elif line[:4] == "----" or (len(line) > 2 and line[0] == "=" and line[1] != "="): - self._end = idx - break - if currSect == "": - print line - - def startElement(self, name, attrs): - if self._level == 1: - # subtopic - title = "===%s===" % name.replace("_", " ").title() - if title in self._intro: - begin, end = self._intro[title] - title = ("".join(self._mergeWiki[begin:end])) - else: - title += "\n" - print """%s{| class="wikitable" style="width:90%%" -|- -! style="background:#ddffdd; vertical-align:top; width:350px" | Option -! style="background:#ddffdd; vertical-align:top" | Description""" % title - if self._level == 2: - # entry - print '|-\n| style="vertical-align:top" |', - a = "" - for s in attrs.get('synonymes', '').split(): - if len(s) == 1: - a = s - if a != "": - print '{{Option|-%s {{DT_%s}}}}<br/>' % (a, attrs['type']), - print '{{Option|--%s {{DT_%s}}}}' % (name, attrs['type']) - suffix = "" - if attrs['value']: - suffix = "; ''default: '''%s'''''" % attrs['value'] - print '| style="vertical-align:top" | %s%s' % (attrs['help'], suffix) - self._level += 1 - - def endElement(self, name): - self._level -= 1 - if self._level == 1: - # subtopic end - print "|-\n|}\n" - - def endDocument(self): - print ("".join(self._mergeWiki[self._end:])).strip() - -if __name__ == "__main__": - if len(sys.argv) == 2: - app = sys.argv[1].lower() - if app == "netgenerate": - app = "netgen" - cfg = os.path.join(os.path.dirname(__file__), "..", "..", "tests", app, "meta", "write_template_full", "cfg." + app) - parse(cfg, ConfigReader(readParseEditPage(sys.argv[1].upper()).splitlines(True))) - elif len(sys.argv) == 3: - parse(sys.argv[1], ConfigReader(open(sys.argv[2]).readlines())) - else: - print >> sys.stderr, "Usage: %s <template> <wikisrc>\n or: %s <app>" % (os.path.basename(__file__), os.path.basename(__file__)) diff -Nru sumo-0.21.0+dfsg/tools/docs/mirrorWiki.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/docs/mirrorWiki.py --- sumo-0.21.0+dfsg/tools/docs/mirrorWiki.py 2014-06-11 22:20:48.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/docs/mirrorWiki.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -#!/usr/bin/env python -""" -@file mirrorWiki.py -@author Daniel Krajzewicz -@author Michael Behrisch -@date 2011-10-20 -@version $Id: mirrorWiki.py 15959 2014-03-17 16:58:35Z cschmidt87 $ - -Mirrors wiki-documentation. - -Determines what to mirror, first: if a command line argument is given, -it is interpreted as the page to mirror. Otherwise, "Special:AllPages" is -downloaded and parsed for obtaining the list of all pages which will be -converted in subsequent steps. - -For each of the pages to mirror, the page is downloaded as for -being edited and is stripped from wiki-header/footer, first. -Then, the image-links are extracted from the HTML page and stored -temporarily. -The page is saved into MIRROR_FOLDER/<PAGE_PATH>. - -After mirroring all pages, the images are downloaded and stored into -MIRROR_FOLDER/images. - -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 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. -""" -import urllib, os, sys, shutil -from optparse import OptionParser - -def readParsePage(page): - f = urllib.urlopen("http://sumo-sim.org/wiki/%s" % page) - c = f.read() - b = c.find("This page was last modified on"); - e = c.find("<", b) - lastMod = c[b:e] - b = c.find('<a id="top"') - e = c.find('<div class="printfooter">') - c = c[b:e] - c = c.replace('<h3 id="siteSub">From sumo</h3>', '') - b = c.find('<div id="jump-to-nav"') - e = c.find('</div>', b)+6 - return c[:b] + c[e:] + '</div><hr/><div id="lastmod">' + lastMod + '</div>' - -def readParseEditPage(page): - f = urllib.urlopen("http://sumo-sim.org/w/index.php?title=%s&action=edit" % page) - c = f.read() - b = c.find("wpTextbox1") - b = c.find('>', b) + 1 - e = c.find("</textarea>") - return c[b:e] - -def getImages(page): - images = set() - for t in ["Image:", "File:"]: - b = page.find(t) - while b >= 0: - e = len(page) - for ch in ["|", "\n", "]"]: - pos = page.find(ch, b) - if pos >= 0 and pos < e: - e = pos - images.add(page[b:e].strip()) - b = page.find(t, b+1) - return images - -if __name__ == "__main__": - optParser = OptionParser() - optParser.add_option("-o", "--output", default="wiki", help="output folder") - (options, args) = optParser.parse_args() - - try: - os.makedirs(os.path.join(options.output, "images")) - except: - pass - images = set() - if len(args) == 0: - p = readParsePage("Special:AllPages") - p = p[p.find("<input type=\"submit\" value=\"Go\" />"):] - p = p[p.find("<table "):] - pages = p.split("<a ") - else: - pages = ['href="/wiki/%s"' % a for a in args] - for p in pages: - if not p.startswith("href"): - continue - b = p.find("/wiki/") - e = p.find("\"", b) - name = p[b+6:e] - print "Fetching %s" % name - c = readParseEditPage(name) - if name.find("/")>0: - try: - os.makedirs(os.path.join(options.output, name[:name.rfind("/")])) - except: - pass - images.update(getImages(c)) - name = name + ".txt" - fd = open(os.path.join(options.output, name), "w") - fd.write(c) - fd.close() - - for i in images: - print "Fetching image %s" % i - if i.find(":")>=0: - f = urllib.urlopen("http://sumo-sim.org/wiki/%s" % i) - c = f.read() - b = c.find("<div class=\"fullImageLink\" id=\"file\">") - b = c.find("href=", b)+6 - e = c.find("\"", b+1) - f = urllib.urlopen("http://sourceforge.net/%s" % c[b:e]) - i = i[i.find(":")+1:] - else: - f = urllib.urlopen("http://sourceforge.net/%s" % i) - i = i[i.rfind("/")+1:] - if i.find("px-") >= 0: - i = i[:i.find('-')+1] - fd = open(os.path.join(options.output, "images", i), "wb") - fd.write(f.read()) - fd.close() diff -Nru sumo-0.21.0+dfsg/tools/game/bs3d/bs3d.settings.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/bs3d/bs3d.settings.xml --- sumo-0.21.0+dfsg/tools/game/bs3d/bs3d.settings.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/bs3d/bs3d.settings.xml 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,90 @@ +<viewsettings> + <delay value="100"/> + <viewport zoom="105" x="484" y="650" centerX="664" centerY="631"/> + <decal filename="bs_141125_small_1/master.ive" centerX="-715838" centerY="-5808214" centerZ="-225" altitude="5"/> + <decal filename="tl:cluster_104171179_28142770_28298581_28298587:0" centerX="680" centerY="660" rotation="180" width="-1" height="-1" altitude="3"/> + <decal filename="tl:cluster_104171179_28142770_28298581_28298587:5" centerX="690" centerY="630" rotation="90" width="-1" height="-1" altitude="4"/> + <decal filename="tl:cluster_104171179_28142770_28298581_28298587:10" layer="-1" centerX="655" centerY="622.5" centerZ="4" width="-1" height="-1" altitude="1"/> + <decal filename="tl:cluster_104171179_28142770_28298581_28298587:11" layer="-1" centerX="654" centerY="627.5" centerZ="10" width="-1" height="-1" altitude="1"/> + <decal filename="tl:cluster_104171179_28142770_28298581_28298587:13" layer="-1" centerX="651.5" centerY="633" centerZ="10" width="-1" height="-1" altitude="1"/> + <decal filename="tl:cluster_104171179_28142770_28298581_28298587:14" layer="-1" centerX="650.5" centerY="636" centerZ="10" width="-1" height="-1" altitude="1"/> + <decal filename="tl:cluster_104171179_28142770_28298581_28298587:15" centerX="650" centerY="650" rotation="-90" width="-1" height="-1" altitude="4"/> + <light centerX="600" centerY="600" centerZ="300"/> + <scheme name="game_cross"> + <opengl antialiase="0" dither="0"/> + <vehicles vehicleMode="9" vehicleQuality="2" minVehicleSize="1.00" vehicleExaggeration="1.00" showBlinker="1" + vehicleName_show="0" vehicleName_size="50.00" vehicleName_color="0.80,0.60,0.00" > + <colorScheme name="uniform"> + <entry color="1.00,1.00,0.00"/> + </colorScheme> + <colorScheme name="given/assigned vehicle color"> + <entry color="1.00,1.00,0.00"/> + </colorScheme> + <colorScheme name="given/assigned type color"> + <entry color="1.00,1.00,0.00"/> + </colorScheme> + <colorScheme name="given/assigned route color"> + <entry color="1.00,1.00,0.00"/> + </colorScheme> + <colorScheme name="depart position as HSV"> + <entry color="1.00,1.00,0.00"/> + </colorScheme> + <colorScheme name="arrival position as HSV"> + <entry color="1.00,1.00,0.00"/> + </colorScheme> + <colorScheme name="direction/distance as HSV"> + <entry color="1.00,1.00,0.00"/> + </colorScheme> + <colorScheme name="by speed" interpolated="1"> + <entry color="1.00,0.00,0.00" threshold="0.00"/> + <entry color="0.00,0.00,1.00" threshold="41.67"/> + </colorScheme> + <colorScheme name="by waiting time" interpolated="1"> + <entry color="1.00,1.00,0.00,0.3" threshold="0.00"/> + <entry color="1.00,0.00,0.00,0.3" threshold="20.00"/> + </colorScheme> + <colorScheme name="by time since last lanechange" interpolated="1"> + <entry color="1.00,1.00,1.00" threshold="0.00"/> + <entry color="0.50,0.50,0.50" threshold="300.00"/> + </colorScheme> + <colorScheme name="by max speed" interpolated="1"> + <entry color="1.00,0.00,0.00" threshold="0.00"/> + <entry color="0.00,0.00,1.00" threshold="41.67"/> + </colorScheme> + <colorScheme name="by CO2 emissions (HBEFA)" interpolated="1"> + <entry color="0.00,1.00,0.00" threshold="0.00"/> + <entry color="1.00,0.00,0.00" threshold="5.00"/> + </colorScheme> + <colorScheme name="by CO emissions (HBEFA)" interpolated="1"> + <entry color="0.00,1.00,0.00" threshold="0.00"/> + <entry color="1.00,0.00,0.00" threshold="0.05"/> + </colorScheme> + <colorScheme name="by PMx emissions (HBEFA)" interpolated="1"> + <entry color="0.00,1.00,0.00" threshold="0.00"/> + <entry color="1.00,0.00,0.00" threshold="0.01"/> + </colorScheme> + <colorScheme name="by NOx emissions (HBEFA)" interpolated="1"> + <entry color="0.00,1.00,0.00" threshold="0.00"/> + <entry color="1.00,0.00,0.00" threshold="0.12"/> + </colorScheme> + <colorScheme name="by HC emissions (HBEFA)" interpolated="1"> + <entry color="0.00,1.00,0.00" threshold="0.00"/> + <entry color="1.00,0.00,0.00" threshold="0.02"/> + </colorScheme> + <colorScheme name="by fuel consumption (HBEFA)" interpolated="1"> + <entry color="0.00,1.00,0.00" threshold="0.00"/> + <entry color="1.00,0.00,0.00" threshold="0.01"/> + </colorScheme> + <colorScheme name="by noise emissions (Harmonoise)" interpolated="1"> + <entry color="0.00,1.00,0.00" threshold="0.00"/> + <entry color="1.00,0.00,0.00" threshold="100.00"/> + </colorScheme> + <colorScheme name="by reroute number" interpolated="1"> + <entry color="1.00,0.00,0.00" threshold="0.00"/> + <entry color="1.00,1.00,0.00" threshold="1.00"/> + <entry color="1.00,1.00,1.00" threshold="10.00"/> + </colorScheme> + </vehicles> + <legend showSizeLegend="1"/> + </scheme> +</viewsettings> diff -Nru sumo-0.21.0+dfsg/tools/game/bs3d/bs.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/bs3d/bs.net.xml --- sumo-0.21.0+dfsg/tools/game/bs3d/bs.net.xml 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/bs3d/bs.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -1,19 +1,19 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- generated on 05/06/14 15:45:50 by SUMO netconvert Version dev-SVN-r16258 +<!-- generated on 01/23/15 15:10:04 by SUMO netconvert Version dev-SVN-r17669 <?xml version="1.0" encoding="UTF-8"?> -<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo-sim.org/xsd/netconvertConfiguration.xsd"> +<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netconvertConfiguration.xsd"> <input> - <node-files value="bsplain.nod.xml"/> - <edge-files value="bsplain.edg.xml"/> - <connection-files value="bsplain.con.xml"/> - <tllogic-files value="bsplain.tll.xml"/> + <node-files value="bs3d\bsplain.nod.xml"/> + <edge-files value="bs3d\bsplain.edg.xml"/> + <connection-files value="bs3d\bsplain.con.xml"/> + <tllogic-files value="bs3d\bsplain.tll.xml"/> </input> <output> - <output-file value="bs.net.xml"/> + <output-file value="bs3d\bs.net.xml"/> </output> <processing> @@ -23,7 +23,7 @@ </configuration> --> -<net version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo-sim.org/xsd/net_file.xsd"> +<net version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/net_file.xsd"> <location netOffset="-604099.60,-5792153.74" convBoundary="0.00,0.00,1593.78,2141.25" origBoundary="10.525796,52.269679,10.549189,52.288860" projParameter="+proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"/> @@ -204,31 +204,19 @@ <lane id=":1356135515_8_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="515.70,838.81 516.70,837.70 517.57,837.41 518.33,837.94 518.97,839.28"/> </edge> <edge id=":1356135516_0" function="internal"> - <lane id=":1356135516_0_0" index="0" allow="pedestrian" speed="6.95" length="5.25" shape="497.58,833.10 496.24,833.13 495.18,833.62 494.41,834.58 493.93,836.01"/> + <lane id=":1356135516_0_0" index="0" allow="delivery" speed="5.56" length="9.51" shape="497.58,833.10 488.16,831.77"/> </edge> <edge id=":1356135516_1" function="internal"> - <lane id=":1356135516_1_0" index="0" allow="delivery" speed="5.56" length="9.51" shape="497.58,833.10 488.16,831.77"/> + <lane id=":1356135516_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="497.58,833.10 496.47,832.11 496.18,831.24 496.70,830.48 498.05,829.84"/> </edge> <edge id=":1356135516_2" function="internal"> - <lane id=":1356135516_2_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="497.58,833.10 496.47,832.11 496.18,831.24 496.70,830.48 498.05,829.84"/> + <lane id=":1356135516_2_0" index="0" allow="delivery" speed="5.56" length="9.51" shape="488.63,828.50 498.05,829.84"/> </edge> <edge id=":1356135516_3" function="internal"> - <lane id=":1356135516_3_0" index="0" allow="delivery" speed="5.56" length="9.51" shape="488.63,828.50 498.05,829.84"/> + <lane id=":1356135516_3_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="488.63,828.50 489.74,829.49 490.03,830.37 489.51,831.13 488.16,831.77"/> </edge> <edge id=":1356135516_4" function="internal"> - <lane id=":1356135516_4_0" index="0" allow="pedestrian" speed="6.95" length="10.63" shape="488.63,828.50 491.45,829.32 493.27,830.85 494.10,833.08 493.93,836.01"/> - </edge> - <edge id=":1356135516_5" function="internal"> - <lane id=":1356135516_5_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="488.63,828.50 489.74,829.49 490.03,830.37 489.51,831.13 488.16,831.77"/> - </edge> - <edge id=":1356135516_6" function="internal"> - <lane id=":1356135516_6_0" index="0" allow="delivery" speed="6.95" length="5.07" shape="490.69,835.35 490.78,833.95 490.38,832.89 489.51,832.16 488.16,831.77"/> - </edge> - <edge id=":1356135516_7" function="internal"> - <lane id=":1356135516_7_0" index="0" allow="delivery" speed="6.95" length="10.35" shape="490.69,835.35 491.64,832.62 493.18,830.79 495.32,829.86 498.05,829.84"/> - </edge> - <edge id=":1356135516_8" function="internal"> - <lane id=":1356135516_8_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="490.69,835.35 491.75,834.31 492.64,834.07 493.37,834.64 493.93,836.01"/> + <lane id=":1356135516_4_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="490.69,835.35 491.75,834.31 492.64,834.07 493.37,834.64 493.93,836.01"/> </edge> <edge id=":1367507446_0" function="internal"> <lane id=":1367507446_0_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="588.24,674.12 589.51,674.90 589.95,675.71 589.57,676.55 588.36,677.42"/> @@ -309,34 +297,16 @@ <lane id=":1424270251_0_0" index="0" allow="delivery" speed="5.56" length="5.18" shape="728.35,920.75 725.04,916.76"/> </edge> <edge id=":1424270251_1" function="internal"> - <lane id=":1424270251_1_0" index="0" allow="pedestrian" speed="6.95" length="18.33" shape="728.35,920.75 725.47,915.46 725.53,912.32 728.51,911.33 734.42,912.51"/> + <lane id=":1424270251_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="728.35,920.75 728.33,919.26 728.78,918.46 729.70,918.34 731.08,918.89"/> </edge> <edge id=":1424270251_2" function="internal"> - <lane id=":1424270251_2_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="728.35,920.75 728.33,919.26 728.78,918.46 729.70,918.34 731.08,918.89"/> + <lane id=":1424270251_2_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="733.46,915.66 732.51,914.51 732.36,913.60 732.99,912.93 734.42,912.51"/> </edge> <edge id=":1424270251_3" function="internal"> - <lane id=":1424270251_3_0" index="0" allow="delivery" speed="6.95" length="7.19" shape="733.46,915.66 731.14,915.20 729.97,915.59 729.95,916.82 731.08,918.89"/> + <lane id=":1424270251_3_0" index="0" allow="delivery" speed="5.56" length="4.91" shape="727.92,915.14 731.08,918.89"/> </edge> <edge id=":1424270251_4" function="internal"> - <lane id=":1424270251_4_0" index="0" allow="delivery" speed="6.95" length="8.48" shape="733.46,915.66 725.04,916.76"/> - </edge> - <edge id=":1424270251_5" function="internal"> - <lane id=":1424270251_5_0" index="0" allow="pedestrian" speed="8.33" length="3.00" shape="733.46,915.66 732.51,914.51 732.36,913.60 732.76,913.18"/> - </edge> - <edge id=":1424270251_9" function="internal"> - <lane id=":1424270251_9_0" index="0" speed="8.33" length="1.82" shape="732.76,913.18 732.99,912.93 734.42,912.51"/> - </edge> - <edge id=":1424270251_6" function="internal"> - <lane id=":1424270251_6_0" index="0" allow="pedestrian" speed="6.95" length="7.01" shape="727.92,915.14 734.42,912.51"/> - </edge> - <edge id=":1424270251_7" function="internal"> - <lane id=":1424270251_7_0" index="0" allow="delivery" speed="5.56" length="4.91" shape="727.92,915.14 731.08,918.89"/> - </edge> - <edge id=":1424270251_8" function="internal"> - <lane id=":1424270251_8_0" index="0" allow="delivery" speed="5.56" length="1.26" shape="727.92,915.14 727.82,916.40"/> - </edge> - <edge id=":1424270251_10" function="internal"> - <lane id=":1424270251_10_0" index="0" speed="5.56" length="3.56" shape="727.82,916.40 727.81,916.62 727.29,917.39 726.37,917.43 725.04,916.76"/> + <lane id=":1424270251_4_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="727.92,915.14 727.81,916.62 727.29,917.39 726.37,917.43 725.04,916.76"/> </edge> <edge id=":1424274807_0" function="internal"> <lane id=":1424274807_0_0" index="0" speed="9.73" length="3.16" shape="847.95,785.85 845.11,784.45"/> @@ -519,9 +489,6 @@ <edge id=":1771199559_15" function="internal"> <lane id=":1771199559_15_0" index="0" speed="20.84" length="0.10" shape="933.21,469.03 933.21,469.03"/> </edge> - <edge id=":1771199559_17" function="internal"> - <lane id=":1771199559_17_0" index="0" speed="20.84" length="0.10" shape="933.21,469.03 933.21,469.03"/> - </edge> <edge id=":1778997184_0" function="internal"> <lane id=":1778997184_0_0" index="0" speed="13.89" length="0.10" shape="698.97,584.20 698.96,584.22"/> <lane id=":1778997184_0_1" index="1" speed="13.89" length="0.10" shape="695.83,583.19 695.84,583.16"/> @@ -573,31 +540,19 @@ <lane id=":1881838954_0_0" index="0" allow="rail_electric" speed="83.33" length="0.10" shape="305.94,936.18 305.94,936.18"/> </edge> <edge id=":1894312954_0" function="internal"> - <lane id=":1894312954_0_0" index="0" allow="pedestrian" speed="6.95" length="4.79" shape="360.10,516.12 359.66,514.91 358.93,514.07 357.93,513.59 356.65,513.46"/> + <lane id=":1894312954_0_0" index="0" allow="delivery" speed="5.56" length="4.07" shape="360.10,516.12 359.22,512.14"/> </edge> <edge id=":1894312954_1" function="internal"> - <lane id=":1894312954_1_0" index="0" allow="delivery" speed="5.56" length="4.07" shape="360.10,516.12 359.22,512.14"/> + <lane id=":1894312954_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="360.10,516.12 360.64,514.73 361.35,514.14 362.25,514.36 363.32,515.39"/> </edge> <edge id=":1894312954_2" function="internal"> - <lane id=":1894312954_2_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="360.10,516.12 360.64,514.73 361.35,514.14 362.25,514.36 363.32,515.39"/> + <lane id=":1894312954_2_0" index="0" allow="delivery" speed="5.56" length="6.00" shape="361.87,509.57 363.32,515.39"/> </edge> <edge id=":1894312954_3" function="internal"> - <lane id=":1894312954_3_0" index="0" allow="delivery" speed="5.56" length="6.00" shape="361.87,509.57 363.32,515.39"/> + <lane id=":1894312954_3_0" index="0" allow="delivery" speed="5.56" length="5.39" shape="361.87,509.57 362.17,511.21 361.83,512.19 360.84,512.50 359.22,512.14"/> </edge> <edge id=":1894312954_4" function="internal"> - <lane id=":1894312954_4_0" index="0" allow="pedestrian" speed="6.95" length="7.72" shape="361.87,509.57 361.97,511.18 361.13,512.37 359.36,513.13 356.65,513.46"/> - </edge> - <edge id=":1894312954_5" function="internal"> - <lane id=":1894312954_5_0" index="0" allow="delivery" speed="5.56" length="5.39" shape="361.87,509.57 362.17,511.21 361.83,512.19 360.84,512.50 359.22,512.14"/> - </edge> - <edge id=":1894312954_6" function="internal"> - <lane id=":1894312954_6_0" index="0" allow="delivery" speed="6.95" length="3.34" shape="356.52,510.17 359.22,512.14"/> - </edge> - <edge id=":1894312954_7" function="internal"> - <lane id=":1894312954_7_0" index="0" allow="delivery" speed="6.95" length="9.43" shape="356.52,510.17 359.04,510.41 361.01,511.36 362.44,513.02 363.32,515.39"/> - </edge> - <edge id=":1894312954_8" function="internal"> - <lane id=":1894312954_8_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="356.52,510.17 357.79,510.94 358.24,511.75 357.86,512.59 356.65,513.46"/> + <lane id=":1894312954_4_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="356.52,510.17 357.79,510.94 358.24,511.75 357.86,512.59 356.65,513.46"/> </edge> <edge id=":21613360_0" function="internal"> <lane id=":21613360_0_0" index="0" speed="13.89" length="0.10" shape="185.51,633.85 185.50,633.85"/> @@ -901,9 +856,6 @@ <edge id=":266777507_8" function="internal"> <lane id=":266777507_8_0" index="0" speed="20.84" length="0.10" shape="1132.85,609.36 1132.85,609.36"/> </edge> - <edge id=":266777507_10" function="internal"> - <lane id=":266777507_10_0" index="0" speed="20.84" length="0.10" shape="1132.85,609.36 1132.85,609.36"/> - </edge> <edge id=":269964106_0" function="internal"> <lane id=":269964106_0_0" index="0" speed="8.33" length="7.41" shape="793.01,954.61 790.98,954.73 789.35,955.39 788.13,956.59 787.32,958.32"/> </edge> @@ -1007,9 +959,6 @@ <edge id=":269964113_12" function="internal"> <lane id=":269964113_12_0" index="0" speed="20.84" length="0.10" shape="945.85,479.84 945.85,479.84"/> </edge> - <edge id=":269964113_18" function="internal"> - <lane id=":269964113_18_0" index="0" speed="20.84" length="0.10" shape="945.85,479.84 945.85,479.84"/> - </edge> <edge id=":269964113_13" function="internal"> <lane id=":269964113_13_0" index="0" speed="11.11" length="6.20" shape="946.08,485.63 946.74,483.75 946.92,482.17 946.62,480.86 945.85,479.84"/> </edge> @@ -1063,7 +1012,7 @@ <lane id=":27557122_0_0" index="0" speed="8.33" length="4.82" shape="1594.36,746.71 1595.23,747.91 1595.32,748.83 1594.65,749.46 1593.20,749.79"/> </edge> <edge id=":27557127_0" function="internal"> - <lane id=":27557127_0_0" index="0" speed="13.89" length="8.65" shape="785.48,350.58 782.89,349.06 780.82,348.56 779.26,349.09 778.22,350.65"/> + <lane id=":27557127_0_0" index="0" speed="13.89" length="5.34" shape="785.48,350.58 784.12,349.88 782.98,349.85 782.03,350.50 781.30,351.83"/> </edge> <edge id=":27557127_1" function="internal"> <lane id=":27557127_1_0" index="0" allow="rail_urban" speed="20.84" length="0.10" shape="785.48,350.58 785.48,350.58"/> @@ -1081,7 +1030,7 @@ <lane id=":27557127_4_0" index="0" allow="rail_urban" speed="27.78" length="10.45" shape="777.57,344.92 780.28,346.22 782.49,346.41 784.69,346.59 787.40,347.90"/> </edge> <edge id=":27557127_5" function="internal"> - <lane id=":27557127_5_0" index="0" speed="20.84" length="8.44" shape="777.57,344.92 779.68,346.69 781.00,348.43 781.54,350.15 781.30,351.83"/> + <lane id=":27557127_5_0" index="0" speed="20.84" length="6.21" shape="777.57,344.92 778.44,345.87 778.84,347.14 778.77,348.74 778.22,350.65"/> </edge> <edge id=":276419026_0" function="internal"> <lane id=":276419026_0_0" index="0" speed="8.33" length="6.05" shape="544.30,522.36 544.01,516.32"/> @@ -1162,64 +1111,37 @@ <lane id=":277697625_0_0" index="0" allow="delivery" speed="5.56" length="7.18" shape="342.81,452.68 337.55,457.57"/> </edge> <edge id=":277697625_1" function="internal"> - <lane id=":277697625_1_0" index="0" allow="pedestrian" speed="3.48" length="5.24" shape="342.81,452.68 340.78,453.33 338.66,453.32 337.71,453.04"/> + <lane id=":277697625_1_0" index="0" allow="delivery" speed="5.56" length="2.41" shape="342.81,452.68 341.33,452.49 340.60,451.94"/> </edge> - <edge id=":277697625_2" function="internal"> - <lane id=":277697625_2_0" index="0" allow="delivery" speed="5.56" length="2.41" shape="342.81,452.68 341.33,452.49 340.60,451.94"/> - </edge> - <edge id=":277697625_9" function="internal"> - <lane id=":277697625_9_0" index="0" speed="3.48" length="4.00" shape="337.71,453.04 336.44,452.66 334.13,451.33"/> + <edge id=":277697625_5" function="internal"> + <lane id=":277697625_5_0" index="0" speed="5.56" length="2.41" shape="340.60,451.94 340.60,451.01 341.34,449.73"/> </edge> - <edge id=":277697625_10" function="internal"> - <lane id=":277697625_10_0" index="0" speed="5.56" length="2.41" shape="340.60,451.94 340.60,451.01 341.34,449.73"/> + <edge id=":277697625_2" function="internal"> + <lane id=":277697625_2_0" index="0" allow="pedestrian" speed="1.39" length="4.82" shape="336.02,448.63 336.56,450.01 336.43,450.93 335.62,451.36 334.13,451.33"/> </edge> <edge id=":277697625_3" function="internal"> - <lane id=":277697625_3_0" index="0" allow="delivery" speed="3.48" length="5.69" shape="336.02,448.63 337.53,449.52 338.91,450.00 340.18,450.07 341.34,449.73"/> + <lane id=":277697625_3_0" index="0" allow="delivery" speed="5.56" length="8.78" shape="334.86,455.65 341.34,449.73"/> </edge> <edge id=":277697625_4" function="internal"> - <lane id=":277697625_4_0" index="0" allow="delivery" speed="3.48" length="10.37" shape="336.02,448.63 338.10,450.58 339.05,452.72 338.86,455.05 337.55,457.57"/> - </edge> - <edge id=":277697625_5" function="internal"> - <lane id=":277697625_5_0" index="0" allow="pedestrian" speed="1.39" length="4.82" shape="336.02,448.63 336.56,450.01 336.43,450.93 335.62,451.36 334.13,451.33"/> + <lane id=":277697625_4_0" index="0" allow="delivery" speed="5.56" length="2.41" shape="334.86,455.65 336.25,455.12 337.16,455.26"/> </edge> <edge id=":277697625_6" function="internal"> - <lane id=":277697625_6_0" index="0" allow="pedestrian" speed="3.48" length="5.01" shape="334.86,455.65 335.50,454.43 335.59,453.30 335.13,452.27 334.13,451.33"/> - </edge> - <edge id=":277697625_7" function="internal"> - <lane id=":277697625_7_0" index="0" allow="delivery" speed="5.56" length="8.78" shape="334.86,455.65 341.34,449.73"/> - </edge> - <edge id=":277697625_8" function="internal"> - <lane id=":277697625_8_0" index="0" allow="delivery" speed="5.56" length="2.41" shape="334.86,455.65 336.25,455.12 337.16,455.26"/> - </edge> - <edge id=":277697625_11" function="internal"> - <lane id=":277697625_11_0" index="0" speed="5.56" length="2.41" shape="337.16,455.26 337.60,456.08 337.55,457.57"/> + <lane id=":277697625_6_0" index="0" speed="5.56" length="2.41" shape="337.16,455.26 337.60,456.08 337.55,457.57"/> </edge> <edge id=":277697630_0" function="internal"> - <lane id=":277697630_0_0" index="0" allow="delivery" speed="6.95" length="5.14" shape="357.93,470.76 356.82,469.84 355.72,469.55 354.64,469.87 353.56,470.82"/> + <lane id=":277697630_0_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="357.93,470.76 357.71,469.29 358.04,468.43 358.93,468.18 360.37,468.54"/> </edge> <edge id=":277697630_1" function="internal"> - <lane id=":277697630_1_0" index="0" allow="delivery" speed="6.95" length="9.30" shape="357.93,470.76 356.20,468.57 355.08,466.45 354.56,464.39 354.64,462.41"/> + <lane id=":277697630_1_0" index="0" allow="delivery" speed="5.56" length="8.89" shape="357.88,463.05 353.56,470.82"/> </edge> <edge id=":277697630_2" function="internal"> - <lane id=":277697630_2_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="357.93,470.76 357.71,469.29 358.04,468.43 358.93,468.18 360.37,468.54"/> + <lane id=":277697630_2_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="357.88,463.05 356.83,464.10 355.94,464.35 355.21,463.78 354.64,462.41"/> </edge> <edge id=":277697630_3" function="internal"> - <lane id=":277697630_3_0" index="0" allow="pedestrian" speed="6.95" length="6.22" shape="357.88,463.05 357.87,464.24 358.28,465.55 359.11,466.98 360.37,468.54"/> + <lane id=":277697630_3_0" index="0" allow="delivery" speed="5.56" length="7.43" shape="350.93,468.51 352.18,467.76 353.21,466.49 354.03,464.71 354.64,462.41"/> </edge> <edge id=":277697630_4" function="internal"> - <lane id=":277697630_4_0" index="0" allow="delivery" speed="5.56" length="8.89" shape="357.88,463.05 353.56,470.82"/> - </edge> - <edge id=":277697630_5" function="internal"> - <lane id=":277697630_5_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="357.88,463.05 356.83,464.10 355.94,464.35 355.21,463.78 354.64,462.41"/> - </edge> - <edge id=":277697630_6" function="internal"> - <lane id=":277697630_6_0" index="0" allow="delivery" speed="5.56" length="7.43" shape="350.93,468.51 352.18,467.76 353.21,466.49 354.03,464.71 354.64,462.41"/> - </edge> - <edge id=":277697630_7" function="internal"> - <lane id=":277697630_7_0" index="0" allow="pedestrian" speed="6.95" length="9.92" shape="350.93,468.51 354.17,467.54 356.82,467.22 358.88,467.55 360.37,468.54"/> - </edge> - <edge id=":277697630_8" function="internal"> - <lane id=":277697630_8_0" index="0" allow="delivery" speed="5.56" length="5.11" shape="350.93,468.51 352.46,468.10 353.40,468.35 353.77,469.25 353.56,470.82"/> + <lane id=":277697630_4_0" index="0" allow="delivery" speed="5.56" length="5.11" shape="350.93,468.51 352.46,468.10 353.40,468.35 353.77,469.25 353.56,470.82"/> </edge> <edge id=":277697633_0" function="internal"> <lane id=":277697633_0_0" index="0" speed="6.95" length="5.03" shape="362.93,405.94 362.66,404.58 362.02,403.65 361.01,403.14 359.62,403.06"/> @@ -1588,37 +1510,25 @@ <lane id=":293695864_11_0" index="0" speed="13.89" length="2.41" shape="841.11,791.39 841.76,792.04 842.16,793.47"/> </edge> <edge id=":293695883_0" function="internal"> - <lane id=":293695883_0_0" index="0" allow="delivery" speed="6.95" length="7.25" shape="1007.42,853.06 1006.26,850.88 1005.13,849.23 1004.05,848.10 1003.00,847.49"/> + <lane id=":293695883_0_0" index="0" allow="pedestrian" speed="8.33" length="12.28" shape="1007.42,853.06 1006.33,849.67 1006.76,847.13 1008.69,845.42 1012.14,844.54"/> </edge> <edge id=":293695883_1" function="internal"> - <lane id=":293695883_1_0" index="0" allow="pedestrian" speed="8.33" length="12.28" shape="1007.42,853.06 1006.33,849.67 1006.76,847.13 1008.69,845.42 1012.14,844.54"/> + <lane id=":293695883_1_0" index="0" allow="pedestrian" speed="8.33" length="2.41" shape="1007.42,853.06 1007.62,851.59 1008.19,850.86"/> </edge> - <edge id=":293695883_2" function="internal"> - <lane id=":293695883_2_0" index="0" allow="pedestrian" speed="8.33" length="2.41" shape="1007.42,853.06 1007.62,851.59 1008.19,850.86"/> + <edge id=":293695883_5" function="internal"> + <lane id=":293695883_5_0" index="0" speed="8.33" length="2.41" shape="1008.19,850.86 1009.11,850.87 1010.39,851.62"/> </edge> - <edge id=":293695883_9" function="internal"> - <lane id=":293695883_9_0" index="0" speed="8.33" length="2.41" shape="1008.19,850.86 1009.11,850.87 1010.39,851.62"/> + <edge id=":293695883_2" function="internal"> + <lane id=":293695883_2_0" index="0" allow="pedestrian" speed="8.33" length="5.48" shape="1012.50,847.82 1010.96,848.21 1010.09,848.98 1009.90,850.11 1010.39,851.62"/> </edge> <edge id=":293695883_3" function="internal"> - <lane id=":293695883_3_0" index="0" allow="pedestrian" speed="8.33" length="5.48" shape="1012.50,847.82 1010.96,848.21 1010.09,848.98 1009.90,850.11 1010.39,851.62"/> - </edge> - <edge id=":293695883_4" function="internal"> - <lane id=":293695883_4_0" index="0" allow="delivery" speed="6.95" length="9.50" shape="1012.50,847.82 1003.00,847.49"/> - </edge> - <edge id=":293695883_5" function="internal"> - <lane id=":293695883_5_0" index="0" allow="pedestrian" speed="8.33" length="2.41" shape="1012.50,847.82 1011.18,847.14 1010.68,846.36"/> - </edge> - <edge id=":293695883_10" function="internal"> - <lane id=":293695883_10_0" index="0" speed="8.33" length="2.41" shape="1010.68,846.36 1011.00,845.50 1012.14,844.54"/> + <lane id=":293695883_3_0" index="0" allow="pedestrian" speed="8.33" length="2.41" shape="1012.50,847.82 1011.18,847.14 1010.68,846.36"/> </edge> <edge id=":293695883_6" function="internal"> - <lane id=":293695883_6_0" index="0" allow="pedestrian" speed="6.95" length="8.10" shape="1004.05,844.36 1012.14,844.54"/> - </edge> - <edge id=":293695883_7" function="internal"> - <lane id=":293695883_7_0" index="0" allow="pedestrian" speed="6.95" length="9.86" shape="1004.05,844.36 1005.71,845.24 1007.32,846.74 1008.88,848.87 1010.39,851.62"/> + <lane id=":293695883_6_0" index="0" speed="8.33" length="2.41" shape="1010.68,846.36 1011.00,845.50 1012.14,844.54"/> </edge> - <edge id=":293695883_8" function="internal"> - <lane id=":293695883_8_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="1004.05,844.36 1004.96,845.54 1005.09,846.45 1004.43,847.10 1003.00,847.49"/> + <edge id=":293695883_4" function="internal"> + <lane id=":293695883_4_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="1004.05,844.36 1004.96,845.54 1005.09,846.45 1004.43,847.10 1003.00,847.49"/> </edge> <edge id=":293696006_0" function="internal"> <lane id=":293696006_0_0" index="0" allow="delivery" speed="5.56" length="5.06" shape="870.67,800.53 869.31,800.24 868.20,800.46 867.34,801.19 866.73,802.45"/> @@ -1648,22 +1558,10 @@ <lane id=":293696006_8_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="863.58,801.44 864.75,800.52 865.66,800.37 866.32,801.02 866.73,802.45"/> </edge> <edge id=":293696007_0" function="internal"> - <lane id=":293696007_0_0" index="0" allow="pedestrian" speed="6.95" length="0.10" shape="855.09,838.84 855.08,838.86"/> + <lane id=":293696007_0_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="855.09,838.84 853.93,839.77 853.02,839.91 852.36,839.26 851.95,837.83"/> </edge> <edge id=":293696007_1" function="internal"> - <lane id=":293696007_1_0" index="0" allow="delivery" speed="5.56" length="2.41" shape="855.09,838.84 853.93,839.77 853.02,839.91"/> - </edge> - <edge id=":293696007_4" function="internal"> - <lane id=":293696007_4_0" index="0" speed="5.56" length="2.41" shape="853.02,839.91 852.36,839.26 851.95,837.83"/> - </edge> - <edge id=":293696007_2" function="internal"> - <lane id=":293696007_2_0" index="0" allow="delivery" speed="6.95" length="0.10" shape="851.96,837.80 851.95,837.83"/> - </edge> - <edge id=":293696007_3" function="internal"> - <lane id=":293696007_3_0" index="0" allow="pedestrian" speed="8.33" length="2.41" shape="851.96,837.80 853.13,836.89 854.05,836.77"/> - </edge> - <edge id=":293696007_5" function="internal"> - <lane id=":293696007_5_0" index="0" speed="8.33" length="2.41" shape="854.05,836.77 854.70,837.42 855.08,838.86"/> + <lane id=":293696007_1_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="851.96,837.80 853.13,836.89 854.05,836.77 854.70,837.42 855.08,838.86"/> </edge> <edge id=":293696234_0" function="internal"> <lane id=":293696234_0_0" index="0" allow="delivery" speed="5.56" length="5.01" shape="962.05,833.73 960.69,833.48 959.59,833.72 958.74,834.46 958.13,835.70"/> @@ -1750,28 +1648,16 @@ <lane id=":293696356_0_0" index="0" allow="delivery" speed="5.56" length="5.06" shape="946.77,941.74 945.40,941.48 944.29,941.74 943.46,942.50 942.88,943.77"/> </edge> <edge id=":293696356_1" function="internal"> - <lane id=":293696356_1_0" index="0" allow="pedestrian" speed="4.17" length="8.88" shape="946.77,941.74 938.97,937.51"/> + <lane id=":293696356_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="946.77,941.74 945.86,940.56 945.74,939.64 946.39,939.00 947.83,938.61"/> </edge> <edge id=":293696356_2" function="internal"> - <lane id=":293696356_2_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="946.77,941.74 945.86,940.56 945.74,939.64 946.39,939.00 947.83,938.61"/> + <lane id=":293696356_2_0" index="0" allow="pedestrian" speed="2.78" length="5.19" shape="941.65,935.18 941.85,936.77 941.47,937.69 940.51,937.93 938.97,937.51"/> </edge> <edge id=":293696356_3" function="internal"> - <lane id=":293696356_3_0" index="0" allow="delivery" speed="4.17" length="7.06" shape="941.65,935.18 947.83,938.61"/> + <lane id=":293696356_3_0" index="0" allow="delivery" speed="5.56" length="10.56" shape="939.71,942.86 940.91,940.21 942.66,938.61 944.96,938.08 947.83,938.61"/> </edge> <edge id=":293696356_4" function="internal"> - <lane id=":293696356_4_0" index="0" allow="delivery" speed="4.17" length="9.09" shape="941.65,935.18 942.80,936.83 943.38,938.81 943.41,941.12 942.88,943.77"/> - </edge> - <edge id=":293696356_5" function="internal"> - <lane id=":293696356_5_0" index="0" allow="pedestrian" speed="2.78" length="5.19" shape="941.65,935.18 941.85,936.77 941.47,937.69 940.51,937.93 938.97,937.51"/> - </edge> - <edge id=":293696356_6" function="internal"> - <lane id=":293696356_6_0" index="0" allow="pedestrian" speed="4.17" length="5.78" shape="939.71,942.86 940.11,940.97 940.12,939.44 939.74,938.29 938.97,937.51"/> - </edge> - <edge id=":293696356_7" function="internal"> - <lane id=":293696356_7_0" index="0" allow="delivery" speed="5.56" length="10.56" shape="939.71,942.86 940.91,940.21 942.66,938.61 944.96,938.08 947.83,938.61"/> - </edge> - <edge id=":293696356_8" function="internal"> - <lane id=":293696356_8_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="939.71,942.86 940.85,941.90 941.75,941.73 942.43,942.36 942.88,943.77"/> + <lane id=":293696356_4_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="939.71,942.86 940.85,941.90 941.75,941.73 942.43,942.36 942.88,943.77"/> </edge> <edge id=":293696357_0" function="internal"> <lane id=":293696357_0_0" index="0" speed="8.33" length="9.28" shape="927.57,999.39 918.93,995.99"/> @@ -1846,22 +1732,10 @@ <lane id=":293696530_11_0" index="0" speed="13.89" length="2.41" shape="809.55,886.78 810.20,887.43 810.60,888.87"/> </edge> <edge id=":293696556_0" function="internal"> - <lane id=":293696556_0_0" index="0" allow="delivery" speed="6.95" length="0.10" shape="852.88,899.49 852.91,899.50"/> + <lane id=":293696556_0_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="852.88,899.49 851.99,898.30 851.87,897.38 852.53,896.74 853.98,896.37"/> </edge> <edge id=":293696556_1" function="internal"> - <lane id=":293696556_1_0" index="0" allow="pedestrian" speed="8.33" length="2.41" shape="852.88,899.49 851.99,898.30 851.87,897.38"/> - </edge> - <edge id=":293696556_4" function="internal"> - <lane id=":293696556_4_0" index="0" speed="8.33" length="2.41" shape="851.87,897.38 852.53,896.74 853.98,896.37"/> - </edge> - <edge id=":293696556_2" function="internal"> - <lane id=":293696556_2_0" index="0" allow="pedestrian" speed="6.95" length="0.10" shape="854.00,896.38 853.98,896.37"/> - </edge> - <edge id=":293696556_3" function="internal"> - <lane id=":293696556_3_0" index="0" allow="delivery" speed="5.56" length="2.41" shape="854.00,896.38 854.89,897.57 855.01,898.48"/> - </edge> - <edge id=":293696556_5" function="internal"> - <lane id=":293696556_5_0" index="0" speed="5.56" length="2.41" shape="855.01,898.48 854.35,899.12 852.91,899.50"/> + <lane id=":293696556_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="854.00,896.38 854.89,897.57 855.01,898.48 854.35,899.12 852.91,899.50"/> </edge> <edge id=":293696558_0" function="internal"> <lane id=":293696558_0_0" index="0" allow="delivery" speed="5.56" length="9.44" shape="830.87,892.16 821.89,889.24"/> @@ -2118,16 +1992,10 @@ <lane id=":34677738_0_0" index="0" speed="8.33" length="4.82" shape="393.02,329.89 394.05,328.81 394.93,328.54 395.67,329.09 396.28,330.45"/> </edge> <edge id=":348042902_0" function="internal"> - <lane id=":348042902_0_0" index="0" allow="delivery" speed="6.95" length="7.44" shape="994.92,898.55 993.94,900.31 992.62,901.38 990.96,901.77 988.97,901.48"/> + <lane id=":348042902_0_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="994.92,898.55 993.70,899.40 992.78,899.49 992.16,898.81 991.84,897.36"/> </edge> <edge id=":348042902_1" function="internal"> - <lane id=":348042902_1_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="994.92,898.55 993.70,899.40 992.78,899.49 992.16,898.81 991.84,897.36"/> - </edge> - <edge id=":348042902_2" function="internal"> - <lane id=":348042902_2_0" index="0" allow="pedestrian" speed="6.95" length="2.43" shape="989.90,898.31 990.55,898.41 991.09,898.28 991.52,897.93 991.84,897.36"/> - </edge> - <edge id=":348042902_3" function="internal"> - <lane id=":348042902_3_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="989.90,898.31 990.85,899.45 991.01,900.36 990.39,901.04 988.97,901.48"/> + <lane id=":348042902_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="989.90,898.31 990.85,899.45 991.01,900.36 990.39,901.04 988.97,901.48"/> </edge> <edge id=":34814866_0" function="internal"> <lane id=":34814866_0_0" index="0" speed="8.33" length="5.12" shape="983.18,404.13 981.88,403.57 980.74,403.58 979.77,404.17 978.97,405.34"/> @@ -2281,22 +2149,16 @@ <lane id=":36854116_8_0" index="0" speed="8.33" length="4.82" shape="900.79,606.54 901.95,605.61 902.86,605.47 903.52,606.11 903.94,607.54"/> </edge> <edge id=":36854120_0" function="internal"> - <lane id=":36854120_0_0" index="0" allow="pedestrian" speed="4.17" length="2.69" shape="837.40,666.91 836.66,666.80 836.08,666.96 835.66,667.38 835.39,668.07"/> + <lane id=":36854120_0_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="837.40,666.91 836.44,665.76 836.28,664.86 836.91,664.18 838.33,663.74"/> </edge> <edge id=":36854120_1" function="internal"> - <lane id=":36854120_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="837.40,666.91 836.44,665.76 836.28,664.86 836.91,664.18 838.33,663.74"/> - </edge> - <edge id=":36854120_2" function="internal"> - <lane id=":36854120_2_0" index="0" allow="delivery" speed="4.17" length="8.22" shape="832.18,667.31 833.01,665.20 834.31,663.90 836.08,663.41 838.33,663.74"/> - </edge> - <edge id=":36854120_3" function="internal"> - <lane id=":36854120_3_0" index="0" allow="pedestrian" speed="2.78" length="4.82" shape="832.18,667.31 833.26,666.30 834.16,666.09 834.87,666.68 835.39,668.07"/> + <lane id=":36854120_1_0" index="0" allow="pedestrian" speed="2.78" length="4.82" shape="832.18,667.31 833.26,666.30 834.16,666.09 834.87,666.68 835.39,668.07"/> </edge> <edge id=":378917495_0" function="internal"> <lane id=":378917495_0_0" index="0" speed="13.89" length="3.09" shape="801.94,362.53 799.48,360.65"/> </edge> <edge id=":378917495_1" function="internal"> - <lane id=":378917495_1_0" index="0" allow="rail_urban" speed="20.84" length="3.30" shape="801.94,362.53 804.02,359.96"/> + <lane id=":378917495_1_0" index="0" allow="rail_urban" speed="20.84" length="0.10" shape="801.94,362.53 801.94,362.53"/> </edge> <edge id=":378917495_2" function="internal"> <lane id=":378917495_2_0" index="0" speed="13.89" length="2.41" shape="801.94,362.53 801.50,361.11 801.70,360.20"/> @@ -2308,7 +2170,7 @@ <lane id=":378917495_3_0" index="0" speed="13.89" length="3.28" shape="801.41,357.97 804.02,359.96"/> </edge> <edge id=":378917495_4" function="internal"> - <lane id=":378917495_4_0" index="0" allow="rail_urban" speed="20.84" length="4.59" shape="801.41,357.97 801.94,362.53"/> + <lane id=":378917495_4_0" index="0" allow="rail_urban" speed="20.84" length="3.28" shape="801.41,357.97 804.02,359.96"/> </edge> <edge id=":378917495_5" function="internal"> <lane id=":378917495_5_0" index="0" speed="13.89" length="4.82" shape="801.41,357.97 801.93,359.36 801.79,360.27 800.97,360.70 799.48,360.65"/> @@ -2322,9 +2184,6 @@ <edge id=":378917495_8" function="internal"> <lane id=":378917495_8_0" index="0" speed="20.84" length="0.10" shape="799.48,360.65 799.48,360.65"/> </edge> - <edge id=":378917495_10" function="internal"> - <lane id=":378917495_10_0" index="0" speed="20.84" length="0.10" shape="799.48,360.65 799.48,360.65"/> - </edge> <edge id=":381910193_0" function="internal"> <lane id=":381910193_0_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="1080.80,858.36 1081.71,859.54 1081.85,860.45 1081.20,861.10 1079.76,861.50"/> </edge> @@ -2497,28 +2356,16 @@ <lane id=":429587907_0_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="908.84,968.15 907.70,969.11 906.80,969.27 906.12,968.64 905.68,967.23"/> </edge> <edge id=":429587908_0" function="internal"> - <lane id=":429587908_0_0" index="0" allow="delivery" speed="6.95" length="4.68" shape="915.86,942.77 916.39,943.85 916.63,944.96 916.58,946.09 916.24,947.25"/> + <lane id=":429587908_0_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="915.86,942.77 915.82,944.25 915.34,945.04 914.43,945.14 913.07,944.53"/> </edge> <edge id=":429587908_1" function="internal"> - <lane id=":429587908_1_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="915.86,942.77 915.82,944.25 915.34,945.04 914.43,945.14 913.07,944.53"/> - </edge> - <edge id=":429587908_2" function="internal"> - <lane id=":429587908_2_0" index="0" allow="pedestrian" speed="6.95" length="1.53" shape="913.19,946.00 913.30,945.62 913.32,945.25 913.24,944.88 913.07,944.53"/> - </edge> - <edge id=":429587908_3" function="internal"> - <lane id=":429587908_3_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="913.19,946.00 914.43,945.17 915.35,945.10 915.95,945.79 916.24,947.25"/> + <lane id=":429587908_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="913.19,946.00 914.43,945.17 915.35,945.10 915.95,945.79 916.24,947.25"/> </edge> <edge id=":429587921_0" function="internal"> - <lane id=":429587921_0_0" index="0" allow="pedestrian" speed="6.95" length="7.96" shape="928.62,927.64 927.62,929.59 926.24,930.74 924.48,931.10 922.34,930.66"/> + <lane id=":429587921_0_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="928.62,927.64 927.44,928.55 926.52,928.67 925.88,928.01 925.50,926.57"/> </edge> <edge id=":429587921_1" function="internal"> - <lane id=":429587921_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="928.62,927.64 927.44,928.55 926.52,928.67 925.88,928.01 925.50,926.57"/> - </edge> - <edge id=":429587921_2" function="internal"> - <lane id=":429587921_2_0" index="0" allow="delivery" speed="6.95" length="2.60" shape="923.45,927.55 924.15,927.69 924.73,927.58 925.18,927.20 925.50,926.57"/> - </edge> - <edge id=":429587921_3" function="internal"> - <lane id=":429587921_3_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="923.45,927.55 924.34,928.75 924.45,929.66 923.79,930.30 922.34,930.66"/> + <lane id=":429587921_1_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="923.45,927.55 924.34,928.75 924.45,929.66 923.79,930.30 922.34,930.66"/> </edge> <edge id=":429587940_0" function="internal"> <lane id=":429587940_0_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="924.12,870.73 922.94,871.63 922.02,871.75 921.38,871.09 921.00,869.65"/> @@ -2881,58 +2728,31 @@ <lane id=":442839558_0_0" index="0" allow="delivery" speed="5.56" length="6.37" shape="831.04,729.04 828.57,734.91"/> </edge> <edge id=":442839558_1" function="internal"> - <lane id=":442839558_1_0" index="0" allow="pedestrian" speed="6.95" length="6.86" shape="831.04,729.04 829.94,731.37 828.94,733.08 828.04,734.14 827.24,734.57"/> + <lane id=":442839558_1_0" index="0" allow="delivery" speed="5.56" length="4.83" shape="831.04,729.04 829.73,729.75 828.80,729.73 828.26,728.98 828.10,727.50"/> </edge> <edge id=":442839558_2" function="internal"> - <lane id=":442839558_2_0" index="0" allow="pedestrian" speed="6.95" length="7.43" shape="831.04,729.04 829.74,731.68 828.54,733.40 827.43,734.19 826.42,734.07"/> + <lane id=":442839558_2_0" index="0" allow="pedestrian" speed="8.33" length="9.32" shape="824.15,728.82 827.42,731.06 829.03,732.76 828.97,733.93 827.24,734.57"/> </edge> <edge id=":442839558_3" function="internal"> - <lane id=":442839558_3_0" index="0" allow="delivery" speed="5.56" length="4.83" shape="831.04,729.04 829.73,729.75 828.80,729.73 828.26,728.98 828.10,727.50"/> + <lane id=":442839558_3_0" index="0" allow="pedestrian" speed="8.33" length="4.17" shape="824.15,728.82 826.68,729.28 827.90,730.31"/> + </edge> + <edge id=":442839558_8" function="internal"> + <lane id=":442839558_8_0" index="0" speed="8.33" length="4.17" shape="827.90,730.31 827.82,731.90 826.42,734.07"/> </edge> <edge id=":442839558_4" function="internal"> - <lane id=":442839558_4_0" index="0" allow="delivery" speed="6.95" length="4.93" shape="824.15,728.82 825.40,729.35 826.48,729.31 827.38,728.69 828.10,727.50"/> + <lane id=":442839558_4_0" index="0" allow="pedestrian" speed="8.33" length="4.73" shape="822.17,731.97 826.42,734.07"/> </edge> <edge id=":442839558_5" function="internal"> - <lane id=":442839558_5_0" index="0" allow="delivery" speed="6.95" length="8.07" shape="824.15,728.82 826.48,730.45 827.99,732.01 828.69,733.49 828.57,734.91"/> - </edge> - <edge id=":442839558_6" function="internal"> - <lane id=":442839558_6_0" index="0" allow="pedestrian" speed="8.33" length="9.32" shape="824.15,728.82 827.42,731.06 829.03,732.76 828.97,733.93 827.24,734.57"/> - </edge> - <edge id=":442839558_7" function="internal"> - <lane id=":442839558_7_0" index="0" allow="pedestrian" speed="8.33" length="4.17" shape="824.15,728.82 826.68,729.28 827.90,730.31"/> - </edge> - <edge id=":442839558_16" function="internal"> - <lane id=":442839558_16_0" index="0" speed="8.33" length="4.17" shape="827.90,730.31 827.82,731.90 826.42,734.07"/> - </edge> - <edge id=":442839558_8" function="internal"> - <lane id=":442839558_8_0" index="0" allow="pedestrian" speed="8.33" length="4.73" shape="822.17,731.97 826.42,734.07"/> + <lane id=":442839558_5_0" index="0" allow="pedestrian" speed="8.33" length="4.16" shape="822.17,731.97 824.41,730.72 826.01,730.74"/> </edge> <edge id=":442839558_9" function="internal"> - <lane id=":442839558_9_0" index="0" allow="delivery" speed="6.95" length="7.78" shape="822.17,731.97 824.14,731.46 825.79,730.54 827.11,729.22 828.10,727.50"/> - </edge> - <edge id=":442839558_10" function="internal"> - <lane id=":442839558_10_0" index="0" allow="delivery" speed="6.95" length="6.47" shape="822.17,731.97 825.56,731.72 827.75,732.13 828.33,732.74"/> - </edge> - <edge id=":442839558_11" function="internal"> - <lane id=":442839558_11_0" index="0" allow="pedestrian" speed="8.33" length="4.16" shape="822.17,731.97 824.41,730.72 826.01,730.74"/> + <lane id=":442839558_9_0" index="0" speed="8.33" length="4.16" shape="826.01,730.74 826.95,732.02 827.24,734.57"/> </edge> - <edge id=":442839558_17" function="internal"> - <lane id=":442839558_17_0" index="0" speed="6.95" length="2.34" shape="828.33,732.74 828.76,733.19 828.57,734.91"/> - </edge> - <edge id=":442839558_18" function="internal"> - <lane id=":442839558_18_0" index="0" speed="8.33" length="4.16" shape="826.01,730.74 826.95,732.02 827.24,734.57"/> - </edge> - <edge id=":442839558_12" function="internal"> - <lane id=":442839558_12_0" index="0" allow="pedestrian" speed="6.95" length="2.06" shape="825.18,734.53 827.24,734.57"/> - </edge> - <edge id=":442839558_13" function="internal"> - <lane id=":442839558_13_0" index="0" allow="pedestrian" speed="6.95" length="1.32" shape="825.18,734.53 826.42,734.07"/> - </edge> - <edge id=":442839558_14" function="internal"> - <lane id=":442839558_14_0" index="0" allow="delivery" speed="5.56" length="7.62" shape="825.18,734.53 828.10,727.50"/> + <edge id=":442839558_6" function="internal"> + <lane id=":442839558_6_0" index="0" allow="delivery" speed="5.56" length="7.62" shape="825.18,734.53 828.10,727.50"/> </edge> - <edge id=":442839558_15" function="internal"> - <lane id=":442839558_15_0" index="0" allow="delivery" speed="5.56" length="4.98" shape="825.18,734.53 826.17,733.36 827.06,733.03 827.87,733.54 828.57,734.91"/> + <edge id=":442839558_7" function="internal"> + <lane id=":442839558_7_0" index="0" allow="delivery" speed="5.56" length="4.98" shape="825.18,734.53 826.17,733.36 827.06,733.03 827.87,733.54 828.57,734.91"/> </edge> <edge id=":442839576_0" function="internal"> <lane id=":442839576_0_0" index="0" allow="pedestrian" speed="8.33" length="8.31" shape="827.04,734.60 824.80,735.85 823.21,735.83 822.27,734.55 821.98,732.00"/> @@ -3011,31 +2831,19 @@ <lane id=":467011004_3_1" index="1" speed="13.89" length="9.57" shape="652.64,676.12 655.75,667.10"/> </edge> <edge id=":467106195_0" function="internal"> - <lane id=":467106195_0_0" index="0" allow="pedestrian" speed="6.95" length="4.96" shape="429.37,465.97 429.12,464.64 428.51,463.70 427.53,463.13 426.19,462.95"/> + <lane id=":467106195_0_0" index="0" allow="delivery" speed="5.56" length="8.91" shape="429.37,465.97 429.28,457.07"/> </edge> <edge id=":467106195_1" function="internal"> - <lane id=":467106195_1_0" index="0" allow="delivery" speed="5.56" length="8.91" shape="429.37,465.97 429.28,457.07"/> + <lane id=":467106195_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="429.37,465.97 430.14,464.70 430.95,464.25 431.79,464.63 432.67,465.83"/> </edge> <edge id=":467106195_2" function="internal"> - <lane id=":467106195_2_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="429.37,465.97 430.14,464.70 430.95,464.25 431.79,464.63 432.67,465.83"/> + <lane id=":467106195_2_0" index="0" allow="delivery" speed="5.56" length="7.62" shape="432.96,458.28 432.71,458.76 432.58,460.18 432.56,462.54 432.67,465.83"/> </edge> <edge id=":467106195_3" function="internal"> - <lane id=":467106195_3_0" index="0" allow="delivery" speed="5.56" length="7.62" shape="432.96,458.28 432.71,458.76 432.58,460.18 432.56,462.54 432.67,465.83"/> + <lane id=":467106195_3_0" index="0" allow="delivery" speed="5.56" length="5.65" shape="432.96,458.28 431.58,459.36 430.51,459.51 429.74,458.75 429.28,457.07"/> </edge> <edge id=":467106195_4" function="internal"> - <lane id=":467106195_4_0" index="0" allow="pedestrian" speed="6.95" length="8.22" shape="432.96,458.28 426.19,462.95"/> - </edge> - <edge id=":467106195_5" function="internal"> - <lane id=":467106195_5_0" index="0" allow="delivery" speed="5.56" length="5.65" shape="432.96,458.28 431.58,459.36 430.51,459.51 429.74,458.75 429.28,457.07"/> - </edge> - <edge id=":467106195_6" function="internal"> - <lane id=":467106195_6_0" index="0" allow="delivery" speed="6.95" length="4.57" shape="426.17,459.65 427.50,459.48 428.47,459.00 429.06,458.19 429.28,457.07"/> - </edge> - <edge id=":467106195_7" function="internal"> - <lane id=":467106195_7_0" index="0" allow="delivery" speed="6.95" length="10.15" shape="426.17,459.65 428.91,460.02 430.91,461.18 432.16,463.11 432.67,465.83"/> - </edge> - <edge id=":467106195_8" function="internal"> - <lane id=":467106195_8_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="426.17,459.65 427.41,460.47 427.83,461.29 427.42,462.12 426.19,462.95"/> + <lane id=":467106195_4_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="426.17,459.65 427.41,460.47 427.83,461.29 427.42,462.12 426.19,462.95"/> </edge> <edge id=":480440288_0" function="internal"> <lane id=":480440288_0_0" index="0" speed="13.89" length="3.01" shape="997.89,519.96 995.48,518.15"/> @@ -3067,9 +2875,6 @@ <edge id=":480440288_8" function="internal"> <lane id=":480440288_8_0" index="0" speed="20.84" length="0.10" shape="995.48,518.15 995.48,518.15"/> </edge> - <edge id=":480440288_10" function="internal"> - <lane id=":480440288_10_0" index="0" speed="20.84" length="0.10" shape="995.48,518.15 995.48,518.15"/> - </edge> <edge id=":48999923_0" function="internal"> <lane id=":48999923_0_0" index="0" allow="rail_electric" speed="83.33" length="3.00" shape="388.10,955.86 385.26,954.89"/> </edge> @@ -3176,14 +2981,11 @@ <edge id=":59824154_8" function="internal"> <lane id=":59824154_8_0" index="0" speed="20.84" length="0.10" shape="814.05,372.33 814.05,372.33"/> </edge> - <edge id=":59824154_10" function="internal"> - <lane id=":59824154_10_0" index="0" speed="20.84" length="0.10" shape="814.05,372.33 814.05,372.33"/> - </edge> <edge id=":59824195_0" function="internal"> <lane id=":59824195_0_0" index="0" speed="13.89" length="3.30" shape="1025.15,539.92 1022.43,538.05"/> </edge> <edge id=":59824195_1" function="internal"> - <lane id=":59824195_1_0" index="0" allow="rail_urban" speed="20.84" length="0.10" shape="1025.15,539.92 1025.15,539.92"/> + <lane id=":59824195_1_0" index="0" allow="rail_urban" speed="20.84" length="3.30" shape="1025.15,539.92 1026.94,537.15"/> </edge> <edge id=":59824195_2" function="internal"> <lane id=":59824195_2_0" index="0" speed="13.89" length="2.41" shape="1025.15,539.92 1024.56,538.56 1024.66,537.64"/> @@ -3195,7 +2997,7 @@ <lane id=":59824195_3_0" index="0" speed="13.89" length="3.10" shape="1024.39,535.39 1026.94,537.15"/> </edge> <edge id=":59824195_4" function="internal"> - <lane id=":59824195_4_0" index="0" allow="rail_urban" speed="20.84" length="3.10" shape="1024.39,535.39 1026.94,537.15"/> + <lane id=":59824195_4_0" index="0" allow="rail_urban" speed="20.84" length="4.60" shape="1024.39,535.39 1025.15,539.92"/> </edge> <edge id=":59824195_5" function="internal"> <lane id=":59824195_5_0" index="0" speed="13.89" length="4.82" shape="1024.39,535.39 1024.90,536.79 1024.74,537.70 1023.92,538.12 1022.43,538.05"/> @@ -3209,9 +3011,6 @@ <edge id=":59824195_8" function="internal"> <lane id=":59824195_8_0" index="0" speed="20.84" length="0.10" shape="1022.43,538.05 1022.43,538.05"/> </edge> - <edge id=":59824195_10" function="internal"> - <lane id=":59824195_10_0" index="0" speed="20.84" length="0.10" shape="1022.43,538.05 1022.43,538.05"/> - </edge> <edge id=":602783338_0" function="internal"> <lane id=":602783338_0_0" index="0" allow="pedestrian" speed="2.78" length="4.82" shape="832.22,681.52 831.13,682.53 830.23,682.75 829.52,682.16 829.00,680.76"/> </edge> @@ -3273,58 +3072,34 @@ <lane id=":622336955_10_0" index="0" speed="8.33" length="2.68" shape="340.39,429.60 340.44,430.63 339.68,432.10"/> </edge> <edge id=":622336960_0" function="internal"> - <lane id=":622336960_0_0" index="0" allow="pedestrian" speed="6.95" length="5.03" shape="364.48,433.87 364.24,432.51 363.62,431.56 362.63,431.02 361.25,430.90"/> + <lane id=":622336960_0_0" index="0" allow="delivery" speed="5.56" length="6.24" shape="364.48,433.87 364.25,427.64"/> </edge> <edge id=":622336960_1" function="internal"> - <lane id=":622336960_1_0" index="0" allow="delivery" speed="5.56" length="6.24" shape="364.48,433.87 364.25,427.64"/> + <lane id=":622336960_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="364.48,433.87 365.27,432.61 366.08,432.17 366.92,432.56 367.78,433.77"/> </edge> <edge id=":622336960_2" function="internal"> - <lane id=":622336960_2_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="364.48,433.87 365.27,432.61 366.08,432.17 366.92,432.56 367.78,433.77"/> + <lane id=":622336960_2_0" index="0" allow="delivery" speed="5.56" length="6.33" shape="367.54,427.44 367.78,433.77"/> </edge> <edge id=":622336960_3" function="internal"> - <lane id=":622336960_3_0" index="0" allow="delivery" speed="5.56" length="6.33" shape="367.54,427.44 367.78,433.77"/> + <lane id=":622336960_3_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="367.54,427.44 366.79,428.73 365.99,429.19 365.14,428.82 364.25,427.64"/> </edge> <edge id=":622336960_4" function="internal"> - <lane id=":622336960_4_0" index="0" allow="pedestrian" speed="6.95" length="7.92" shape="367.54,427.44 367.22,428.82 366.06,429.86 364.07,430.55 361.25,430.90"/> - </edge> - <edge id=":622336960_5" function="internal"> - <lane id=":622336960_5_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="367.54,427.44 366.79,428.73 365.99,429.19 365.14,428.82 364.25,427.64"/> - </edge> - <edge id=":622336960_6" function="internal"> - <lane id=":622336960_6_0" index="0" allow="delivery" speed="6.95" length="3.20" shape="361.07,427.61 362.45,427.55 363.45,427.53 364.04,427.56 364.25,427.64"/> - </edge> - <edge id=":622336960_7" function="internal"> - <lane id=":622336960_7_0" index="0" allow="delivery" speed="6.95" length="10.45" shape="361.07,427.61 363.93,427.86 366.00,428.97 367.28,430.94 367.78,433.77"/> - </edge> - <edge id=":622336960_8" function="internal"> - <lane id=":622336960_8_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="361.07,427.61 362.35,428.37 362.80,429.17 362.44,430.01 361.25,430.90"/> + <lane id=":622336960_4_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="361.07,427.61 362.35,428.37 362.80,429.17 362.44,430.01 361.25,430.90"/> </edge> <edge id=":622336968_0" function="internal"> - <lane id=":622336968_0_0" index="0" allow="pedestrian" speed="6.95" length="3.12" shape="364.23,427.38 364.04,427.46 363.46,427.54 362.50,427.63 361.14,427.72"/> + <lane id=":622336968_0_0" index="0" allow="delivery" speed="5.56" length="6.25" shape="364.23,427.38 363.85,421.14"/> </edge> <edge id=":622336968_1" function="internal"> - <lane id=":622336968_1_0" index="0" allow="delivery" speed="5.56" length="6.25" shape="364.23,427.38 363.85,421.14"/> + <lane id=":622336968_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="364.23,427.38 364.98,426.10 365.78,425.64 366.63,426.00 367.53,427.19"/> </edge> <edge id=":622336968_2" function="internal"> - <lane id=":622336968_2_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="364.23,427.38 364.98,426.10 365.78,425.64 366.63,426.00 367.53,427.19"/> + <lane id=":622336968_2_0" index="0" allow="delivery" speed="5.56" length="6.26" shape="367.15,420.94 367.53,427.19"/> </edge> <edge id=":622336968_3" function="internal"> - <lane id=":622336968_3_0" index="0" allow="delivery" speed="5.56" length="6.26" shape="367.15,420.94 367.53,427.19"/> + <lane id=":622336968_3_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="367.15,420.94 366.40,422.23 365.60,422.69 364.75,422.33 363.85,421.14"/> </edge> <edge id=":622336968_4" function="internal"> - <lane id=":622336968_4_0" index="0" allow="pedestrian" speed="6.95" length="10.33" shape="367.15,420.94 366.92,423.76 365.84,425.83 363.91,427.15 361.14,427.72"/> - </edge> - <edge id=":622336968_5" function="internal"> - <lane id=":622336968_5_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="367.15,420.94 366.40,422.23 365.60,422.69 364.75,422.33 363.85,421.14"/> - </edge> - <edge id=":622336968_6" function="internal"> - <lane id=":622336968_6_0" index="0" allow="delivery" speed="6.95" length="5.00" shape="360.94,424.42 362.29,424.15 363.22,423.51 363.74,422.51 363.85,421.14"/> - </edge> - <edge id=":622336968_7" function="internal"> - <lane id=":622336968_7_0" index="0" allow="delivery" speed="6.95" length="7.88" shape="360.94,424.42 363.75,424.45 365.79,424.93 367.04,425.84 367.53,427.19"/> - </edge> - <edge id=":622336968_8" function="internal"> - <lane id=":622336968_8_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="360.94,424.42 362.23,425.17 362.69,425.97 362.33,426.82 361.14,427.72"/> + <lane id=":622336968_4_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="360.94,424.42 362.23,425.17 362.69,425.97 362.33,426.82 361.14,427.72"/> </edge> <edge id=":622336972_0" function="internal"> <lane id=":622336972_0_0" index="0" allow="pedestrian" speed="8.33" length="4.23" shape="348.37,428.47 344.15,428.72"/> @@ -3519,64 +3294,34 @@ <lane id=":634580664_3_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="518.07,506.98 519.01,505.83 519.86,505.49 520.65,505.97 521.36,507.28"/> </edge> <edge id=":667901703_0" function="internal"> - <lane id=":667901703_0_0" index="0" allow="pedestrian" speed="6.95" length="5.18" shape="929.14,965.51 927.78,965.30 926.67,965.60 925.81,966.42 925.19,967.75"/> + <lane id=":667901703_0_0" index="0" allow="delivery" speed="5.56" length="9.67" shape="929.14,965.51 919.96,962.46"/> </edge> <edge id=":667901703_1" function="internal"> - <lane id=":667901703_1_0" index="0" allow="delivery" speed="5.56" length="9.67" shape="929.14,965.51 919.96,962.46"/> + <lane id=":667901703_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="929.14,965.51 928.20,964.35 928.06,963.44 928.70,962.77 930.13,962.36"/> </edge> <edge id=":667901703_2" function="internal"> - <lane id=":667901703_2_0" index="0" allow="pedestrian" speed="6.95" length="10.42" shape="929.14,965.51 926.66,964.30 925.16,962.52 924.62,960.18 925.05,957.28"/> + <lane id=":667901703_2_0" index="0" allow="pedestrian" speed="8.33" length="9.79" shape="928.16,958.41 925.19,967.75"/> </edge> <edge id=":667901703_3" function="internal"> - <lane id=":667901703_3_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="929.14,965.51 928.20,964.35 928.06,963.44 928.70,962.77 930.13,962.36"/> + <lane id=":667901703_3_0" index="0" allow="pedestrian" speed="8.33" length="2.41" shape="928.16,958.41 926.95,959.29 926.04,959.40"/> + </edge> + <edge id=":667901703_8" function="internal"> + <lane id=":667901703_8_0" index="0" speed="8.33" length="2.41" shape="926.04,959.40 925.40,958.72 925.05,957.28"/> </edge> <edge id=":667901703_4" function="internal"> - <lane id=":667901703_4_0" index="0" allow="delivery" speed="6.95" length="5.00" shape="928.16,958.41 927.95,959.80 928.21,960.92 928.93,961.78 930.13,962.36"/> + <lane id=":667901703_4_0" index="0" allow="delivery" speed="5.56" length="9.57" shape="921.05,959.35 930.13,962.36"/> </edge> <edge id=":667901703_5" function="internal"> - <lane id=":667901703_5_0" index="0" allow="pedestrian" speed="8.33" length="9.79" shape="928.16,958.41 925.19,967.75"/> + <lane id=":667901703_5_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="921.05,959.35 921.94,960.54 922.06,961.45 921.40,962.09 919.96,962.46"/> </edge> <edge id=":667901703_6" function="internal"> - <lane id=":667901703_6_0" index="0" allow="delivery" speed="6.95" length="7.17" shape="928.16,958.41 926.97,961.02 925.20,962.57 923.29,962.96"/> + <lane id=":667901703_6_0" index="0" allow="pedestrian" speed="8.33" length="10.40" shape="921.92,967.19 922.84,964.31 923.53,962.25 924.19,960.18 925.05,957.28"/> </edge> <edge id=":667901703_7" function="internal"> - <lane id=":667901703_7_0" index="0" allow="pedestrian" speed="8.33" length="2.41" shape="928.16,958.41 926.95,959.29 926.04,959.40"/> - </edge> - <edge id=":667901703_16" function="internal"> - <lane id=":667901703_16_0" index="0" speed="6.95" length="3.40" shape="923.29,962.96 922.87,963.05 919.96,962.46"/> - </edge> - <edge id=":667901703_17" function="internal"> - <lane id=":667901703_17_0" index="0" speed="8.33" length="2.41" shape="926.04,959.40 925.40,958.72 925.05,957.28"/> - </edge> - <edge id=":667901703_8" function="internal"> - <lane id=":667901703_8_0" index="0" allow="pedestrian" speed="6.95" length="5.21" shape="921.05,959.35 922.46,959.63 923.60,959.37 924.46,958.59 925.05,957.28"/> + <lane id=":667901703_7_0" index="0" allow="pedestrian" speed="8.33" length="2.42" shape="921.92,967.19 922.94,966.11 923.83,965.83"/> </edge> <edge id=":667901703_9" function="internal"> - <lane id=":667901703_9_0" index="0" allow="delivery" speed="5.56" length="9.57" shape="921.05,959.35 930.13,962.36"/> - </edge> - <edge id=":667901703_10" function="internal"> - <lane id=":667901703_10_0" index="0" allow="pedestrian" speed="6.95" length="10.60" shape="921.05,959.35 923.59,960.68 925.13,962.52 925.66,964.87 925.19,967.75"/> - </edge> - <edge id=":667901703_11" function="internal"> - <lane id=":667901703_11_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="921.05,959.35 921.94,960.54 922.06,961.45 921.40,962.09 919.96,962.46"/> - </edge> - <edge id=":667901703_12" function="internal"> - <lane id=":667901703_12_0" index="0" allow="delivery" speed="6.95" length="5.79" shape="921.92,967.19 922.22,965.53 922.00,964.19 921.24,963.17 919.96,962.46"/> - </edge> - <edge id=":667901703_13" function="internal"> - <lane id=":667901703_13_0" index="0" allow="pedestrian" speed="8.33" length="10.40" shape="921.92,967.19 922.84,964.31 923.53,962.25 924.19,960.18 925.05,957.28"/> - </edge> - <edge id=":667901703_14" function="internal"> - <lane id=":667901703_14_0" index="0" allow="delivery" speed="6.95" length="7.69" shape="921.92,967.19 923.22,964.36 925.03,962.61 927.00,962.04"/> - </edge> - <edge id=":667901703_15" function="internal"> - <lane id=":667901703_15_0" index="0" allow="pedestrian" speed="8.33" length="2.42" shape="921.92,967.19 922.94,966.11 923.83,965.83"/> - </edge> - <edge id=":667901703_18" function="internal"> - <lane id=":667901703_18_0" index="0" speed="6.95" length="3.17" shape="927.00,962.04 927.33,961.94 930.13,962.36"/> - </edge> - <edge id=":667901703_19" function="internal"> - <lane id=":667901703_19_0" index="0" speed="8.33" length="2.42" shape="923.83,965.83 924.58,966.38 925.19,967.75"/> + <lane id=":667901703_9_0" index="0" speed="8.33" length="2.42" shape="923.83,965.83 924.58,966.38 925.19,967.75"/> </edge> <edge id=":667901706_0" function="internal"> <lane id=":667901706_0_0" index="0" allow="pedestrian" speed="5.55" length="6.52" shape="938.50,937.22 936.42,936.18 934.86,935.92 933.80,936.46 933.26,937.78"/> @@ -3606,40 +3351,25 @@ <lane id=":667901706_8_0" index="0" allow="pedestrian" speed="8.33" length="4.96" shape="930.14,936.42 931.43,935.59 932.38,935.54 932.99,936.27 933.26,937.78"/> </edge> <edge id=":667901708_0" function="internal"> - <lane id=":667901708_0_0" index="0" allow="delivery" speed="4.17" length="5.19" shape="932.53,925.52 931.39,924.82 930.38,924.85 929.52,925.63 928.80,927.14"/> + <lane id=":667901708_0_0" index="0" allow="pedestrian" speed="2.78" length="5.50" shape="932.53,925.52 931.65,924.07 931.63,923.01 932.46,922.36 934.14,922.11"/> </edge> <edge id=":667901708_1" function="internal"> - <lane id=":667901708_1_0" index="0" allow="delivery" speed="4.17" length="10.21" shape="932.53,925.52 930.40,923.29 929.05,921.06 928.51,918.84 928.75,916.62"/> + <lane id=":667901708_1_0" index="0" allow="delivery" speed="5.56" length="10.09" shape="931.92,917.55 931.07,920.41 930.45,922.37 929.78,924.32 928.80,927.14"/> </edge> <edge id=":667901708_2" function="internal"> - <lane id=":667901708_2_0" index="0" allow="pedestrian" speed="2.78" length="5.50" shape="932.53,925.52 931.65,924.07 931.63,923.01 932.46,922.36 934.14,922.11"/> + <lane id=":667901708_2_0" index="0" allow="delivery" speed="5.56" length="2.41" shape="931.92,917.55 930.78,918.51 929.88,918.67"/> + </edge> + <edge id=":667901708_5" function="internal"> + <lane id=":667901708_5_0" index="0" speed="5.56" length="2.41" shape="929.88,918.67 929.20,918.04 928.75,916.62"/> </edge> <edge id=":667901708_3" function="internal"> - <lane id=":667901708_3_0" index="0" allow="pedestrian" speed="4.17" length="5.07" shape="931.92,917.55 934.14,922.11"/> + <lane id=":667901708_3_0" index="0" allow="delivery" speed="5.56" length="9.92" shape="925.68,926.06 928.75,916.62"/> </edge> <edge id=":667901708_4" function="internal"> - <lane id=":667901708_4_0" index="0" allow="delivery" speed="5.56" length="10.09" shape="931.92,917.55 931.07,920.41 930.45,922.37 929.78,924.32 928.80,927.14"/> - </edge> - <edge id=":667901708_5" function="internal"> - <lane id=":667901708_5_0" index="0" allow="delivery" speed="5.56" length="2.41" shape="931.92,917.55 930.78,918.51 929.88,918.67"/> - </edge> - <edge id=":667901708_9" function="internal"> - <lane id=":667901708_9_0" index="0" speed="5.56" length="2.41" shape="929.88,918.67 929.20,918.04 928.75,916.62"/> + <lane id=":667901708_4_0" index="0" allow="delivery" speed="5.56" length="2.41" shape="925.68,926.06 926.86,925.16 927.78,925.04"/> </edge> <edge id=":667901708_6" function="internal"> - <lane id=":667901708_6_0" index="0" allow="delivery" speed="5.56" length="9.92" shape="925.68,926.06 928.75,916.62"/> - </edge> - <edge id=":667901708_7" function="internal"> - <lane id=":667901708_7_0" index="0" allow="pedestrian" speed="4.17" length="9.80" shape="925.68,926.06 927.76,921.33 929.86,919.09 931.41,919.28"/> - </edge> - <edge id=":667901708_8" function="internal"> - <lane id=":667901708_8_0" index="0" allow="delivery" speed="5.56" length="2.41" shape="925.68,926.06 926.86,925.16 927.78,925.04"/> - </edge> - <edge id=":667901708_10" function="internal"> - <lane id=":667901708_10_0" index="0" speed="4.17" length="4.08" shape="931.41,919.28 931.99,919.35 934.14,922.11"/> - </edge> - <edge id=":667901708_11" function="internal"> - <lane id=":667901708_11_0" index="0" speed="5.56" length="2.41" shape="927.78,925.04 928.42,925.70 928.80,927.14"/> + <lane id=":667901708_6_0" index="0" speed="5.56" length="2.41" shape="927.78,925.04 928.42,925.70 928.80,927.14"/> </edge> <edge id=":667901709_0" function="internal"> <lane id=":667901709_0_0" index="0" speed="8.33" length="9.35" shape="918.66,995.89 909.84,992.79"/> @@ -3726,10 +3456,7 @@ <lane id=":765703076_0_0" index="0" allow="rail_electric" speed="83.33" length="2.95" shape="732.72,1400.83 731.12,1398.36"/> </edge> <edge id=":765703076_1" function="internal"> - <lane id=":765703076_1_0" index="0" allow="rail_electric" speed="83.33" length="0.10" shape="731.15,1398.34 731.13,1398.35"/> - </edge> - <edge id=":765703076_2" function="internal"> - <lane id=":765703076_2_0" index="0" speed="83.33" length="0.10" shape="731.13,1398.35 731.12,1398.36"/> + <lane id=":765703076_1_0" index="0" allow="rail_electric" speed="83.33" length="0.10" shape="731.15,1398.34 731.12,1398.36"/> </edge> <edge id=":765703090_0" function="internal"> <lane id=":765703090_0_0" index="0" allow="pedestrian" speed="2.78" length="7.63" shape="550.26,997.49 548.57,998.70 546.88,999.11 545.19,998.71 543.50,997.50"/> @@ -3816,31 +3543,19 @@ <lane id=":853135513_8_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="341.39,528.26 340.60,529.52 339.79,529.96 338.95,529.57 338.09,528.36"/> </edge> <edge id=":853135516_0" function="internal"> - <lane id=":853135516_0_0" index="0" allow="pedestrian" speed="6.95" length="5.05" shape="362.78,536.74 362.54,535.37 361.92,534.42 360.91,533.90 359.52,533.80"/> + <lane id=":853135516_0_0" index="0" allow="delivery" speed="5.56" length="9.51" shape="362.78,536.74 362.49,527.23"/> </edge> <edge id=":853135516_1" function="internal"> - <lane id=":853135516_1_0" index="0" allow="delivery" speed="5.56" length="9.51" shape="362.78,536.74 362.49,527.23"/> + <lane id=":853135516_1_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="362.78,536.74 363.57,535.48 364.38,535.05 365.22,535.44 366.08,536.65"/> </edge> <edge id=":853135516_2" function="internal"> - <lane id=":853135516_2_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="362.78,536.74 363.57,535.48 364.38,535.05 365.22,535.44 366.08,536.65"/> + <lane id=":853135516_2_0" index="0" allow="delivery" speed="5.56" length="9.53" shape="365.79,527.12 366.08,536.65"/> </edge> <edge id=":853135516_3" function="internal"> - <lane id=":853135516_3_0" index="0" allow="delivery" speed="5.56" length="9.53" shape="365.79,527.12 366.08,536.65"/> + <lane id=":853135516_3_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="365.79,527.12 365.00,528.39 364.19,528.83 363.35,528.44 362.49,527.23"/> </edge> <edge id=":853135516_4" function="internal"> - <lane id=":853135516_4_0" index="0" allow="pedestrian" speed="6.95" length="10.35" shape="365.79,527.12 365.47,529.87 364.32,531.90 362.34,533.21 359.52,533.80"/> - </edge> - <edge id=":853135516_5" function="internal"> - <lane id=":853135516_5_0" index="0" allow="delivery" speed="5.56" length="4.82" shape="365.79,527.12 365.00,528.39 364.19,528.83 363.35,528.44 362.49,527.23"/> - </edge> - <edge id=":853135516_6" function="internal"> - <lane id=":853135516_6_0" index="0" allow="delivery" speed="6.95" length="5.18" shape="359.28,530.51 360.72,530.22 361.74,529.57 362.32,528.58 362.49,527.23"/> - </edge> - <edge id=":853135516_7" function="internal"> - <lane id=":853135516_7_0" index="0" allow="delivery" speed="6.95" length="10.55" shape="359.28,530.51 362.19,530.71 364.29,531.81 365.58,533.78 366.08,536.65"/> - </edge> - <edge id=":853135516_8" function="internal"> - <lane id=":853135516_8_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="359.28,530.51 360.58,531.24 361.05,532.04 360.70,532.89 359.52,533.80"/> + <lane id=":853135516_4_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="359.28,530.51 360.58,531.24 361.05,532.04 360.70,532.89 359.52,533.80"/> </edge> <edge id=":979119480_0" function="internal"> <lane id=":979119480_0_0" index="0" allow="pedestrian" speed="8.33" length="4.82" shape="632.76,360.06 633.84,359.04 634.74,358.84 635.45,359.43 635.96,360.82"/> @@ -5594,23 +5309,23 @@ </edge> <tlLogic id="cluster_104171179_28142770_28298581_28298587" type="static" programID="0" offset="0"> - <phase duration="4" state="rrryyrrrrrrrryyrrrrr"/> - <phase duration="2" state="rrrrrrrrrrrrrrrrrrrr"/> + <phase duration="4" state="rrryyuuuuurrryyuuuuu"/> + <phase duration="2" state="rrrrruuuuurrrrruuuuu"/> <phase duration="1000" state="rrrrrGGGggrrrrrGGGgg"/> </tlLogic> <tlLogic id="cluster_104171179_28142770_28298581_28298587" type="static" programID="1" offset="0"> - <phase duration="4" state="rrrrryyyggrrrrryyygg"/> + <phase duration="4" state="rrrrryyyuurrrrryyyuu"/> <phase duration="2" state="rrrrrrrrrrrrrrrrrrrr"/> <phase duration="1000" state="rrrrrrrrGGrrrrrrrrGG"/> </tlLogic> <tlLogic id="cluster_104171179_28142770_28298581_28298587" type="static" programID="2" offset="0"> - <phase duration="4" state="rrrrrrrryyrrrrrrrryy"/> - <phase duration="2" state="rrrrrrrrrrrrrrrrrrrr"/> + <phase duration="4" state="uuuuurrryyuuuuurrryy"/> + <phase duration="2" state="uuuuurrrrruuuuurrrrr"/> <phase duration="1000" state="GGGggrrrrrGGGggrrrrr"/> </tlLogic> <tlLogic id="cluster_104171179_28142770_28298581_28298587" type="static" programID="3" offset="0"> - <phase duration="4" state="yyyggrrrrryyyggrrrrr"/> - <phase duration="2" state="rrrrrrrrrrrrrrrrrrrr"/> + <phase duration="4" state="yyyuurrrrryyyuurrrrr"/> + <phase duration="2" state="rrruurrrrrrrruurrrrr"/> <phase duration="1000" state="rrrGGrrrrrrrrGGrrrrr"/> </tlLogic> @@ -5688,16 +5403,12 @@ <request index="7" response="000011000" foes="000011110" cont="0"/> <request index="8" response="000010001" foes="000010001" cont="0"/> </junction> - <junction id="1356135516" type="priority" x="493.30" y="830.83" incLanes="121069898#0_0 -121069898#1_0 121069900_0" intLanes=":1356135516_0_0 :1356135516_1_0 :1356135516_2_0 :1356135516_3_0 :1356135516_4_0 :1356135516_5_0 :1356135516_6_0 :1356135516_7_0 :1356135516_8_0" shape="497.36,834.69 498.27,828.25 488.85,826.92 487.94,833.36 489.13,835.04 495.50,836.33"> - <request index="0" response="000000000" foes="100010000" cont="0"/> - <request index="1" response="011000000" foes="011110000" cont="0"/> - <request index="2" response="010001000" foes="010001000" cont="0"/> - <request index="3" response="010000000" foes="010000100" cont="0"/> - <request index="4" response="010000011" foes="110000011" cont="0"/> - <request index="5" response="001000010" foes="001000010" cont="0"/> - <request index="6" response="000000000" foes="000100010" cont="0"/> - <request index="7" response="000000000" foes="000011110" cont="0"/> - <request index="8" response="000010001" foes="000010001" cont="0"/> + <junction id="1356135516" type="priority" x="493.30" y="830.83" incLanes="121069898#0_0 -121069898#1_0 121069900_0" intLanes=":1356135516_0_0 :1356135516_1_0 :1356135516_2_0 :1356135516_3_0 :1356135516_4_0" shape="497.36,834.69 498.27,828.25 488.85,826.92 487.94,833.36 489.13,835.04 495.50,836.33"> + <request index="0" response="00000" foes="01000" cont="0"/> + <request index="1" response="00100" foes="00100" cont="0"/> + <request index="2" response="00000" foes="00010" cont="0"/> + <request index="3" response="00001" foes="00001" cont="0"/> + <request index="4" response="00000" foes="00000" cont="0"/> </junction> <junction id="1367507446" type="priority" x="588.30" y="675.77" incLanes="122351619_0" intLanes=":1367507446_0_0" shape="588.30,675.82 588.42,679.02 588.18,672.52 588.30,675.72"> <request index="0" response="0" foes="0" cont="0"/> @@ -5724,16 +5435,12 @@ <request index="7" response="000000000" foes="000011110" cont="0"/> <request index="8" response="000010001" foes="000010001" cont="1"/> </junction> - <junction id="1424270251" type="priority" x="723.67" y="910.95" incLanes="26562389#1_0 -129013950_0 -26562389#2_0" intLanes=":1424270251_0_0 :1424270251_1_0 :1424270251_2_0 :1424270251_3_0 :1424270251_4_0 :1424270251_9_0 :1424270251_6_0 :1424270251_7_0 :1424270251_10_0" shape="727.02,921.65 732.40,917.99 732.99,917.19 734.89,910.98 729.31,914.35 723.65,917.54"> - <request index="0" response="000010000" foes="100010000" cont="0"/> - <request index="1" response="011010000" foes="011110000" cont="0"/> - <request index="2" response="010001000" foes="010001000" cont="0"/> - <request index="3" response="000000000" foes="010000100" cont="0"/> - <request index="4" response="000000000" foes="110000011" cont="0"/> - <request index="5" response="001000010" foes="001000010" cont="1"/> - <request index="6" response="000000000" foes="000100010" cont="0"/> - <request index="7" response="000011000" foes="000011110" cont="0"/> - <request index="8" response="000010001" foes="000010001" cont="1"/> + <junction id="1424270251" type="priority" x="723.67" y="910.95" incLanes="26562389#1_0 -129013950_0 -26562389#2_0" intLanes=":1424270251_0_0 :1424270251_1_0 :1424270251_2_0 :1424270251_3_0 :1424270251_4_0" shape="727.02,921.65 732.40,917.99 732.99,917.19 734.89,910.98 729.31,914.35 723.65,917.54"> + <request index="0" response="00000" foes="10000" cont="0"/> + <request index="1" response="01000" foes="01000" cont="0"/> + <request index="2" response="00000" foes="00000" cont="0"/> + <request index="3" response="00000" foes="00010" cont="0"/> + <request index="4" response="00001" foes="00001" cont="0"/> </junction> <junction id="1424274807" type="priority" x="843.94" y="782.71" incLanes="-129014453_0 -38167738#7_0 38167738#6_0" intLanes=":1424274807_0_0 :1424274807_1_0 :1424274807_2_0 :1424274807_3_0 :1424274807_4_0 :1424274807_9_0 :1424274807_6_0 :1424274807_10_0 :1424274807_11_0" shape="847.43,787.36 849.55,781.22 848.47,779.25 842.29,777.25 839.36,786.29 845.55,788.29"> <request index="0" response="000010000" foes="100010000" cont="0"/> @@ -5790,7 +5497,7 @@ <junction id="1757034233" type="priority" x="575.24" y="1048.19" incLanes="-22959383_0" intLanes=":1757034233_0_0" shape="575.20,1048.21 572.39,1049.75 578.09,1046.63 575.28,1048.17"> <request index="0" response="0" foes="0" cont="0"/> </junction> - <junction id="1771199559" type="priority" x="938.32" y="471.05" incLanes="-33049407#3_0 -165574143_0 33049407#2_0 64797654#5_0 64797654#5_1" intLanes=":1771199559_0_0 :1771199559_1_0 :1771199559_2_0 :1771199559_16_0 :1771199559_4_0 :1771199559_5_0 :1771199559_6_0 :1771199559_7_0 :1771199559_8_0 :1771199559_9_0 :1771199559_10_0 :1771199559_11_0 :1771199559_12_0 :1771199559_13_0 :1771199559_14_0 :1771199559_17_0" shape="939.36,476.28 943.64,471.38 943.81,468.24 938.24,464.89 936.30,465.23 932.21,470.27"> + <junction id="1771199559" type="priority" x="938.32" y="471.05" incLanes="-33049407#3_0 -165574143_0 33049407#2_0 64797654#5_0 64797654#5_1" intLanes=":1771199559_0_0 :1771199559_1_0 :1771199559_2_0 :1771199559_16_0 :1771199559_4_0 :1771199559_5_0 :1771199559_6_0 :1771199559_7_0 :1771199559_8_0 :1771199559_9_0 :1771199559_10_0 :1771199559_11_0 :1771199559_12_0 :1771199559_13_0 :1771199559_14_0 :1771199559_15_0" shape="939.36,476.28 943.64,471.38 943.81,468.24 938.24,464.89 936.30,465.23 932.21,470.27"> <request index="0" response="0000000000000000" foes="1110111001110000" cont="0"/> <request index="1" response="0001000000000000" foes="0001000111110000" cont="0"/> <request index="2" response="0000000000000000" foes="0100010000100000" cont="0"/> @@ -5806,7 +5513,7 @@ <request index="12" response="0000000000000000" foes="0000111110000010" cont="0"/> <request index="13" response="0000000000000001" foes="0000101001011001" cont="0"/> <request index="14" response="0000000000000101" foes="0000111001111101" cont="0"/> - <request index="15" response="0000000001000001" foes="0000100001000001" cont="1"/> + <request index="15" response="0000000001000001" foes="0000100001000001" cont="0"/> </junction> <junction id="1778997184" type="priority" x="697.40" y="583.69" incLanes="166445406_0 166445406_1" intLanes=":1778997184_0_0 :1778997184_0_1" shape="700.49,584.70 694.31,582.69 700.48,584.73"> <request index="0" response="00" foes="00" cont="0"/> @@ -5835,16 +5542,12 @@ <request index="0" response="0" foes="0" cont="0"/> </junction> <junction id="1881881963" type="unregulated" x="16.05" y="905.57" incLanes="23335805#3_0" intLanes="" shape="15.90,907.16 16.20,903.98"/> - <junction id="1894312954" type="priority" x="360.79" y="511.65" incLanes="-26384275#1_0 26384275#0_0 179093197_0" intLanes=":1894312954_0_0 :1894312954_1_0 :1894312954_2_0 :1894312954_3_0 :1894312954_4_0 :1894312954_5_0 :1894312954_6_0 :1894312954_7_0 :1894312954_8_0" shape="358.54,516.47 364.88,515.04 363.48,509.38 357.28,511.31 356.46,508.57 356.72,515.06"> - <request index="0" response="000000000" foes="100010000" cont="0"/> - <request index="1" response="011000000" foes="011110000" cont="0"/> - <request index="2" response="010001000" foes="010001000" cont="0"/> - <request index="3" response="010000000" foes="010000100" cont="0"/> - <request index="4" response="010000011" foes="110000011" cont="0"/> - <request index="5" response="001000010" foes="001000010" cont="0"/> - <request index="6" response="000000000" foes="000100010" cont="0"/> - <request index="7" response="000000000" foes="000011110" cont="0"/> - <request index="8" response="000010001" foes="000010001" cont="0"/> + <junction id="1894312954" type="priority" x="360.79" y="511.65" incLanes="-26384275#1_0 26384275#0_0 179093197_0" intLanes=":1894312954_0_0 :1894312954_1_0 :1894312954_2_0 :1894312954_3_0 :1894312954_4_0" shape="358.54,516.47 364.88,515.04 363.48,509.38 357.28,511.31 356.46,508.57 356.72,515.06"> + <request index="0" response="00000" foes="01000" cont="0"/> + <request index="1" response="00100" foes="00100" cont="0"/> + <request index="2" response="00000" foes="00010" cont="0"/> + <request index="3" response="00001" foes="00001" cont="0"/> + <request index="4" response="00000" foes="00000" cont="0"/> </junction> <junction id="21613360" type="priority" x="185.65" y="632.21" incLanes="30425847#3_0 30425847#3_1" intLanes=":21613360_0_0 :21613360_0_1" shape="185.37,635.45 185.93,628.97 185.36,635.45"> <request index="0" response="00" foes="00" cont="0"/> @@ -5962,7 +5665,7 @@ <request index="2" response="0011" foes="0011" cont="0"/> <request index="3" response="0010" foes="0010" cont="0"/> </junction> - <junction id="266777507" type="priority" x="1135.00" y="608.79" incLanes="-33049407#7_0 33049407#6_0 64797654#9_0 64797654#9_1" intLanes=":266777507_0_0 :266777507_1_0 :266777507_9_0 :266777507_3_0 :266777507_4_0 :266777507_5_0 :266777507_6_0 :266777507_7_0 :266777507_10_0" shape="1134.49,612.33 1138.03,606.88 1135.50,605.25 1131.98,610.71"> + <junction id="266777507" type="priority" x="1135.00" y="608.79" incLanes="-33049407#7_0 33049407#6_0 64797654#9_0 64797654#9_1" intLanes=":266777507_0_0 :266777507_1_0 :266777507_9_0 :266777507_3_0 :266777507_4_0 :266777507_5_0 :266777507_6_0 :266777507_7_0 :266777507_8_0" shape="1134.49,612.33 1138.03,606.88 1135.50,605.25 1131.98,610.71"> <request index="0" response="000000000" foes="111111000" cont="0"/> <request index="1" response="000000000" foes="010010000" cont="0"/> <request index="2" response="011011000" foes="011011000" cont="1"/> @@ -5971,7 +5674,7 @@ <request index="5" response="111000001" foes="111000001" cont="0"/> <request index="6" response="000000001" foes="000101101" cont="0"/> <request index="7" response="000000011" foes="000111111" cont="0"/> - <request index="8" response="000000001" foes="000100001" cont="1"/> + <request index="8" response="000000001" foes="000100001" cont="0"/> </junction> <junction id="269964106" type="priority" x="787.33" y="952.59" incLanes="7782975#2_0 -38167738#0_0 -7782975#3_0 25068137_0" intLanes=":269964106_0_0 :269964106_1_0 :269964106_2_0 :269964106_3_0 :269964106_4_0 :269964106_5_0 :269964106_16_0 :269964106_17_0 :269964106_8_0 :269964106_9_0 :269964106_10_0 :269964106_11_0 :269964106_12_0 :269964106_13_0 :269964106_18_0 :269964106_19_0" shape="792.91,956.21 793.33,949.72 792.33,948.21 786.20,946.04 782.16,948.86 781.57,955.33 782.63,956.90 788.85,958.78"> <request index="0" response="0000000000100000" foes="1000010000100000" cont="0"/> @@ -5994,7 +5697,7 @@ <junction id="269964108" type="priority" x="741.94" y="1086.85" incLanes="-25068137_0" intLanes=":269964108_0_0" shape="741.89,1086.83 738.90,1085.70 744.98,1088.00 741.99,1086.87"> <request index="0" response="0" foes="0" cont="0"/> </junction> - <junction id="269964113" type="priority" x="949.87" y="481.16" incLanes="-33049407#4_0 33049407#3_0 64797654#6_0 64797654#6_1 38167741#5_0" intLanes=":269964113_0_0 :269964113_1_0 :269964113_2_0 :269964113_17_0 :269964113_4_0 :269964113_5_0 :269964113_6_0 :269964113_7_0 :269964113_8_0 :269964113_9_0 :269964113_9_1 :269964113_11_0 :269964113_18_0 :269964113_13_0 :269964113_14_0 :269964113_15_0 :269964113_16_0" shape="952.36,487.16 956.31,482.00 949.08,476.15 944.80,481.04 944.62,484.98 950.56,487.62"> + <junction id="269964113" type="priority" x="949.87" y="481.16" incLanes="-33049407#4_0 33049407#3_0 64797654#6_0 64797654#6_1 38167741#5_0" intLanes=":269964113_0_0 :269964113_1_0 :269964113_2_0 :269964113_17_0 :269964113_4_0 :269964113_5_0 :269964113_6_0 :269964113_7_0 :269964113_8_0 :269964113_9_0 :269964113_9_1 :269964113_11_0 :269964113_12_0 :269964113_13_0 :269964113_14_0 :269964113_15_0 :269964113_16_0" shape="952.36,487.16 956.31,482.00 949.08,476.15 944.80,481.04 944.62,484.98 950.56,487.62"> <request index="0" response="00000000000000000" foes="11100111101110000" cont="0"/> <request index="1" response="00000000000000000" foes="00011111111110000" cont="0"/> <request index="2" response="00000000000000000" foes="01000011000100000" cont="0"/> @@ -6007,7 +5710,7 @@ <request index="9" response="00000000000000111" foes="01000000011111111" cont="0"/> <request index="10" response="00000000000000111" foes="01000000011111111" cont="0"/> <request index="11" response="00000000000000011" foes="11100000011000011" cont="0"/> - <request index="12" response="00010000000000010" foes="00010000010000010" cont="1"/> + <request index="12" response="00010000000000010" foes="00010000010000010" cont="0"/> <request index="13" response="00000000000000010" foes="00001000010000010" cont="0"/> <request index="14" response="00000100101010001" foes="00000100101011001" cont="0"/> <request index="15" response="00000111101110101" foes="00000111101111101" cont="0"/> @@ -6038,11 +5741,11 @@ </junction> <junction id="27557127" type="priority" x="781.80" y="345.91" incLanes="-33049407#0_0 64797654#2_0 64797654#2_1" intLanes=":27557127_0_0 :27557127_1_0 :27557127_6_0 :27557127_3_0 :27557127_4_0 :27557127_5_0" shape="784.54,351.88 788.33,346.60 780.41,340.93 776.64,346.22 776.73,350.07 782.79,352.41"> <request index="0" response="000000" foes="000000" cont="0"/> - <request index="1" response="101000" foes="101000" cont="0"/> - <request index="2" response="101000" foes="101000" cont="1"/> + <request index="1" response="001000" foes="001000" cont="0"/> + <request index="2" response="001000" foes="001000" cont="1"/> <request index="3" response="000000" foes="000110" cont="0"/> <request index="4" response="000000" foes="000000" cont="0"/> - <request index="5" response="000000" foes="000110" cont="0"/> + <request index="5" response="000000" foes="000000" cont="0"/> </junction> <junction id="276419026" type="right_before_left" x="545.84" y="519.02" incLanes="-25363135#1_0 7745711#2_0 25363135#0_0" intLanes=":276419026_0_0 :276419026_1_0 :276419026_2_0 :276419026_3_0 :276419026_4_0 :276419026_5_0" shape="542.70,522.41 549.20,522.19 550.65,520.72 550.72,517.52 548.90,515.99 542.41,516.42"> <request index="0" response="000000" foes="101000" cont="0"/> @@ -6077,27 +5780,19 @@ <request index="7" response="000011000" foes="000011110" cont="0"/> <request index="8" response="000010001" foes="000010001" cont="0"/> </junction> - <junction id="277697625" type="priority" x="339.00" y="452.73" incLanes="25485133#0_0 -49042724_0 -25485133#1_0" intLanes=":277697625_0_0 :277697625_9_0 :277697625_10_0 :277697625_3_0 :277697625_4_0 :277697625_5_0 :277697625_6_0 :277697625_7_0 :277697625_11_0" shape="343.52,454.11 340.63,448.29 336.94,447.32 333.21,452.64 333.56,454.72 338.93,458.56"> - <request index="0" response="000000000" foes="100010000" cont="0"/> - <request index="1" response="011000000" foes="011110000" cont="1"/> - <request index="2" response="010001000" foes="010001000" cont="1"/> - <request index="3" response="010000000" foes="010000100" cont="0"/> - <request index="4" response="010000011" foes="110000011" cont="0"/> - <request index="5" response="001000010" foes="001000010" cont="0"/> - <request index="6" response="000000000" foes="000100010" cont="0"/> - <request index="7" response="000000000" foes="000011110" cont="0"/> - <request index="8" response="000010001" foes="000010001" cont="1"/> - </junction> - <junction id="277697630" type="priority" x="355.65" y="465.81" incLanes="49047248_0 -25485133#2_0 25485133#1_0" intLanes=":277697630_0_0 :277697630_1_0 :277697630_2_0 :277697630_3_0 :277697630_4_0 :277697630_5_0 :277697630_6_0 :277697630_7_0 :277697630_8_0" shape="356.75,471.84 361.55,467.46 359.45,463.36 353.07,462.10 349.56,467.31 354.77,471.87"> - <request index="0" response="000000000" foes="100010000" cont="0"/> - <request index="1" response="000000000" foes="011110000" cont="0"/> - <request index="2" response="010001000" foes="010001000" cont="0"/> - <request index="3" response="000000000" foes="010000100" cont="0"/> - <request index="4" response="000000011" foes="110000011" cont="0"/> - <request index="5" response="001000010" foes="001000010" cont="0"/> - <request index="6" response="000000010" foes="000100010" cont="0"/> - <request index="7" response="000011010" foes="000011110" cont="0"/> - <request index="8" response="000010001" foes="000010001" cont="0"/> + <junction id="277697625" type="priority" x="339.00" y="452.73" incLanes="25485133#0_0 -49042724_0 -25485133#1_0" intLanes=":277697625_0_0 :277697625_5_0 :277697625_2_0 :277697625_3_0 :277697625_6_0" shape="343.52,454.11 340.63,448.29 336.94,447.32 333.21,452.64 333.56,454.72 338.93,458.56"> + <request index="0" response="00000" foes="10000" cont="0"/> + <request index="1" response="01000" foes="01000" cont="1"/> + <request index="2" response="00000" foes="00000" cont="0"/> + <request index="3" response="00000" foes="00010" cont="0"/> + <request index="4" response="00001" foes="00001" cont="1"/> + </junction> + <junction id="277697630" type="priority" x="355.65" y="465.81" incLanes="49047248_0 -25485133#2_0 25485133#1_0" intLanes=":277697630_0_0 :277697630_1_0 :277697630_2_0 :277697630_3_0 :277697630_4_0" shape="356.75,471.84 361.55,467.46 359.45,463.36 353.07,462.10 349.56,467.31 354.77,471.87"> + <request index="0" response="00000" foes="00000" cont="0"/> + <request index="1" response="00000" foes="10000" cont="0"/> + <request index="2" response="01000" foes="01000" cont="0"/> + <request index="3" response="00000" foes="00100" cont="0"/> + <request index="4" response="00010" foes="00010" cont="0"/> </junction> <junction id="277697633" type="priority" x="364.31" y="401.02" incLanes="50005239#2_0 5088373#1_0 -5088373#2_0" intLanes=":277697633_0_0 :277697633_1_0 :277697633_2_0 :277697633_3_0 :277697633_4_0 :277697633_9_0 :277697633_6_0 :277697633_10_0 :277697633_11_0" shape="361.33,406.03 367.82,405.67 369.20,403.60 368.28,397.17 359.23,398.17 359.75,404.65"> <request index="0" response="000010000" foes="100010000" cont="0"/> @@ -6242,16 +5937,12 @@ <request index="7" response="000011000" foes="000011110" cont="1"/> <request index="8" response="000010001" foes="000010001" cont="1"/> </junction> - <junction id="293695883" type="priority" x="1006.24" y="846.84" incLanes="31281702#0_0 -31281702#1_0 26775981#3_0" intLanes=":293695883_0_0 :293695883_1_0 :293695883_9_0 :293695883_3_0 :293695883_4_0 :293695883_10_0 :293695883_6_0 :293695883_7_0 :293695883_8_0" shape="1005.98,853.76 1011.83,850.93 1012.67,849.41 1011.97,842.95 1004.56,842.85 1002.49,849.01"> - <request index="0" response="000000000" foes="100010000" cont="0"/> - <request index="1" response="000000000" foes="011110000" cont="0"/> - <request index="2" response="010001000" foes="010001000" cont="1"/> - <request index="3" response="000000000" foes="010000100" cont="0"/> - <request index="4" response="000000011" foes="110000011" cont="0"/> - <request index="5" response="001000010" foes="001000010" cont="1"/> - <request index="6" response="000000010" foes="000100010" cont="0"/> - <request index="7" response="000011010" foes="000011110" cont="0"/> - <request index="8" response="000010001" foes="000010001" cont="0"/> + <junction id="293695883" type="priority" x="1006.24" y="846.84" incLanes="31281702#0_0 -31281702#1_0 26775981#3_0" intLanes=":293695883_0_0 :293695883_5_0 :293695883_2_0 :293695883_6_0 :293695883_4_0" shape="1005.98,853.76 1011.83,850.93 1012.67,849.41 1011.97,842.95 1004.56,842.85 1002.49,849.01"> + <request index="0" response="00000" foes="01000" cont="0"/> + <request index="1" response="00100" foes="00100" cont="1"/> + <request index="2" response="00000" foes="00010" cont="0"/> + <request index="3" response="00001" foes="00001" cont="1"/> + <request index="4" response="00000" foes="00000" cont="0"/> </junction> <junction id="293696006" type="right_before_left" x="866.65" y="797.27" incLanes="-26775981#1_0 26775981#0_0 -26775984_0" intLanes=":293696006_0_0 :293696006_1_0 :293696006_2_0 :293696006_3_0 :293696006_4_0 :293696006_5_0 :293696006_6_0 :293696006_7_0 :293696006_8_0" shape="870.11,802.03 872.39,795.94 863.41,792.64 861.19,798.74 862.06,800.96 868.25,802.94"> <request index="0" response="000000000" foes="100010000" cont="0"/> @@ -6264,11 +5955,9 @@ <request index="7" response="000011000" foes="000011110" cont="0"/> <request index="8" response="000010001" foes="000010001" cont="0"/> </junction> - <junction id="293696007" type="priority" x="853.52" y="838.33" incLanes="26775984_0 -49844607_0" intLanes=":293696007_0_0 :293696007_4_0 :293696007_2_0 :293696007_5_0" shape="856.61,839.33 850.42,837.35 856.60,839.36"> - <request index="0" response="0000" foes="1000" cont="0"/> - <request index="1" response="0100" foes="0100" cont="1"/> - <request index="2" response="0000" foes="0010" cont="0"/> - <request index="3" response="0001" foes="0001" cont="1"/> + <junction id="293696007" type="priority" x="853.52" y="838.33" incLanes="26775984_0 -49844607_0" intLanes=":293696007_0_0 :293696007_1_0" shape="856.61,839.33 850.42,837.35 856.60,839.36"> + <request index="0" response="00" foes="00" cont="0"/> + <request index="1" response="00" foes="00" cont="0"/> </junction> <junction id="293696234" type="right_before_left" x="958.04" y="830.64" incLanes="-26775981#3_0 26775981#2_0 -26776014#0_0" intLanes=":293696234_0_0 :293696234_1_0 :293696234_2_0 :293696234_3_0 :293696234_4_0 :293696234_5_0 :293696234_6_0 :293696234_7_0 :293696234_8_0" shape="961.54,835.24 963.61,829.08 954.59,826.06 952.53,832.22 953.47,834.18 959.65,836.19"> <request index="0" response="000000000" foes="100010000" cont="0"/> @@ -6303,16 +5992,12 @@ <request index="7" response="000011000" foes="000011110" cont="0"/> <request index="8" response="000010001" foes="000010001" cont="0"/> </junction> - <junction id="293696356" type="right_before_left" x="942.65" y="938.60" incLanes="26776014#2_0 -52572950#0_0 -26776014#3_0" intLanes=":293696356_0_0 :293696356_1_0 :293696356_2_0 :293696356_3_0 :293696356_4_0 :293696356_5_0 :293696356_6_0 :293696356_7_0 :293696356_8_0" shape="946.26,943.25 948.34,937.10 942.60,933.99 937.78,938.66 938.17,942.42 944.42,944.21"> - <request index="0" response="000000000" foes="100010000" cont="0"/> - <request index="1" response="011000000" foes="011110000" cont="0"/> - <request index="2" response="010001000" foes="010001000" cont="0"/> - <request index="3" response="000000000" foes="010000100" cont="0"/> - <request index="4" response="000000011" foes="110000011" cont="0"/> - <request index="5" response="001000010" foes="001000010" cont="0"/> - <request index="6" response="000000000" foes="000100010" cont="0"/> - <request index="7" response="000011000" foes="000011110" cont="0"/> - <request index="8" response="000010001" foes="000010001" cont="0"/> + <junction id="293696356" type="right_before_left" x="942.65" y="938.60" incLanes="26776014#2_0 -52572950#0_0 -26776014#3_0" intLanes=":293696356_0_0 :293696356_1_0 :293696356_2_0 :293696356_3_0 :293696356_4_0" shape="946.26,943.25 948.34,937.10 942.60,933.99 937.78,938.66 938.17,942.42 944.42,944.21"> + <request index="0" response="00000" foes="10000" cont="0"/> + <request index="1" response="01000" foes="01000" cont="0"/> + <request index="2" response="00000" foes="00000" cont="0"/> + <request index="3" response="00000" foes="00010" cont="0"/> + <request index="4" response="00001" foes="00001" cont="0"/> </junction> <junction id="293696357" type="priority" x="923.98" y="996.09" incLanes="7782975#0_0 26776014#4_0 -7782975#1_0" intLanes=":293696357_0_0 :293696357_9_0 :293696357_10_0 :293696357_3_0 :293696357_4_0 :293696357_5_0 :293696357_6_0 :293696357_7_0 :293696357_11_0" shape="926.95,1000.86 929.46,994.87 928.65,992.69 922.53,990.50 920.62,991.39 918.38,997.49"> <request index="0" response="000000000" foes="100010000" cont="0"/> @@ -6336,11 +6021,9 @@ <request index="7" response="000011000" foes="000011110" cont="1"/> <request index="8" response="000010001" foes="000010001" cont="1"/> </junction> - <junction id="293696556" type="priority" x="853.43" y="897.93" incLanes="36943289#3_0 26776026#1_0" intLanes=":293696556_0_0 :293696556_4_0 :293696556_2_0 :293696556_5_0" shape="852.38,901.00 853.47,897.89 854.53,894.87"> - <request index="0" response="0000" foes="1000" cont="0"/> - <request index="1" response="0100" foes="0100" cont="1"/> - <request index="2" response="0000" foes="0010" cont="0"/> - <request index="3" response="0001" foes="0001" cont="1"/> + <junction id="293696556" type="priority" x="853.43" y="897.93" incLanes="36943289#3_0 26776026#1_0" intLanes=":293696556_0_0 :293696556_1_0" shape="852.38,901.00 853.47,897.89 854.53,894.87"> + <request index="0" response="00" foes="00" cont="0"/> + <request index="1" response="00" foes="00" cont="0"/> </junction> <junction id="293696558" type="right_before_left" x="826.88" y="889.10" incLanes="-26776026#1_0 -26776032_0 26776026#0_0" intLanes=":293696558_0_0 :293696558_1_0 :293696558_2_0 :293696558_3_0 :293696558_4_0 :293696558_5_0 :293696558_6_0 :293696558_7_0 :293696558_8_0" shape="830.36,893.68 832.41,887.51 831.46,885.62 825.29,883.57 823.38,884.57 821.40,890.76"> <request index="0" response="000000000" foes="100010000" cont="0"/> @@ -6443,11 +6126,9 @@ <junction id="34677738" type="priority" x="394.65" y="330.17" incLanes="8013387_0" intLanes=":34677738_0_0" shape="394.70,330.18 397.85,330.72 391.45,329.62 394.60,330.16"> <request index="0" response="0" foes="0" cont="0"/> </junction> - <junction id="348042902" type="priority" x="992.30" y="900.74" incLanes="-31281702#0_0 -31288488_0" intLanes=":348042902_0_0 :348042902_1_0 :348042902_2_0 :348042902_3_0" shape="996.41,899.12 990.35,896.78 988.51,903.01"> - <request index="0" response="0000" foes="1000" cont="0"/> - <request index="1" response="0100" foes="0100" cont="0"/> - <request index="2" response="0000" foes="0010" cont="0"/> - <request index="3" response="0001" foes="0001" cont="0"/> + <junction id="348042902" type="priority" x="992.30" y="900.74" incLanes="-31281702#0_0 -31288488_0" intLanes=":348042902_0_0 :348042902_1_0" shape="996.41,899.12 990.35,896.78 988.51,903.01"> + <request index="0" response="00" foes="00" cont="0"/> + <request index="1" response="00" foes="00" cont="0"/> </junction> <junction id="34814866" type="right_before_left" x="979.73" y="400.06" incLanes="-5229164#1_0 -159243113_0 5229164#0_0 165574143_0" intLanes=":34814866_0_0 :34814866_1_0 :34814866_2_0 :34814866_3_0 :34814866_4_0 :34814866_5_0 :34814866_6_0 :34814866_7_0 :34814866_8_0 :34814866_9_0 :34814866_10_0 :34814866_11_0 :34814866_12_0 :34814866_13_0 :34814866_14_0 :34814866_15_0" shape="982.34,405.49 985.76,399.97 984.57,395.72 978.40,393.69 976.65,394.33 973.23,399.85 974.57,403.18 980.40,406.05"> <request index="0" response="0000000000000000" foes="1000010000100000" cont="0"/> @@ -6513,23 +6194,21 @@ <request index="7" response="000011000" foes="000011110" cont="0"/> <request index="8" response="000010001" foes="000010001" cont="0"/> </junction> - <junction id="36854120" type="priority" x="834.57" y="664.35" incLanes="5237597_0 -47328513_0" intLanes=":36854120_0_0 :36854120_1_0 :36854120_2_0 :36854120_3_0" shape="836.94,668.44 838.78,662.21 830.62,666.95 836.94,668.44"> - <request index="0" response="0000" foes="1000" cont="0"/> - <request index="1" response="0100" foes="0100" cont="0"/> - <request index="2" response="0000" foes="0010" cont="0"/> - <request index="3" response="0001" foes="0001" cont="0"/> + <junction id="36854120" type="priority" x="834.57" y="664.35" incLanes="5237597_0 -47328513_0" intLanes=":36854120_0_0 :36854120_1_0" shape="836.94,668.44 838.78,662.21 830.62,666.95 836.94,668.44"> + <request index="0" response="00" foes="00" cont="0"/> + <request index="1" response="00" foes="00" cont="0"/> </junction> <junction id="377939393" type="unregulated" x="1059.89" y="785.30" incLanes="23207363#2_0 23207363#2_1" intLanes="" shape="1060.96,782.23 1058.82,788.37"/> - <junction id="378917495" type="priority" x="801.74" y="360.24" incLanes="-33049407#1_0 33049407#0_0 64797654#3_0 64797654#3_1" intLanes=":378917495_0_0 :378917495_1_0 :378917495_9_0 :378917495_3_0 :378917495_4_0 :378917495_5_0 :378917495_6_0 :378917495_7_0 :378917495_10_0" shape="800.93,363.77 805.02,358.72 802.34,356.67 798.55,361.95"> - <request index="0" response="000000000" foes="111111000" cont="0"/> - <request index="1" response="000000000" foes="010010000" cont="0"/> - <request index="2" response="011011000" foes="011011000" cont="1"/> - <request index="3" response="011000001" foes="011000101" cont="0"/> - <request index="4" response="010000011" foes="010000111" cont="0"/> + <junction id="378917495" type="priority" x="801.74" y="360.24" incLanes="-33049407#1_0 33049407#0_0 64797654#3_0 64797654#3_1" intLanes=":378917495_0_0 :378917495_1_0 :378917495_9_0 :378917495_3_0 :378917495_4_0 :378917495_5_0 :378917495_6_0 :378917495_7_0 :378917495_8_0" shape="800.93,363.77 805.02,358.72 802.34,356.67 798.55,361.95"> + <request index="0" response="000000000" foes="100100000" cont="0"/> + <request index="1" response="011000000" foes="011011000" cont="0"/> + <request index="2" response="001001000" foes="001001000" cont="1"/> + <request index="3" response="011000010" foes="011000110" cont="0"/> + <request index="4" response="010000010" foes="010000010" cont="0"/> <request index="5" response="111000001" foes="111000001" cont="0"/> - <request index="6" response="000000001" foes="000101101" cont="0"/> - <request index="7" response="000000011" foes="000111111" cont="0"/> - <request index="8" response="000000001" foes="000100001" cont="1"/> + <request index="6" response="000000000" foes="000101110" cont="0"/> + <request index="7" response="000000000" foes="000111010" cont="0"/> + <request index="8" response="000000001" foes="000100001" cont="0"/> </junction> <junction id="381910193" type="priority" x="1080.28" y="859.93" incLanes="31281702#1_0" intLanes=":381910193_0_0" shape="1080.26,859.98 1079.26,863.02 1081.30,856.84 1080.30,859.88"> <request index="0" response="0" foes="0" cont="0"/> @@ -6605,17 +6284,13 @@ <junction id="429587907" type="priority" x="907.26" y="967.69" incLanes="-36943292#0_0" intLanes=":429587907_0_0" shape="907.21,967.68 904.14,966.77 910.38,968.61 907.31,967.70"> <request index="0" response="0" foes="0" cont="0"/> </junction> - <junction id="429587908" type="priority" x="915.36" y="945.07" incLanes="-36943290_0 36943292#1_0" intLanes=":429587908_0_0 :429587908_1_0 :429587908_2_0 :429587908_3_0" shape="917.21,941.91 911.71,945.39 917.72,947.86"> - <request index="0" response="0000" foes="1000" cont="0"/> - <request index="1" response="0100" foes="0100" cont="0"/> - <request index="2" response="0000" foes="0010" cont="0"/> - <request index="3" response="0001" foes="0001" cont="0"/> + <junction id="429587908" type="priority" x="915.36" y="945.07" incLanes="-36943290_0 36943292#1_0" intLanes=":429587908_0_0 :429587908_1_0" shape="917.21,941.91 911.71,945.39 917.72,947.86"> + <request index="0" response="00" foes="00" cont="0"/> + <request index="1" response="00" foes="00" cont="0"/> </junction> - <junction id="429587921" type="priority" x="925.99" y="930.21" incLanes="36943296#1_0 37601917_0" intLanes=":429587921_0_0 :429587921_1_0 :429587921_2_0 :429587921_3_0" shape="930.13,928.17 923.99,926.05 921.81,932.17"> - <request index="0" response="0000" foes="1000" cont="0"/> - <request index="1" response="0100" foes="0100" cont="0"/> - <request index="2" response="0000" foes="0010" cont="0"/> - <request index="3" response="0001" foes="0001" cont="0"/> + <junction id="429587921" type="priority" x="925.99" y="930.21" incLanes="36943296#1_0 37601917_0" intLanes=":429587921_0_0 :429587921_1_0" shape="930.13,928.17 923.99,926.05 921.81,932.17"> + <request index="0" response="00" foes="00" cont="0"/> + <request index="1" response="00" foes="00" cont="0"/> </junction> <junction id="429587940" type="priority" x="922.56" y="870.19" incLanes="-36943301_0" intLanes=":429587940_0_0" shape="922.51,870.17 919.49,869.13 925.63,871.25 922.61,870.21"> <request index="0" response="0" foes="0" cont="0"/> @@ -6763,23 +6438,15 @@ <request index="7" response="000011000" foes="000011110" cont="0"/> <request index="8" response="000010001" foes="000010001" cont="0"/> </junction> - <junction id="442839558" type="priority" x="827.59" y="732.85" incLanes="37752125#0_0 -37752126#1_0 37752126#0_0 -37752125#1_0" intLanes=":442839558_0_0 :442839558_1_0 :442839558_2_0 :442839558_3_0 :442839558_4_0 :442839558_5_0 :442839558_6_0 :442839558_16_0 :442839558_8_0 :442839558_9_0 :442839558_17_0 :442839558_18_0 :442839558_12_0 :442839558_13_0 :442839558_14_0 :442839558_15_0" shape="832.95,730.04 826.68,726.75 824.81,727.35 821.43,732.90 825.75,729.83 826.69,736.27 823.99,733.16 830.07,735.47"> - <request index="0" response="0000010000100000" foes="1000010000100000" cont="0"/> - <request index="1" response="0111010001100000" foes="0111110001100000" cont="0"/> - <request index="2" response="0110001101100000" foes="0110001111100000" cont="0"/> - <request index="3" response="0100001000010000" foes="0100001000010000" cont="0"/> - <request index="4" response="0000000000000000" foes="0100001000001000" cont="0"/> - <request index="5" response="0000000000000000" foes="1100011000000111" cont="0"/> - <request index="6" response="0000000000000000" foes="0011111000000110" cont="0"/> - <request index="7" response="0010000100000100" foes="0010000100000100" cont="1"/> - <request index="8" response="0000000000000000" foes="0010000010000100" cont="0"/> - <request index="9" response="0000000001110000" foes="0110000001111100" cont="0"/> - <request index="10" response="0000000001100000" foes="1110000001100011" cont="1"/> - <request index="11" response="0001000001000010" foes="0001000001000010" cont="1"/> - <request index="12" response="0000000001000000" foes="0000100001000010" cont="0"/> - <request index="13" response="0000011101000000" foes="0000011111000110" cont="0"/> - <request index="14" response="0000011000110000" foes="0000011000111110" cont="0"/> - <request index="15" response="0000010000100001" foes="0000010000100001" cont="0"/> + <junction id="442839558" type="priority" x="827.59" y="732.85" incLanes="37752125#0_0 -37752126#1_0 37752126#0_0 -37752125#1_0" intLanes=":442839558_0_0 :442839558_1_0 :442839558_2_0 :442839558_8_0 :442839558_4_0 :442839558_9_0 :442839558_6_0 :442839558_7_0" shape="832.95,730.04 826.68,726.75 824.81,727.35 821.43,732.90 825.75,729.83 826.69,736.27 823.99,733.16 830.07,735.47"> + <request index="0" response="00000000" foes="10000000" cont="0"/> + <request index="1" response="01000000" foes="01000000" cont="0"/> + <request index="2" response="00000000" foes="00100000" cont="0"/> + <request index="3" response="00010000" foes="00010000" cont="1"/> + <request index="4" response="00000000" foes="00001000" cont="0"/> + <request index="5" response="00000100" foes="00000100" cont="1"/> + <request index="6" response="00000000" foes="00000010" cont="0"/> + <request index="7" response="00000001" foes="00000001" cont="0"/> </junction> <junction id="442839576" type="priority" x="826.22" y="733.05" incLanes="-37752126#0_0" intLanes=":442839576_0_0" shape="826.21,733.00 825.75,729.83 826.69,736.27 826.23,733.10"> <request index="0" response="0" foes="0" cont="0"/> @@ -6814,18 +6481,14 @@ <request index="3" response="00000" foes="00001" cont="0"/> <request index="4" response="00000" foes="00001" cont="0"/> </junction> - <junction id="467106195" type="priority" x="430.82" y="461.27" incLanes="27059110#0_0 -27059110#1_0 25363167_0" intLanes=":467106195_0_0 :467106195_1_0 :467106195_2_0 :467106195_3_0 :467106195_4_0 :467106195_5_0 :467106195_6_0 :467106195_7_0 :467106195_8_0" shape="427.77,466.04 434.27,465.76 437.22,459.69 427.69,456.54 426.15,458.05 426.20,464.55"> - <request index="0" response="000000000" foes="100010000" cont="0"/> - <request index="1" response="011000000" foes="011110000" cont="0"/> - <request index="2" response="010001000" foes="010001000" cont="0"/> - <request index="3" response="010000000" foes="010000100" cont="0"/> - <request index="4" response="010000011" foes="110000011" cont="0"/> - <request index="5" response="001000010" foes="001000010" cont="0"/> - <request index="6" response="000000000" foes="000100010" cont="0"/> - <request index="7" response="000000000" foes="000011110" cont="0"/> - <request index="8" response="000010001" foes="000010001" cont="0"/> + <junction id="467106195" type="priority" x="430.82" y="461.27" incLanes="27059110#0_0 -27059110#1_0 25363167_0" intLanes=":467106195_0_0 :467106195_1_0 :467106195_2_0 :467106195_3_0 :467106195_4_0" shape="427.77,466.04 434.27,465.76 437.22,459.69 427.69,456.54 426.15,458.05 426.20,464.55"> + <request index="0" response="00000" foes="01000" cont="0"/> + <request index="1" response="00100" foes="00100" cont="0"/> + <request index="2" response="00000" foes="00010" cont="0"/> + <request index="3" response="00001" foes="00001" cont="0"/> + <request index="4" response="00000" foes="00000" cont="0"/> </junction> - <junction id="480440288" type="priority" x="997.67" y="517.75" incLanes="-33049407#5_0 33049407#4_0 64797654#7_0 64797654#7_1" intLanes=":480440288_0_0 :480440288_1_0 :480440288_9_0 :480440288_3_0 :480440288_4_0 :480440288_5_0 :480440288_6_0 :480440288_7_0 :480440288_10_0" shape="996.94,521.25 1000.80,516.02 998.46,514.26 994.51,519.42"> + <junction id="480440288" type="priority" x="997.67" y="517.75" incLanes="-33049407#5_0 33049407#4_0 64797654#7_0 64797654#7_1" intLanes=":480440288_0_0 :480440288_1_0 :480440288_9_0 :480440288_3_0 :480440288_4_0 :480440288_5_0 :480440288_6_0 :480440288_7_0 :480440288_8_0" shape="996.94,521.25 1000.80,516.02 998.46,514.26 994.51,519.42"> <request index="0" response="000000000" foes="111111000" cont="0"/> <request index="1" response="000000000" foes="010010000" cont="0"/> <request index="2" response="011011000" foes="011011000" cont="1"/> @@ -6834,7 +6497,7 @@ <request index="5" response="111000001" foes="111000001" cont="0"/> <request index="6" response="000000001" foes="000101101" cont="0"/> <request index="7" response="000000011" foes="000111111" cont="0"/> - <request index="8" response="000000001" foes="000100001" cont="1"/> + <request index="8" response="000000001" foes="000100001" cont="0"/> </junction> <junction id="48999821" type="unregulated" x="1467.14" y="2141.25" incLanes="" intLanes="" shape="1468.64,2141.80 1465.64,2140.70"/> <junction id="48999923" type="priority" x="386.72" y="955.40" incLanes="23335805#1_0" intLanes=":48999923_0_0 :48999923_1_0" shape="387.65,957.40 388.56,954.26 385.79,953.38 384.73,956.40"> @@ -6875,7 +6538,7 @@ <request index="0" response="0" foes="0" cont="0"/> </junction> <junction id="59612368" type="unregulated" x="194.32" y="513.08" incLanes="7745716#6_0" intLanes="" shape="194.35,514.68 194.29,511.48"/> - <junction id="59824154" type="priority" x="816.25" y="371.99" incLanes="-33049407#2_0 33049407#1_0 64797654#4_0 64797654#4_1" intLanes=":59824154_0_0 :59824154_1_0 :59824154_9_0 :59824154_3_0 :59824154_4_0 :59824154_5_0 :59824154_6_0 :59824154_7_0 :59824154_10_0" shape="815.37,375.46 819.46,370.41 817.13,368.52 813.04,373.57"> + <junction id="59824154" type="priority" x="816.25" y="371.99" incLanes="-33049407#2_0 33049407#1_0 64797654#4_0 64797654#4_1" intLanes=":59824154_0_0 :59824154_1_0 :59824154_9_0 :59824154_3_0 :59824154_4_0 :59824154_5_0 :59824154_6_0 :59824154_7_0 :59824154_8_0" shape="815.37,375.46 819.46,370.41 817.13,368.52 813.04,373.57"> <request index="0" response="000000000" foes="111111000" cont="0"/> <request index="1" response="000000000" foes="010010000" cont="0"/> <request index="2" response="011011000" foes="011011000" cont="1"/> @@ -6884,18 +6547,18 @@ <request index="5" response="111000001" foes="111000001" cont="0"/> <request index="6" response="000000001" foes="000101101" cont="0"/> <request index="7" response="000000011" foes="000111111" cont="0"/> - <request index="8" response="000000001" foes="000100001" cont="1"/> + <request index="8" response="000000001" foes="000100001" cont="0"/> </junction> - <junction id="59824195" type="priority" x="1024.70" y="537.67" incLanes="-33049407#6_0 33049407#5_0 64797654#8_0 64797654#8_1" intLanes=":59824195_0_0 :59824195_1_0 :59824195_9_0 :59824195_3_0 :59824195_4_0 :59824195_5_0 :59824195_6_0 :59824195_7_0 :59824195_10_0" shape="1024.28,541.27 1027.81,535.81 1025.34,534.10 1021.48,539.34"> - <request index="0" response="000000000" foes="100100000" cont="0"/> - <request index="1" response="011000000" foes="011011000" cont="0"/> - <request index="2" response="001001000" foes="001001000" cont="1"/> - <request index="3" response="011000010" foes="011000110" cont="0"/> - <request index="4" response="010000010" foes="010000010" cont="0"/> + <junction id="59824195" type="priority" x="1024.70" y="537.67" incLanes="-33049407#6_0 33049407#5_0 64797654#8_0 64797654#8_1" intLanes=":59824195_0_0 :59824195_1_0 :59824195_9_0 :59824195_3_0 :59824195_4_0 :59824195_5_0 :59824195_6_0 :59824195_7_0 :59824195_8_0" shape="1024.28,541.27 1027.81,535.81 1025.34,534.10 1021.48,539.34"> + <request index="0" response="000000000" foes="111111000" cont="0"/> + <request index="1" response="000000000" foes="010010000" cont="0"/> + <request index="2" response="011011000" foes="011011000" cont="1"/> + <request index="3" response="011000001" foes="011000101" cont="0"/> + <request index="4" response="010000011" foes="010000111" cont="0"/> <request index="5" response="111000001" foes="111000001" cont="0"/> - <request index="6" response="000000000" foes="000101110" cont="0"/> - <request index="7" response="000000000" foes="000111010" cont="0"/> - <request index="8" response="000000001" foes="000100001" cont="1"/> + <request index="6" response="000000001" foes="000101101" cont="0"/> + <request index="7" response="000000011" foes="000111111" cont="0"/> + <request index="8" response="000000001" foes="000100001" cont="0"/> </junction> <junction id="602783338" type="priority" x="830.61" y="681.14" incLanes="47328513_0" intLanes=":602783338_0_0" shape="830.56,681.13 827.45,680.39 833.77,681.89 830.66,681.15"> <request index="0" response="0" foes="0" cont="0"/> @@ -6921,27 +6584,19 @@ <request index="7" response="000000000" foes="000011110" cont="0"/> <request index="8" response="000010001" foes="000010001" cont="1"/> </junction> - <junction id="622336960" type="priority" x="365.98" y="428.99" incLanes="50005239#0_0 -50005239#1_0 49042723#1_0" intLanes=":622336960_0_0 :622336960_1_0 :622336960_2_0 :622336960_3_0 :622336960_4_0 :622336960_5_0 :622336960_6_0 :622336960_7_0 :622336960_8_0" shape="362.88,433.92 369.38,433.72 369.14,427.35 362.65,427.73 360.98,426.01 361.34,432.50"> - <request index="0" response="000000000" foes="100010000" cont="0"/> - <request index="1" response="011000000" foes="011110000" cont="0"/> - <request index="2" response="010001000" foes="010001000" cont="0"/> - <request index="3" response="010000000" foes="010000100" cont="0"/> - <request index="4" response="010000011" foes="110000011" cont="0"/> - <request index="5" response="001000010" foes="001000010" cont="0"/> - <request index="6" response="000000000" foes="000100010" cont="0"/> - <request index="7" response="000000000" foes="000011110" cont="0"/> - <request index="8" response="000010001" foes="000010001" cont="0"/> + <junction id="622336960" type="priority" x="365.98" y="428.99" incLanes="50005239#0_0 -50005239#1_0 49042723#1_0" intLanes=":622336960_0_0 :622336960_1_0 :622336960_2_0 :622336960_3_0 :622336960_4_0" shape="362.88,433.92 369.38,433.72 369.14,427.35 362.65,427.73 360.98,426.01 361.34,432.50"> + <request index="0" response="00000" foes="01000" cont="0"/> + <request index="1" response="00100" foes="00100" cont="0"/> + <request index="2" response="00000" foes="00010" cont="0"/> + <request index="3" response="00001" foes="00001" cont="0"/> + <request index="4" response="00000" foes="00000" cont="0"/> </junction> - <junction id="622336968" type="priority" x="365.79" y="425.79" incLanes="50005239#1_0 -50005239#2_0 -49042726#0_0" intLanes=":622336968_0_0 :622336968_1_0 :622336968_2_0 :622336968_3_0 :622336968_4_0 :622336968_5_0 :622336968_6_0 :622336968_7_0 :622336968_8_0" shape="362.63,427.48 369.12,427.09 368.74,420.84 362.25,421.24 360.85,422.83 361.23,429.32"> - <request index="0" response="000000000" foes="100010000" cont="0"/> - <request index="1" response="011000000" foes="011110000" cont="0"/> - <request index="2" response="010001000" foes="010001000" cont="0"/> - <request index="3" response="010000000" foes="010000100" cont="0"/> - <request index="4" response="010000011" foes="110000011" cont="0"/> - <request index="5" response="001000010" foes="001000010" cont="0"/> - <request index="6" response="000000000" foes="000100010" cont="0"/> - <request index="7" response="000000000" foes="000011110" cont="0"/> - <request index="8" response="000010001" foes="000010001" cont="0"/> + <junction id="622336968" type="priority" x="365.79" y="425.79" incLanes="50005239#1_0 -50005239#2_0 -49042726#0_0" intLanes=":622336968_0_0 :622336968_1_0 :622336968_2_0 :622336968_3_0 :622336968_4_0" shape="362.63,427.48 369.12,427.09 368.74,420.84 362.25,421.24 360.85,422.83 361.23,429.32"> + <request index="0" response="00000" foes="01000" cont="0"/> + <request index="1" response="00100" foes="00100" cont="0"/> + <request index="2" response="00000" foes="00010" cont="0"/> + <request index="3" response="00001" foes="00001" cont="0"/> + <request index="4" response="00000" foes="00000" cont="0"/> </junction> <junction id="622336972" type="right_before_left" x="343.48" y="427.11" incLanes="49042726#0_0 -49042727_0 -49042726#1_0" intLanes=":622336972_0_0 :622336972_1_0 :622336972_2_0 :622336972_3_0 :622336972_4_0 :622336972_5_0 :622336972_6_0 :622336972_7_0 :622336972_8_0" shape="348.46,430.07 348.08,423.58 346.52,422.17 340.02,422.45 341.77,423.96 342.18,430.45"> <request index="0" response="000000000" foes="100010000" cont="0"/> @@ -7013,23 +6668,15 @@ <request index="2" response="0010" foes="0010" cont="0"/> <request index="3" response="0001" foes="0001" cont="0"/> </junction> - <junction id="667901703" type="priority" x="924.94" y="962.46" incLanes="36943288#0_0 -52572951#1_0 -36943288#1_0 52572951#0_0" intLanes=":667901703_0_0 :667901703_1_0 :667901703_2_0 :667901703_3_0 :667901703_4_0 :667901703_5_0 :667901703_16_0 :667901703_17_0 :667901703_8_0 :667901703_9_0 :667901703_10_0 :667901703_11_0 :667901703_12_0 :667901703_13_0 :667901703_18_0 :667901703_19_0" shape="928.66,967.03 930.60,960.83 929.66,958.96 923.55,956.73 921.57,957.84 919.43,963.98 920.32,966.93 926.78,968.02"> - <request index="0" response="0000000000100000" foes="1000010000100000" cont="0"/> - <request index="1" response="0111000001100000" foes="0111110001100000" cont="0"/> - <request index="2" response="0110001101100000" foes="0110001111100000" cont="0"/> - <request index="3" response="0100001000010000" foes="0100001000010000" cont="0"/> - <request index="4" response="0000000000000000" foes="0100001000001000" cont="0"/> - <request index="5" response="0000000000000000" foes="1100011000000111" cont="0"/> - <request index="6" response="0011000000000000" foes="0011111000000110" cont="1"/> - <request index="7" response="0010000100000100" foes="0010000100000100" cont="1"/> - <request index="8" response="0010000000000000" foes="0010000010000100" cont="0"/> - <request index="9" response="0110000001110000" foes="0110000001111100" cont="0"/> - <request index="10" response="0110000001100011" foes="1110000001100011" cont="0"/> - <request index="11" response="0001000001000010" foes="0001000001000010" cont="0"/> - <request index="12" response="0000000000000000" foes="0000100001000010" cont="0"/> - <request index="13" response="0000000000000000" foes="0000011111000110" cont="0"/> - <request index="14" response="0000000000110000" foes="0000011000111110" cont="1"/> - <request index="15" response="0000010000100001" foes="0000010000100001" cont="1"/> + <junction id="667901703" type="priority" x="924.94" y="962.46" incLanes="36943288#0_0 -52572951#1_0 -36943288#1_0 52572951#0_0" intLanes=":667901703_0_0 :667901703_1_0 :667901703_2_0 :667901703_8_0 :667901703_4_0 :667901703_5_0 :667901703_6_0 :667901703_9_0" shape="928.66,967.03 930.60,960.83 929.66,958.96 923.55,956.73 921.57,957.84 919.43,963.98 920.32,966.93 926.78,968.02"> + <request index="0" response="01000100" foes="01100100" cont="0"/> + <request index="1" response="00010000" foes="00010000" cont="0"/> + <request index="2" response="00000000" foes="10010001" cont="0"/> + <request index="3" response="01000000" foes="01000000" cont="1"/> + <request index="4" response="01000100" foes="01000110" cont="0"/> + <request index="5" response="00000001" foes="00000001" cont="0"/> + <request index="6" response="00000000" foes="00011001" cont="0"/> + <request index="7" response="00000100" foes="00000100" cont="1"/> </junction> <junction id="667901706" type="priority" x="934.08" y="925.48" incLanes="52572950#0_0 -52572950#1_0 52572951#1_0" intLanes=":667901706_0_0 :667901706_1_0 :667901706_2_0 :667901706_3_0 :667901706_4_0 :667901706_5_0 :667901706_6_0 :667901706_7_0 :667901706_8_0" shape="936.29,937.74 944.46,935.80 935.33,921.45 929.28,924.79 928.63,935.75 934.77,938.44"> <request index="0" response="000000000" foes="100010000" cont="0"/> @@ -7042,16 +6689,12 @@ <request index="7" response="000000000" foes="000011110" cont="0"/> <request index="8" response="000010001" foes="000010001" cont="0"/> </junction> - <junction id="667901708" type="priority" x="929.34" y="920.51" incLanes="52572950#1_0 36943296#0_0 -36943296#1_0" intLanes=":667901708_0_0 :667901708_1_0 :667901708_2_0 :667901708_3_0 :667901708_4_0 :667901708_9_0 :667901708_6_0 :667901708_10_0 :667901708_11_0" shape="931.22,927.02 936.13,922.43 933.46,918.00 927.22,916.18 924.17,925.54 930.31,927.66"> - <request index="0" response="000010000" foes="100010000" cont="0"/> - <request index="1" response="011010000" foes="011110000" cont="0"/> - <request index="2" response="010001000" foes="010001000" cont="0"/> - <request index="3" response="000000000" foes="010000100" cont="0"/> - <request index="4" response="000000000" foes="110000011" cont="0"/> - <request index="5" response="001000010" foes="001000010" cont="1"/> - <request index="6" response="000000000" foes="000100010" cont="0"/> - <request index="7" response="000011000" foes="000011110" cont="1"/> - <request index="8" response="000010001" foes="000010001" cont="1"/> + <junction id="667901708" type="priority" x="929.34" y="920.51" incLanes="52572950#1_0 36943296#0_0 -36943296#1_0" intLanes=":667901708_0_0 :667901708_1_0 :667901708_5_0 :667901708_3_0 :667901708_6_0" shape="931.22,927.02 936.13,922.43 933.46,918.00 927.22,916.18 924.17,925.54 930.31,927.66"> + <request index="0" response="00000" foes="00000" cont="0"/> + <request index="1" response="00000" foes="10000" cont="0"/> + <request index="2" response="01000" foes="01000" cont="1"/> + <request index="3" response="00000" foes="00100" cont="0"/> + <request index="4" response="00010" foes="00010" cont="1"/> </junction> <junction id="667901709" type="priority" x="914.71" y="992.68" incLanes="7782975#1_0 -52572951#0_0 -7782975#2_0" intLanes=":667901709_0_0 :667901709_9_0 :667901709_10_0 :667901709_3_0 :667901709_4_0 :667901709_5_0 :667901709_6_0 :667901709_7_0 :667901709_11_0" shape="918.11,997.39 920.35,991.29 919.49,989.38 913.44,987.01 911.39,988.15 909.33,994.31"> <request index="0" response="000000000" foes="100010000" cont="0"/> @@ -7083,9 +6726,9 @@ <request index="7" response="000011000" foes="000011110" cont="0"/> <request index="8" response="000010001" foes="000010001" cont="0"/> </junction> - <junction id="765703076" type="priority" x="731.91" y="1399.58" incLanes="23335805#0_0 61284120_0" intLanes=":765703076_0_0 :765703076_2_0" shape="731.38,1401.70 734.06,1399.97 732.49,1397.47 729.78,1399.23"> + <junction id="765703076" type="priority" x="731.91" y="1399.58" incLanes="23335805#0_0 61284120_0" intLanes=":765703076_0_0 :765703076_1_0" shape="731.38,1401.70 734.06,1399.97 732.49,1397.47 729.78,1399.23"> <request index="0" response="00" foes="10" cont="0"/> - <request index="1" response="01" foes="01" cont="1"/> + <request index="1" response="01" foes="01" cont="0"/> </junction> <junction id="765703090" type="priority" x="546.88" y="998.44" incLanes="-61284122_0 58149866#1_0" intLanes=":765703090_0_0 :765703090_4_0 :765703090_2_0 :765703090_5_0" shape="551.37,998.65 546.88,993.95 542.39,998.66"> <request index="0" response="0000" foes="1000" cont="0"/> @@ -7120,16 +6763,12 @@ <request index="7" response="000011000" foes="000011110" cont="0"/> <request index="8" response="000010001" foes="000010001" cont="0"/> </junction> - <junction id="853135516" type="priority" x="364.29" y="531.80" incLanes="-26384275#2_0 26384275#1_0 71763552_0" intLanes=":853135516_0_0 :853135516_1_0 :853135516_2_0 :853135516_3_0 :853135516_4_0 :853135516_5_0 :853135516_6_0 :853135516_7_0 :853135516_8_0" shape="361.18,536.79 367.67,536.61 367.38,527.07 360.89,527.29 359.17,528.91 359.64,535.40"> - <request index="0" response="000000000" foes="100010000" cont="0"/> - <request index="1" response="011000000" foes="011110000" cont="0"/> - <request index="2" response="010001000" foes="010001000" cont="0"/> - <request index="3" response="010000000" foes="010000100" cont="0"/> - <request index="4" response="010000011" foes="110000011" cont="0"/> - <request index="5" response="001000010" foes="001000010" cont="0"/> - <request index="6" response="000000000" foes="000100010" cont="0"/> - <request index="7" response="000000000" foes="000011110" cont="0"/> - <request index="8" response="000010001" foes="000010001" cont="0"/> + <junction id="853135516" type="priority" x="364.29" y="531.80" incLanes="-26384275#2_0 26384275#1_0 71763552_0" intLanes=":853135516_0_0 :853135516_1_0 :853135516_2_0 :853135516_3_0 :853135516_4_0" shape="361.18,536.79 367.67,536.61 367.38,527.07 360.89,527.29 359.17,528.91 359.64,535.40"> + <request index="0" response="00000" foes="01000" cont="0"/> + <request index="1" response="00100" foes="00100" cont="0"/> + <request index="2" response="00000" foes="00010" cont="0"/> + <request index="3" response="00001" foes="00001" cont="0"/> + <request index="4" response="00000" foes="00000" cont="0"/> </junction> <junction id="979119480" type="priority" x="634.36" y="360.44" incLanes="177688392_0" intLanes=":979119480_0_0" shape="634.41,360.45 637.52,361.19 631.20,359.69 634.31,360.43"> <request index="0" response="0" foes="0" cont="0"/> @@ -7262,8 +6901,6 @@ <junction id=":1424270250_9_0" type="internal" x="792.45" y="933.08" incLanes=":1424270250_1_0 38167738#0_0" intLanes=":1424270250_4_0 :1424270250_5_0 :1424270250_6_0 :1424270250_7_0"/> <junction id=":1424270250_10_0" type="internal" x="795.38" y="929.68" incLanes=":1424270250_2_0 129013950_0 38167738#0_0" intLanes=":1424270250_3_0 :1424270250_7_0"/> <junction id=":1424270250_11_0" type="internal" x="793.35" y="935.61" incLanes=":1424270250_8_0 -38167738#1_0 129013950_0" intLanes=":1424270250_0_0 :1424270250_4_0"/> - <junction id=":1424270251_9_0" type="internal" x="732.76" y="913.18" incLanes=":1424270251_5_0 -26562389#2_0 26562389#1_0" intLanes=":1424270251_1_0 :1424270251_6_0"/> - <junction id=":1424270251_10_0" type="internal" x="727.82" y="916.40" incLanes=":1424270251_8_0 -129013950_0 26562389#1_0" intLanes=":1424270251_0_0 :1424270251_4_0"/> <junction id=":1424274807_9_0" type="internal" x="844.87" y="779.82" incLanes=":1424274807_5_0 -129014453_0 38167738#6_0" intLanes=":1424274807_1_0 :1424274807_6_0"/> <junction id=":1424274807_10_0" type="internal" x="845.82" y="782.25" incLanes=":1424274807_7_0 -38167738#7_0" intLanes=":1424274807_1_0 :1424274807_2_0 :1424274807_3_0 :1424274807_4_0"/> <junction id=":1424274807_11_0" type="internal" x="841.96" y="783.44" incLanes=":1424274807_8_0 -129014453_0 -38167738#7_0" intLanes=":1424274807_0_0 :1424274807_4_0"/> @@ -7274,7 +6911,6 @@ <junction id=":1476473564_10_0" type="internal" x="575.35" y="832.34" incLanes=":1476473564_2_0 -134220302_0 -8034799#1_0" intLanes=":1476473564_3_0 :1476473564_7_0"/> <junction id=":1476473564_11_0" type="internal" x="573.07" y="826.09" incLanes=":1476473564_8_0 -134220302_0 8034799#0_0" intLanes=":1476473564_0_0 :1476473564_4_0"/> <junction id=":1771199559_16_0" type="internal" x="940.25" y="472.74" incLanes=":1771199559_3_0 -165574143_0 33049407#2_0 64797654#5_0 64797654#5_1" intLanes=":1771199559_4_0 :1771199559_5_0 :1771199559_9_0 :1771199559_10_0 :1771199559_13_0 :1771199559_14_0"/> - <junction id=":1771199559_17_0" type="internal" x="933.21" y="469.03" incLanes=":1771199559_15_0 -165574143_0 -33049407#3_0" intLanes=":1771199559_0_0 :1771199559_6_0 :1771199559_11_0"/> <junction id=":1835408176_9_0" type="internal" x="566.23" y="801.74" incLanes=":1835408176_1_0 -8034799#3_0" intLanes=":1835408176_4_0 :1835408176_5_0 :1835408176_6_0 :1835408176_7_0"/> <junction id=":1835408176_10_0" type="internal" x="565.33" y="805.85" incLanes=":1835408176_2_0 -25952467_0 -8034799#3_0" intLanes=":1835408176_3_0 :1835408176_7_0"/> <junction id=":1835408176_11_0" type="internal" x="564.00" y="800.16" incLanes=":1835408176_8_0 -25952467_0 8034799#2_0" intLanes=":1835408176_0_0 :1835408176_4_0"/> @@ -7289,17 +6925,14 @@ <junction id=":264778809_10_0" type="internal" x="542.86" y="474.88" incLanes=":264778809_2_0 -24396404_0 33070760#2_0" intLanes=":264778809_3_0 :264778809_7_0"/> <junction id=":264778809_11_0" type="internal" x="542.44" y="468.66" incLanes=":264778809_8_0 -24396404_0 -33070760#3_0" intLanes=":264778809_0_0 :264778809_4_0"/> <junction id=":266777507_9_0" type="internal" x="1134.87" y="608.71" incLanes=":266777507_2_0 33049407#6_0 64797654#9_0 64797654#9_1" intLanes=":266777507_3_0 :266777507_4_0 :266777507_6_0 :266777507_7_0"/> - <junction id=":266777507_10_0" type="internal" x="1132.85" y="609.36" incLanes=":266777507_8_0 -33049407#7_0" intLanes=":266777507_0_0 :266777507_5_0"/> <junction id=":269964106_16_0" type="internal" x="785.41" y="953.34" incLanes=":269964106_6_0 25068137_0" intLanes=":269964106_1_0 :269964106_2_0 :269964106_9_0 :269964106_10_0 :269964106_11_0 :269964106_12_0 :269964106_13_0"/> <junction id=":269964106_17_0" type="internal" x="788.72" y="948.68" incLanes=":269964106_7_0 -7782975#3_0 25068137_0 7782975#2_0" intLanes=":269964106_2_0 :269964106_8_0 :269964106_13_0"/> <junction id=":269964106_18_0" type="internal" x="789.39" y="951.77" incLanes=":269964106_14_0 -38167738#0_0" intLanes=":269964106_1_0 :269964106_2_0 :269964106_3_0 :269964106_4_0 :269964106_5_0 :269964106_9_0 :269964106_10_0"/> <junction id=":269964106_19_0" type="internal" x="786.22" y="956.26" incLanes=":269964106_15_0 -38167738#0_0 -7782975#3_0 7782975#2_0" intLanes=":269964106_0_0 :269964106_5_0 :269964106_10_0"/> <junction id=":269964113_17_0" type="internal" x="953.02" y="483.57" incLanes=":269964113_3_0 33049407#3_0 38167741#5_0 64797654#6_0 64797654#6_1" intLanes=":269964113_4_0 :269964113_5_0 :269964113_8_0 :269964113_9_0 :269964113_9_1 :269964113_14_0 :269964113_15_0"/> - <junction id=":269964113_18_0" type="internal" x="945.85" y="479.84" incLanes=":269964113_12_0 -33049407#4_0 38167741#5_0" intLanes=":269964113_1_0 :269964113_7_0 :269964113_13_0"/> - <junction id=":27557127_6_0" type="internal" x="785.10" y="348.28" incLanes=":27557127_2_0 64797654#2_0 64797654#2_1" intLanes=":27557127_3_0 :27557127_5_0"/> - <junction id=":277697625_9_0" type="internal" x="337.71" y="453.04" incLanes=":277697625_1_0 -25485133#1_0" intLanes=":277697625_4_0 :277697625_5_0 :277697625_6_0 :277697625_7_0"/> - <junction id=":277697625_10_0" type="internal" x="340.60" y="451.94" incLanes=":277697625_2_0 -25485133#1_0 -49042724_0" intLanes=":277697625_3_0 :277697625_7_0"/> - <junction id=":277697625_11_0" type="internal" x="337.16" y="455.26" incLanes=":277697625_8_0 -49042724_0 25485133#0_0" intLanes=":277697625_0_0 :277697625_4_0"/> + <junction id=":27557127_6_0" type="internal" x="785.10" y="348.28" incLanes=":27557127_2_0 64797654#2_0" intLanes=":27557127_3_0"/> + <junction id=":277697625_5_0" type="internal" x="340.60" y="451.94" incLanes=":277697625_1_0 -25485133#1_0" intLanes=":277697625_3_0"/> + <junction id=":277697625_6_0" type="internal" x="337.16" y="455.26" incLanes=":277697625_4_0 25485133#0_0" intLanes=":277697625_0_0"/> <junction id=":277697633_9_0" type="internal" x="367.11" y="400.62" incLanes=":277697633_5_0 -5088373#2_0 50005239#2_0" intLanes=":277697633_1_0 :277697633_6_0"/> <junction id=":277697633_10_0" type="internal" x="365.31" y="402.42" incLanes=":277697633_7_0 5088373#1_0" intLanes=":277697633_1_0 :277697633_2_0 :277697633_3_0 :277697633_4_0"/> <junction id=":277697633_11_0" type="internal" x="361.14" y="401.28" incLanes=":277697633_8_0 50005239#2_0 5088373#1_0" intLanes=":277697633_0_0 :277697633_4_0"/> @@ -7315,18 +6948,14 @@ <junction id=":293695864_9_0" type="internal" x="844.04" y="787.79" incLanes=":293695864_5_0 -26775981#0_0 38167738#5_0" intLanes=":293695864_1_0 :293695864_6_0"/> <junction id=":293695864_10_0" type="internal" x="843.96" y="787.96" incLanes=":293695864_7_0 -38167738#6_0" intLanes=":293695864_1_0 :293695864_2_0 :293695864_3_0 :293695864_4_0"/> <junction id=":293695864_11_0" type="internal" x="841.11" y="791.39" incLanes=":293695864_8_0 -26775981#0_0 -38167738#6_0" intLanes=":293695864_0_0 :293695864_4_0"/> - <junction id=":293695883_9_0" type="internal" x="1008.19" y="850.86" incLanes=":293695883_2_0 -31281702#1_0 26775981#3_0" intLanes=":293695883_3_0 :293695883_7_0"/> - <junction id=":293695883_10_0" type="internal" x="1010.68" y="846.36" incLanes=":293695883_5_0 26775981#3_0 31281702#0_0" intLanes=":293695883_1_0 :293695883_6_0"/> - <junction id=":293696007_4_0" type="internal" x="853.02" y="839.91" incLanes=":293696007_1_0 -49844607_0" intLanes=":293696007_2_0"/> - <junction id=":293696007_5_0" type="internal" x="854.05" y="836.77" incLanes=":293696007_3_0 26775984_0" intLanes=":293696007_0_0"/> + <junction id=":293695883_5_0" type="internal" x="1008.19" y="850.86" incLanes=":293695883_1_0 -31281702#1_0" intLanes=":293695883_2_0"/> + <junction id=":293695883_6_0" type="internal" x="1010.68" y="846.36" incLanes=":293695883_3_0 31281702#0_0" intLanes=":293695883_0_0"/> <junction id=":293696357_9_0" type="internal" x="923.54" y="994.26" incLanes=":293696357_1_0 -7782975#1_0" intLanes=":293696357_4_0 :293696357_5_0 :293696357_6_0 :293696357_7_0"/> <junction id=":293696357_10_0" type="internal" x="926.68" y="997.23" incLanes=":293696357_2_0 -7782975#1_0 26776014#4_0" intLanes=":293696357_3_0 :293696357_7_0"/> <junction id=":293696357_11_0" type="internal" x="921.05" y="995.01" incLanes=":293696357_8_0 26776014#4_0 7782975#0_0" intLanes=":293696357_0_0 :293696357_4_0"/> <junction id=":293696530_9_0" type="internal" x="811.53" y="880.87" incLanes=":293696530_5_0 -26776026#0_0 38167738#2_0" intLanes=":293696530_1_0 :293696530_6_0"/> <junction id=":293696530_10_0" type="internal" x="812.45" y="883.36" incLanes=":293696530_7_0 -38167738#3_0" intLanes=":293696530_1_0 :293696530_2_0 :293696530_3_0 :293696530_4_0"/> <junction id=":293696530_11_0" type="internal" x="809.55" y="886.78" incLanes=":293696530_8_0 -26776026#0_0 -38167738#3_0" intLanes=":293696530_0_0 :293696530_4_0"/> - <junction id=":293696556_4_0" type="internal" x="851.87" y="897.38" incLanes=":293696556_1_0 26776026#1_0" intLanes=":293696556_2_0"/> - <junction id=":293696556_5_0" type="internal" x="855.01" y="898.48" incLanes=":293696556_3_0 36943289#3_0" intLanes=":293696556_0_0"/> <junction id=":34677659_9_0" type="internal" x="555.37" y="772.93" incLanes=":34677659_2_0 -24038534#0_0 -8034799#4_0" intLanes=":34677659_3_0 :34677659_7_0"/> <junction id=":34677659_10_0" type="internal" x="553.54" y="771.11" incLanes=":34677659_4_0 8034799#3_0" intLanes=":34677659_0_0 :34677659_1_0 :34677659_7_0 :34677659_8_0"/> <junction id=":34677659_11_0" type="internal" x="554.26" y="767.58" incLanes=":34677659_5_0 -24038534#0_0 8034799#3_0" intLanes=":34677659_1_0 :34677659_6_0"/> @@ -7341,8 +6970,7 @@ <junction id=":36854115_9_0" type="internal" x="877.49" y="678.13" incLanes=":36854115_1_0 38167741#1_0" intLanes=":36854115_4_0 :36854115_5_0 :36854115_6_0 :36854115_7_0"/> <junction id=":36854115_10_0" type="internal" x="880.35" y="674.77" incLanes=":36854115_2_0 -5237597_0 38167741#1_0" intLanes=":36854115_3_0 :36854115_7_0"/> <junction id=":36854115_11_0" type="internal" x="878.38" y="680.63" incLanes=":36854115_8_0 -38167741#2_0 -5237597_0" intLanes=":36854115_0_0 :36854115_4_0"/> - <junction id=":378917495_9_0" type="internal" x="801.70" y="360.20" incLanes=":378917495_2_0 33049407#0_0 64797654#3_0 64797654#3_1" intLanes=":378917495_3_0 :378917495_4_0 :378917495_6_0 :378917495_7_0"/> - <junction id=":378917495_10_0" type="internal" x="799.48" y="360.65" incLanes=":378917495_8_0 -33049407#1_0" intLanes=":378917495_0_0 :378917495_5_0"/> + <junction id=":378917495_9_0" type="internal" x="801.70" y="360.20" incLanes=":378917495_2_0 33049407#0_0 64797654#3_0" intLanes=":378917495_3_0 :378917495_6_0"/> <junction id=":429587901_4_0" type="internal" x="913.51" y="934.57" incLanes=":429587901_1_0 38306209_0" intLanes=":429587901_2_0"/> <junction id=":429587901_5_0" type="internal" x="913.89" y="932.29" incLanes=":429587901_3_0 -36943289#0_0" intLanes=":429587901_0_0"/> <junction id=":436828486_9_0" type="internal" x="859.55" y="908.82" incLanes=":436828486_2_0 -36943289#2_0 -37399605_0" intLanes=":436828486_3_0 :436828486_7_0"/> @@ -7354,23 +6982,19 @@ <junction id=":440696682_9_0" type="internal" x="825.44" y="839.97" incLanes=":440696682_5_0 -37593790#0_0 38167738#3_0" intLanes=":440696682_1_0 :440696682_6_0"/> <junction id=":440696682_10_0" type="internal" x="826.34" y="842.45" incLanes=":440696682_7_0 -38167738#4_0" intLanes=":440696682_1_0 :440696682_2_0 :440696682_3_0 :440696682_4_0"/> <junction id=":440696682_11_0" type="internal" x="823.51" y="845.80" incLanes=":440696682_8_0 -37593790#0_0 -38167738#4_0" intLanes=":440696682_0_0 :440696682_4_0"/> - <junction id=":442839558_16_0" type="internal" x="827.90" y="730.31" incLanes=":442839558_7_0 -37752125#1_0 37752125#0_0 37752126#0_0" intLanes=":442839558_2_0 :442839558_8_0 :442839558_13_0"/> - <junction id=":442839558_17_0" type="internal" x="828.33" y="732.74" incLanes=":442839558_10_0 -37752126#1_0" intLanes=":442839558_0_0 :442839558_1_0 :442839558_5_0 :442839558_6_0 :442839558_13_0 :442839558_14_0 :442839558_15_0"/> - <junction id=":442839558_18_0" type="internal" x="826.01" y="730.74" incLanes=":442839558_11_0 -37752125#1_0 -37752126#1_0 37752125#0_0" intLanes=":442839558_1_0 :442839558_6_0 :442839558_12_0"/> + <junction id=":442839558_8_0" type="internal" x="827.90" y="730.31" incLanes=":442839558_3_0 37752126#0_0" intLanes=":442839558_4_0"/> + <junction id=":442839558_9_0" type="internal" x="826.01" y="730.74" incLanes=":442839558_5_0 -37752126#1_0" intLanes=":442839558_2_0"/> <junction id=":450519041_4_0" type="internal" x="859.65" y="853.49" incLanes=":450519041_1_0 37593790#1_0" intLanes=":450519041_2_0"/> <junction id=":450519041_5_0" type="internal" x="862.80" y="854.50" incLanes=":450519041_3_0 -38227185_0" intLanes=":450519041_0_0"/> <junction id=":467011002_9_0" type="internal" x="551.70" y="660.65" incLanes=":467011002_1_0 -8034799#6_0" intLanes=":467011002_4_0 :467011002_5_0 :467011002_6_0 :467011002_7_0"/> <junction id=":467011002_10_0" type="internal" x="550.20" y="664.88" incLanes=":467011002_2_0 -39085064_0 -8034799#6_0" intLanes=":467011002_3_0 :467011002_7_0"/> <junction id=":467011002_11_0" type="internal" x="549.97" y="658.65" incLanes=":467011002_8_0 -39085064_0 8034799#5_0" intLanes=":467011002_0_0 :467011002_4_0"/> <junction id=":480440288_9_0" type="internal" x="997.54" y="517.66" incLanes=":480440288_2_0 33049407#4_0 64797654#7_0 64797654#7_1" intLanes=":480440288_3_0 :480440288_4_0 :480440288_6_0 :480440288_7_0"/> - <junction id=":480440288_10_0" type="internal" x="995.48" y="518.15" incLanes=":480440288_8_0 -33049407#5_0" intLanes=":480440288_0_0 :480440288_5_0"/> <junction id=":564631546_9_0" type="internal" x="636.71" y="962.49" incLanes=":564631546_1_0 -108892340#1_0" intLanes=":564631546_4_0 :564631546_5_0 :564631546_6_0 :564631546_7_0"/> <junction id=":564631546_10_0" type="internal" x="636.70" y="966.95" incLanes=":564631546_2_0 -108892340#1_0 -44419041_0" intLanes=":564631546_3_0 :564631546_7_0"/> <junction id=":564631546_11_0" type="internal" x="634.43" y="961.21" incLanes=":564631546_8_0 -44419041_0 108892340#0_0" intLanes=":564631546_0_0 :564631546_4_0"/> <junction id=":59824154_9_0" type="internal" x="816.13" y="371.90" incLanes=":59824154_2_0 33049407#1_0 64797654#4_0 64797654#4_1" intLanes=":59824154_3_0 :59824154_4_0 :59824154_6_0 :59824154_7_0"/> - <junction id=":59824154_10_0" type="internal" x="814.05" y="372.33" incLanes=":59824154_8_0 -33049407#2_0" intLanes=":59824154_0_0 :59824154_5_0"/> - <junction id=":59824195_9_0" type="internal" x="1024.66" y="537.64" incLanes=":59824195_2_0 33049407#5_0 64797654#8_0" intLanes=":59824195_3_0 :59824195_6_0"/> - <junction id=":59824195_10_0" type="internal" x="1022.43" y="538.05" incLanes=":59824195_8_0 -33049407#6_0" intLanes=":59824195_0_0 :59824195_5_0"/> + <junction id=":59824195_9_0" type="internal" x="1024.66" y="537.64" incLanes=":59824195_2_0 33049407#5_0 64797654#8_0 64797654#8_1" intLanes=":59824195_3_0 :59824195_4_0 :59824195_6_0 :59824195_7_0"/> <junction id=":622336943_4_0" type="internal" x="333.39" y="448.79" incLanes=":622336943_1_0 -49042723#0_0" intLanes=":622336943_2_0"/> <junction id=":622336943_5_0" type="internal" x="334.81" y="450.25" incLanes=":622336943_3_0 49042724_0" intLanes=":622336943_0_0"/> <junction id=":622336955_9_0" type="internal" x="341.69" y="429.54" incLanes=":622336955_2_0 49042723#0_0 49042728_0" intLanes=":622336955_3_0 :622336955_7_0"/> @@ -7385,17 +7009,13 @@ <junction id=":622336999_11_0" type="internal" x="338.89" y="403.08" incLanes=":622336999_8_0 49042727_0 5088373#2_0" intLanes=":622336999_0_0 :622336999_4_0"/> <junction id=":634580663_4_0" type="internal" x="381.75" y="507.35" incLanes=":634580663_2_0 7745716#3_0" intLanes=":634580663_0_0 :634580663_1_0"/> <junction id=":634580663_5_0" type="internal" x="381.31" y="506.46" incLanes=":634580663_3_0 7745716#3_0" intLanes=":634580663_1_0"/> - <junction id=":667901703_16_0" type="internal" x="923.29" y="962.96" incLanes=":667901703_6_0 52572951#0_0" intLanes=":667901703_1_0 :667901703_2_0 :667901703_9_0 :667901703_10_0 :667901703_11_0 :667901703_12_0 :667901703_13_0"/> - <junction id=":667901703_17_0" type="internal" x="926.04" y="959.40" incLanes=":667901703_7_0 -36943288#1_0 36943288#0_0 52572951#0_0" intLanes=":667901703_2_0 :667901703_8_0 :667901703_13_0"/> - <junction id=":667901703_18_0" type="internal" x="927.00" y="962.04" incLanes=":667901703_14_0 -52572951#1_0" intLanes=":667901703_1_0 :667901703_2_0 :667901703_3_0 :667901703_4_0 :667901703_5_0 :667901703_9_0 :667901703_10_0"/> - <junction id=":667901703_19_0" type="internal" x="923.83" y="965.83" incLanes=":667901703_15_0 -36943288#1_0 -52572951#1_0 36943288#0_0" intLanes=":667901703_0_0 :667901703_5_0 :667901703_10_0"/> - <junction id=":667901708_9_0" type="internal" x="929.88" y="918.67" incLanes=":667901708_5_0 -36943296#1_0 52572950#1_0" intLanes=":667901708_1_0 :667901708_6_0"/> - <junction id=":667901708_10_0" type="internal" x="931.41" y="919.28" incLanes=":667901708_7_0 36943296#0_0" intLanes=":667901708_1_0 :667901708_2_0 :667901708_3_0 :667901708_4_0"/> - <junction id=":667901708_11_0" type="internal" x="927.78" y="925.04" incLanes=":667901708_8_0 36943296#0_0 52572950#1_0" intLanes=":667901708_0_0 :667901708_4_0"/> + <junction id=":667901703_8_0" type="internal" x="926.04" y="959.40" incLanes=":667901703_3_0 52572951#0_0" intLanes=":667901703_6_0"/> + <junction id=":667901703_9_0" type="internal" x="923.83" y="965.83" incLanes=":667901703_7_0 -52572951#1_0" intLanes=":667901703_2_0"/> + <junction id=":667901708_5_0" type="internal" x="929.88" y="918.67" incLanes=":667901708_2_0 -36943296#1_0" intLanes=":667901708_3_0"/> + <junction id=":667901708_6_0" type="internal" x="927.78" y="925.04" incLanes=":667901708_4_0 36943296#0_0" intLanes=":667901708_1_0"/> <junction id=":667901709_9_0" type="internal" x="914.36" y="990.89" incLanes=":667901709_1_0 -7782975#2_0" intLanes=":667901709_4_0 :667901709_5_0 :667901709_6_0 :667901709_7_0"/> <junction id=":667901709_10_0" type="internal" x="917.68" y="993.77" incLanes=":667901709_2_0 -52572951#0_0 -7782975#2_0" intLanes=":667901709_3_0 :667901709_7_0"/> <junction id=":667901709_11_0" type="internal" x="911.92" y="991.75" incLanes=":667901709_8_0 -52572951#0_0 7782975#1_0" intLanes=":667901709_0_0 :667901709_4_0"/> - <junction id=":765703076_2_0" type="internal" x="731.13" y="1398.35" incLanes=":765703076_1_0 23335805#0_0" intLanes=":765703076_0_0"/> <junction id=":765703090_4_0" type="internal" x="547.93" y="997.44" incLanes=":765703090_1_0 58149866#1_0" intLanes=":765703090_2_0"/> <junction id=":765703090_5_0" type="internal" x="545.83" y="997.44" incLanes=":765703090_3_0 -61284122_0" intLanes=":765703090_0_0"/> <junction id=":806390749_4_0" type="internal" x="300.59" y="595.80" incLanes=":806390749_1_0 -26384237#2_0" intLanes=":806390749_2_0"/> @@ -7447,18 +7067,15 @@ <connection from="-121069898#0" to="-103268088#0" fromLane="0" toLane="0" via=":1356135515_3_0" dir="r" state="="/> <connection from="-121069898#0" to="103268088#1" fromLane="0" toLane="0" via=":1356135515_4_0" dir="l" state="="/> <connection from="-121069898#0" to="121069898#0" fromLane="0" toLane="0" via=":1356135515_5_0" dir="t" state="="/> - <connection from="-121069898#1" to="-121069898#0" fromLane="0" toLane="0" via=":1356135516_3_0" dir="s" state="m"/> - <connection from="-121069898#1" to="-121069900" fromLane="0" toLane="0" via=":1356135516_4_0" dir="l" state="m"/> - <connection from="-121069898#1" to="121069898#1" fromLane="0" toLane="0" via=":1356135516_5_0" dir="t" state="m"/> + <connection from="-121069898#1" to="-121069898#0" fromLane="0" toLane="0" via=":1356135516_2_0" dir="s" state="m"/> + <connection from="-121069898#1" to="121069898#1" fromLane="0" toLane="0" via=":1356135516_3_0" dir="t" state="m"/> <connection from="-121069900" to="-206498911#2" fromLane="0" toLane="0" via=":1356135514_3_0" dir="r" state="m"/> <connection from="-121069900" to="206498911#3" fromLane="0" toLane="0" via=":1356135514_4_0" dir="l" state="m"/> <connection from="-121069900" to="121069900" fromLane="0" toLane="0" via=":1356135514_5_0" dir="t" state="m"/> <connection from="-122351619" to="-8034799#4" fromLane="0" toLane="0" via=":1367507447_3_0" dir="r" state="m"/> <connection from="-122351619" to="8034799#5" fromLane="0" toLane="0" via=":1367507447_4_0" dir="l" state="m"/> <connection from="-122351619" to="122351619" fromLane="0" toLane="0" via=":1367507447_5_0" dir="t" state="m"/> - <connection from="-129013950" to="-26562389#1" fromLane="0" toLane="0" via=":1424270251_3_0" dir="r" state="M"/> - <connection from="-129013950" to="26562389#2" fromLane="0" toLane="0" via=":1424270251_4_0" dir="s" state="M"/> - <connection from="-129013950" to="129013950" fromLane="0" toLane="0" via=":1424270251_5_0" dir="t" state="m"/> + <connection from="-129013950" to="129013950" fromLane="0" toLane="0" via=":1424270251_2_0" dir="t" state="m"/> <connection from="-129014453" to="-38167738#6" fromLane="0" toLane="0" via=":1424274807_0_0" dir="r" state="m"/> <connection from="-129014453" to="38167738#7" fromLane="0" toLane="0" via=":1424274807_1_0" dir="l" state="m"/> <connection from="-129014453" to="129014453" fromLane="0" toLane="0" via=":1424274807_2_0" dir="t" state="m"/> @@ -7536,12 +7153,10 @@ <connection from="-25485133#0" to="50005239#0" fromLane="0" toLane="0" via=":277697623_6_0" dir="r" state="="/> <connection from="-25485133#0" to="-25485133#2" fromLane="0" toLane="0" via=":277697623_7_0" dir="s" state="="/> <connection from="-25485133#0" to="25485133#0" fromLane="0" toLane="0" via=":277697623_8_0" dir="t" state="="/> - <connection from="-25485133#1" to="49042724" fromLane="0" toLane="0" via=":277697625_6_0" dir="r" state="M"/> - <connection from="-25485133#1" to="-25485133#0" fromLane="0" toLane="0" via=":277697625_7_0" dir="s" state="M"/> - <connection from="-25485133#1" to="25485133#1" fromLane="0" toLane="0" via=":277697625_8_0" dir="t" state="m"/> - <connection from="-25485133#2" to="-49047248" fromLane="0" toLane="0" via=":277697630_3_0" dir="r" state="M"/> - <connection from="-25485133#2" to="-25485133#1" fromLane="0" toLane="0" via=":277697630_4_0" dir="s" state="m"/> - <connection from="-25485133#2" to="25485133#2" fromLane="0" toLane="0" via=":277697630_5_0" dir="t" state="m"/> + <connection from="-25485133#1" to="-25485133#0" fromLane="0" toLane="0" via=":277697625_3_0" dir="s" state="M"/> + <connection from="-25485133#1" to="25485133#1" fromLane="0" toLane="0" via=":277697625_4_0" dir="t" state="m"/> + <connection from="-25485133#2" to="-25485133#1" fromLane="0" toLane="0" via=":277697630_1_0" dir="s" state="m"/> + <connection from="-25485133#2" to="25485133#2" fromLane="0" toLane="0" via=":277697630_2_0" dir="t" state="m"/> <connection from="-25952467" to="-8034799#2" fromLane="0" toLane="0" via=":1835408176_3_0" dir="r" state="m"/> <connection from="-25952467" to="8034799#3" fromLane="0" toLane="0" via=":1835408176_4_0" dir="l" state="m"/> <connection from="-25952467" to="25952467" fromLane="0" toLane="0" via=":1835408176_5_0" dir="t" state="m"/> @@ -7554,12 +7169,10 @@ <connection from="-26384237#2" to="26384237#2" fromLane="0" toLane="0" via=":806390749_3_0" dir="t" state="m"/> <connection from="-26384275#0" to="7745716#6" fromLane="0" toLane="0" via=":289047648_0_0" dir="r" state="m"/> <connection from="-26384275#0" to="26384275#0" fromLane="0" toLane="0" via=":289047648_1_0" dir="t" state="m"/> - <connection from="-26384275#1" to="-179093197" fromLane="0" toLane="0" via=":1894312954_0_0" dir="r" state="M"/> - <connection from="-26384275#1" to="-26384275#0" fromLane="0" toLane="0" via=":1894312954_1_0" dir="s" state="m"/> - <connection from="-26384275#1" to="26384275#1" fromLane="0" toLane="0" via=":1894312954_2_0" dir="t" state="m"/> - <connection from="-26384275#2" to="-71763552" fromLane="0" toLane="0" via=":853135516_0_0" dir="r" state="M"/> - <connection from="-26384275#2" to="-26384275#1" fromLane="0" toLane="0" via=":853135516_1_0" dir="s" state="m"/> - <connection from="-26384275#2" to="26384275#2" fromLane="0" toLane="0" via=":853135516_2_0" dir="t" state="m"/> + <connection from="-26384275#1" to="-26384275#0" fromLane="0" toLane="0" via=":1894312954_0_0" dir="s" state="m"/> + <connection from="-26384275#1" to="26384275#1" fromLane="0" toLane="0" via=":1894312954_1_0" dir="t" state="m"/> + <connection from="-26384275#2" to="-26384275#1" fromLane="0" toLane="0" via=":853135516_0_0" dir="s" state="m"/> + <connection from="-26384275#2" to="26384275#2" fromLane="0" toLane="0" via=":853135516_1_0" dir="t" state="m"/> <connection from="-26384298" to="24038534#1" fromLane="0" toLane="0" via=":260700545_6_0" dir="r" state="="/> <connection from="-26384298" to="-24038534#0" fromLane="0" toLane="0" via=":260700545_7_0" dir="l" state="="/> <connection from="-26384298" to="26384298" fromLane="0" toLane="0" via=":260700545_8_0" dir="t" state="="/> @@ -7569,9 +7182,8 @@ <connection from="-26562389#1" to="37601918" fromLane="0" toLane="0" via=":440765481_6_0" dir="r" state="="/> <connection from="-26562389#1" to="-26562389#0" fromLane="0" toLane="0" via=":440765481_7_0" dir="s" state="="/> <connection from="-26562389#1" to="26562389#1" fromLane="0" toLane="0" via=":440765481_8_0" dir="t" state="="/> - <connection from="-26562389#2" to="129013950" fromLane="0" toLane="0" via=":1424270251_6_0" dir="s" state="M"/> - <connection from="-26562389#2" to="-26562389#1" fromLane="0" toLane="0" via=":1424270251_7_0" dir="s" state="m"/> - <connection from="-26562389#2" to="26562389#2" fromLane="0" toLane="0" via=":1424270251_8_0" dir="t" state="m"/> + <connection from="-26562389#2" to="-26562389#1" fromLane="0" toLane="0" via=":1424270251_3_0" dir="s" state="m"/> + <connection from="-26562389#2" to="26562389#2" fromLane="0" toLane="0" via=":1424270251_4_0" dir="t" state="m"/> <connection from="-26562389#3" to="26562391#0" fromLane="0" toLane="0" via=":291185195_6_0" dir="r" state="="/> <connection from="-26562389#3" to="-26562389#2" fromLane="0" toLane="0" via=":291185195_7_0" dir="s" state="="/> <connection from="-26562389#3" to="26562389#3" fromLane="0" toLane="0" via=":291185195_8_0" dir="t" state="="/> @@ -7623,9 +7235,8 @@ <connection from="-26776014#2" to="-26776014#1" fromLane="0" toLane="0" via=":293696354_6_0" dir="r" state="="/> <connection from="-26776014#2" to="-31288488" fromLane="0" toLane="0" via=":293696354_7_0" dir="s" state="="/> <connection from="-26776014#2" to="26776014#2" fromLane="0" toLane="0" via=":293696354_8_0" dir="t" state="="/> - <connection from="-26776014#3" to="52572950#0" fromLane="0" toLane="0" via=":293696356_6_0" dir="r" state="="/> - <connection from="-26776014#3" to="-26776014#2" fromLane="0" toLane="0" via=":293696356_7_0" dir="l" state="="/> - <connection from="-26776014#3" to="26776014#3" fromLane="0" toLane="0" via=":293696356_8_0" dir="t" state="="/> + <connection from="-26776014#3" to="-26776014#2" fromLane="0" toLane="0" via=":293696356_3_0" dir="l" state="="/> + <connection from="-26776014#3" to="26776014#3" fromLane="0" toLane="0" via=":293696356_4_0" dir="t" state="="/> <connection from="-26776014#4" to="36943288#0" fromLane="0" toLane="0" via=":429587898_6_0" dir="r" state="="/> <connection from="-26776014#4" to="-26776014#3" fromLane="0" toLane="0" via=":429587898_7_0" dir="s" state="="/> <connection from="-26776014#4" to="26776014#4" fromLane="0" toLane="0" via=":429587898_8_0" dir="t" state="="/> @@ -7642,22 +7253,18 @@ <connection from="-27059094" to="27059094" fromLane="0" toLane="0" via=":634580664_3_0" dir="t" state="m"/> <connection from="-27059110#0" to="7745716#3" fromLane="0" toLane="0" via=":270703391_2_0" dir="l" state="m"/> <connection from="-27059110#0" to="27059110#0" fromLane="0" toLane="0" via=":270703391_3_0" dir="t" state="m"/> - <connection from="-27059110#1" to="-27059110#0" fromLane="0" toLane="0" via=":467106195_3_0" dir="s" state="m"/> - <connection from="-27059110#1" to="-25363167" fromLane="0" toLane="0" via=":467106195_4_0" dir="l" state="m"/> - <connection from="-27059110#1" to="27059110#1" fromLane="0" toLane="0" via=":467106195_5_0" dir="t" state="m"/> + <connection from="-27059110#1" to="-27059110#0" fromLane="0" toLane="0" via=":467106195_2_0" dir="s" state="m"/> + <connection from="-27059110#1" to="27059110#1" fromLane="0" toLane="0" via=":467106195_3_0" dir="t" state="m"/> <connection from="-30738461" to="30738461" fromLane="0" toLane="0" via=":339975562_0_0" dir="t" state="M"/> - <connection from="-31281702#0" to="31288488" fromLane="0" toLane="0" via=":348042902_0_0" dir="l" state="M"/> - <connection from="-31281702#0" to="31281702#0" fromLane="0" toLane="0" via=":348042902_1_0" dir="t" state="m"/> - <connection from="-31281702#1" to="-31281702#0" fromLane="0" toLane="0" via=":293695883_3_0" dir="r" state="M"/> - <connection from="-31281702#1" to="-26775981#3" fromLane="0" toLane="0" via=":293695883_4_0" dir="s" state="m"/> - <connection from="-31281702#1" to="31281702#1" fromLane="0" toLane="0" via=":293695883_5_0" dir="t" state="m"/> - <connection from="-31288488" to="31281702#0" fromLane="0" toLane="0" via=":348042902_2_0" dir="r" state="M"/> - <connection from="-31288488" to="31288488" fromLane="0" toLane="0" via=":348042902_3_0" dir="t" state="m"/> - <connection from="-33049407#0" to="33049438#0" fromLane="0" toLane="1" via=":27557127_0_0" dir="R" state="M"/> - <connection from="-33049407#0" to="64797654#3" fromLane="0" toLane="1" via=":27557127_1_0" dir="L" state="m"/> + <connection from="-31281702#0" to="31281702#0" fromLane="0" toLane="0" via=":348042902_0_0" dir="t" state="m"/> + <connection from="-31281702#1" to="-31281702#0" fromLane="0" toLane="0" via=":293695883_2_0" dir="r" state="M"/> + <connection from="-31281702#1" to="31281702#1" fromLane="0" toLane="0" via=":293695883_3_0" dir="t" state="m"/> + <connection from="-31288488" to="31288488" fromLane="0" toLane="0" via=":348042902_1_0" dir="t" state="m"/> + <connection from="-33049407#0" to="33049438#0" fromLane="0" toLane="0" via=":27557127_0_0" dir="r" state="M"/> + <connection from="-33049407#0" to="64797654#3" fromLane="0" toLane="1" via=":27557127_1_0" dir="l" state="m"/> <connection from="-33049407#0" to="33049407#0" fromLane="0" toLane="0" via=":27557127_2_0" dir="t" state="m"/> <connection from="-33049407#1" to="-33049407#0" fromLane="0" toLane="0" via=":378917495_0_0" dir="s" state="M"/> - <connection from="-33049407#1" to="64797654#4" fromLane="0" toLane="0" via=":378917495_1_0" dir="L" state="M"/> + <connection from="-33049407#1" to="64797654#4" fromLane="0" toLane="1" via=":378917495_1_0" dir="l" state="m"/> <connection from="-33049407#1" to="33049407#1" fromLane="0" toLane="0" via=":378917495_2_0" dir="t" state="m"/> <connection from="-33049407#2" to="-33049407#1" fromLane="0" toLane="0" via=":59824154_0_0" dir="s" state="M"/> <connection from="-33049407#2" to="64797654#5" fromLane="0" toLane="0" via=":59824154_1_0" dir="L" state="M"/> @@ -7674,7 +7281,7 @@ <connection from="-33049407#5" to="64797654#8" fromLane="0" toLane="0" via=":480440288_1_0" dir="L" state="M"/> <connection from="-33049407#5" to="33049407#5" fromLane="0" toLane="0" via=":480440288_2_0" dir="t" state="m"/> <connection from="-33049407#6" to="-33049407#5" fromLane="0" toLane="0" via=":59824195_0_0" dir="s" state="M"/> - <connection from="-33049407#6" to="64797654#9" fromLane="0" toLane="1" via=":59824195_1_0" dir="l" state="m"/> + <connection from="-33049407#6" to="64797654#9" fromLane="0" toLane="0" via=":59824195_1_0" dir="L" state="M"/> <connection from="-33049407#6" to="33049407#6" fromLane="0" toLane="0" via=":59824195_2_0" dir="t" state="m"/> <connection from="-33049407#7" to="-33049407#6" fromLane="0" toLane="0" via=":266777507_0_0" dir="s" state="M"/> <connection from="-33049407#7" to="64797654#10" fromLane="0" toLane="0" via=":266777507_1_0" dir="L" state="M"/> @@ -7693,10 +7300,8 @@ <connection from="-36943288#0" to="-26776014#3" fromLane="0" toLane="0" via=":429587898_3_0" dir="r" state="="/> <connection from="-36943288#0" to="26776014#4" fromLane="0" toLane="0" via=":429587898_4_0" dir="l" state="="/> <connection from="-36943288#0" to="36943288#0" fromLane="0" toLane="0" via=":429587898_5_0" dir="t" state="="/> - <connection from="-36943288#1" to="52572951#1" fromLane="0" toLane="0" via=":667901703_8_0" dir="r" state="m"/> - <connection from="-36943288#1" to="-36943288#0" fromLane="0" toLane="0" via=":667901703_9_0" dir="s" state="m"/> - <connection from="-36943288#1" to="-52572951#0" fromLane="0" toLane="0" via=":667901703_10_0" dir="l" state="m"/> - <connection from="-36943288#1" to="36943288#1" fromLane="0" toLane="0" via=":667901703_11_0" dir="t" state="m"/> + <connection from="-36943288#1" to="-36943288#0" fromLane="0" toLane="0" via=":667901703_4_0" dir="s" state="m"/> + <connection from="-36943288#1" to="36943288#1" fromLane="0" toLane="0" via=":667901703_5_0" dir="t" state="m"/> <connection from="-36943289#0" to="-38306209" fromLane="0" toLane="0" via=":429587901_0_0" dir="s" state="M"/> <connection from="-36943289#0" to="36943289#0" fromLane="0" toLane="0" via=":429587901_1_0" dir="t" state="m"/> <connection from="-36943289#1" to="37601917" fromLane="0" toLane="0" via=":429587902_3_0" dir="s" state="="/> @@ -7708,8 +7313,7 @@ <connection from="-36943289#3" to="-36943289#2" fromLane="0" toLane="0" via=":429587903_3_0" dir="r" state="="/> <connection from="-36943289#3" to="37399606" fromLane="0" toLane="0" via=":429587903_4_0" dir="l" state="="/> <connection from="-36943289#3" to="36943289#3" fromLane="0" toLane="0" via=":429587903_5_0" dir="t" state="="/> - <connection from="-36943290" to="-36943292#1" fromLane="0" toLane="0" via=":429587908_0_0" dir="l" state="M"/> - <connection from="-36943290" to="36943290" fromLane="0" toLane="0" via=":429587908_1_0" dir="t" state="m"/> + <connection from="-36943290" to="36943290" fromLane="0" toLane="0" via=":429587908_0_0" dir="t" state="m"/> <connection from="-36943292#0" to="36943292#0" fromLane="0" toLane="0" via=":429587907_0_0" dir="t" state="M"/> <connection from="-36943292#1" to="-36943288#1" fromLane="0" toLane="0" via=":429587900_3_0" dir="r" state="="/> <connection from="-36943292#1" to="-36943292#0" fromLane="0" toLane="0" via=":429587900_4_0" dir="s" state="="/> @@ -7717,9 +7321,8 @@ <connection from="-36943296#0" to="-26776014#0" fromLane="0" toLane="0" via=":293696352_6_0" dir="s" state="="/> <connection from="-36943296#0" to="26776014#1" fromLane="0" toLane="0" via=":293696352_7_0" dir="l" state="="/> <connection from="-36943296#0" to="36943296#0" fromLane="0" toLane="0" via=":293696352_8_0" dir="t" state="="/> - <connection from="-36943296#1" to="-36943296#0" fromLane="0" toLane="0" via=":667901708_6_0" dir="s" state="M"/> - <connection from="-36943296#1" to="-52572950#1" fromLane="0" toLane="0" via=":667901708_7_0" dir="l" state="m"/> - <connection from="-36943296#1" to="36943296#1" fromLane="0" toLane="0" via=":667901708_8_0" dir="t" state="m"/> + <connection from="-36943296#1" to="-36943296#0" fromLane="0" toLane="0" via=":667901708_3_0" dir="s" state="M"/> + <connection from="-36943296#1" to="36943296#1" fromLane="0" toLane="0" via=":667901708_4_0" dir="t" state="m"/> <connection from="-36943301" to="36943301" fromLane="0" toLane="0" via=":429587940_0_0" dir="t" state="M"/> <connection from="-37399604#0" to="-38167738#1" fromLane="0" toLane="0" via=":436828502_0_0" dir="r" state="m"/> <connection from="-37399604#0" to="38167738#2" fromLane="0" toLane="0" via=":436828502_1_0" dir="l" state="m"/> @@ -7757,15 +7360,11 @@ <connection from="-37752125#0" to="26562404#2" fromLane="0" toLane="0" via=":442839529_3_0" dir="r" state="="/> <connection from="-37752125#0" to="-26562404#1" fromLane="0" toLane="0" via=":442839529_4_0" dir="l" state="="/> <connection from="-37752125#0" to="37752125#0" fromLane="0" toLane="0" via=":442839529_5_0" dir="t" state="="/> - <connection from="-37752125#1" to="-37752126#0" fromLane="0" toLane="0" via=":442839558_12_0" dir="r" state="m"/> - <connection from="-37752125#1" to="37752126#1" fromLane="0" toLane="0" via=":442839558_13_0" dir="R" state="m"/> - <connection from="-37752125#1" to="-37752125#0" fromLane="0" toLane="0" via=":442839558_14_0" dir="s" state="m"/> - <connection from="-37752125#1" to="37752125#1" fromLane="0" toLane="0" via=":442839558_15_0" dir="t" state="m"/> + <connection from="-37752125#1" to="-37752125#0" fromLane="0" toLane="0" via=":442839558_6_0" dir="s" state="m"/> + <connection from="-37752125#1" to="37752125#1" fromLane="0" toLane="0" via=":442839558_7_0" dir="t" state="m"/> <connection from="-37752126#0" to="37752126#0" fromLane="0" toLane="0" via=":442839576_0_0" dir="t" state="M"/> - <connection from="-37752126#1" to="-37752125#0" fromLane="0" toLane="0" via=":442839558_4_0" dir="r" state="M"/> - <connection from="-37752126#1" to="37752125#1" fromLane="0" toLane="0" via=":442839558_5_0" dir="L" state="M"/> - <connection from="-37752126#1" to="-37752126#0" fromLane="0" toLane="0" via=":442839558_6_0" dir="l" state="M"/> - <connection from="-37752126#1" to="37752126#1" fromLane="0" toLane="0" via=":442839558_7_0" dir="t" state="m"/> + <connection from="-37752126#1" to="-37752126#0" fromLane="0" toLane="0" via=":442839558_2_0" dir="l" state="M"/> + <connection from="-37752126#1" to="37752126#1" fromLane="0" toLane="0" via=":442839558_3_0" dir="t" state="m"/> <connection from="-38167738#0" to="-7782975#2" fromLane="0" toLane="0" via=":269964106_4_0" dir="r" state="M"/> <connection from="-38167738#0" to="-25068137" fromLane="0" toLane="0" via=":269964106_5_0" dir="s" state="M"/> <connection from="-38167738#0" to="7782975#3" fromLane="0" toLane="0" via=":269964106_6_0" dir="l" state="m"/> @@ -7823,19 +7422,14 @@ <connection from="-44419041" to="-108892340#0" fromLane="0" toLane="0" via=":564631546_3_0" dir="r" state="m"/> <connection from="-44419041" to="108892340#1" fromLane="0" toLane="0" via=":564631546_4_0" dir="l" state="m"/> <connection from="-44419041" to="44419041" fromLane="0" toLane="0" via=":564631546_5_0" dir="t" state="m"/> - <connection from="-47328513" to="-5237597" fromLane="0" toLane="0" via=":36854120_2_0" dir="l" state="M"/> - <connection from="-47328513" to="47328513" fromLane="0" toLane="0" via=":36854120_3_0" dir="t" state="m"/> + <connection from="-47328513" to="47328513" fromLane="0" toLane="0" via=":36854120_1_0" dir="t" state="m"/> <connection from="-49042723#0" to="-49042724" fromLane="0" toLane="0" via=":622336943_2_0" dir="s" state="M"/> <connection from="-49042723#0" to="49042723#0" fromLane="0" toLane="0" via=":622336943_3_0" dir="t" state="m"/> <connection from="-49042723#1" to="-49042723#0" fromLane="0" toLane="0" via=":622336955_0_0" dir="s" state="M"/> <connection from="-49042723#1" to="-49042728" fromLane="0" toLane="0" via=":622336955_1_0" dir="l" state="m"/> <connection from="-49042723#1" to="49042723#1" fromLane="0" toLane="0" via=":622336955_2_0" dir="t" state="m"/> - <connection from="-49042724" to="-25485133#0" fromLane="0" toLane="0" via=":277697625_3_0" dir="r" state="m"/> - <connection from="-49042724" to="25485133#1" fromLane="0" toLane="0" via=":277697625_4_0" dir="l" state="m"/> - <connection from="-49042724" to="49042724" fromLane="0" toLane="0" via=":277697625_5_0" dir="t" state="m"/> - <connection from="-49042726#0" to="50005239#2" fromLane="0" toLane="0" via=":622336968_6_0" dir="r" state="M"/> - <connection from="-49042726#0" to="-50005239#1" fromLane="0" toLane="0" via=":622336968_7_0" dir="l" state="M"/> - <connection from="-49042726#0" to="49042726#0" fromLane="0" toLane="0" via=":622336968_8_0" dir="t" state="m"/> + <connection from="-49042724" to="49042724" fromLane="0" toLane="0" via=":277697625_2_0" dir="t" state="m"/> + <connection from="-49042726#0" to="49042726#0" fromLane="0" toLane="0" via=":622336968_4_0" dir="t" state="m"/> <connection from="-49042726#1" to="49042727" fromLane="0" toLane="0" via=":622336972_6_0" dir="r" state="="/> <connection from="-49042726#1" to="-49042726#0" fromLane="0" toLane="0" via=":622336972_7_0" dir="s" state="="/> <connection from="-49042726#1" to="49042726#1" fromLane="0" toLane="0" via=":622336972_8_0" dir="t" state="="/> @@ -7852,17 +7446,14 @@ <connection from="-49047248" to="25363167" fromLane="0" toLane="0" via=":cluster_270703615_622360014_9_0" dir="s" state="="/> <connection from="-49047248" to="5563258#2" fromLane="0" toLane="0" via=":cluster_270703615_622360014_10_0" dir="l" state="="/> <connection from="-49047248" to="49047248" fromLane="0" toLane="0" via=":cluster_270703615_622360014_11_0" dir="t" state="="/> - <connection from="-49844607" to="-26775984" fromLane="0" toLane="0" via=":293696007_2_0" dir="s" state="M"/> - <connection from="-49844607" to="49844607" fromLane="0" toLane="0" via=":293696007_3_0" dir="t" state="m"/> + <connection from="-49844607" to="49844607" fromLane="0" toLane="0" via=":293696007_1_0" dir="t" state="m"/> <connection from="-50005239#0" to="-25485133#2" fromLane="0" toLane="0" via=":277697623_3_0" dir="r" state="="/> <connection from="-50005239#0" to="25485133#0" fromLane="0" toLane="0" via=":277697623_4_0" dir="l" state="="/> <connection from="-50005239#0" to="50005239#0" fromLane="0" toLane="0" via=":277697623_5_0" dir="t" state="="/> - <connection from="-50005239#1" to="-50005239#0" fromLane="0" toLane="0" via=":622336960_3_0" dir="s" state="m"/> - <connection from="-50005239#1" to="-49042723#1" fromLane="0" toLane="0" via=":622336960_4_0" dir="l" state="m"/> - <connection from="-50005239#1" to="50005239#1" fromLane="0" toLane="0" via=":622336960_5_0" dir="t" state="m"/> - <connection from="-50005239#2" to="-50005239#1" fromLane="0" toLane="0" via=":622336968_3_0" dir="s" state="m"/> - <connection from="-50005239#2" to="49042726#0" fromLane="0" toLane="0" via=":622336968_4_0" dir="l" state="m"/> - <connection from="-50005239#2" to="50005239#2" fromLane="0" toLane="0" via=":622336968_5_0" dir="t" state="m"/> + <connection from="-50005239#1" to="-50005239#0" fromLane="0" toLane="0" via=":622336960_2_0" dir="s" state="m"/> + <connection from="-50005239#1" to="50005239#1" fromLane="0" toLane="0" via=":622336960_3_0" dir="t" state="m"/> + <connection from="-50005239#2" to="-50005239#1" fromLane="0" toLane="0" via=":622336968_2_0" dir="s" state="m"/> + <connection from="-50005239#2" to="50005239#2" fromLane="0" toLane="0" via=":622336968_3_0" dir="t" state="m"/> <connection from="-5088373#0" to="-33070760#0" fromLane="0" toLane="0" via=":34677711_12_0" dir="r" state="m"/> <connection from="-5088373#0" to="24038475#0" fromLane="0" toLane="0" via=":34677711_13_0" dir="s" state="m"/> <connection from="-5088373#0" to="33070760#1" fromLane="0" toLane="0" via=":34677711_14_0" dir="l" state="m"/> @@ -7890,19 +7481,15 @@ <connection from="-5237597" to="38167741#2" fromLane="0" toLane="0" via=":36854115_3_0" dir="r" state="m"/> <connection from="-5237597" to="-38167741#1" fromLane="0" toLane="0" via=":36854115_4_0" dir="l" state="m"/> <connection from="-5237597" to="5237597" fromLane="0" toLane="0" via=":36854115_5_0" dir="t" state="m"/> - <connection from="-52572950#0" to="-26776014#2" fromLane="0" toLane="0" via=":293696356_3_0" dir="s" state="="/> - <connection from="-52572950#0" to="26776014#3" fromLane="0" toLane="0" via=":293696356_4_0" dir="l" state="="/> - <connection from="-52572950#0" to="52572950#0" fromLane="0" toLane="0" via=":293696356_5_0" dir="t" state="="/> + <connection from="-52572950#0" to="52572950#0" fromLane="0" toLane="0" via=":293696356_2_0" dir="t" state="="/> <connection from="-52572950#1" to="-52572950#0" fromLane="0" toLane="0" via=":667901706_3_0" dir="s" state="m"/> <connection from="-52572950#1" to="-52572951#1" fromLane="0" toLane="0" via=":667901706_4_0" dir="l" state="m"/> <connection from="-52572950#1" to="52572950#1" fromLane="0" toLane="0" via=":667901706_5_0" dir="t" state="m"/> <connection from="-52572951#0" to="-7782975#1" fromLane="0" toLane="0" via=":667901709_3_0" dir="r" state="m"/> <connection from="-52572951#0" to="7782975#2" fromLane="0" toLane="0" via=":667901709_4_0" dir="l" state="m"/> <connection from="-52572951#0" to="52572951#0" fromLane="0" toLane="0" via=":667901709_5_0" dir="t" state="m"/> - <connection from="-52572951#1" to="-36943288#0" fromLane="0" toLane="0" via=":667901703_4_0" dir="r" state="M"/> - <connection from="-52572951#1" to="-52572951#0" fromLane="0" toLane="0" via=":667901703_5_0" dir="s" state="M"/> - <connection from="-52572951#1" to="36943288#1" fromLane="0" toLane="0" via=":667901703_6_0" dir="l" state="m"/> - <connection from="-52572951#1" to="52572951#1" fromLane="0" toLane="0" via=":667901703_7_0" dir="t" state="m"/> + <connection from="-52572951#1" to="-52572951#0" fromLane="0" toLane="0" via=":667901703_2_0" dir="s" state="M"/> + <connection from="-52572951#1" to="52572951#1" fromLane="0" toLane="0" via=":667901703_3_0" dir="t" state="m"/> <connection from="-5563258#0" to="5088373#1" fromLane="0" toLane="0" via=":34677731_0_0" dir="r" state="M"/> <connection from="-5563258#0" to="8013387" fromLane="0" toLane="0" via=":34677731_1_0" dir="s" state="M"/> <connection from="-5563258#0" to="-5088373#0" fromLane="0" toLane="0" via=":34677731_2_0" dir="l" state="m"/> @@ -7992,13 +7579,10 @@ <connection from="121068763" to="-121068763" fromLane="0" toLane="0" via=":1356130769_1_0" dir="t" state="m"/> <connection from="121068764" to="-121068764" fromLane="0" toLane="0" via=":1356130749_0_0" dir="t" state="M"/> <connection from="121068765" to="-121068765" fromLane="0" toLane="0" via=":1356130726_0_0" dir="t" state="M"/> - <connection from="121069898#0" to="-121069900" fromLane="0" toLane="0" via=":1356135516_0_0" dir="r" state="M"/> - <connection from="121069898#0" to="121069898#1" fromLane="0" toLane="0" via=":1356135516_1_0" dir="s" state="m"/> - <connection from="121069898#0" to="-121069898#0" fromLane="0" toLane="0" via=":1356135516_2_0" dir="t" state="m"/> + <connection from="121069898#0" to="121069898#1" fromLane="0" toLane="0" via=":1356135516_0_0" dir="s" state="m"/> + <connection from="121069898#0" to="-121069898#0" fromLane="0" toLane="0" via=":1356135516_1_0" dir="t" state="m"/> <connection from="121069898#1" to="-121069898#1" fromLane="0" toLane="0" via=":1356135510_0_0" dir="t" state="M"/> - <connection from="121069900" to="121069898#1" fromLane="0" toLane="0" via=":1356135516_6_0" dir="r" state="M"/> - <connection from="121069900" to="-121069898#0" fromLane="0" toLane="0" via=":1356135516_7_0" dir="l" state="M"/> - <connection from="121069900" to="-121069900" fromLane="0" toLane="0" via=":1356135516_8_0" dir="t" state="m"/> + <connection from="121069900" to="-121069900" fromLane="0" toLane="0" via=":1356135516_4_0" dir="t" state="m"/> <connection from="122351619" to="-122351619" fromLane="0" toLane="0" via=":1367507446_0_0" dir="t" state="M"/> <connection from="129013950" to="38167738#1" fromLane="0" toLane="0" via=":1424270250_3_0" dir="r" state="m"/> <connection from="129013950" to="-38167738#0" fromLane="0" toLane="0" via=":1424270250_4_0" dir="l" state="m"/> @@ -8034,9 +7618,7 @@ <connection from="177688397" to="-24038475#0" fromLane="0" toLane="0" via=":260700116_1_0" dir="s" state="="/> <connection from="177688397" to="177688392" fromLane="0" toLane="0" via=":260700116_2_0" dir="l" state="="/> <connection from="177688397" to="-177688397" fromLane="0" toLane="0" via=":260700116_3_0" dir="t" state="="/> - <connection from="179093197" to="-26384275#0" fromLane="0" toLane="0" via=":1894312954_6_0" dir="r" state="M"/> - <connection from="179093197" to="26384275#1" fromLane="0" toLane="0" via=":1894312954_7_0" dir="l" state="M"/> - <connection from="179093197" to="-179093197" fromLane="0" toLane="0" via=":1894312954_8_0" dir="t" state="m"/> + <connection from="179093197" to="-179093197" fromLane="0" toLane="0" via=":1894312954_4_0" dir="t" state="m"/> <connection from="206498903" to="-108892340#1" fromLane="0" toLane="0" via=":26155586_2_0" dir="s" state="M"/> <connection from="206498903" to="4314834#0" fromLane="1" toLane="1" via=":26155586_3_0" dir="t" state="M"/> <connection from="206498911#0" to="-22959383" fromLane="0" toLane="0" via=":247378385_3_0" dir="r" state="M"/> @@ -8112,16 +7694,12 @@ <connection from="25363135#2" to="-8034799#6" fromLane="0" toLane="0" via=":cluster_26153656_34673725_10_0" dir="s" state="m"/> <connection from="25363135#2" to="30425847#1" fromLane="0" toLane="1" via=":cluster_26153656_34673725_11_0" dir="l" state="m"/> <connection from="25363135#2" to="-25363135#2" fromLane="0" toLane="0" via=":cluster_26153656_34673725_12_0" dir="t" state="m"/> - <connection from="25363167" to="27059110#1" fromLane="0" toLane="0" via=":467106195_6_0" dir="r" state="M"/> - <connection from="25363167" to="-27059110#0" fromLane="0" toLane="0" via=":467106195_7_0" dir="l" state="M"/> - <connection from="25363167" to="-25363167" fromLane="0" toLane="0" via=":467106195_8_0" dir="t" state="m"/> + <connection from="25363167" to="-25363167" fromLane="0" toLane="0" via=":467106195_4_0" dir="t" state="m"/> <connection from="25446022" to="-25446022" fromLane="0" toLane="0" via=":277310886_0_0" dir="t" state="M"/> <connection from="25485133#0" to="25485133#1" fromLane="0" toLane="0" via=":277697625_0_0" dir="s" state="M"/> - <connection from="25485133#0" to="49042724" fromLane="0" toLane="0" via=":277697625_1_0" dir="l" state="m"/> - <connection from="25485133#0" to="-25485133#0" fromLane="0" toLane="0" via=":277697625_2_0" dir="t" state="m"/> - <connection from="25485133#1" to="25485133#2" fromLane="0" toLane="0" via=":277697630_6_0" dir="s" state="m"/> - <connection from="25485133#1" to="-49047248" fromLane="0" toLane="0" via=":277697630_7_0" dir="l" state="m"/> - <connection from="25485133#1" to="-25485133#1" fromLane="0" toLane="0" via=":277697630_8_0" dir="t" state="m"/> + <connection from="25485133#0" to="-25485133#0" fromLane="0" toLane="0" via=":277697625_1_0" dir="t" state="m"/> + <connection from="25485133#1" to="25485133#2" fromLane="0" toLane="0" via=":277697630_3_0" dir="s" state="m"/> + <connection from="25485133#1" to="-25485133#1" fromLane="0" toLane="0" via=":277697630_4_0" dir="t" state="m"/> <connection from="25485133#2" to="25485133#0" fromLane="0" toLane="0" via=":277697623_0_0" dir="s" state="="/> <connection from="25485133#2" to="50005239#0" fromLane="0" toLane="0" via=":277697623_1_0" dir="l" state="="/> <connection from="25485133#2" to="-25485133#2" fromLane="0" toLane="0" via=":277697623_2_0" dir="t" state="="/> @@ -8135,12 +7713,10 @@ <connection from="26384237#2" to="-26384237#0" fromLane="0" toLane="0" via=":289047549_0_0" dir="r" state="="/> <connection from="26384237#2" to="26384237#1" fromLane="0" toLane="0" via=":289047549_1_0" dir="l" state="="/> <connection from="26384237#2" to="-26384237#2" fromLane="0" toLane="0" via=":289047549_2_0" dir="t" state="="/> - <connection from="26384275#0" to="26384275#1" fromLane="0" toLane="0" via=":1894312954_3_0" dir="s" state="m"/> - <connection from="26384275#0" to="-179093197" fromLane="0" toLane="0" via=":1894312954_4_0" dir="l" state="m"/> - <connection from="26384275#0" to="-26384275#0" fromLane="0" toLane="0" via=":1894312954_5_0" dir="t" state="m"/> - <connection from="26384275#1" to="26384275#2" fromLane="0" toLane="0" via=":853135516_3_0" dir="s" state="m"/> - <connection from="26384275#1" to="-71763552" fromLane="0" toLane="0" via=":853135516_4_0" dir="l" state="m"/> - <connection from="26384275#1" to="-26384275#1" fromLane="0" toLane="0" via=":853135516_5_0" dir="t" state="m"/> + <connection from="26384275#0" to="26384275#1" fromLane="0" toLane="0" via=":1894312954_2_0" dir="s" state="m"/> + <connection from="26384275#0" to="-26384275#0" fromLane="0" toLane="0" via=":1894312954_3_0" dir="t" state="m"/> + <connection from="26384275#1" to="26384275#2" fromLane="0" toLane="0" via=":853135516_2_0" dir="s" state="m"/> + <connection from="26384275#1" to="-26384275#1" fromLane="0" toLane="0" via=":853135516_3_0" dir="t" state="m"/> <connection from="26384275#2" to="-26384275#2" fromLane="0" toLane="0" via=":289047670_0_0" dir="t" state="M"/> <connection from="26384298" to="103268088#0" fromLane="0" toLane="0" via=":1192507866_0_0" dir="s" state="M"/> <connection from="26384298" to="-26384298" fromLane="0" toLane="0" via=":1192507866_1_0" dir="t" state="m"/> @@ -8148,8 +7724,7 @@ <connection from="26562389#0" to="37601918" fromLane="0" toLane="0" via=":440765481_1_0" dir="l" state="="/> <connection from="26562389#0" to="-26562389#0" fromLane="0" toLane="0" via=":440765481_2_0" dir="t" state="="/> <connection from="26562389#1" to="26562389#2" fromLane="0" toLane="0" via=":1424270251_0_0" dir="s" state="m"/> - <connection from="26562389#1" to="129013950" fromLane="0" toLane="0" via=":1424270251_1_0" dir="l" state="m"/> - <connection from="26562389#1" to="-26562389#1" fromLane="0" toLane="0" via=":1424270251_2_0" dir="t" state="m"/> + <connection from="26562389#1" to="-26562389#1" fromLane="0" toLane="0" via=":1424270251_1_0" dir="t" state="m"/> <connection from="26562389#2" to="26562389#3" fromLane="0" toLane="0" via=":291185195_0_0" dir="s" state="="/> <connection from="26562389#2" to="26562391#0" fromLane="0" toLane="0" via=":291185195_1_0" dir="l" state="="/> <connection from="26562389#2" to="-26562389#2" fromLane="0" toLane="0" via=":291185195_2_0" dir="t" state="="/> @@ -8187,11 +7762,8 @@ <connection from="26775981#2" to="26775981#3" fromLane="0" toLane="0" via=":293696234_3_0" dir="s" state="="/> <connection from="26775981#2" to="26776014#0" fromLane="0" toLane="0" via=":293696234_4_0" dir="l" state="="/> <connection from="26775981#2" to="-26775981#2" fromLane="0" toLane="0" via=":293696234_5_0" dir="t" state="="/> - <connection from="26775981#3" to="31281702#1" fromLane="0" toLane="0" via=":293695883_6_0" dir="s" state="m"/> - <connection from="26775981#3" to="-31281702#0" fromLane="0" toLane="0" via=":293695883_7_0" dir="l" state="m"/> - <connection from="26775981#3" to="-26775981#3" fromLane="0" toLane="0" via=":293695883_8_0" dir="t" state="m"/> - <connection from="26775984" to="49844607" fromLane="0" toLane="0" via=":293696007_0_0" dir="s" state="M"/> - <connection from="26775984" to="-26775984" fromLane="0" toLane="0" via=":293696007_1_0" dir="t" state="m"/> + <connection from="26775981#3" to="-26775981#3" fromLane="0" toLane="0" via=":293695883_4_0" dir="t" state="m"/> + <connection from="26775984" to="-26775984" fromLane="0" toLane="0" via=":293696007_0_0" dir="t" state="m"/> <connection from="26776014#0" to="26776014#1" fromLane="0" toLane="0" via=":293696352_3_0" dir="r" state="="/> <connection from="26776014#0" to="36943296#0" fromLane="0" toLane="0" via=":293696352_4_0" dir="s" state="="/> <connection from="26776014#0" to="-26776014#0" fromLane="0" toLane="0" via=":293696352_5_0" dir="t" state="="/> @@ -8199,8 +7771,7 @@ <connection from="26776014#1" to="26776014#2" fromLane="0" toLane="0" via=":293696354_4_0" dir="l" state="="/> <connection from="26776014#1" to="-26776014#1" fromLane="0" toLane="0" via=":293696354_5_0" dir="t" state="="/> <connection from="26776014#2" to="26776014#3" fromLane="0" toLane="0" via=":293696356_0_0" dir="r" state="="/> - <connection from="26776014#2" to="52572950#0" fromLane="0" toLane="0" via=":293696356_1_0" dir="s" state="="/> - <connection from="26776014#2" to="-26776014#2" fromLane="0" toLane="0" via=":293696356_2_0" dir="t" state="="/> + <connection from="26776014#2" to="-26776014#2" fromLane="0" toLane="0" via=":293696356_1_0" dir="t" state="="/> <connection from="26776014#3" to="26776014#4" fromLane="0" toLane="0" via=":429587898_0_0" dir="s" state="="/> <connection from="26776014#3" to="36943288#0" fromLane="0" toLane="0" via=":429587898_1_0" dir="l" state="="/> <connection from="26776014#3" to="-26776014#3" fromLane="0" toLane="0" via=":429587898_2_0" dir="t" state="="/> @@ -8210,14 +7781,12 @@ <connection from="26776026#0" to="26776032" fromLane="0" toLane="0" via=":293696558_6_0" dir="r" state="="/> <connection from="26776026#0" to="26776026#1" fromLane="0" toLane="0" via=":293696558_7_0" dir="s" state="="/> <connection from="26776026#0" to="-26776026#0" fromLane="0" toLane="0" via=":293696558_8_0" dir="t" state="="/> - <connection from="26776026#1" to="-36943289#3" fromLane="0" toLane="0" via=":293696556_2_0" dir="s" state="M"/> - <connection from="26776026#1" to="-26776026#1" fromLane="0" toLane="0" via=":293696556_3_0" dir="t" state="m"/> + <connection from="26776026#1" to="-26776026#1" fromLane="0" toLane="0" via=":293696556_1_0" dir="t" state="m"/> <connection from="26776032" to="-26776032" fromLane="0" toLane="0" via=":293696602_0_0" dir="t" state="M"/> <connection from="27059094" to="7745716#5" fromLane="0" toLane="0" via=":296893556_0_0" dir="r" state="m"/> <connection from="27059094" to="-27059094" fromLane="0" toLane="0" via=":296893556_1_0" dir="t" state="m"/> - <connection from="27059110#0" to="-25363167" fromLane="0" toLane="0" via=":467106195_0_0" dir="r" state="M"/> - <connection from="27059110#0" to="27059110#1" fromLane="0" toLane="0" via=":467106195_1_0" dir="s" state="m"/> - <connection from="27059110#0" to="-27059110#0" fromLane="0" toLane="0" via=":467106195_2_0" dir="t" state="m"/> + <connection from="27059110#0" to="27059110#1" fromLane="0" toLane="0" via=":467106195_0_0" dir="s" state="m"/> + <connection from="27059110#0" to="-27059110#0" fromLane="0" toLane="0" via=":467106195_1_0" dir="t" state="m"/> <connection from="27059110#1" to="7745716#2" fromLane="0" toLane="0" via=":270703437_2_0" dir="l" state="m"/> <connection from="27059110#1" to="-27059110#1" fromLane="0" toLane="0" via=":270703437_3_0" dir="t" state="m"/> <connection from="29136063#0" to="-121068763" fromLane="0" toLane="0" via=":1356130769_2_0" dir="r" state="M"/> @@ -8248,15 +7817,14 @@ <connection from="30738461" to="-5724307" fromLane="0" toLane="0" via=":cluster_339975567_43242046_1_0" dir="s" state="m"/> <connection from="30738461" to="38167741#5" fromLane="0" toLane="0" via=":cluster_339975567_43242046_2_0" dir="l" state="m"/> <connection from="30738461" to="-30738461" fromLane="0" toLane="0" via=":cluster_339975567_43242046_3_0" dir="t" state="m"/> - <connection from="31281702#0" to="-26775981#3" fromLane="0" toLane="0" via=":293695883_0_0" dir="r" state="M"/> - <connection from="31281702#0" to="31281702#1" fromLane="0" toLane="0" via=":293695883_1_0" dir="l" state="M"/> - <connection from="31281702#0" to="-31281702#0" fromLane="0" toLane="0" via=":293695883_2_0" dir="t" state="m"/> + <connection from="31281702#0" to="31281702#1" fromLane="0" toLane="0" via=":293695883_0_0" dir="l" state="M"/> + <connection from="31281702#0" to="-31281702#0" fromLane="0" toLane="0" via=":293695883_1_0" dir="t" state="m"/> <connection from="31281702#1" to="-31281702#1" fromLane="0" toLane="0" via=":381910193_0_0" dir="t" state="M"/> <connection from="31288488" to="26776014#2" fromLane="0" toLane="0" via=":293696354_0_0" dir="s" state="="/> <connection from="31288488" to="-26776014#1" fromLane="0" toLane="0" via=":293696354_1_0" dir="l" state="="/> <connection from="31288488" to="-31288488" fromLane="0" toLane="0" via=":293696354_2_0" dir="t" state="="/> <connection from="33049407#0" to="33049407#1" fromLane="0" toLane="0" via=":378917495_3_0" dir="s" state="m"/> - <connection from="33049407#0" to="64797654#4" fromLane="0" toLane="1" via=":378917495_4_0" dir="s" state="m"/> + <connection from="33049407#0" to="64797654#4" fromLane="0" toLane="0" via=":378917495_4_0" dir="s" state="m"/> <connection from="33049407#0" to="-33049407#0" fromLane="0" toLane="0" via=":378917495_5_0" dir="t" state="m"/> <connection from="33049407#1" to="33049407#2" fromLane="0" toLane="0" via=":59824154_3_0" dir="s" state="m"/> <connection from="33049407#1" to="64797654#5" fromLane="0" toLane="1" via=":59824154_4_0" dir="s" state="m"/> @@ -8273,7 +7841,7 @@ <connection from="33049407#4" to="64797654#8" fromLane="0" toLane="1" via=":480440288_4_0" dir="s" state="m"/> <connection from="33049407#4" to="-33049407#4" fromLane="0" toLane="0" via=":480440288_5_0" dir="t" state="m"/> <connection from="33049407#5" to="33049407#6" fromLane="0" toLane="0" via=":59824195_3_0" dir="s" state="m"/> - <connection from="33049407#5" to="64797654#9" fromLane="0" toLane="0" via=":59824195_4_0" dir="s" state="m"/> + <connection from="33049407#5" to="64797654#9" fromLane="0" toLane="1" via=":59824195_4_0" dir="s" state="m"/> <connection from="33049407#5" to="-33049407#5" fromLane="0" toLane="0" via=":59824195_5_0" dir="t" state="m"/> <connection from="33049407#6" to="33049407#7" fromLane="0" toLane="0" via=":266777507_3_0" dir="s" state="m"/> <connection from="33049407#6" to="64797654#10" fromLane="0" toLane="1" via=":266777507_4_0" dir="s" state="m"/> @@ -8299,10 +7867,8 @@ <connection from="33070760#3" to="25363135#0" fromLane="0" toLane="0" via=":35651461_3_0" dir="s" state="="/> <connection from="33070760#3" to="7745716#0" fromLane="0" toLane="0" via=":35651461_4_0" dir="l" state="="/> <connection from="33070760#3" to="-33070760#3" fromLane="0" toLane="0" via=":35651461_5_0" dir="t" state="="/> - <connection from="36943288#0" to="-52572951#0" fromLane="0" toLane="0" via=":667901703_0_0" dir="r" state="m"/> - <connection from="36943288#0" to="36943288#1" fromLane="0" toLane="0" via=":667901703_1_0" dir="s" state="m"/> - <connection from="36943288#0" to="52572951#1" fromLane="0" toLane="0" via=":667901703_2_0" dir="l" state="m"/> - <connection from="36943288#0" to="-36943288#0" fromLane="0" toLane="0" via=":667901703_3_0" dir="t" state="m"/> + <connection from="36943288#0" to="36943288#1" fromLane="0" toLane="0" via=":667901703_0_0" dir="s" state="m"/> + <connection from="36943288#0" to="-36943288#0" fromLane="0" toLane="0" via=":667901703_1_0" dir="t" state="m"/> <connection from="36943288#1" to="-36943292#0" fromLane="0" toLane="0" via=":429587900_0_0" dir="r" state="="/> <connection from="36943288#1" to="36943292#1" fromLane="0" toLane="0" via=":429587900_1_0" dir="l" state="="/> <connection from="36943288#1" to="-36943288#1" fromLane="0" toLane="0" via=":429587900_2_0" dir="t" state="="/> @@ -8315,20 +7881,16 @@ <connection from="36943289#2" to="37399606" fromLane="0" toLane="0" via=":429587903_0_0" dir="s" state="="/> <connection from="36943289#2" to="36943289#3" fromLane="0" toLane="0" via=":429587903_1_0" dir="l" state="="/> <connection from="36943289#2" to="-36943289#2" fromLane="0" toLane="0" via=":429587903_2_0" dir="t" state="="/> - <connection from="36943289#3" to="-26776026#1" fromLane="0" toLane="0" via=":293696556_0_0" dir="s" state="M"/> - <connection from="36943289#3" to="-36943289#3" fromLane="0" toLane="0" via=":293696556_1_0" dir="t" state="m"/> + <connection from="36943289#3" to="-36943289#3" fromLane="0" toLane="0" via=":293696556_0_0" dir="t" state="m"/> <connection from="36943290" to="38306209" fromLane="0" toLane="0" via=":429587906_0_0" dir="l" state="M"/> <connection from="36943290" to="-36943290" fromLane="0" toLane="0" via=":429587906_1_0" dir="t" state="m"/> <connection from="36943292#0" to="36943292#1" fromLane="0" toLane="0" via=":429587900_6_0" dir="s" state="="/> <connection from="36943292#0" to="-36943288#1" fromLane="0" toLane="0" via=":429587900_7_0" dir="l" state="="/> <connection from="36943292#0" to="-36943292#0" fromLane="0" toLane="0" via=":429587900_8_0" dir="t" state="="/> - <connection from="36943292#1" to="36943290" fromLane="0" toLane="0" via=":429587908_2_0" dir="r" state="M"/> - <connection from="36943292#1" to="-36943292#1" fromLane="0" toLane="0" via=":429587908_3_0" dir="t" state="m"/> - <connection from="36943296#0" to="-52572950#1" fromLane="0" toLane="0" via=":667901708_3_0" dir="r" state="M"/> - <connection from="36943296#0" to="36943296#1" fromLane="0" toLane="0" via=":667901708_4_0" dir="s" state="M"/> - <connection from="36943296#0" to="-36943296#0" fromLane="0" toLane="0" via=":667901708_5_0" dir="t" state="m"/> - <connection from="36943296#1" to="-37601917" fromLane="0" toLane="0" via=":429587921_0_0" dir="l" state="M"/> - <connection from="36943296#1" to="-36943296#1" fromLane="0" toLane="0" via=":429587921_1_0" dir="t" state="m"/> + <connection from="36943292#1" to="-36943292#1" fromLane="0" toLane="0" via=":429587908_1_0" dir="t" state="m"/> + <connection from="36943296#0" to="36943296#1" fromLane="0" toLane="0" via=":667901708_1_0" dir="s" state="M"/> + <connection from="36943296#0" to="-36943296#0" fromLane="0" toLane="0" via=":667901708_2_0" dir="t" state="m"/> + <connection from="36943296#1" to="-36943296#1" fromLane="0" toLane="0" via=":429587921_0_0" dir="t" state="m"/> <connection from="36943301" to="-26775981#1" fromLane="0" toLane="0" via=":429587899_6_0" dir="r" state="="/> <connection from="36943301" to="26775981#2" fromLane="0" toLane="0" via=":429587899_7_0" dir="l" state="="/> <connection from="36943301" to="-36943301" fromLane="0" toLane="0" via=":429587899_8_0" dir="t" state="="/> @@ -8357,20 +7919,15 @@ <connection from="37593791#0" to="37593791#1" fromLane="0" toLane="0" via=":442839521_4_0" dir="s" state="="/> <connection from="37593791#0" to="-37593791#0" fromLane="0" toLane="0" via=":442839521_5_0" dir="t" state="="/> <connection from="37593791#1" to="-37593791#1" fromLane="0" toLane="0" via=":307961027_0_0" dir="t" state="M"/> - <connection from="37601917" to="-36943296#1" fromLane="0" toLane="0" via=":429587921_2_0" dir="r" state="M"/> - <connection from="37601917" to="-37601917" fromLane="0" toLane="0" via=":429587921_3_0" dir="t" state="m"/> + <connection from="37601917" to="-37601917" fromLane="0" toLane="0" via=":429587921_1_0" dir="t" state="m"/> <connection from="37601918" to="-37601918" fromLane="0" toLane="0" via=":440765482_0_0" dir="t" state="M"/> <connection from="37752125#0" to="37752125#1" fromLane="0" toLane="0" via=":442839558_0_0" dir="s" state="m"/> - <connection from="37752125#0" to="-37752126#0" fromLane="0" toLane="0" via=":442839558_1_0" dir="L" state="m"/> - <connection from="37752125#0" to="37752126#1" fromLane="0" toLane="0" via=":442839558_2_0" dir="l" state="m"/> - <connection from="37752125#0" to="-37752125#0" fromLane="0" toLane="0" via=":442839558_3_0" dir="t" state="m"/> + <connection from="37752125#0" to="-37752125#0" fromLane="0" toLane="0" via=":442839558_1_0" dir="t" state="m"/> <connection from="37752125#1" to="26562404#1" fromLane="0" toLane="0" via=":442839527_3_0" dir="r" state="="/> <connection from="37752125#1" to="-26562404#0" fromLane="0" toLane="0" via=":442839527_4_0" dir="l" state="="/> <connection from="37752125#1" to="-37752125#1" fromLane="0" toLane="0" via=":442839527_5_0" dir="t" state="="/> - <connection from="37752126#0" to="37752126#1" fromLane="0" toLane="0" via=":442839558_8_0" dir="r" state="M"/> - <connection from="37752126#0" to="-37752125#0" fromLane="0" toLane="0" via=":442839558_9_0" dir="R" state="m"/> - <connection from="37752126#0" to="37752125#1" fromLane="0" toLane="0" via=":442839558_10_0" dir="l" state="m"/> - <connection from="37752126#0" to="-37752126#0" fromLane="0" toLane="0" via=":442839558_11_0" dir="t" state="m"/> + <connection from="37752126#0" to="37752126#1" fromLane="0" toLane="0" via=":442839558_4_0" dir="r" state="M"/> + <connection from="37752126#0" to="-37752126#0" fromLane="0" toLane="0" via=":442839558_5_0" dir="t" state="m"/> <connection from="37752126#1" to="37593791#1" fromLane="0" toLane="0" via=":442839521_0_0" dir="r" state="="/> <connection from="37752126#1" to="-37593791#0" fromLane="0" toLane="0" via=":442839521_1_0" dir="l" state="="/> <connection from="37752126#1" to="-37752126#1" fromLane="0" toLane="0" via=":442839521_2_0" dir="t" state="="/> @@ -8445,9 +8002,7 @@ <connection from="49042723#0" to="-49042728" fromLane="0" toLane="0" via=":622336955_6_0" dir="r" state="M"/> <connection from="49042723#0" to="49042723#1" fromLane="0" toLane="0" via=":622336955_7_0" dir="s" state="M"/> <connection from="49042723#0" to="-49042723#0" fromLane="0" toLane="0" via=":622336955_8_0" dir="t" state="m"/> - <connection from="49042723#1" to="50005239#1" fromLane="0" toLane="0" via=":622336960_6_0" dir="r" state="M"/> - <connection from="49042723#1" to="-50005239#0" fromLane="0" toLane="0" via=":622336960_7_0" dir="l" state="M"/> - <connection from="49042723#1" to="-49042723#1" fromLane="0" toLane="0" via=":622336960_8_0" dir="t" state="m"/> + <connection from="49042723#1" to="-49042723#1" fromLane="0" toLane="0" via=":622336960_4_0" dir="t" state="m"/> <connection from="49042724" to="49042723#0" fromLane="0" toLane="0" via=":622336943_0_0" dir="s" state="M"/> <connection from="49042724" to="-49042724" fromLane="0" toLane="0" via=":622336943_1_0" dir="t" state="m"/> <connection from="49042726#0" to="49042726#1" fromLane="0" toLane="0" via=":622336972_0_0" dir="s" state="="/> @@ -8465,18 +8020,14 @@ <connection from="49042728" to="49042723#1" fromLane="0" toLane="0" via=":622336955_3_0" dir="r" state="m"/> <connection from="49042728" to="-49042723#0" fromLane="0" toLane="0" via=":622336955_4_0" dir="l" state="m"/> <connection from="49042728" to="-49042728" fromLane="0" toLane="0" via=":622336955_5_0" dir="t" state="m"/> - <connection from="49047248" to="-25485133#1" fromLane="0" toLane="0" via=":277697630_0_0" dir="r" state="M"/> - <connection from="49047248" to="25485133#2" fromLane="0" toLane="0" via=":277697630_1_0" dir="l" state="M"/> - <connection from="49047248" to="-49047248" fromLane="0" toLane="0" via=":277697630_2_0" dir="t" state="m"/> + <connection from="49047248" to="-49047248" fromLane="0" toLane="0" via=":277697630_0_0" dir="t" state="m"/> <connection from="49844607" to="37593790#1" fromLane="0" toLane="0" via=":633292230_3_0" dir="r" state="="/> <connection from="49844607" to="-37593790#0" fromLane="0" toLane="0" via=":633292230_4_0" dir="l" state="="/> <connection from="49844607" to="-49844607" fromLane="0" toLane="0" via=":633292230_5_0" dir="t" state="="/> - <connection from="50005239#0" to="-49042723#1" fromLane="0" toLane="0" via=":622336960_0_0" dir="r" state="M"/> - <connection from="50005239#0" to="50005239#1" fromLane="0" toLane="0" via=":622336960_1_0" dir="s" state="m"/> - <connection from="50005239#0" to="-50005239#0" fromLane="0" toLane="0" via=":622336960_2_0" dir="t" state="m"/> - <connection from="50005239#1" to="49042726#0" fromLane="0" toLane="0" via=":622336968_0_0" dir="r" state="M"/> - <connection from="50005239#1" to="50005239#2" fromLane="0" toLane="0" via=":622336968_1_0" dir="s" state="m"/> - <connection from="50005239#1" to="-50005239#1" fromLane="0" toLane="0" via=":622336968_2_0" dir="t" state="m"/> + <connection from="50005239#0" to="50005239#1" fromLane="0" toLane="0" via=":622336960_0_0" dir="s" state="m"/> + <connection from="50005239#0" to="-50005239#0" fromLane="0" toLane="0" via=":622336960_1_0" dir="t" state="m"/> + <connection from="50005239#1" to="50005239#2" fromLane="0" toLane="0" via=":622336968_0_0" dir="s" state="m"/> + <connection from="50005239#1" to="-50005239#1" fromLane="0" toLane="0" via=":622336968_1_0" dir="t" state="m"/> <connection from="50005239#2" to="5088373#2" fromLane="0" toLane="0" via=":277697633_0_0" dir="r" state="m"/> <connection from="50005239#2" to="-5088373#1" fromLane="0" toLane="0" via=":277697633_1_0" dir="l" state="m"/> <connection from="50005239#2" to="-50005239#2" fromLane="0" toLane="0" via=":277697633_2_0" dir="t" state="m"/> @@ -8502,18 +8053,13 @@ <connection from="5237595" to="38167741#3" fromLane="0" toLane="0" via=":36854116_3_0" dir="r" state="="/> <connection from="5237595" to="-38167741#2" fromLane="0" toLane="0" via=":36854116_4_0" dir="l" state="="/> <connection from="5237595" to="-5237595" fromLane="0" toLane="0" via=":36854116_5_0" dir="t" state="="/> - <connection from="5237597" to="47328513" fromLane="0" toLane="0" via=":36854120_0_0" dir="r" state="M"/> - <connection from="5237597" to="-5237597" fromLane="0" toLane="0" via=":36854120_1_0" dir="t" state="m"/> + <connection from="5237597" to="-5237597" fromLane="0" toLane="0" via=":36854120_0_0" dir="t" state="m"/> <connection from="52572950#0" to="-52572951#1" fromLane="0" toLane="0" via=":667901706_0_0" dir="r" state="M"/> <connection from="52572950#0" to="52572950#1" fromLane="0" toLane="0" via=":667901706_1_0" dir="s" state="m"/> <connection from="52572950#0" to="-52572950#0" fromLane="0" toLane="0" via=":667901706_2_0" dir="t" state="m"/> - <connection from="52572950#1" to="36943296#1" fromLane="0" toLane="0" via=":667901708_0_0" dir="r" state="m"/> - <connection from="52572950#1" to="-36943296#0" fromLane="0" toLane="0" via=":667901708_1_0" dir="l" state="m"/> - <connection from="52572950#1" to="-52572950#1" fromLane="0" toLane="0" via=":667901708_2_0" dir="t" state="m"/> - <connection from="52572951#0" to="36943288#1" fromLane="0" toLane="0" via=":667901703_12_0" dir="r" state="M"/> - <connection from="52572951#0" to="52572951#1" fromLane="0" toLane="0" via=":667901703_13_0" dir="s" state="M"/> - <connection from="52572951#0" to="-36943288#0" fromLane="0" toLane="0" via=":667901703_14_0" dir="l" state="m"/> - <connection from="52572951#0" to="-52572951#0" fromLane="0" toLane="0" via=":667901703_15_0" dir="t" state="m"/> + <connection from="52572950#1" to="-52572950#1" fromLane="0" toLane="0" via=":667901708_0_0" dir="t" state="m"/> + <connection from="52572951#0" to="52572951#1" fromLane="0" toLane="0" via=":667901703_6_0" dir="s" state="M"/> + <connection from="52572951#0" to="-52572951#0" fromLane="0" toLane="0" via=":667901703_7_0" dir="t" state="m"/> <connection from="52572951#1" to="52572950#1" fromLane="0" toLane="0" via=":667901706_6_0" dir="r" state="M"/> <connection from="52572951#1" to="-52572950#0" fromLane="0" toLane="0" via=":667901706_7_0" dir="l" state="M"/> <connection from="52572951#1" to="-52572951#1" fromLane="0" toLane="0" via=":667901706_8_0" dir="t" state="m"/> @@ -8565,9 +8111,9 @@ <connection from="64797654#10" to="-33049407#7" fromLane="1" toLane="0" via=":36745051_4_0" dir="t" state="M"/> <connection from="64797654#2" to="33049407#0" fromLane="0" toLane="0" via=":27557127_3_0" dir="s" state="M"/> <connection from="64797654#2" to="64797654#3" fromLane="1" toLane="0" via=":27557127_4_0" dir="s" state="M"/> - <connection from="64797654#2" to="33049438#0" fromLane="1" toLane="0" via=":27557127_5_0" dir="l" state="M"/> - <connection from="64797654#3" to="33049407#1" fromLane="0" toLane="0" via=":378917495_6_0" dir="s" state="m"/> - <connection from="64797654#3" to="64797654#4" fromLane="1" toLane="1" via=":378917495_7_0" dir="s" state="m"/> + <connection from="64797654#2" to="33049438#0" fromLane="1" toLane="1" via=":27557127_5_0" dir="l" state="M"/> + <connection from="64797654#3" to="33049407#1" fromLane="0" toLane="0" via=":378917495_6_0" dir="s" state="M"/> + <connection from="64797654#3" to="64797654#4" fromLane="1" toLane="1" via=":378917495_7_0" dir="s" state="M"/> <connection from="64797654#3" to="-33049407#0" fromLane="1" toLane="0" via=":378917495_8_0" dir="t" state="m"/> <connection from="64797654#4" to="33049407#2" fromLane="0" toLane="0" via=":59824154_6_0" dir="s" state="m"/> <connection from="64797654#4" to="64797654#5" fromLane="1" toLane="1" via=":59824154_7_0" dir="s" state="m"/> @@ -8584,8 +8130,8 @@ <connection from="64797654#7" to="33049407#5" fromLane="0" toLane="0" via=":480440288_6_0" dir="s" state="m"/> <connection from="64797654#7" to="64797654#8" fromLane="1" toLane="1" via=":480440288_7_0" dir="s" state="m"/> <connection from="64797654#7" to="-33049407#4" fromLane="1" toLane="0" via=":480440288_8_0" dir="t" state="m"/> - <connection from="64797654#8" to="33049407#6" fromLane="0" toLane="0" via=":59824195_6_0" dir="s" state="M"/> - <connection from="64797654#8" to="64797654#9" fromLane="1" toLane="1" via=":59824195_7_0" dir="s" state="M"/> + <connection from="64797654#8" to="33049407#6" fromLane="0" toLane="0" via=":59824195_6_0" dir="s" state="m"/> + <connection from="64797654#8" to="64797654#9" fromLane="1" toLane="1" via=":59824195_7_0" dir="s" state="m"/> <connection from="64797654#8" to="-33049407#5" fromLane="1" toLane="0" via=":59824195_8_0" dir="t" state="m"/> <connection from="64797654#9" to="33049407#7" fromLane="0" toLane="0" via=":266777507_6_0" dir="s" state="m"/> <connection from="64797654#9" to="64797654#10" fromLane="1" toLane="1" via=":266777507_7_0" dir="s" state="m"/> @@ -8594,9 +8140,7 @@ <connection from="66654719#0" to="66654719#1" fromLane="0" toLane="0" via=":853135513_7_0" dir="s" state="="/> <connection from="66654719#0" to="-66654719#0" fromLane="0" toLane="0" via=":853135513_8_0" dir="t" state="="/> <connection from="66654719#1" to="-66654719#1" fromLane="0" toLane="0" via=":513585702_0_0" dir="t" state="M"/> - <connection from="71763552" to="-26384275#1" fromLane="0" toLane="0" via=":853135516_6_0" dir="r" state="M"/> - <connection from="71763552" to="26384275#2" fromLane="0" toLane="0" via=":853135516_7_0" dir="l" state="M"/> - <connection from="71763552" to="-71763552" fromLane="0" toLane="0" via=":853135516_8_0" dir="t" state="m"/> + <connection from="71763552" to="-71763552" fromLane="0" toLane="0" via=":853135516_4_0" dir="t" state="m"/> <connection from="71763553" to="71763552" fromLane="0" toLane="0" via=":853135507_2_0" dir="s" state="M"/> <connection from="71763553" to="-71763553" fromLane="0" toLane="0" via=":853135507_3_0" dir="t" state="m"/> <connection from="7745711#0" to="7745711#1" fromLane="0" toLane="0" via=":62004677_0_0" dir="s" state="="/> @@ -8718,15 +8262,11 @@ <connection from=":1356135515_6" to="121069898#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1356135515_7" to="-103268088#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1356135515_8" to="103268088#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1356135516_0" to="-121069900" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1356135516_1" to="121069898#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":1356135516_0" to="121069898#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":1356135516_1" to="-121069898#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1356135516_2" to="-121069898#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1356135516_3" to="-121069898#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":1356135516_3" to="121069898#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1356135516_4" to="-121069900" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1356135516_5" to="121069898#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1356135516_6" to="121069898#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1356135516_7" to="-121069898#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1356135516_8" to="-121069900" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1367507446_0" to="-122351619" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1367507447_0" to="8034799#5" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1367507447_1" to="122351619" fromLane="0" toLane="0" via=":1367507447_9_0" dir="s" state="m"/> @@ -8753,16 +8293,10 @@ <connection from=":1424270250_8" to="-38167738#0" fromLane="0" toLane="0" via=":1424270250_11_0" dir="s" state="m"/> <connection from=":1424270250_11" to="-38167738#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1424270251_0" to="26562389#2" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1424270251_1" to="129013950" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1424270251_2" to="-26562389#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":1424270251_1" to="-26562389#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":1424270251_2" to="129013950" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1424270251_3" to="-26562389#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1424270251_4" to="26562389#2" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1424270251_5" to="129013950" fromLane="0" toLane="0" via=":1424270251_9_0" dir="s" state="m"/> - <connection from=":1424270251_9" to="129013950" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1424270251_6" to="129013950" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1424270251_7" to="-26562389#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1424270251_8" to="26562389#2" fromLane="0" toLane="0" via=":1424270251_10_0" dir="s" state="m"/> - <connection from=":1424270251_10" to="26562389#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1424274807_0" to="-38167738#6" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1424274807_1" to="38167738#7" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1424274807_2" to="129014453" fromLane="0" toLane="0" dir="s" state="M"/> @@ -8823,8 +8357,7 @@ <connection from=":1771199559_12" to="165574143" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1771199559_13" to="33049407#3" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1771199559_14" to="64797654#6" fromLane="0" toLane="1" dir="s" state="M"/> - <connection from=":1771199559_15" to="-33049407#2" fromLane="0" toLane="0" via=":1771199559_17_0" dir="s" state="m"/> - <connection from=":1771199559_17" to="-33049407#2" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":1771199559_15" to="-33049407#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1778997184_0" to="166445405" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1778997184_0" to="166445405" fromLane="1" toLane="1" dir="s" state="M"/> <connection from=":1778997188_0" to="166445407" fromLane="0" toLane="0" dir="s" state="M"/> @@ -8843,15 +8376,11 @@ <connection from=":1835408176_11" to="8034799#3" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1881108785_0" to="177688397" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1881838954_0" to="23335805#3" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1894312954_0" to="-179093197" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1894312954_1" to="-26384275#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":1894312954_0" to="-26384275#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":1894312954_1" to="26384275#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1894312954_2" to="26384275#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1894312954_3" to="26384275#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":1894312954_3" to="-26384275#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":1894312954_4" to="-179093197" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1894312954_5" to="-26384275#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1894312954_6" to="-26384275#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1894312954_7" to="26384275#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":1894312954_8" to="-179093197" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":21613360_0" to="30425847#4" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":21613360_0" to="30425847#4" fromLane="1" toLane="1" dir="s" state="M"/> <connection from=":247378375_0" to="25068700" fromLane="0" toLane="0" dir="s" state="M"/> @@ -8955,8 +8484,7 @@ <connection from=":266777507_5" to="-33049407#6" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":266777507_6" to="33049407#7" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":266777507_7" to="64797654#10" fromLane="0" toLane="1" dir="s" state="M"/> - <connection from=":266777507_8" to="-33049407#6" fromLane="0" toLane="0" via=":266777507_10_0" dir="s" state="m"/> - <connection from=":266777507_10" to="-33049407#6" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":266777507_8" to="-33049407#6" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":269964106_0" to="-25068137" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":269964106_1" to="7782975#3" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":269964106_2" to="38167738#0" fromLane="0" toLane="0" dir="s" state="M"/> @@ -8991,8 +8519,7 @@ <connection from=":269964113_9" to="64797654#7" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":269964113_9" to="64797654#7" fromLane="1" toLane="1" dir="s" state="M"/> <connection from=":269964113_11" to="-38167741#5" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":269964113_12" to="-33049407#3" fromLane="0" toLane="0" via=":269964113_18_0" dir="s" state="m"/> - <connection from=":269964113_18" to="-33049407#3" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":269964113_12" to="-33049407#3" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":269964113_13" to="-33049407#3" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":269964113_14" to="33049407#4" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":269964113_15" to="64797654#7" fromLane="0" toLane="1" dir="s" state="M"/> @@ -9011,13 +8538,13 @@ <connection from=":271359580_3" to="30425847#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":271359580_3" to="30425847#2" fromLane="1" toLane="1" dir="s" state="M"/> <connection from=":27557122_0" to="-5229164#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":27557127_0" to="33049438#0" fromLane="0" toLane="1" dir="s" state="M"/> + <connection from=":27557127_0" to="33049438#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":27557127_1" to="64797654#3" fromLane="0" toLane="1" dir="s" state="M"/> <connection from=":27557127_2" to="33049407#0" fromLane="0" toLane="0" via=":27557127_6_0" dir="s" state="m"/> <connection from=":27557127_6" to="33049407#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":27557127_3" to="33049407#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":27557127_4" to="64797654#3" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":27557127_5" to="33049438#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":27557127_5" to="33049438#0" fromLane="0" toLane="1" dir="s" state="M"/> <connection from=":276419026_0" to="-25363135#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":276419026_1" to="25363135#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":276419026_2" to="25363135#1" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9044,26 +8571,17 @@ <connection from=":277697623_7" to="-25485133#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":277697623_8" to="25485133#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":277697625_0" to="25485133#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697625_1" to="49042724" fromLane="0" toLane="0" via=":277697625_9_0" dir="s" state="m"/> - <connection from=":277697625_9" to="49042724" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697625_2" to="-25485133#0" fromLane="0" toLane="0" via=":277697625_10_0" dir="s" state="m"/> - <connection from=":277697625_10" to="-25485133#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":277697625_1" to="-25485133#0" fromLane="0" toLane="0" via=":277697625_5_0" dir="s" state="m"/> + <connection from=":277697625_5" to="-25485133#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":277697625_2" to="49042724" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":277697625_3" to="-25485133#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697625_4" to="25485133#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697625_5" to="49042724" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697625_6" to="49042724" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697625_7" to="-25485133#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697625_8" to="25485133#1" fromLane="0" toLane="0" via=":277697625_11_0" dir="s" state="m"/> - <connection from=":277697625_11" to="25485133#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697630_0" to="-25485133#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697630_1" to="25485133#2" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697630_2" to="-49047248" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697630_3" to="-49047248" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":277697625_4" to="25485133#1" fromLane="0" toLane="0" via=":277697625_6_0" dir="s" state="m"/> + <connection from=":277697625_6" to="25485133#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":277697630_0" to="-49047248" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":277697630_1" to="-25485133#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":277697630_2" to="25485133#2" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":277697630_3" to="25485133#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":277697630_4" to="-25485133#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697630_5" to="25485133#2" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697630_6" to="25485133#2" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697630_7" to="-49047248" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":277697630_8" to="-25485133#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":277697633_0" to="5088373#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":277697633_1" to="-5088373#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":277697633_2" to="-50005239#2" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9188,17 +8706,13 @@ <connection from=":293695864_10" to="26775981#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293695864_8" to="-38167738#5" fromLane="0" toLane="0" via=":293695864_11_0" dir="s" state="m"/> <connection from=":293695864_11" to="-38167738#5" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293695883_0" to="-26775981#3" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293695883_1" to="31281702#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293695883_2" to="-31281702#0" fromLane="0" toLane="0" via=":293695883_9_0" dir="s" state="m"/> - <connection from=":293695883_9" to="-31281702#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293695883_3" to="-31281702#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293695883_4" to="-26775981#3" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293695883_5" to="31281702#1" fromLane="0" toLane="0" via=":293695883_10_0" dir="s" state="m"/> - <connection from=":293695883_10" to="31281702#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":293695883_0" to="31281702#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":293695883_1" to="-31281702#0" fromLane="0" toLane="0" via=":293695883_5_0" dir="s" state="m"/> + <connection from=":293695883_5" to="-31281702#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":293695883_2" to="-31281702#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":293695883_3" to="31281702#1" fromLane="0" toLane="0" via=":293695883_6_0" dir="s" state="m"/> <connection from=":293695883_6" to="31281702#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293695883_7" to="-31281702#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293695883_8" to="-26775981#3" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":293695883_4" to="-26775981#3" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696006_0" to="26775984" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696006_1" to="-26775981#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696006_2" to="26775981#1" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9208,12 +8722,8 @@ <connection from=":293696006_6" to="-26775981#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696006_7" to="26775981#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696006_8" to="26775984" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696007_0" to="49844607" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696007_1" to="-26775984" fromLane="0" toLane="0" via=":293696007_4_0" dir="s" state="m"/> - <connection from=":293696007_4" to="-26775984" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696007_2" to="-26775984" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696007_3" to="49844607" fromLane="0" toLane="0" via=":293696007_5_0" dir="s" state="m"/> - <connection from=":293696007_5" to="49844607" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":293696007_0" to="-26775984" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":293696007_1" to="49844607" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696234_0" to="26776014#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696234_1" to="-26775981#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696234_2" to="26775981#3" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9242,14 +8752,10 @@ <connection from=":293696354_7" to="-31288488" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696354_8" to="26776014#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696356_0" to="26776014#3" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696356_1" to="52572950#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696356_2" to="-26776014#2" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":293696356_1" to="-26776014#2" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":293696356_2" to="52572950#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696356_3" to="-26776014#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696356_4" to="26776014#3" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696356_5" to="52572950#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696356_6" to="52572950#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696356_7" to="-26776014#2" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696356_8" to="26776014#3" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696357_0" to="7782975#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696357_1" to="-26776014#4" fromLane="0" toLane="0" via=":293696357_9_0" dir="s" state="m"/> <connection from=":293696357_9" to="-26776014#4" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9274,12 +8780,8 @@ <connection from=":293696530_10" to="26776026#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696530_8" to="-38167738#2" fromLane="0" toLane="0" via=":293696530_11_0" dir="s" state="m"/> <connection from=":293696530_11" to="-38167738#2" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696556_0" to="-26776026#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696556_1" to="-36943289#3" fromLane="0" toLane="0" via=":293696556_4_0" dir="s" state="m"/> - <connection from=":293696556_4" to="-36943289#3" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696556_2" to="-36943289#3" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":293696556_3" to="-26776026#1" fromLane="0" toLane="0" via=":293696556_5_0" dir="s" state="m"/> - <connection from=":293696556_5" to="-26776026#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":293696556_0" to="-36943289#3" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":293696556_1" to="-26776026#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696558_0" to="-26776026#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696558_1" to="26776032" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":293696558_2" to="26776026#1" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9366,10 +8868,8 @@ <connection from=":34677731_14" to="5563258#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":34677731_15" to="5088373#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":34677738_0" to="-8013387" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":348042902_0" to="31288488" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":348042902_1" to="31281702#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":348042902_2" to="31281702#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":348042902_3" to="31288488" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":348042902_0" to="31281702#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":348042902_1" to="31288488" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":34814866_0" to="-165574143" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":34814866_1" to="-5229164#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":34814866_2" to="159243113" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9421,21 +8921,18 @@ <connection from=":36854116_6" to="-5237595" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":36854116_7" to="38167741#3" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":36854116_8" to="-38167741#2" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":36854120_0" to="47328513" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":36854120_1" to="-5237597" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":36854120_2" to="-5237597" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":36854120_3" to="47328513" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":36854120_0" to="-5237597" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":36854120_1" to="47328513" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":378917495_0" to="-33049407#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":378917495_1" to="64797654#4" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":378917495_1" to="64797654#4" fromLane="0" toLane="1" dir="s" state="M"/> <connection from=":378917495_2" to="33049407#1" fromLane="0" toLane="0" via=":378917495_9_0" dir="s" state="m"/> <connection from=":378917495_9" to="33049407#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":378917495_3" to="33049407#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":378917495_4" to="64797654#4" fromLane="0" toLane="1" dir="s" state="M"/> + <connection from=":378917495_4" to="64797654#4" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":378917495_5" to="-33049407#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":378917495_6" to="33049407#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":378917495_7" to="64797654#4" fromLane="0" toLane="1" dir="s" state="M"/> - <connection from=":378917495_8" to="-33049407#0" fromLane="0" toLane="0" via=":378917495_10_0" dir="s" state="m"/> - <connection from=":378917495_10" to="-33049407#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":378917495_8" to="-33049407#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":381910193_0" to="-31281702#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":429587898_0" to="26776014#4" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":429587898_1" to="36943288#0" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9493,14 +8990,10 @@ <connection from=":429587906_2" to="-36943290" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":429587906_3" to="38306209" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":429587907_0" to="36943292#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":429587908_0" to="-36943292#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":429587908_1" to="36943290" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":429587908_2" to="36943290" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":429587908_3" to="-36943292#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":429587921_0" to="-37601917" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":429587921_1" to="-36943296#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":429587921_2" to="-36943296#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":429587921_3" to="-37601917" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":429587908_0" to="36943290" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":429587908_1" to="-36943292#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":429587921_0" to="-36943296#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":429587921_1" to="-37601917" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":429587940_0" to="36943301" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":43242031_0" to="-33070760#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":43242031_1" to="5724308#0" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9623,24 +9116,15 @@ <connection from=":442839529_7" to="26562404#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":442839529_8" to="-26562404#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":442839558_0" to="37752125#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_1" to="-37752126#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_2" to="37752126#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_3" to="-37752125#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_4" to="-37752125#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_5" to="37752125#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_6" to="-37752126#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_7" to="37752126#1" fromLane="0" toLane="0" via=":442839558_16_0" dir="s" state="m"/> - <connection from=":442839558_16" to="37752126#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":442839558_1" to="-37752125#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":442839558_2" to="-37752126#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":442839558_3" to="37752126#1" fromLane="0" toLane="0" via=":442839558_8_0" dir="s" state="m"/> <connection from=":442839558_8" to="37752126#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_9" to="-37752125#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_10" to="37752125#1" fromLane="0" toLane="0" via=":442839558_17_0" dir="s" state="m"/> - <connection from=":442839558_17" to="37752125#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_11" to="-37752126#0" fromLane="0" toLane="0" via=":442839558_18_0" dir="s" state="m"/> - <connection from=":442839558_18" to="-37752126#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_12" to="-37752126#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_13" to="37752126#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_14" to="-37752125#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":442839558_15" to="37752125#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":442839558_4" to="37752126#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":442839558_5" to="-37752126#0" fromLane="0" toLane="0" via=":442839558_9_0" dir="s" state="m"/> + <connection from=":442839558_9" to="-37752126#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":442839558_6" to="-37752125#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":442839558_7" to="37752125#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":442839576_0" to="37752126#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":445067630_0" to="58149866#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":445100348_0" to="-25068700" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9667,15 +9151,11 @@ <connection from=":467011004_2" to="-39085064" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":467011004_3" to="4314834#3" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":467011004_3" to="4314834#3" fromLane="1" toLane="1" dir="s" state="M"/> - <connection from=":467106195_0" to="-25363167" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":467106195_1" to="27059110#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":467106195_0" to="27059110#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":467106195_1" to="-27059110#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":467106195_2" to="-27059110#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":467106195_3" to="-27059110#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":467106195_3" to="27059110#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":467106195_4" to="-25363167" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":467106195_5" to="27059110#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":467106195_6" to="27059110#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":467106195_7" to="-27059110#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":467106195_8" to="-25363167" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":480440288_0" to="-33049407#4" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":480440288_1" to="64797654#8" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":480440288_2" to="33049407#5" fromLane="0" toLane="0" via=":480440288_9_0" dir="s" state="m"/> @@ -9685,8 +9165,7 @@ <connection from=":480440288_5" to="-33049407#4" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":480440288_6" to="33049407#5" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":480440288_7" to="64797654#8" fromLane="0" toLane="1" dir="s" state="M"/> - <connection from=":480440288_8" to="-33049407#4" fromLane="0" toLane="0" via=":480440288_10_0" dir="s" state="m"/> - <connection from=":480440288_10" to="-33049407#4" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":480440288_8" to="-33049407#4" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":48999923_0" to="23335805#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":48999923_1" to="61284120" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":513585702_0" to="-66654719#1" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9722,19 +9201,17 @@ <connection from=":59824154_5" to="-33049407#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":59824154_6" to="33049407#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":59824154_7" to="64797654#5" fromLane="0" toLane="1" dir="s" state="M"/> - <connection from=":59824154_8" to="-33049407#1" fromLane="0" toLane="0" via=":59824154_10_0" dir="s" state="m"/> - <connection from=":59824154_10" to="-33049407#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":59824154_8" to="-33049407#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":59824195_0" to="-33049407#5" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":59824195_1" to="64797654#9" fromLane="0" toLane="1" dir="s" state="M"/> + <connection from=":59824195_1" to="64797654#9" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":59824195_2" to="33049407#6" fromLane="0" toLane="0" via=":59824195_9_0" dir="s" state="m"/> <connection from=":59824195_9" to="33049407#6" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":59824195_3" to="33049407#6" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":59824195_4" to="64797654#9" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":59824195_4" to="64797654#9" fromLane="0" toLane="1" dir="s" state="M"/> <connection from=":59824195_5" to="-33049407#5" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":59824195_6" to="33049407#6" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":59824195_7" to="64797654#9" fromLane="0" toLane="1" dir="s" state="M"/> - <connection from=":59824195_8" to="-33049407#5" fromLane="0" toLane="0" via=":59824195_10_0" dir="s" state="m"/> - <connection from=":59824195_10" to="-33049407#5" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":59824195_8" to="-33049407#5" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":602783338_0" to="-47328513" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":62004677_0" to="7745711#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":62004677_1" to="7745711#1" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9755,24 +9232,16 @@ <connection from=":622336955_7" to="49042723#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":622336955_8" to="-49042723#0" fromLane="0" toLane="0" via=":622336955_10_0" dir="s" state="m"/> <connection from=":622336955_10" to="-49042723#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336960_0" to="-49042723#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336960_1" to="50005239#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":622336960_0" to="50005239#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":622336960_1" to="-50005239#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":622336960_2" to="-50005239#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336960_3" to="-50005239#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":622336960_3" to="50005239#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":622336960_4" to="-49042723#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336960_5" to="50005239#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336960_6" to="50005239#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336960_7" to="-50005239#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336960_8" to="-49042723#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336968_0" to="49042726#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336968_1" to="50005239#2" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":622336968_0" to="50005239#2" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":622336968_1" to="-50005239#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":622336968_2" to="-50005239#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336968_3" to="-50005239#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":622336968_3" to="50005239#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":622336968_4" to="49042726#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336968_5" to="50005239#2" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336968_6" to="50005239#2" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336968_7" to="-50005239#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":622336968_8" to="49042726#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":622336972_0" to="49042726#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":622336972_1" to="49042727" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":622336972_2" to="-49042726#0" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9837,26 +9306,16 @@ <connection from=":634580664_1" to="7745716#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":634580664_2" to="7745716#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":634580664_3" to="27059094" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_0" to="-52572951#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_1" to="36943288#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_2" to="52572951#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_3" to="-36943288#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_4" to="-36943288#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_5" to="-52572951#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_6" to="36943288#1" fromLane="0" toLane="0" via=":667901703_16_0" dir="s" state="m"/> - <connection from=":667901703_16" to="36943288#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_7" to="52572951#1" fromLane="0" toLane="0" via=":667901703_17_0" dir="s" state="m"/> - <connection from=":667901703_17" to="52572951#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901703_0" to="36943288#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901703_1" to="-36943288#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901703_2" to="-52572951#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901703_3" to="52572951#1" fromLane="0" toLane="0" via=":667901703_8_0" dir="s" state="m"/> <connection from=":667901703_8" to="52572951#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_9" to="-36943288#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_10" to="-52572951#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_11" to="36943288#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_12" to="36943288#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_13" to="52572951#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_14" to="-36943288#0" fromLane="0" toLane="0" via=":667901703_18_0" dir="s" state="m"/> - <connection from=":667901703_18" to="-36943288#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901703_15" to="-52572951#0" fromLane="0" toLane="0" via=":667901703_19_0" dir="s" state="m"/> - <connection from=":667901703_19" to="-52572951#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901703_4" to="-36943288#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901703_5" to="36943288#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901703_6" to="52572951#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901703_7" to="-52572951#0" fromLane="0" toLane="0" via=":667901703_9_0" dir="s" state="m"/> + <connection from=":667901703_9" to="-52572951#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":667901706_0" to="-52572951#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":667901706_1" to="52572950#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":667901706_2" to="-52572950#0" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9866,18 +9325,13 @@ <connection from=":667901706_6" to="52572950#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":667901706_7" to="-52572950#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":667901706_8" to="-52572951#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901708_0" to="36943296#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901708_1" to="-36943296#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901708_2" to="-52572950#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901708_3" to="-52572950#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901708_4" to="36943296#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901708_5" to="-36943296#0" fromLane="0" toLane="0" via=":667901708_9_0" dir="s" state="m"/> - <connection from=":667901708_9" to="-36943296#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901708_6" to="-36943296#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901708_7" to="-52572950#1" fromLane="0" toLane="0" via=":667901708_10_0" dir="s" state="m"/> - <connection from=":667901708_10" to="-52572950#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":667901708_8" to="36943296#1" fromLane="0" toLane="0" via=":667901708_11_0" dir="s" state="m"/> - <connection from=":667901708_11" to="36943296#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901708_0" to="-52572950#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901708_1" to="36943296#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901708_2" to="-36943296#0" fromLane="0" toLane="0" via=":667901708_5_0" dir="s" state="m"/> + <connection from=":667901708_5" to="-36943296#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901708_3" to="-36943296#0" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":667901708_4" to="36943296#1" fromLane="0" toLane="0" via=":667901708_6_0" dir="s" state="m"/> + <connection from=":667901708_6" to="36943296#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":667901709_0" to="7782975#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":667901709_1" to="52572951#0" fromLane="0" toLane="0" via=":667901709_9_0" dir="s" state="m"/> <connection from=":667901709_9" to="52572951#0" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9906,8 +9360,7 @@ <connection from=":721437426_7" to="58149866#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":721437426_8" to="-58149866#0" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":765703076_0" to="23335805#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":765703076_1" to="23335805#1" fromLane="0" toLane="0" via=":765703076_2_0" dir="s" state="m"/> - <connection from=":765703076_2" to="23335805#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":765703076_1" to="23335805#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":765703090_0" to="-58149866#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":765703090_1" to="61284122" fromLane="0" toLane="0" via=":765703090_4_0" dir="s" state="m"/> <connection from=":765703090_4" to="61284122" fromLane="0" toLane="0" dir="s" state="M"/> @@ -9936,15 +9389,11 @@ <connection from=":853135513_6" to="71763553" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":853135513_7" to="66654719#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":853135513_8" to="-66654719#0" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":853135516_0" to="-71763552" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":853135516_1" to="-26384275#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":853135516_0" to="-26384275#1" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":853135516_1" to="26384275#2" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":853135516_2" to="26384275#2" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":853135516_3" to="26384275#2" fromLane="0" toLane="0" dir="s" state="M"/> + <connection from=":853135516_3" to="-26384275#1" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":853135516_4" to="-71763552" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":853135516_5" to="-26384275#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":853135516_6" to="-26384275#1" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":853135516_7" to="26384275#2" fromLane="0" toLane="0" dir="s" state="M"/> - <connection from=":853135516_8" to="-71763552" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":979119480_0" to="-177688392" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":cluster_104171179_28142770_28298581_28298587_0" to="23204862" fromLane="0" toLane="0" dir="s" state="M"/> <connection from=":cluster_104171179_28142770_28298581_28298587_1" to="30425847#0" fromLane="0" toLane="0" dir="s" state="M"/> diff -Nru sumo-0.21.0+dfsg/tools/game/bs3d/bsplain.tll.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/bs3d/bsplain.tll.xml --- sumo-0.21.0+dfsg/tools/game/bs3d/bsplain.tll.xml 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/bs3d/bsplain.tll.xml 2015-04-17 05:44:20.000000000 +0000 @@ -2,23 +2,23 @@ <tlLogics version="0.13" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo-sim.org/xsd/tllogic_file.xsd"> <tlLogic id="cluster_104171179_28142770_28298581_28298587" type="static" programID="0" offset="0"> - <phase duration="4" state="rrryyrrrrrrrryyrrrrr"/> - <phase duration="2" state="rrrrrrrrrrrrrrrrrrrr"/> + <phase duration="4" state="rrryyuuuuurrryyuuuuu"/> + <phase duration="2" state="rrrrruuuuurrrrruuuuu"/> <phase duration="1000" state="rrrrrGGGggrrrrrGGGgg"/> </tlLogic> <tlLogic id="cluster_104171179_28142770_28298581_28298587" type="static" programID="1" offset="0"> - <phase duration="4" state="rrrrryyyggrrrrryyygg"/> - <phase duration="2" state="rrrrrrrrrrrrrrrrrrrr"/> + <phase duration="4" state="rrrrryyyuurrrrryyyuu"/> + <phase duration="2" state="rrrrrrrrrrrrrrrrrrrr"/> <phase duration="1000" state="rrrrrrrrGGrrrrrrrrGG"/> </tlLogic> <tlLogic id="cluster_104171179_28142770_28298581_28298587" type="static" programID="2" offset="0"> - <phase duration="4" state="rrrrrrrryyrrrrrrrryy"/> - <phase duration="2" state="rrrrrrrrrrrrrrrrrrrr"/> + <phase duration="4" state="uuuuurrryyuuuuurrryy"/> + <phase duration="2" state="uuuuurrrrruuuuurrrrr"/> <phase duration="1000" state="GGGggrrrrrGGGggrrrrr"/> </tlLogic> <tlLogic id="cluster_104171179_28142770_28298581_28298587" type="static" programID="3" offset="0"> - <phase duration="4" state="yyyggrrrrryyyggrrrrr"/> - <phase duration="2" state="rrrrrrrrrrrrrrrrrrrr"/> + <phase duration="4" state="yyyuurrrrryyyuurrrrr"/> + <phase duration="2" state="rrruurrrrrrrruurrrrr"/> <phase duration="1000" state="rrrGGrrrrrrrrGGrrrrr"/> </tlLogic> </tlLogics> diff -Nru sumo-0.21.0+dfsg/tools/game/bs3Dosm.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/bs3Dosm.sumocfg --- sumo-0.21.0+dfsg/tools/game/bs3Dosm.sumocfg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/bs3Dosm.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,21 @@ +<configuration> + + <input> + <net-file value="bs3d/bs.net.xml"/> + <route-files value="bs3d/bs3d.rou.xml"/> + <additional-files value="input_additional.add.xml"/> + <gui-settings-file value="bs3d/view_B.xml"/> + </input> + + <time> + <begin value="0"/> + <end value="180"/> + <step-length value=".2"/> + </time> + + <report> + <no-duration-log value="true"/> + <no-step-log value="true"/> + </report> + <osg-view value="true"/> +</configuration> diff -Nru sumo-0.21.0+dfsg/tools/game/bs3d.sumocfg sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/bs3d.sumocfg --- sumo-0.21.0+dfsg/tools/game/bs3d.sumocfg 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/bs3d.sumocfg 2015-04-17 05:44:20.000000000 +0000 @@ -4,7 +4,7 @@ <net-file value="bs3d/bs.net.xml"/> <route-files value="bs3d/bs3d.rou.xml"/> <additional-files value="input_additional.add.xml"/> - <gui-settings-file value="bs3d/view_B.xml"/> + <gui-settings-file value="bs3d/bs3d.settings.xml"/> </input> <time> diff -Nru sumo-0.21.0+dfsg/tools/game/patchTrafficLights.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/patchTrafficLights.py --- sumo-0.21.0+dfsg/tools/game/patchTrafficLights.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/patchTrafficLights.py 2015-04-17 05:44:20.000000000 +0000 @@ -4,12 +4,12 @@ @author Michael Behrisch @author Jakob Erdmann @date 2010-03-11 -@version $Id: patchTrafficLights.py 15692 2014-02-22 09:17:02Z behrisch $ +@version $Id: patchTrafficLights.py 18096 2015-03-17 09:50:59Z behrisch $ This script patches the traffic lights of an input network for the gaming mode. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -17,15 +17,17 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import re, sys +import re +import sys from optparse import OptionParser optParser = OptionParser() optParser.add_option("-n", "--net-file", dest="netfile", - help="define the input net file (mandatory)") + help="define the input net file (mandatory)") optParser.add_option("-o", "--output-net-file", dest="outfile", default="out.net.xml", help="define the output net filename") -optParser.add_option("-s", "--switch", type="int", default=2, help="switch time") +optParser.add_option( + "-s", "--switch", type="int", default=2, help="switch time") (options, args) = optParser.parse_args() if not options.netfile: optParser.print_help() diff -Nru sumo-0.21.0+dfsg/tools/game/runner.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/runner.py --- sumo-0.21.0+dfsg/tools/game/runner.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/runner.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,15 +5,15 @@ @author Michael Behrisch @author Jakob Erdmann @date 2010-01-30 -@version $Id: runner.py 16342 2014-05-10 14:36:28Z namdre $ +@version $Id: runner.py 18096 2015-03-17 09:50:59Z behrisch $ This script runs the gaming GUI for the LNdW traffic light game. It checks for possible scenarios in the current working directory and lets the user start them as a game. Furthermore it saves highscores to local disc and to the central highscore server. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2010-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -21,21 +21,30 @@ the Free Software Foundation; either version 3 of the License, or (at your option) any later version. """ -import os, subprocess, sys, re, pickle, httplib, glob, Tkinter +import os +import subprocess +import sys +import re +import pickle +import httplib +import glob +import Tkinter +from optparse import OptionParser from xml.dom import pulldom _SCOREFILE = "scores.pkl" -_SCORESERVER = "sumo-sim.org" +_SCORESERVER = "sumo.dlr.de" _SCORESCRIPT = "/scores.php?game=TLS&" _DEBUG = False -_SCORES= 30 +_SCORES = 30 _LANGUAGE_EN = {'title': 'Interactive Traffic Light', 'cross': 'Simple Junction', 'cross_demo': 'Simple Junction (Demo)', 'square': 'Four Junctions', 'kuehne': 'Prof. Kühne', - 'bs3d': '3D Junction', + 'bs3d': '3D Junction Virtual World', + 'bs3Dosm': '3D Junction OpenStreetMap', 'ramp': 'Highway Scenario', 'high': 'Highscore', 'reset': 'Reset Highscore', @@ -46,13 +55,15 @@ 'cross_demo': 'Einfache Kreuzung (Demo)', 'square': 'Vier Kreuzungen', 'kuehne': 'Prof. Kühne', - 'bs3d': '3D Kreuzung', + 'bs3d': '3D Forschungskreuzung Virtuelle Welt', + 'bs3Dosm': '3D Forschungskreuzung OpenStreetMap', 'ramp': 'Autobahnauffahrt', 'high': 'Highscore', 'reset': 'Highscore zurücksetzen', 'lang': 'Englisch', 'quit': 'Beenden'} + def loadHighscore(): try: conn = httplib.HTTPConnection(_SCORESERVER) @@ -62,7 +73,7 @@ scores = {} for line in response.read().splitlines(): category, values = line.split() - scores[category] = _SCORES*[("", "", -1.)] + scores[category] = _SCORES * [("", "", -1.)] for idx, item in enumerate(values.split(':')): name, game, points = item.split(',') scores[category][idx] = (name, game, int(float(points))) @@ -76,18 +87,21 @@ pass return {} -def parseEndTime(cfg): + +def parseEndTime(cfg): cfg_doc = pulldom.parse(cfg) for event, parsenode in cfg_doc: if event == pulldom.START_ELEMENT and parsenode.localName == 'end': return float(parsenode.getAttribute('value')) break - + + class StartDialog: + def __init__(self, lang): # variables for changing language self._language_text = lang - self.buttons= {} + self.buttons = {} # misc variables self.name = '' # setup gui @@ -97,68 +111,76 @@ # we use a grid layout with 4 columns COL_DLRLOGO, COL_START, COL_HIGH, COL_SUMOLOGO = range(4) - # there is one column for every config, +2 more columns for control buttons - configs = glob.glob(os.path.join(base, "*.sumocfg")) + # there is one column for every config, +2 more columns for control + # buttons + configs = sorted(glob.glob(os.path.join(base, "*.sumocfg"))) numButtons = len(configs) + 3 # button dimensions - bWidth_start = 20 - bWidth_high = 7 - bWidth_control = 31 + bWidth_start = 30 + bWidth_high = 10 + bWidth_control = 41 self.gametime = 0 self.ret = 0 # some pretty images - dlrLogo = Tkinter.PhotoImage(file='dlr.gif') + dlrLogo = Tkinter.PhotoImage(file='dlr.gif') sumoLogo = Tkinter.PhotoImage(file='logo.gif') - Tkinter.Label(self.root, image=dlrLogo).grid(row=0, rowspan=numButtons, column=COL_DLRLOGO) - Tkinter.Label(self.root, image=sumoLogo).grid(row=0, rowspan=numButtons, column=COL_SUMOLOGO) + Tkinter.Label(self.root, image=dlrLogo).grid( + row=0, rowspan=numButtons, column=COL_DLRLOGO) + Tkinter.Label(self.root, image=sumoLogo).grid( + row=0, rowspan=numButtons, column=COL_SUMOLOGO) # 2 button for each config (start, highscore) for row, cfg in enumerate(configs): + if "bs3" in cfg and "meso-gui" not in guisimPath: + continue category = os.path.basename(cfg)[:-8] # lambda must make a copy of cfg argument - button=Tkinter.Button(self.root, width=bWidth_start, - command=lambda cfg=cfg:self.start_cfg(cfg)) + button = Tkinter.Button(self.root, width=bWidth_start, + command=lambda cfg=cfg: self.start_cfg(cfg)) self.addButton(button, category) button.grid(row=row, column=COL_START) - - button=Tkinter.Button(self.root, width=bWidth_high, - command=lambda cfg=cfg:ScoreDialog([], None, self.category_name(cfg)))#.grid(row=row, column=COL_HIGH) + + button = Tkinter.Button(self.root, width=bWidth_high, + command=lambda cfg=cfg: ScoreDialog([], None, self.category_name(cfg))) # .grid(row=row, column=COL_HIGH) self.addButton(button, 'high') button.grid(row=row, column=COL_HIGH) # control buttons - button=Tkinter.Button(self.root, width=bWidth_control, command=high.clear) + button = Tkinter.Button( + self.root, width=bWidth_control, command=high.clear) self.addButton(button, 'reset') button.grid(row=numButtons - 3, column=COL_START, columnspan=2) - - button=Tkinter.Button(self.root, width=bWidth_control, command=sys.exit) + + button = Tkinter.Button( + self.root, width=bWidth_control, command=sys.exit) self.addButton(button, 'quit') - button.grid(row=numButtons - 1, column=COL_START, columnspan = 2) - - button=Tkinter.Button(self.root, width=bWidth_control, command=lambda:self.change_language()) + button.grid(row=numButtons - 1, column=COL_START, columnspan=2) + + button = Tkinter.Button( + self.root, width=bWidth_control, command=lambda: self.change_language()) self.addButton(button, 'lang') - button.grid(row=numButtons - 2, column=COL_START, columnspan=2) - + button.grid(row=numButtons - 2, column=COL_START, columnspan=2) + self.root.grid() # The following three commands are needed so the window pops # up on top on Windows... self.root.iconify() self.root.update() self.root.deiconify() - self.root.mainloop() + self.root.mainloop() - def addButton(self, button, text): + def addButton(self, button, text): button["text"] = self._language_text.get(text, text) self.buttons[text] = button - - def change_language(self): + + def change_language(self): if self._language_text == _LANGUAGE_DE: self._language_text = _LANGUAGE_EN else: self._language_text = _LANGUAGE_DE for text, button in self.buttons.iteritems(): - button["text"]= self._language_text[text] + button["text"] = self._language_text[text] def category_name(self, cfg): return os.path.basename(cfg)[:-8] @@ -169,11 +191,12 @@ print "starting", cfg self.gametime = parseEndTime(cfg) self.ret = subprocess.call([guisimPath, "-S", "-G", "-Q", "-c", cfg]) - self.category = self.category_name(cfg) # remember which which cfg was launched - + # remember which which cfg was launched + self.category = self.category_name(cfg) class ScoreDialog: + def __init__(self, game, points, category): self.root = Tkinter.Tk() self.name = None @@ -185,11 +208,12 @@ self.root.minsize(250, 50) if not category in high: - high[category] = _SCORES*[("", "", -1.)] + high[category] = _SCORES * [("", "", -1.)] idx = 0 for n, g, p in high[category]: if not haveHigh and p < points: - Tkinter.Label(self.root, text=(str(idx + 1) + '. ')).grid(row=idx) + Tkinter.Label( + self.root, text=(str(idx + 1) + '. ')).grid(row=idx) self.name = Tkinter.Entry(self.root) self.name.grid(row=idx, sticky=Tkinter.W, column=1) self.scoreLabel = Tkinter.Label(self.root, text=str(points), @@ -201,23 +225,26 @@ if p == -1 or idx == _SCORES: break Tkinter.Label(self.root, text=(str(idx + 1) + '. ')).grid(row=idx) - Tkinter.Label(self.root, text=n, padx=5).grid(row=idx, sticky=Tkinter.W, column=1) + Tkinter.Label(self.root, text=n, padx=5).grid( + row=idx, sticky=Tkinter.W, column=1) Tkinter.Label(self.root, text=str(p)).grid(row=idx, column=2) idx += 1 if not haveHigh: - if points != None: # not called from the main menue + if points != None: # not called from the main menue Tkinter.Label(self.root, text='your score', padx=5, bg="indian red").grid(row=idx, sticky=Tkinter.W, column=1) Tkinter.Label(self.root, text=str(points), bg="indian red").grid(row=idx, column=2) idx += 1 else: - self.saveBut = Tkinter.Button(self.root, text="Save", command=self.save) + self.saveBut = Tkinter.Button( + self.root, text="Save", command=self.save) self.saveBut.grid(row=idx, column=1) - Tkinter.Button(self.root, text="Continue", command=self.quit).grid(row=idx, column=2) + Tkinter.Button(self.root, text="Continue", command=self.quit).grid( + row=idx, column=2) self.root.grid() self.root.bind("<Return>", self.save) - # self.root.wait_visibility() + # self.root.wait_visibility() # self.root.grab_set() if self.name: self.name.focus_set() @@ -231,7 +258,8 @@ def save(self, event=None): if self.name: name = self.name.get() - high[self.category].insert(self.idx, (name, self.game, self.points)) + high[self.category].insert( + self.idx, (name, self.game, self.points)) high[self.category].pop() self.saveBut.config(state=Tkinter.DISABLED) self.name.destroy() @@ -256,24 +284,57 @@ else: self.quit() - def quit(self, event=None): self.root.destroy() +stereoModes = ( + 'ANAGLYPHIC', 'QUAD_BUFFER', 'VERTICAL_SPLIT', 'HORIZONTAL_SPLIT') +optParser = OptionParser() +optParser.add_option("-s", "--stereo", metavar="OSG_STEREO_MODE", + help="Defines the stereo mode to use for 3D output; unique prefix of %s" % (", ".join(stereoModes))) +options, args = optParser.parse_args() base = os.path.dirname(sys.argv[0]) high = loadHighscore() -guisimBinary = "meso-gui" -if os.name != "posix": - guisimBinary += ".exe" -if os.path.exists(os.path.join(base, guisimBinary)): - guisimPath = os.path.join(base, guisimBinary) + + +def findSumoBinary(guisimBinary): + if os.name != "posix": + guisimBinary += ".exe" + elif guisimBinary.endswith("64"): + guisimBinary = guisimBinary[:-2] + if os.path.exists(os.path.join(base, guisimBinary)): + guisimPath = os.path.join(base, guisimBinary) + else: + guisimPath = os.environ.get( + "GUISIM_BINARY", os.path.join(base, '..', '..', 'bin', guisimBinary)) + if not os.path.exists(guisimPath): + guisimPath = guisimBinary + return guisimPath + +guisimPath = findSumoBinary("meso-gui64") +try: + subprocess.call([guisimPath, "-Q", "-c", "blub"], stderr=open(os.devnull)) +except OSError: + print("meso-gui64 not found. 3D scenario will not work.") + guisimPath = findSumoBinary("sumo-gui") + + +if options.stereo: + for m in stereoModes: + if m.lower().startswith(options.stereo.lower()): + os.environ["OSG_STEREO_MODE"] = m + os.environ["OSG_STEREO"] = "ON" + break + +lang = _LANGUAGE_EN +if "OSG_FILE_PATH" in os.environ: + os.environ["OSG_FILE_PATH"] += os.pathsep + \ + os.path.join(os.environ.get("SUMO_HOME", ""), "data", "3D") else: - guisimPath = os.environ.get("GUISIM_BINARY", os.path.join(base, '..', '..', 'bin', guisimBinary)) -if not os.path.exists(guisimPath): - guisimPath = guisimBinary -lang = _LANGUAGE_EN - + os.environ["OSG_FILE_PATH"] = os.path.join( + os.environ.get("SUMO_HOME", ""), "data", "3D") + while True: start = StartDialog(lang) totalDistance = 0 @@ -300,7 +361,8 @@ switch = [] lastProg = {} for line in open(os.path.join(base, "tlsstate.xml")): - m = re.search('tlsstate time="(\d+(.\d+)?)" id="([^"]*)" programID="([^"]*)"', line) + m = re.search( + 'tlsstate time="(\d+(.\d+)?)" id="([^"]*)" programID="([^"]*)"', line) if m: tls = m.group(3) program = m.group(4) @@ -308,7 +370,7 @@ lastProg[tls] = program switch += [m.group(3), m.group(1)] # doing nothing gives a waitingTime of 6033 for cross and 6700 for square - score = 10000 - totalWaitingTime + score = 10000 - totalWaitingTime if _DEBUG: print switch, score, totalArrived, complete if complete: diff -Nru sumo-0.21.0+dfsg/tools/game/setup.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/setup.py --- sumo-0.21.0+dfsg/tools/game/setup.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/setup.py 2015-04-17 05:44:20.000000000 +0000 @@ -3,11 +3,11 @@ @author Michael Behrisch @author Jakob Erdmann @date 2010-05-23 -@version $Id: setup.py 16358 2014-05-12 22:48:19Z behrisch $ +@version $Id: setup.py 18096 2015-03-17 09:50:59Z behrisch $ -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2008-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -17,17 +17,26 @@ """ from distutils.core import setup -import py2exe, sys, shutil, os, glob, zipfile -import subprocess, tempfile +import py2exe +import sys +import shutil +import os +import glob +import zipfile +import subprocess +import tempfile + +nightlyDir = r"O:\Daten\Sumo\Nightly" +sevenZip = r'C:\Program Files\7-Zip\7z.exe' +if not os.path.exists(sevenZip): + sevenZip = r'C:\Program Files (x86)\7-Zip\7z.exe' -nightlyDir="O:\\Daten\\Sumo\\Nightly" - -if len(sys.argv) == 1: - sys.argv.append("py2exe") internal = False if "internal" in sys.argv: internal = True - sys.arg.remove["internal"] + sys.argv.remove("internal") +if len(sys.argv) == 1: + sys.argv.append("py2exe") base = os.path.abspath(os.path.dirname(__file__)) oldDir = os.getcwd() @@ -37,24 +46,37 @@ setup(console=[os.path.join(base, 'runner.py')]) -for f in glob.glob(os.path.join(base, "*.sumocfg")): +for f in glob.glob(os.path.join(base, "*.sumocfg")): shutil.copy2(f, "dist") for f in ['input_additional.add.xml', 'logo.gif', 'dlr.gif']: shutil.copy2(os.path.join(base, f), "dist") for dir in ['cross', 'square', 'kuehne', 'highway', 'sounds', 'ramp', 'bs3d']: - subprocess.call(['svn', 'export', os.path.join(base, dir), os.path.join("dist", dir)]) -for dll in glob.glob(os.path.join(nightlyDir, "*.dll")): - shutil.copy2(dll, "dist") + subprocess.call( + ['svn', 'export', os.path.join(base, dir), os.path.join("dist", dir)]) +os.chdir("dist") if internal: - pluginDir = glob.glob(os.path.join(nightlyDir, "osgPlugins*"))[0] - shutil.copytree(pluginDir, os.path.join("dist", os.path.basename(pluginDir))) - shutil.copy2(os.path.join(nightlyDir, "meso-gui.exe"), "dist") + for dll in glob.glob(os.path.join(nightlyDir, 'bin64', '*.dll')): + shutil.copy2(dll, ".") + pluginDir = glob.glob(os.path.join(nightlyDir, 'bin64', 'osgPlugins*'))[0] + shutil.copytree(pluginDir, os.path.basename(pluginDir)) + shutil.copy2(os.path.join(nightlyDir, 'bin64', 'meso-gui64.exe'), ".") + for f in glob.glob(os.path.join(base, '..', '..', 'data', '3D', '*')): + shutil.copy2(f, ".") + os.chdir("bs3d") + subprocess.call([sevenZip, 'x', os.path.join( + nightlyDir, '..', '3D_Modell_Forschungskreuzung_BS.7z')]) + os.chdir("..") + zipf = zipfile.ZipFile( + os.path.join(nightlyDir, "sumo-game-internal.zip"), 'w', zipfile.ZIP_DEFLATED) else: - shutil.copy2(os.path.join(nightlyDir, "sumo-gui.exe"), "dist") + for dll in glob.glob(os.path.join(nightlyDir, "*.dll")): + shutil.copy2(dll, ".") + shutil.copy2(os.path.join(nightlyDir, "sumo-gui.exe"), ".") + zipf = zipfile.ZipFile( + os.path.join(nightlyDir, "sumo-game.zip"), 'w', zipfile.ZIP_DEFLATED) -zipf = zipfile.ZipFile(os.path.join(nightlyDir, "sumogame.zip"), 'w', zipfile.ZIP_DEFLATED) -root_len = len(os.path.abspath("dist")) -for root, dirs, files in os.walk("dist"): +root_len = len(os.path.abspath(".")) +for root, dirs, files in os.walk("."): archive_root = os.path.abspath(root)[root_len:] for f in files: fullpath = os.path.join(root, f) diff -Nru sumo-0.21.0+dfsg/tools/game/square/square.net.xml sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/square/square.net.xml --- sumo-0.21.0+dfsg/tools/game/square/square.net.xml 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/game/square/square.net.xml 2015-04-17 05:44:20.000000000 +0000 @@ -413,39 +413,39 @@ </edge> <tlLogic id="0/0" type="static" programID="0" offset="0"> - <phase duration="2" state="rrrrrrrrrrrrrrrr"/> + <phase duration="2" state="rrrruuuurrrruuuu"/> <phase duration="10000" state="rrrrGGggrrrrGGgg"/> </tlLogic> <tlLogic id="0/0" type="static" programID="1" offset="0"> - <phase duration="2" state="rrrrrrrrrrrrrrrr"/> + <phase duration="2" state="uuuurrrruuuurrrr"/> <phase duration="10000" state="GGggrrrrGGggrrrr"/> </tlLogic> <tlLogic id="0/1" type="static" programID="0" offset="0"> - <phase duration="2" state="rrrrrrrrrrrrrrrr"/> + <phase duration="2" state="rrrruuuurrrruuuu"/> <phase duration="10000" state="rrrrGGggrrrrGGgg"/> </tlLogic> <tlLogic id="0/1" type="static" programID="1" offset="0"> - <phase duration="2" state="rrrrrrrrrrrrrrrr"/> + <phase duration="2" state="uuuurrrruuuurrrr"/> <phase duration="10000" state="GGggrrrrGGggrrrr"/> </tlLogic> <tlLogic id="1/0" type="static" programID="0" offset="0"> - <phase duration="2" state="rrrrrrrrrrrrrrrr"/> + <phase duration="2" state="rrrruuuurrrruuuu"/> <phase duration="10000" state="rrrrGGggrrrrGGgg"/> </tlLogic> <tlLogic id="1/0" type="static" programID="1" offset="0"> - <phase duration="2" state="rrrrrrrrrrrrrrrr"/> + <phase duration="2" state="uuuurrrruuuurrrr"/> <phase duration="10000" state="GGggrrrrGGggrrrr"/> </tlLogic> <tlLogic id="1/1" type="static" programID="0" offset="0"> - <phase duration="2" state="rrrrrrrrrrrrrrrr"/> + <phase duration="2" state="rrrruuuurrrruuuu"/> <phase duration="10000" state="rrrrGGggrrrrGGgg"/> </tlLogic> <tlLogic id="1/1" type="static" programID="1" offset="0"> - <phase duration="2" state="rrrrrrrrrrrrrrrr"/> + <phase duration="2" state="uuuurrrruuuurrrr"/> <phase duration="10000" state="GGggrrrrGGggrrrr"/> </tlLogic> <tlLogic id="bottom0" type="static" programID="0" offset="0"> @@ -454,31 +454,31 @@ </tlLogic> <tlLogic id="bottom1" type="static" programID="0" offset="0"> <phase duration="31" state="G"/> - <phase duration="4" state="y"/> + <phase duration="4" state="y"/> </tlLogic> <tlLogic id="left0" type="static" programID="0" offset="0"> <phase duration="31" state="G"/> - <phase duration="4" state="y"/> + <phase duration="4" state="y"/> </tlLogic> <tlLogic id="left1" type="static" programID="0" offset="0"> <phase duration="31" state="G"/> - <phase duration="4" state="y"/> + <phase duration="4" state="y"/> </tlLogic> <tlLogic id="right0" type="static" programID="0" offset="0"> <phase duration="31" state="G"/> - <phase duration="4" state="y"/> + <phase duration="4" state="y"/> </tlLogic> <tlLogic id="right1" type="static" programID="0" offset="0"> <phase duration="31" state="G"/> - <phase duration="4" state="y"/> + <phase duration="4" state="y"/> </tlLogic> <tlLogic id="top0" type="static" programID="0" offset="0"> <phase duration="31" state="G"/> - <phase duration="4" state="y"/> + <phase duration="4" state="y"/> </tlLogic> <tlLogic id="top1" type="static" programID="0" offset="0"> <phase duration="31" state="G"/> - <phase duration="4" state="y"/> + <phase duration="4" state="y"/> </tlLogic> <junction id="0/0" type="traffic_light" x="200.00" y="200.00" incLanes="0/1to0/0_0 1/0to0/0_0 bottom0to0/0_0 left0to0/0_0" intLanes=":0/0_0_0 :0/0_1_0 :0/0_16_0 :0/0_17_0 :0/0_4_0 :0/0_5_0 :0/0_18_0 :0/0_19_0 :0/0_8_0 :0/0_9_0 :0/0_20_0 :0/0_21_0 :0/0_12_0 :0/0_13_0 :0/0_22_0 :0/0_23_0" shape="196.75,204.75 203.25,204.75 204.75,203.25 204.75,196.75 203.25,195.25 196.75,195.25 195.25,196.75 195.25,203.25"> diff -Nru sumo-0.21.0+dfsg/tools/generate-ns2.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/generate-ns2.py --- sumo-0.21.0+dfsg/tools/generate-ns2.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/generate-ns2.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,175 +0,0 @@ -#!/usr/bin/env python -""" -@file generate-ns2.py -@author Thimor Bohn -@author Axel Wegener -@author Michael Behrisch -@date 2006-08-07 -@version $Id: generate-ns2.py 15959 2014-03-17 16:58:35Z cschmidt87 $ - -automating generation of ns2-tracefiles - -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2008-2014 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. -""" - -exporter = "H:\\itm\\sumo\\tools\\traceExporter\\traceExporter.jar" -sumo = "H:\\itm\\sumo\\bin\\sumo.exe" -netconvert = "H:\\itm\\sumo\\bin\\netconvert.exe" -# -#END: change to your needs -# - -import os -import sys -from optparse import OptionParser - -# -# parse parameters -# - -usage = "usage: %prog [options]" -parser = OptionParser() -parser.add_option("--node", "-N", action="store", type="string", dest="nodefile", help="name of nodesfile to be read") -parser.add_option("--edge", "-E", action="store", type="string", dest="edgefile", help="name of edgesfile to be read") -parser.add_option("--route", "-r", action="store", type="string", dest="routefile", help="name of routesfile to be read") -parser.add_option("--net", "-n", action="store", type="string", dest="netfile", help="name of netfile to be read, you need either to specify this or node and edge") -parser.add_option("--begin", "-b", action="store", type="int", dest="begintime", help="time at which simulation starts") -parser.add_option("--end", "-e", action="store", type="int", dest="endtime", help="time at which simulation ends") -parser.add_option("--penetration", "-p", action="append", type="float", dest="penetration", help="penetration factor of vehicles in [0,1]") -parser.add_option("--seed", "-s", action="store", type="int", dest="seed", help="seed value for random generator") -(options, args) = parser.parse_args() - -# -# check: correct parameter combination? -# -ok = True -print "checking parameters..." -if (options.routefile==None): - print "you have to specify route" - ok = False - -if (options.netfile==None and (options.nodefile==None or options.edgefile==None)): - print "you have to specify either net or node and edge" - ok = False - -if (options.begintime==None): - print "you have to specify begin" - ok = False - -if (options.endtime==None): - print "you have to specify end" - ok = False - -if (options.penetration==None): - print "you have to specify penetration" - ok = False - -if (options.seed==None): - print "no seed specified - defaulting to 0" - options.seed = 0 - -if (ok == False): - sys.exit(1) - -print "done" - -# -# check: all files exist / parameters correct? -# -print "files exist?" -if (options.nodefile!=None): - if (os.path.isfile(options.nodefile)==False): - print "file does not exist:", options.nodefile - ok = False - -if (options.edgefile!=None): - if (os.path.isfile(options.edgefile)==False): - print "file does not exist:", options.edgefile - ok = False - -if (options.routefile!=None): - if (os.path.isfile(options.routefile)==False): - print "file does not exist:", options.routefile - ok = False - -if (options.netfile!=None): - if (os.path.isfile(options.netfile)==False): - print "file does not exist:", options.netfile - ok = False - -if (os.path.isfile(netconvert)==False): - print "file does not exist:", netconvert - ok = False - -if (os.path.isfile(sumo)==False): - print "file does not exist:", sumo - ok = False - -if (os.path.isfile(exporter)==False): - print "file does not exist:", exporter - ok = False - -for val in options.penetration: - if (val < 0 or val > 1): - print "penetration must be in [0,1]" - ok = False - -if (ok == False): - sys.exit(1) - -print "done" - -# -# do the work -# - -# -# create netfile if does not exist -# -if (options.netfile==None): - os.system(netconvert + " -n=" + options.nodefile + " -e=" + options.edgefile + " --output-file=net.xml --disable-normalize-node-positions") - if (os.path.isfile("net.xml")==False): - print "error creating net.xml" - sys.exit(1) - os.system(netconvert + " -n=" + options.nodefile + " -e=" + options.edgefile + " --output-file=net-normalized.xml") - if (os.path.isfile("net-normalized.xml")==False): - print "error creating net-normalized.xml" - sys.exit(1) - -# -# create netstate -# -if (options.netfile==None): - netfile="net.xml" -else: - netfile=options.netfile -os.system(sumo + " -n " + netfile + " -r " + options.routefile + " --netstate-dump netstate.xml -b " + str(options.begintime) + " -e " + str(options.endtime)) -if (os.path.isfile("netstate.xml")==False): - print "error creating netstate.xml" - sys.exit(1) - -# -# create mobility, activity -# -for penetration in options.penetration: - print "start: generation tracefile with penetration level of " + str(penetration) - os.system("java -jar " + exporter + " ns2 -n " + netfile + " -t netstate.xml -m mobility_" + str(penetration) + ".tcl -a activity_" + str(penetration) + ".tcl -c config_" + str(penetration) + ".tcl -p " + str(penetration) + " -s " + str(options.seed) + " -b " + str(options.begintime) + " -e " + str(options.endtime)) - if (os.path.isfile("mobility_" + str(penetration) + ".tcl")==False or os.path.isfile("activity_" + str(penetration) + ".tcl")==False or os.path.isfile("config_" + str(penetration)+".tcl")==False): - print "error creating mobility, activity, config" - sys.exit(1) - else: - print "finished: generation tracefile with penetration level of " + str(penetration) - - -# -# remove netstate -# -os.remove("netstate.xml") -sys.exit(0) diff -Nru sumo-0.21.0+dfsg/tools/import/osm/index.html sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/import/osm/index.html --- sumo-0.21.0+dfsg/tools/import/osm/index.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/import/osm/index.html 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html> + <head> + <title>sumo-websocket + + + + + + + +
    + +
    + + Position +
    + + + +
    +
    + + Exportieren +
    + +
    +
    +
    + + diff -Nru sumo-0.21.0+dfsg/tools/import/osm/lib.js sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/import/osm/lib.js --- sumo-0.21.0+dfsg/tools/import/osm/lib.js 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/import/osm/lib.js 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,44 @@ +function elem(r){ + if(r[0] == "<"){ + var n = document.createElement(r.substring(1, r.length - 1)); + var s = arguments[1] || {}; + var i, j; + for(i in s){ + if(i == "css") i = "style"; + if(s[i] instanceof Object){ + for(j in s[i]) + n[i][j] = s[i][j]; + } else + n[i] = s[i]; + } + s = arguments[2] || {}; + for(i in s) + n.addEventListener(i, s[i]); + return n; + } else + return document.querySelector(r); +} + +function on(type, callback){ + if(type == "ready") type = "DOMContentLoaded"; + addEventListener(type, callback); +} + +HTMLElement.prototype.on = function(type, callback){ + this.addEventListener(type, callback); +} + +HTMLElement.prototype.elem = function(r){ + return this.querySelector(r); +} + +HTMLElement.prototype.append = function(n){ + if(typeof n == "string") n = elem.apply(void 0, arguments); + return this.appendChild(n); +} + +function lequal(){ + for(var i = 1, l = arguments.length; i < l; ++i) + if(arguments[i - 1] > arguments[i]) return false; + return true; +} diff -Nru sumo-0.21.0+dfsg/tools/import/osm/osmBuild.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/import/osm/osmBuild.py --- sumo-0.21.0+dfsg/tools/import/osm/osmBuild.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/import/osm/osmBuild.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ @author Jakob Erdmann @author Michael Behrisch @date 2009-08-01 -@version $Id: osmBuild.py 16425 2014-05-26 06:40:31Z behrisch $ +@version $Id: osmBuild.py 18125 2015-03-23 10:09:53Z namdre $ Retrieves an area from OpenStreetMap. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -19,51 +19,82 @@ (at your option) any later version. """ -import os,sys,optparse,subprocess +import os +import sys +import optparse +import subprocess from os import path -sys.path.append(os.path.join(os.environ.get("SUMO_HOME", os.path.join(os.path.dirname(__file__), '..', '..')), 'tools')) +sys.path.append(os.path.join(os.environ.get( + "SUMO_HOME", os.path.join(os.path.dirname(__file__), '..', '..')), 'tools')) import sumolib -vclassRemove = {"passenger" : " --keep-edges.by-vclass passenger", - "road" : " --remove-edges.by-vclass tram,rail_urban,rail_electric,bicycle,pedestrian", - "all" : "" } +vclassRemove = {"passenger": " --keep-edges.by-vclass passenger", + "road": " --remove-edges.by-vclass tram,rail_urban,rail_electric,bicycle,pedestrian", + "all": ""} possibleVClassOptions = '|'.join(vclassRemove.keys()) +DEFAULT_NETCONVERT_OPTS = "--geometry.remove,--remove-edges.isolated,--roundabouts.guess,--ramps.guess,-v,--junctions.join,--osm.railway.oneway-default,--tls.guess-signals,--tls.discard-simple,--tls.join" + optParser = optparse.OptionParser() optParser.add_option("-p", "--prefix", default="osm", help="for output file") -optParser.add_option("-f", "--osm-file", help="full name of the osm file to import") # don't know whether area or bbox call was used -optParser.add_option("-m", "--typemap", default=None, help="typemap file for the extraction of colored areas (optional)") -optParser.add_option("-o", "--oldapi-prefix", default=None, help="prefix that was used for retrieval with the old API") -optParser.add_option("-t", "--tiles", type="int", default=1, help="number of tiles used for retrieving OSM-data via the old api") -optParser.add_option("-c", "--vehicle-classes", default='all',help="[(%s)]extract network for a reduced set of vehicle classes" % possibleVClassOptions) -optParser.add_option("-d", "--output-directory", default=os.getcwd(), help="directory in which to put the output files") -optParser.add_option("-n", "--netconvert-options", default="-R,--ramps.guess,--tls.guess,--tls.join,-v", help="comma-separated options for netconvert") -optParser.add_option("-y", "--polyconvert-options", default="-v,--osm.keep-full-type", help="comma-separated options for polyconverty") +# don't know whether area or bbox call was used +optParser.add_option( + "-f", "--osm-file", help="full name of the osm file to import") +optParser.add_option("-m", "--typemap", default=None, + help="typemap file for the extraction of colored areas (optional)") +optParser.add_option("--netconvert-typemap", default=None, + help="typemap files for netconverter (optional)") +optParser.add_option("-o", "--oldapi-prefix", default=None, + help="prefix that was used for retrieval with the old API") +optParser.add_option("-t", "--tiles", type="int", default=1, + help="number of tiles used for retrieving OSM-data via the old api") +optParser.add_option("-c", "--vehicle-classes", default='all', + help="[(%s)]extract network for a reduced set of vehicle classes" % possibleVClassOptions) +optParser.add_option("-d", "--output-directory", default=os.getcwd(), + help="directory in which to put the output files") +optParser.add_option("-n", "--netconvert-options", + default=DEFAULT_NETCONVERT_OPTS, help="comma-separated options for netconvert") +optParser.add_option("--pedestrians", action="store_true", + default=False, help="add pedestrian infrastructure to the network") +optParser.add_option("-y", "--polyconvert-options", + default="-v,--osm.keep-full-type", help="comma-separated options for polyconvert") + -def build(args=None, bindir=os.environ.get('SUMO_BINDIR','')): +def build(args=None, bindir=None): (options, args) = optParser.parse_args(args=args) - netconvert = sumolib.checkBinary('netconvert') - polyconvert = sumolib.checkBinary('polyconvert') + netconvert = sumolib.checkBinary('netconvert', bindir) + polyconvert = sumolib.checkBinary('polyconvert', bindir) if ((options.oldapi_prefix and options.osm_file) or not (options.oldapi_prefix or options.osm_file)): - optParser.error("exactly one of the options --osm-file and --oldapi-prefix must be supplied") + optParser.error( + "exactly one of the options --osm-file and --oldapi-prefix must be supplied") if options.typemap and not path.isfile(options.typemap): # fail early because netconvert may take a long time - optParser.error('typemap file "%s" not found' % options.typemap) + optParser.error('typemap file "%s" not found' % options.typemap) if not (options.vehicle_classes in vclassRemove): - optParser.error('invalid vehicle class "%s" given' % options.vehicle_classes) + optParser.error('invalid vehicle class "%s" given' % + options.vehicle_classes) if not path.isdir(options.output_directory): - optParser.error('output directory "%s" does not exist' % options.output_directory) + optParser.error('output directory "%s" does not exist' % + options.output_directory) - netconvertOpts = ' ' + ' '.join(options.netconvert_options.split(',')) + ' --osm-files ' - polyconvertOpts = ' ' + ' '.join(options.polyconvert_options.split(',')) + ' --type-file %s --osm-files ' % options.typemap + netconvertOpts = ' ' + \ + ' '.join(options.netconvert_options.split(',')) + ' --osm-files ' + if options.pedestrians: + netconvertOpts = " --sidewalks.guess --crossings.guess" + \ + netconvertOpts + if options.netconvert_typemap: + netconvertOpts = " -t " + options.netconvert_typemap + netconvertOpts + polyconvertOpts = ' ' + \ + ' '.join(options.polyconvert_options.split(',')) + \ + ' --type-file %s --osm-files ' % options.typemap prefix = options.oldapi_prefix - if prefix: # used old API + if prefix: # used old API num = options.tiles for i in range(num): if i != 0: @@ -72,27 +103,29 @@ netconvertOpts += "%s%s_%s.osm.xml" % (prefix, i, num) polyconvertOpts += "%s%s_%s.osm.xml" % (prefix, i, num) - else: # used new API + else: # used new API netconvertOpts += options.osm_file polyconvertOpts += options.osm_file - prefix = path.basename(options.osm_file).replace('.osm.xml','') + prefix = path.basename(options.osm_file).replace('.osm.xml', '') if options.prefix: prefix = options.prefix remove = vclassRemove[options.vehicle_classes] - netfile = path.join(options.output_directory, prefix+'.net.xml') - polyfile = path.join(options.output_directory, prefix+'.poly.xml') + netfile = path.join(options.output_directory, prefix + '.net.xml') + polyfile = path.join(options.output_directory, prefix + '.poly.xml') call(netconvert + netconvertOpts + remove + " -o %s" % netfile) if options.typemap: - call(polyconvert + polyconvertOpts + " -n %s -o %s" % (netfile, polyfile)) + call(polyconvert + polyconvertOpts + " -n %s -o %s" % + (netfile, polyfile)) + def call(cmd): # ensure unix compatibility - #print(cmd) + # print(cmd) if isinstance(cmd, str): - cmd = filter(lambda a: a!='', cmd.split(' ')) + cmd = filter(lambda a: a != '', cmd.split(' ')) subprocess.call(cmd) diff -Nru sumo-0.21.0+dfsg/tools/import/osm/osmGet.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/import/osm/osmGet.py --- sumo-0.21.0+dfsg/tools/import/osm/osmGet.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/import/osm/osmGet.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,12 +5,12 @@ @author Jakob Erdmann @author Michael Behrisch @date 2009-08-01 -@version $Id: osmGet.py 15692 2014-02-22 09:17:02Z behrisch $ +@version $Id: osmGet.py 18096 2015-03-17 09:50:59Z behrisch $ Retrieves an area from OpenStreetMap. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2009-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2009-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -19,9 +19,15 @@ (at your option) any later version. """ -import os, sys, httplib, StringIO, gzip, optparse +import os +import sys +import httplib +import StringIO +import gzip +import optparse from os import path + def readCompressed(conn, query, filename): conn.request("POST", "/api/interpreter", """ @@ -46,12 +52,17 @@ optParser = optparse.OptionParser() optParser.add_option("-p", "--prefix", default="osm", help="for output file") -optParser.add_option("-b", "--bbox", help="bounding box to retrieve in geo coordinates south,west,north,east") -optParser.add_option("-o", "--oldapi", action="store_true", default=False, help="use old API for retrieval") -optParser.add_option("-t", "--tiles", type="int", default=1, help="number of tiles when using old api") -optParser.add_option("-d", "--output-dir", help="optional output directory (must already exist)") +optParser.add_option( + "-b", "--bbox", help="bounding box to retrieve in geo coordinates south,west,north,east") +optParser.add_option("-o", "--oldapi", action="store_true", + default=False, help="use old API for retrieval") +optParser.add_option("-t", "--tiles", type="int", + default=1, help="number of tiles when using old api") +optParser.add_option( + "-d", "--output-dir", help="optional output directory (must already exist)") optParser.add_option("-a", "--area", type="int", help="area id to retrieve") + def get(args=None): (options, args) = optParser.parse_args(args=args) @@ -60,7 +71,7 @@ if options.oldapi and options.area: optParser.error("Only the new API supports 'area'.") if options.bbox: - south,west,north,east = [float(v) for v in options.bbox.split(',')] + south, west, north, east = [float(v) for v in options.bbox.split(',')] if south > north or west > east: optParser.error("Invalid geocoordinates in bbox.") if options.output_dir: @@ -71,12 +82,13 @@ b = west conn = httplib.HTTPConnection("api.openstreetmap.org") for i in range(num): - e = b + (east-west) / float(num) + e = b + (east - west) / float(num) req = "/api/0.6/map?bbox=%s,%s,%s,%s" % (b, south, e, north) conn.request("GET", req) r = conn.getresponse() print req, r.status, r.reason - out = open(path.join(os.getcwd(), "%s%s_%s.osm.xml" % (options.prefix, i, num)), "w") + out = open( + path.join(os.getcwd(), "%s%s_%s.osm.xml" % (options.prefix, i, num)), "w") out.write(r.read()) out.close() b = e @@ -87,15 +99,17 @@ if options.area: if options.area < 3600000000: options.area += 3600000000 - readCompressed(conn, '' % options.area, options.prefix + "_city.osm.xml") + readCompressed(conn, '' % + options.area, options.prefix + "_city.osm.xml") if options.bbox: if options.tiles == 1: - readCompressed(conn, '' % (north, south, west, east), options.prefix + "_bbox.osm.xml") + readCompressed(conn, '' % + (north, south, west, east), options.prefix + "_bbox.osm.xml") else: num = options.tiles b = west for i in range(num): - e = b + (east-west) / float(num) + e = b + (east - west) / float(num) readCompressed(conn, '' % ( north, south, b, e), "%s%s_%s.osm.xml" % (options.prefix, i, num)) b = e diff -Nru sumo-0.21.0+dfsg/tools/import/osm/osmPopulationExtractor.py sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/import/osm/osmPopulationExtractor.py --- sumo-0.21.0+dfsg/tools/import/osm/osmPopulationExtractor.py 2014-06-11 22:20:49.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/import/osm/osmPopulationExtractor.py 2015-04-17 05:44:20.000000000 +0000 @@ -5,7 +5,7 @@ @author Melanie Knocke @author Michael Behrisch @date 2013-02-08 -@version $Id: osmPopulationExtractor.py 16005 2014-03-24 12:46:02Z cschmidt87 $ +@version $Id: osmPopulationExtractor.py 18096 2015-03-17 09:50:59Z behrisch $ This script is to - extract the popoulation data from a given Open Street Map (OSM). @@ -13,8 +13,8 @@ The redundant information is removed and saved in the output file *_redundantOSMData.txt. If there are data entries without names, they will be saved in *_nameNone.txt. -SUMO, Simulation of Urban MObility; see http://sumo-sim.org/ -Copyright (C) 2013-2014 DLR (http://www.dlr.de/) and contributors +SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ +Copyright (C) 2013-2015 DLR (http://www.dlr.de/) and contributors This file is part of SUMO. SUMO is free software; you can redistribute it and/or modify @@ -23,11 +23,15 @@ (at your option) any later version. """ -import os, sys, math +import os +import sys +import math from xml.sax import saxutils, make_parser, handler from optparse import OptionParser + class Net(): + def __init__(self): self._relations = [] self._nodes = [] @@ -35,14 +39,14 @@ self._relationMap = {} self._uidNodeMap = {} self._uidRelationMap = {} - + def addNode(self, id, lat, lon, population): if id not in self._nodeMap: node = Node(id, lat, lon, population) self._nodes.append(node) self._nodeMap[id] = node return self._nodeMap[id] - + def addRelation(self, id, uid, population): if id not in self._relationMap: relation = Relation(id, uid, population) @@ -50,11 +54,14 @@ self._relationMap[id] = relation return self._relationMap[id] - + + class Node: + """ This class is to store node information. """ + def __init__(self, id, lat, lon, population): self.id = id self.lat = lat @@ -64,13 +71,17 @@ self.place = None self.name = None self.population = population + def __repr__(self): return "<%s|%s_%s_%s>" % (self.id, self.name, self.uid, self.population) - + + class Relation: + """ This class is to store relation information. """ + def __init__(self, id, uid, population): self.id = id self.uid = uid @@ -78,13 +89,17 @@ self.name = None self.type = None self.population = population + def __repr__(self): return "%s|%s_%s" % (self.id, self.name, self.uid, self.population) - + + class PopulationReader(handler.ContentHandler): + """The class is for parsing the OSM XML file. The data parsed is written into the net. """ + def __init__(self, net, foutredundant, encoding): self._net = net self._nodeId = None @@ -94,7 +109,7 @@ self._nodeuid = None self._place = None self._relationId = None - self._relationObj = None + self._relationObj = None self._relationuid = None self._type = None self._name = None @@ -104,7 +119,7 @@ self._encoding = encoding def startElement(self, name, attrs): - if name =='node': + if name == 'node': self._nodeId = attrs['id'] self._nodeLat = attrs['lat'] self._nodeLon = attrs['lon'] @@ -123,7 +138,7 @@ self._population = attrs['v'] if not self._population and attrs['k'] == 'population': self._population = attrs['v'] - if name =='relation': + if name == 'relation': self._relationId = attrs['id'] self._uid = attrs['uid'] if attrs.has_key('uid'): @@ -142,14 +157,18 @@ if name == 'node' and self._population: newInput = True for n in self._net._nodes: - diffLat = abs(float(self._nodeLat) -float( n.lat)) + diffLat = abs(float(self._nodeLat) - float(n.lat)) diffLon = abs(float(self._nodeLon) - float(n.lon)) - if self._name and self._name == n.name and self._population == n.population: #and diffLat < 0.003 and diffLon < 0.003 and int(self._population) == int(n.population): - newInput = False - self._fout.write(('node\t%s\t%s\t%s\t%s\t%s\n' %(self._name, self._nodeId, self._nodeLat, self._nodeLon, self._population)).encode(self._encoding)) + # and diffLat < 0.003 and diffLon < 0.003 and + # int(self._population) == int(n.population): + if self._name and self._name == n.name and self._population == n.population: + newInput = False + self._fout.write(('node\t%s\t%s\t%s\t%s\t%s\n' % ( + self._name, self._nodeId, self._nodeLat, self._nodeLon, self._population)).encode(self._encoding)) break - if newInput: - self._nodeObj = self._net.addNode(self._nodeId, self._nodeLat, self._nodeLon, self._population) + if newInput: + self._nodeObj = self._net.addNode( + self._nodeId, self._nodeLat, self._nodeLon, self._population) if self._nodeuid: self._nodeObj.uid = self._nodeuid if self._nodeuid not in self._net._uidNodeMap: @@ -172,26 +191,31 @@ newInput = True for r in self._net._relations: if self._name and self._name == r.name and self._population == r.population: - newInput = False - self._fout.write(('relation\t%s\t%s\t%s\t%s\n' %(self._name, self._relationId, self._relationuid, self._population)).encode(options.encoding)) + newInput = False + self._fout.write(('relation\t%s\t%s\t%s\t%s\n' % ( + self._name, self._relationId, self._relationuid, self._population)).encode(options.encoding)) break if newInput: - self._relationObj = self._net.addRelation(self._relationId, self._relationuid, self._population) + self._relationObj = self._net.addRelation( + self._relationId, self._relationuid, self._population) self._relationObj.population = self._population if self._relationuid not in self._net._uidRelationMap: self._net._uidRelationMap[self._relationuid] = [] - self._net._uidRelationMap[self._relationuid].append(self._relationObj) + self._net._uidRelationMap[ + self._relationuid].append(self._relationObj) if self._name: self._relationObj.name = self._name if self._type: self._relationObj.place = self._type self._relationId = None - self._relationObj = None + self._relationObj = None self._relationuid = None self._type = None self._name = None self._population = None + + def main(): parser = make_parser() osmFile = options.osmfile @@ -203,22 +227,24 @@ prefix = options.outputfile else: prefix = osmFile.split('.')[0] - redundantDataFile = '%s_redundantOSMData.txt' %prefix + redundantDataFile = '%s_redundantOSMData.txt' % prefix foutredundant = open(redundantDataFile, 'w') net = Net() - parser.setContentHandler(PopulationReader(net, foutredundant,options.encoding)) + parser.setContentHandler( + PopulationReader(net, foutredundant, options.encoding)) parser.parse(osmFile) foutredundant.close() print 'finish with data parsing' if options.generateoutputs: print 'write the population to the output file' - outputfile = '%s_populations.txt' %prefix + outputfile = '%s_populations.txt' % prefix fout = open(outputfile, 'w') fout.write("attribute\tid\tname\tuid\tpopulation\tlat\tlon\n") for n in net._nodes: - fout.write(("%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (n.attribute, n.id, n.name, n.uid, n.population, n.lat, n.lon)).encode(options.encoding)) + fout.write(("%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % ( + n.attribute, n.id, n.name, n.uid, n.population, n.lat, n.lon)).encode(options.encoding)) fout.close() - + if os.path.exists(outputfile): fout = open(outputfile, 'a') else: @@ -227,35 +253,39 @@ fout = open(outputfile, 'w') for r in net._relations: - fout.write(("%s\t%s\t%s\t%s\t%s\tNone\tNone\n" % (r.attribute, r.id, r.name, r.uid, r.population)).encode(options.encoding)) + fout.write(("%s\t%s\t%s\t%s\t%s\tNone\tNone\n" % ( + r.attribute, r.id, r.name, r.uid, r.population)).encode(options.encoding)) fout.close() - - fout = open('%s_nodesWithSameUid.txt' %prefix, 'w') + + fout = open('%s_nodesWithSameUid.txt' % prefix, 'w') fout.write('nodeUid\tnodeId\tname\n') for r in net._uidNodeMap: fout.write('%s' % r) for n in net._uidNodeMap[r]: - fout.write(('\t%s\t%s' % (n.id,n.name)).encode(options.encoding)) + fout.write( + ('\t%s\t%s' % (n.id, n.name)).encode(options.encoding)) fout.write('\n') fout.close() - - fout = open('%s_uidRelations.txt' %prefix, 'w') + + fout = open('%s_uidRelations.txt' % prefix, 'w') fout.write('relationUid\trelationId\tname\n') for r in net._uidRelationMap: fout.write('%s' % r) for n in net._uidRelationMap[r]: - fout.write(('\t%s\t%s' % (n.id, n.name)).encode(options.encoding)) + fout.write( + ('\t%s\t%s' % (n.id, n.name)).encode(options.encoding)) fout.write('\n') fout.close() - - if options.bsafile: + + if options.bsafile: print 'compare the data with the data from BSA' bsaTotalCount = 0 matchedCount = 0 bsaNamesList = [] - fout = open("%s_matchedAreas.txt" %prefix, 'w') - fout.write("#bsaName\tbsaArea\tbsaPop\tbsaLat\tbsaLon\tosmName\tosmAtt\tosmPop\tosmLat\tosmLon\n") + fout = open("%s_matchedAreas.txt" % prefix, 'w') + fout.write( + "#bsaName\tbsaArea\tbsaPop\tbsaLat\tbsaLon\tosmName\tosmAtt\tosmPop\tosmLat\tosmLon\n") noneList = [] for line in open(options.bsafile): if '#' not in line: @@ -271,37 +301,44 @@ for n in net._nodes: if n.name == None and n not in noneList: noneList.append(n) - elif n.name != None and name == n.name:# and n.name not in areasList: + # and n.name not in areasList: + elif n.name != None and name == n.name: matchedCount += 1 - fout.write(("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" %(name, area, pop, lat, lon, n.name, n.attribute, n.population, n.lat, n.lon)).encode(options.encoding)) - + fout.write(("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % ( + name, area, pop, lat, lon, n.name, n.attribute, n.population, n.lat, n.lon)).encode(options.encoding)) + for r in net._relations: if r.name == None and r not in noneList: noneList.append(r) - elif r.name != None and name == r.name:# and r.name not in areasList: + # and r.name not in areasList: + elif r.name != None and name == r.name: matchedCount += 1 - fout.write(("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\tNone\tNone\n" %(name, area, pop, lat, lon, r.name, r.attribute, r.population)).encode(options.encoding)) + fout.write(("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\tNone\tNone\n" % ( + name, area, pop, lat, lon, r.name, r.attribute, r.population)).encode(options.encoding)) fout.close() if len(noneList) > 0: - foutnone = open("%s_nameNone.txt" %prefix, 'w') + foutnone = open("%s_nameNone.txt" % prefix, 'w') foutnone.write("nodeId\tnodeName\tPopulation\tLat\tLon\n") for n in noneList: - foutnone.write(("%s\t%s\t%s\t%s\t%s\n" % (n.id, n.name, n.population, n.lat, n.lon)).encode(options.encoding)) + foutnone.write(("%s\t%s\t%s\t%s\t%s\n" % ( + n.id, n.name, n.population, n.lat, n.lon)).encode(options.encoding)) foutnone.close() - osmTotalCount = len(net._nodes) + len(net._relations) #Duplicated data does not exist. + # Duplicated data does not exist. + osmTotalCount = len(net._nodes) + len(net._relations) print 'matched count in OSM and BSA data:', matchedCount print 'Number of entries in the BSA data:', bsaTotalCount print 'Number of entries in the OSM data:', osmTotalCount optParser = OptionParser() -optParser.add_option("-s", "--osm-file", dest="osmfile", +optParser.add_option("-s", "--osm-file", dest="osmfile", help="read OSM file from FILE (mandatory)", metavar="FILE") -optParser.add_option("-b", "--bsa-file", dest="bsafile", +optParser.add_option("-b", "--bsa-file", dest="bsafile", help="read population (in csv form) provided by German federal statistic authority (Bundesstatistikamt) from FILE", metavar="FILE") -optParser.add_option("-o", "--output-file", dest="outputfile", +optParser.add_option("-o", "--output-file", dest="outputfile", help="define the prefix name of the output file") -optParser.add_option("-e", "--encoding", help="output file encoding (default: %default)", default="utf8") -optParser.add_option("-g", "--generate-outputs", dest="generateoutputs", action="store_true", +optParser.add_option( + "-e", "--encoding", help="output file encoding (default: %default)", default="utf8") +optParser.add_option("-g", "--generate-outputs", dest="generateoutputs", action="store_true", default=False, help="generate output files") (options, args) = optParser.parse_args() diff -Nru sumo-0.21.0+dfsg/tools/import/osm/script.js sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/import/osm/script.js --- sumo-0.21.0+dfsg/tools/import/osm/script.js 1970-01-01 00:00:00.000000000 +0000 +++ sumo-0.23.0+dfsg+5+11~ubuntu14.10.1/tools/import/osm/script.js 2015-04-17 05:44:20.000000000 +0000 @@ -0,0 +1,251 @@ +on("ready", function(){ + elem("#export-button").on("click", function(){ + var cor = map.getExtent(); + cor.transform( + map.getProjectionObject(), // from Spherical Mercator Projection + new OpenLayers.Projection("EPSG:4326") + ); + + //calculates the coordinates of the rectangle if area-picking is active + if(canvasActive){ + var width = cor.right - cor.left; + var height = cor.bottom - cor.top; + cor = [ + cor.top + height * canvasRect[3], + cor.left + width * canvasRect[0], + cor.top + height * canvasRect[1], + cor.left + width * canvasRect[2] + ]; + } else + cor = [cor.bottom, cor.left, cor.top, cor.right]; + + socket.send("coords: " + cor.join(",")); + }); + + /** + * @param de: the display string + * @param en: the internal string + */ + function Settings(de, en, fringeFactor){ + this._init(de, en, fringeFactor); + } + Settings.prototype = { + _init: function(de, en, fringeFactor){ + var node = elem("", {className: "container", textContent: de}); + var checkbox = elem("", {type: "checkbox"}); + checkbox.on("click", function(evt){ + socket.send(en + ": " + (evt.target.checked? "+" : "")); + }); + node.append(checkbox); + + var options = elem("
    ", {className: "options"}); + var label = elem("