SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
StdDefs.h
Go to the documentation of this file.
1
/****************************************************************************/
10
//
11
/****************************************************************************/
12
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13
// Copyright (C) 2005-2014 DLR (http://www.dlr.de/) and contributors
14
/****************************************************************************/
15
//
16
// This file is part of SUMO.
17
// SUMO is free software: you can redistribute it and/or modify
18
// it under the terms of the GNU General Public License as published by
19
// the Free Software Foundation, either version 3 of the License, or
20
// (at your option) any later version.
21
//
22
/****************************************************************************/
23
#ifndef StdDefs_h
24
#define StdDefs_h
25
26
27
// ===========================================================================
28
// included modules
29
// ===========================================================================
30
#ifdef _MSC_VER
31
#include <
windows_config.h
>
32
#else
33
#include <
config.h
>
34
#endif
35
36
#include <
utils/xml/SUMOXMLDefinitions.h
>
37
38
/* avoiding compiler warning unreferenced parameter */
39
#define UNUSED_PARAMETER(x) ((void)(x))
40
41
class
RGBColor
;
42
43
/* -------------------------------------------------------------------------
44
* some constant defaults used by SUMO
45
* ----------------------------------------------------------------------- */
46
const
SUMOReal
SUMO_const_laneWidth
= (
SUMOReal
) 3.2;
47
const
SUMOReal
SUMO_const_halfLaneWidth
= (
SUMOReal
) 1.6;
48
const
SUMOReal
SUMO_const_quarterLaneWidth
= (
SUMOReal
) 0.8;
49
const
SUMOReal
SUMO_const_laneOffset
= (
SUMOReal
) .1;
50
const
SUMOReal
SUMO_const_laneWidthAndOffset
= (
SUMOReal
) 3.3;
51
const
SUMOReal
SUMO_const_halfLaneAndOffset
= (
SUMOReal
)(3.2 / 2. + .1);
52
54
const
SUMOReal
SUMO_const_haltingSpeed
= (
SUMOReal
) 0.1;
55
56
/* @brief map from LinkState to color constants (see above)
57
*/
58
const
RGBColor
&
getLinkColor
(
const
LinkState
& ls);
59
60
61
/* -------------------------------------------------------------------------
62
* templates for mathematical functions missing in some c++-implementations
63
* ----------------------------------------------------------------------- */
64
template
<
typename
T>
65
inline
T
66
MIN2
(T a, T b) {
67
return
a < b ? a : b;
68
}
69
70
template
<
typename
T>
71
inline
T
72
MAX2
(T a, T b) {
73
return
a > b ? a : b;
74
}
75
76
77
template
<
typename
T>
78
inline
T
79
MIN3
(T a, T b, T c) {
80
return
MIN2
(c, a < b ? a : b);
81
}
82
83
84
template
<
typename
T>
85
inline
T
86
MAX3
(T a, T b, T c) {
87
return
MAX2
(c, a > b ? a : b);
88
}
89
90
91
template
<
typename
T>
92
inline
T
93
MIN4
(T a, T b, T c, T d) {
94
return
MIN2
(
MIN2
(a, b),
MIN2
(c, d));
95
}
96
97
98
template
<
typename
T>
99
inline
T
100
MAX4
(T a, T b, T c, T d) {
101
return
MAX2
(
MAX2
(a, b),
MAX2
(c, d));
102
}
103
104
105
template
<
typename
T>
106
inline
T
107
ISNAN
(T a) {
108
volatile
T d = a;
109
return
d != d;
110
}
111
113
extern
bool
gDebugFlag1
;
114
extern
bool
gDebugFlag2
;
115
116
#endif
117
118
/****************************************************************************/
119
tmp
buildd
sumo-0.21.0+dfsg
src
utils
common
StdDefs.h
Generated on Thu Nov 20 2014 19:49:59 for SUMO - Simulation of Urban MObility by
1.8.1.2