Skip to content

Commit

Permalink
updated lib-sumo for SUMO 0.26; includes vehicle API.
Browse files Browse the repository at this point in the history
  • Loading branch information
William Emfinger committed Apr 25, 2016
1 parent 7f6a1ea commit 0e12a65
Show file tree
Hide file tree
Showing 98 changed files with 1,205 additions and 1,005 deletions.
9 changes: 9 additions & 0 deletions src/sumo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ else()
endif()

include_directories(include)
include_directories(include/foreign/eulerspiral)
include_directories(include/foreign/mersenne)
include_directories(include/foreign/tcpip)
include_directories(include/traci-server)
include_directories(include/utils/common)
include_directories(include/utils/iodevices)
include_directories(include/utils/options)
include_directories(include/utils/traci)
include_directories(include/utils/xml)
add_library(sumo
src/sumo/sumo_client.cpp
src/utils/traci/TraCIAPI.cpp
Expand Down
176 changes: 148 additions & 28 deletions src/sumo/include/config.h
Original file line number Diff line number Diff line change
@@ -1,41 +1,89 @@
/* src/config.h. Generated from config.h.in by configure. */
/* src/config.h.in. Generated from configure.ac by autoheader. */

/* Define to 1 in order to enable memory checks. */
/* #undef CHECK_MEMORY_LEAKS */

/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
/* #undef CRAY_STACKSEG_END */

/* Define to 1 if using `alloca.c'. */
/* #undef C_ALLOCA */

/* defines the number of digits after the comma in geo-coordinates output */
#define GEO_OUTPUT_ACCURACY 6

/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* Define to 1 if you have `alloca', as a function or macro. */
#define HAVE_ALLOCA 1

/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
#define HAVE_ALLOCA_H 1

/* Define if compiling under cygwin */
/* #undef HAVE_CYGWIN */

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Reporting string for enabled options */
#define HAVE_ENABLED "x86_64-suse-linux-gnu InternalLanes DoublePrecision TRACI PROJ GDAL GUI UnitTests ffmpeg"

/* defined if ffmpeg is available */
#define HAVE_FFMPEG 1

/* Define to 1 if you have the <float.h> header file. */
#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

/* Define to 1 if you have the `gethostbyname' function. */
#define HAVE_GETHOSTBYNAME 1
/* defined if GDAL is available */
#define HAVE_GDAL 1

/* Define to 1 if you have the `getcwd' function. */
#define HAVE_GETCWD 1

/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1

/* Define to 1 if you want junction internal lanes */
#define HAVE_INTERNAL_LANES 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1

/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1

/* Define to 1 if you have the <math.h> header file. */
#define HAVE_MATH_H 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1

/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1

/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
/* defined if osg is available */
/* #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 to 1 if you have the `select' function. */
#define HAVE_SELECT 1
Expand All @@ -44,23 +92,33 @@
#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. */
/* #undef HAVE_STAT_EMPTY_STRING_BUG */

/* Define to 1 if stdbool.h conforms to C99. */
#define HAVE_STDBOOL_H 1

/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1

/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1

Expand All @@ -76,8 +134,28 @@
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define if auto-generated version.h should be used. */
#define HAVE_VERSION_H 1

/* Define to 1 if you have the <wchar.h> header file. */
#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. */
#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1

/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"

/* Including windows.h gives errors otherwise (cygwin) */
/* #undef NOMINMAX */

/* Define to 1 in order to disable TraCI Server. */
/* #undef NO_TRACI */

/* defines the epsilon to use on general floating point comparison */
#define NUMERICAL_EPS (SUMOReal)0.001
Expand All @@ -86,40 +164,78 @@
#define OUTPUT_ACCURACY 2

/* Name of package */
#define PACKAGE "sumocpp"
#define PACKAGE "sumo"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""

/* Define to the full name of this package. */
#define PACKAGE_NAME "sumocpp"
#define PACKAGE_NAME "sumo"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "sumocpp 0.1.0"
#define PACKAGE_STRING "sumo 0.26.0"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "sumocpp"
#define PACKAGE_TARNAME "sumo"

/* Define to the home page for this package. */
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "0.1.0"
#define PACKAGE_VERSION "0.26.0"

/* defines the epsilon to use on position comparison */
#define POSITION_EPS (SUMOReal)0.1

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void

/* Define to the type of arg 1 for `select'. */
#define SELECT_TYPE_ARG1 int

/* Define to the type of args 2, 3 and 4 for `select'. */
#define SELECT_TYPE_ARG234 (fd_set *)

/* Define to the type of arg 5 for `select'. */
#define SELECT_TYPE_ARG5 (struct timeval *)

/* defines the type for very long integers */
#define SUMOLong long long int
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at runtime.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
/* #undef STACK_DIRECTION */

/* Define to 1 if you have the ANSI C header files. */
/* #undef STDC_HEADERS */

/* defines the precision of floats */
#define SUMOReal double

/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1

/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */

/* Version number of package */
#define VERSION "0.1.0"
#define VERSION "0.26.0"

/* Defined if auto-generated version.h is unavailable. */
/* #undef VERSION_STRING */

/* Xerces and Fox expect this to be defined (cygwin) */
/* #undef WIN32 */

/* Define length for Xerces 3. */
#define XERCES3_SIZE_t XMLSize_t

/* Define to 1 in order to enable sumo debugging code. */
/* #undef _DEBUG */

/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */

/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
Expand All @@ -129,3 +245,7 @@

/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */

/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */
28 changes: 28 additions & 0 deletions src/sumo/include/foreign/mersenne/MersenneTwister.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@

#include <iostream>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <time.h>
#include <math.h>
Expand All @@ -75,6 +76,7 @@ class MTRand {
// Data
public:
typedef unsigned long uint32; // unsigned integer type, at least 32 bits
typedef unsigned long long int uint64; // unsigned integer type, at least 64 bits

enum { N = 624 }; // length of state vector
enum { SAVE = N + 1 }; // length of array for save()
Expand Down Expand Up @@ -106,6 +108,8 @@ class MTRand {
double randDblExc( const double& n ); // real number in (0,n)
uint32 randInt(); // integer in [0,2^32-1]
uint32 randInt( const uint32& n ); // integer in [0,n] for n < 2^32

uint64 randInt64( const uint64& n ); // integer in [0,n] for n < 2^64
double operator()() { return rand(); } // same as rand()

// Access to 53-bit random numbers (capacity of IEEE double precision)
Expand Down Expand Up @@ -218,6 +222,30 @@ inline MTRand::uint32 MTRand::randInt( const uint32& n )
}


inline MTRand::uint64 MTRand::randInt64( const uint64& n )
{
if (n <= INT_MAX) {
return randInt((uint32)n);
}
// Find which bits are used in n
// Optimized by Magnus Jonsson ([email protected])
uint64 used = n;
used |= used >> 1;
used |= used >> 2;
used |= used >> 4;
used |= used >> 8;
used |= used >> 16;
used |= used >> 32;

// Draw numbers until one is found in [0,n]
uint64 i;
do
i = (((uint64)randInt() << 32) | randInt()) & used; // toss unused bits to shorten search
while( i > n );
return i;
}


inline void MTRand::seed( const uint32 oneSeed )
{
// Seed the generator with a simple uint32
Expand Down
Loading

0 comments on commit 0e12a65

Please sign in to comment.