138 SIMLIB_Current->
_Run();
141 }
while( SIMLIB_Current != 0 );
149 Dprintf((
"\n ********************* STOP *********************\n"));
161 Dprintf((
"\n ********************* ABORT *********************\n"));
180 Dprintf((
"\n\t ************************* Init(%g,%g) #%lu \n",
181 T0, T1, SIMLIB_experiment_no));
184 Dprintf((
"\n SIMLIB library version %x.%02x ",
186 Dprintf((
" SIMLIB header version %x.%02x \n",
187 version >> 8, version & 0xFF));
229 Dprintf((
"\n\t ********** Run() --- START \n"));
234 if( NextTime < StartTime )
243 SIMLIB_run_statistics.
Init();
257 while( Time < EndTime && !StopFlag ) {
258 int endFlag = NextTime >
EndTime;
262 if( Time < NextTime ) {
269 while( Time < NextTime ) {
274 if(SIMLIB_run_statistics.
MinStep<0) {
301 while( Time >= NextTime && !StopFlag && !
SQS::Empty() ) {
315 Dprintf((
"\n\t ********** Run() --- END \n"));
const double SIMLIB_MAXTIME
maximum time (1e30 works for float, too)
void SIMLIB_error(const enum _ErrEnum N)
print error message and abort program
const double & StepSize
actual integration step
void Stop()
stop current simulation run
virtual void _Run() noexcept=0
run the Behavior() function
void Run()
run simulation experiment
static void IntegrationDone(void)
bool SIMLIB_ResetStatus
flag set if there is a need for integration method restart
void SIMLIB_DoConditions()
void Init()
initialize - used at the start of each Run()
Implementation of class CalendarList interface is static - using global functions in SQS namespace...
SIMLIB_statistics_t()
constructor runs SIMLIB_statistics_t::Init()
abstract base class for active entities (Process, Event) instances of derived classes provide Behavio...
Entity *const & Current
pointer to active (now running) entity
const double & Time
model time (is NOT the block)
void SIMLIB_Init(double T0, double T1, unsigned version)
const double & EndTime
time of simulation end
static SIMLIB_statistics_t SIMLIB_run_statistics
const SIMLIB_Phase_t & Phase
This variable contains the current phase of experiment (used for internal checking) ...
Entity * GetFirst()
remove entity with minimum activation time
#define SIMLIB_internal_error()
void InstallBreak(void(*f)())
InstallBreak — set function for checking if user breaks simulation.
Internal header file for SIMLIB/C++.
void SIMLIB_ContinueInit()
const double & NextTime
next-event time
static void StepSim(void)
step of numerical integration method
Main SIMLIB/C++ interface.
#define INSTALL_HOOK(name, function)
bool Empty()
empty calendar predicate
#define _SetTime(t, x)
macro for simple assignement to internal time variables
SIMLIB_Phase_t
values indicate current phase of experiment
unsigned long SIMLIB_experiment_no
SIMLIB_Phase_t SIMLIB_Phase
continuous signal delay block
const double SIMLIB_MINTIME
minimal time value
const SIMLIB_statistics_t & SIMLIB_statistics
interface to internal run-time statistics structure
void Abort()
end simulation program
internal statistics structure contains basic statistics of simulator execution
const double & StartTime
time of simulation start
const unsigned SIMLIB_version
library version
void Clear()
remove all scheduled entities