34 #define SUMOTime_MAX (std::numeric_limits<SUMOTime>::max() - 1000)
35 #define SUMOTime_MIN std::numeric_limits<SUMOTime>::min()
36 #define SUMOTime_MAX_PERIOD (SUMOTime_MAX - SUMOTime_MAX % DELTA_T)
42 #define TS (static_cast<double>(DELTA_T)/1000.)
45 #define SPEED2DIST(x) ((x)*TS)
47 #define DIST2SPEED(x) ((x)/TS)
49 #define ACCEL2DIST(x) ((x)*TS*TS)
51 #define ACCEL2SPEED(x) ((x)*TS)
53 #define SPEED2ACCEL(x) ((x)/TS)
55 #define STEPS2TIME(x) (static_cast<double>(x)/1000.)
57 #define TIME2STEPS(x) (static_cast<SUMOTime>((x) * 1000. + ((x) >= 0 ? 0.5 : -0.5)))
58 #define STEPFLOOR(x) (static_cast<SUMOTime>((x)/DELTA_T)*DELTA_T)
59 #define STEPS2MS(x) (x)
61 #define SIMSTEP MSNet::getInstance()->getCurrentTimeStep()
62 #define SIMTIME STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep())
void checkTimeBounds(const double time)
check the valid SUMOTime range of double input and throw an error if out of bounds
std::string elapsedMs2string(long long int t)
convert ms to string for log output
bool checkStepLengthMultiple(const SUMOTime t, const std::string &error="", SUMOTime deltaT=DELTA_T, SUMOTime begin=0)
check if given SUMOTime is multiple of the step length
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)