StdDefs.h
Go to the documentation of this file.00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef StdDefs_h
00020 #define StdDefs_h
00021
00022
00023
00024
00025
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031
00032
00033
00034
00035
00036 const SUMOReal SUMO_const_laneWidth = (SUMOReal) 3.2;
00037 const SUMOReal SUMO_const_halfLaneWidth = (SUMOReal) 1.6;
00038 const SUMOReal SUMO_const_quarterLaneWidth = (SUMOReal) 0.8;
00039 const SUMOReal SUMO_const_laneOffset = (SUMOReal) .1;
00040 const SUMOReal SUMO_const_laneWidthAndOffset = (SUMOReal) 3.3;
00041 const SUMOReal SUMO_const_halfLaneAndOffset = (SUMOReal)(3.2/2.+.1);
00042
00043
00044
00045
00046
00047 #define mBYs2kmBYh(x) ((SUMOReal) (x/3.6))
00048
00049
00050
00051
00052
00053 template<typename T>
00054 inline T
00055 MIN2(T a, T b) {
00056 return a<b?a:b;
00057 }
00058
00059 template<typename T>
00060 inline T
00061 MAX2(T a, T b) {
00062 return a>b?a:b;
00063 }
00064
00065
00066 template<typename T>
00067 inline T
00068 MIN3(T a, T b, T c) {
00069 return MIN2(c, a<b?a:b);
00070 }
00071
00072
00073 template<typename T>
00074 inline T
00075 MAX3(T a, T b, T c) {
00076 return MAX2(c, a>b?a:b);
00077 }
00078
00079
00080 template<typename T>
00081 inline T
00082 MIN4(T a, T b, T c, T d) {
00083 return MIN2(MIN2(a,b),MIN2(c,d));
00084 }
00085
00086
00087 template<typename T>
00088 inline T
00089 MAX4(T a, T b, T c, T d) {
00090 return MAX2(MAX2(a,b),MAX2(c,d));
00091 }
00092
00093
00094 #endif
00095
00096
00097