120 return std::abs( n );
192 friend std::ostream&( ::operator<< )( std::ostream&,
const Time& );
223#define LIM_POS_INF_ms DBL_MAX
230#define LIM_NEG_INF_ms ( -DBL_MAX )
320 static void set_resolution(
double tics_per_ms,
double ms_per_step );
403 assert( divisor.
tics > 0 );
404 return (
tics % divisor.
tics ) == 0;
606 if ( t.
tics == 0 or n / t.
tics == factor )
610 if ( ( t.
tics > 0 and factor > 0 ) or ( t.
tics < 0 and factor < 0 ) )
Class to convert times from one representation to another.
Definition nest_timeconverter.h:42
Definition nest_time.h:135
friend Time operator-(const Time &t1, const Time &t2)
Definition nest_time.h:596
bool is_step() const
Definition nest_time.h:395
friend bool operator<=(const Time &t1, const Time &t2)
Definition nest_time.h:578
void set_to_zero()
Definition nest_time.h:341
Time(step t)
Definition nest_time.h:295
friend bool operator>=(const Time &t1, const Time &t2)
Definition nest_time.h:584
void calibrate()
Definition nest_time.h:452
Time & operator+=(const Time &t)
Definition nest_time.h:462
static double get_tics_per_ms()
Definition nest_time.h:484
Time()
Definition nest_time.h:285
friend bool operator==(const Time &t1, const Time &t2)
Definition nest_time.h:554
static double delay_steps_to_ms(long steps)
Convert between delays given in steps and milliseconds.
Definition nest_time.h:529
bool is_finite() const
Definition nest_time.h:369
bool is_pos_inf() const
Definition nest_time.h:384
Time(tic t)
Definition nest_time.h:288
static bool resolution_is_default()
Definition nest_time.h:331
bool is_neg_inf() const
Definition nest_time.h:375
static void reset_to_defaults()
Definition nest_time.cpp:147
static struct nest::Time::LimitNegInf LIM_NEG_INF
Time(ms t)
Definition nest_time.h:302
static Time get_resolution()
Definition nest_time.h:325
static tic_t compute_max()
Definition nest_time.cpp:55
friend bool operator>(const Time &t1, const Time &t2)
Definition nest_time.h:572
tic_t tics
Definition nest_time.h:171
static void reset_resolution()
Definition nest_time.cpp:111
Time succ() const
Definition nest_time.h:354
static void set_resolution(double tics_per_ms)
Definition nest_time.cpp:85
static Limit LIM_MAX
Definition nest_time.h:213
Time(ms_stamp t)
Definition nest_time.h:310
tic_t get_tics() const
Definition nest_time.h:474
static long delay_ms_to_steps(double ms)
Definition nest_time.h:535
static Time min()
Definition nest_time.h:417
Time(tic_t tics)
Definition nest_time.h:277
static tic_t fromstamp(ms_stamp)
Definition nest_time.cpp:123
long get_steps() const
Definition nest_time.h:504
friend bool operator<(const Time &t1, const Time &t2)
Definition nest_time.h:566
static Time pos_inf()
Definition nest_time.h:432
Time pred() const
Definition nest_time.h:359
static Time neg_inf()
Definition nest_time.h:427
Time::Limit limit(const tic_t &)
static tic_t get_tics_per_step()
Definition nest_time.h:479
void range()
Definition nest_time.h:442
friend Time operator*(const long factor, const Time &t)
Definition nest_time.h:602
static struct nest::Time::LimitPosInf LIM_POS_INF
friend Time operator+(const Time &t1, const Time &t2)
Definition nest_time.h:590
bool is_multiple_of(const Time &divisor) const
Definition nest_time.h:401
static Time max()
Definition nest_time.h:412
static Limit LIM_MIN
Definition nest_time.h:214
static double get_ms_per_tic()
Definition nest_time.h:422
bool is_grid_time() const
Definition nest_time.h:390
friend bool operator!=(const Time &t1, const Time &t2)
Definition nest_time.h:560
void advance()
Definition nest_time.h:347
double get_ms() const
Definition nest_time.h:490
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
const Time TimeZero
Definition nest_time.h:547
Time operator-(const Time &t1, const Time &t2)
Definition nest_time.h:596
N time_abs(const N n)
Class to handle simulation time and realtime.
Definition nest_time.h:118
Time operator*(const long factor, const Time &t)
Definition nest_time.h:602
bool operator<=(const Time &t1, const Time &t2)
Definition nest_time.h:578
long long tic_t
Type for Time tics.
Definition nest_types.h:103
bool operator<(const histentry_extended &he, double t)
Definition histentry.h:67
Time operator+(const Time &t1, const Time &t2)
Definition nest_time.h:590
constexpr tic_t tic_t_max
Definition nest_types.h:104
bool operator>(const Time &t1, const Time &t2)
Definition nest_time.h:572
bool operator==(const Time &t1, const Time &t2)
Definition nest_time.h:554
bool operator>=(const Time &t1, const Time &t2)
Definition nest_time.h:584
constexpr long delay_max
Definition nest_types.h:147
bool operator!=(const Time &t1, const Time &t2)
Definition nest_time.h:560
#define LIM_POS_INF_ms
Definition nest_time.h:223
#define LIM_NEG_INF_ms
Definition nest_time.h:230
std::ostream & operator<<(std::ostream &, const nest::Time &)
Definition nest_time.cpp:163
long ld_round(double x)
Round to nearest int, rounding midpoints upwards.
Definition numerics.cpp:41
Definition nest_time.h:227
static const tic_t tics
Definition nest_time.h:228
static const long steps
Definition nest_time.h:229
Definition nest_time.h:220
static const tic_t tics
Definition nest_time.h:221
static const long steps
Definition nest_time.h:222
Definition nest_time.h:200
double ms
Definition nest_time.h:203
tic_t tics
Definition nest_time.h:201
long steps
Definition nest_time.h:202
Limit(tic_t tics, long steps, double ms)
Definition nest_time.h:205
Definition nest_time.h:147
static const long INF_MARGIN
Definition nest_time.h:160
static const double TICS_PER_MS_DEFAULT
Definition nest_time.h:158
static tic_t TICS_PER_STEP
Definition nest_time.h:148
static const tic_t TICS_PER_STEP_DEFAULT
Definition nest_time.h:157
static double TICS_PER_MS
Definition nest_time.h:152
static double STEPS_PER_MS
Definition nest_time.h:154
static double TICS_PER_STEP_INV
Definition nest_time.h:149
static double MS_PER_STEP
Definition nest_time.h:155
static tic_t TICS_PER_STEP_RND
Definition nest_time.h:150
static double MS_PER_TIC
Definition nest_time.h:153
Definition nest_time.h:264
double t
Definition nest_time.h:265
ms_stamp(double t)
Definition nest_time.h:266
Definition nest_time.h:255
double t
Definition nest_time.h:256
ms(double t)
Definition nest_time.h:257
Definition nest_time.h:246
step(long t)
Definition nest_time.h:248
long t
Definition nest_time.h:247
Definition nest_time.h:239
tic_t t
Definition nest_time.h:240
tic(tic_t t)
Definition nest_time.h:241