8#define __SIMLIB__ 0x0309
9#define SIMLIB_VERSION "3.09"
11#define SIMLIB_COPYRIGHT "(c) Petr Peringer, 1991-2022"
43# error "Use C++ compiler, please."
46#if (__cplusplus < 201103L)
47# error "Use C++11 (or newer) compiler, please."
68# error "MSDOS not supported - please, use older version of SIMLIB"
70#elif defined(__linux__) && defined(__GNUC__)
72# define SIMLIB_SYSTEM "Linux"
73# define SIMLIB_COMPILER "GNU C++"
75#elif defined(__WIN32__)
77# define SIMLIB_SYSTEM "WIN32"
78# if defined(__BCPLUSPLUS__)
79# define SIMLIB_COMPILER "Borland C++"
80# elif defined(__GNUC__)
81# define SIMLIB_COMPILER "GNU C++"
84#elif defined(__DragonFly__) && defined(__GNUC__)
86# define SIMLIB_SYSTEM "DragonFly"
87# define SIMLIB_COMPILER "GNU C++"
89#elif defined(__FreeBSD__) && defined(__GNUC__)
91# define SIMLIB_SYSTEM "FreeBSD"
92# define SIMLIB_COMPILER "GNU C++"
95# warning "SIMLIB is not tested on this system/compiler"
103unsigned long Debug(
unsigned long mode=~0UL);
167extern const double &
Time;
187 extern void SIMLIB_Init(
double t0,
double t1,
unsigned version);
198void SetStep(
double dtmin,
double dtmax);
220[[noreturn]]
void Error(
const char *fmt, ...);
224int Print(
const char *fmt, ...);
227int _Print(
const char *fmt, ...);
231int Print(
const double x);
235int Print(
const double x,
const double y);
240int Print(
const double x,
const double y,
const double z);
269double Beta(
double th,
double fi,
double min,
double max);
271double Erlang(
double alfa,
int beta);
275double Gamma(
double alfa,
double beta);
279double Logar(
double mi,
double delta);
281int NegBin(
double q,
int k);
284double Normal(
double mi,
double sigma);
287double Rayle(
double delta);
290double Uniform(
double l,
double h);
292double Weibul(
double lambda,
double alfa);
318 void *
operator new(
size_t size);
319 void operator delete(
void *ptr);
320 void *
operator new[](
size_t size) =
delete;
321 void operator delete[](
void *ptr) =
delete;
325 virtual std::string
Name()
const;
327 void SetName(
const std::string &name);
330 virtual void Output()
const;
395 double _RemainingTime;
396 unsigned long _RequiredCapacity;
420 virtual void Out()
override;
424 virtual void _Run() noexcept = 0;
447 virtual void _Run() noexcept override;
466 virtual void Output()
const override;
467 virtual std::string
Name()
const override;
469 virtual void Activate(
double t)
override;
471 virtual void Wait(
double dtime);
473#ifdef I_REALLY_KNOW_HOW_TO_USE_WAITUNTIL
475# define WaitUntil(condition) while(_WaitUntil(condition)) ;
494 virtual void _Run()
noexcept override;
500 virtual void Output()
const override;
501 virtual std::string
Name()
const override;
503 virtual void Activate(
double t)
override;
521 Sampler(
void (*pf)(),
double dt=0.0);
523 virtual void Output()
const override;
550 aStat(
const char *name);
552 virtual void Clear() = 0;
554 virtual void operator () (
double x) = 0;
555 virtual void Record(
double x) = 0;
557 virtual double MeanValue() = 0;
558 double Min()
const {
return min; }
559 double Max()
const {
return max; }
560 unsigned long NumberOfRecords()
const {
return n; }
561 virtual void Output()
const override;
577 explicit Stat(
const char *name);
579 virtual void Clear();
583 virtual void Output()
const override;
611 explicit TStat(
double initval=0.0);
612 explicit TStat(
const char *name,
double initval=0.0);
614 virtual void Clear(
double initval=0.0);
615 virtual void Output()
const override;
662 explicit List(
const char *_name);
664 virtual void Output()
const override;
699 explicit Queue(
const char *_name);
702 virtual void Output()
const override;
741 virtual void Output()
const override;
744 virtual void Clear();
767 explicit Facility(
const char *_name);
771 virtual void Output()
const override;
775 bool Busy()
const {
return in!=
nullptr; }
781 virtual void Clear();
799 explicit Store(
unsigned long _capacity);
800 Store(
const char *_name,
unsigned long _capacity);
802 Store(
const char *_name,
unsigned long _capacity,
Queue *queue);
804 virtual void Output()
const override;
816 virtual void Leave(
unsigned long rcap);
818 virtual void Clear();
844 virtual void _Eval();
887#define RegisterReference(aContiBlockPtr)
888#define UnRegisterReference(aContiBlockPtr)
958 double Value()
override;
995 static std::list<Integrator*> *
Instance(
void);
1030 static std::list<Status*>*
Instance(
void);
1069 std::list<IntegrationMethod*>::iterator
ItList;
1114 virtual void Resize(
size_t cs);
1124 virtual void Resize(
size_t size);
1129 static void SetMethod(
const char* name);
1134 static void InitStep(
double step_frag);
1135 static void FunCall(
double step_frag);
1179 static void SetStarter(
const char* name,
const char* slave_name);
1181 virtual void SetStarter(
const char* slave_name);
1183 static const char*
GetStarter(
const char* name);
1185 virtual void TurnOff(
void)
override;
1234 virtual void TurnOff(
void)
override;
1310 void Init(
double initvalue);
1312 void Set(
double value);
1317 void Eval()
override;
1318 double Value()
override;
1351 void Init(
double initvalue);
1353 void Set(
double value);
1354 virtual void Eval()
override;
1355 virtual double Value()
override;
1379 virtual void Eval()
override;
1397 virtual void Eval()
override;
1413 double y1,
double y2);
1414 virtual void Eval()
override;
1459 double (*
f)(double);
1462 virtual double Value()
override;
1473 double (*
f)(double,double);
1476 virtual double Value()
override;
1501 static bool isAny();
1515 virtual void Init()
override;
1518 virtual bool Test()
override;
1566 Lim(
Input in,
double l,
double h,
double tga=1.0);
1567 virtual void _Eval()
override;
1568 virtual double Value()
override;
1583 Insv(
Input in,
double l,
double h,
double tga=1.0,
double tgb=1.0);
1584 virtual void _Eval()
override;
1585 virtual double Value()
override;
1600 virtual void _Eval()
override;
1601 virtual double Value()
override;
1616 Frict(
Input in,
double l,
double h,
double tga=1.0);
1617 virtual void _Eval()
override;
1618 virtual double Value()
override;
1635 Rline(
Input in,
int num,
double *X,
double *Y);
1638 virtual void _Eval()
override;
1639 virtual double Value()
override;
1663 double t_min,
double t_max,
double t0);
1664 void Set(
double eps,
unsigned long max_it,
1665 double t_min,
double t_max,
double t0);
1666 void Set(
double eps,
unsigned long max_it,
1667 double t_min,
double t_max);
1679 double t_min,
double t_max,
double t0):
1680 AlgLoop(i, eps, max_it, t_min, t_max, t0)
1682 virtual double Value()
override;
1693 double t_min,
double t_max):
1694 AlgLoop(i, eps, max_it, t_min, t_max, t_min)
1696 virtual double Value()
override;
1708 double t_min,
double t_max):
1709 AlgLoop(i, eps, max_it, t_min, t_max, t_min),
1712 virtual double Value()
override;
1725 double t_min,
double t_max,
double t0):
1726 AlgLoop(i, eps, max_it, t_min, t_max, t0),
1730 virtual double Value()
override;
1771 virtual void Output()
const override;
1789 Barrier(
const char *_name,
unsigned N);
1794 virtual bool Wait();
1795 virtual int Break();
1797 virtual void Output()
const override;
AlgLoop(Input i, double eps, unsigned long max_it, double t_min, double t_max, double t0)
void Set(double eps, unsigned long max_it, double t_min, double t_max, double t0)
synchronization tool for processes
virtual bool Wait()
wait for barrier break (Current)
unsigned n
current number of waiting entities
void Init()
initialization
void ChangeHeight(unsigned new_maxn)
change size
virtual void Enter(Entity *e)
wait for barrier break TODO: remove/rename
Entity ** waiting
array of waiting entities (fixed size)
virtual int Break()
activate all waiting entities
virtual void Output() const override
print status
Barrier(unsigned N)
constructor
void Clear()
initialization
unsigned maxn
barrier height/size
unsigned Height() const
barrier size
Bisect(Input i, double eps, unsigned long max_it, double t_min, double t_max)
virtual double Value() override
nonlinear block - backlash
Blash(Input i, double p1, double p2, double tga)
blash constructor
virtual void Eval() override
evaluate without loop detection
bool Test() override
Condition::operator ().
bool Test() override
Condition::operator ().
change detector - Boolean version (int)
Input SetInput(Input inp)
virtual void SetNewStatus() override
update
bool Value()
boolean state of condition
virtual bool Test() override
Condition::operator ().
unsigned char ccl
old state
virtual void Init() override
initialize
block: constant (value can not be changed)
virtual double Value() override
abstract base class for active entities (Process, Event) instances of derived classes provide Behavio...
EventNotice * GetEventNotice()
virtual void _Run() noexcept=0
run the Behavior() function
EntityPriority_t Priority_t
Entity(Priority_t p=DEFAULT_PRIORITY)
constructor
bool Idle()
entity activation is not scheduled in calendar
void Activate()
activate now
EventNotice * _evn
points to calendar item, iff scheduled
Priority_t Priority
priority of the entity (scheduling,queues)
static unsigned long _Number
current number of entities
void Cancel()
end Behavior() and remove entity
virtual void Terminate()=0
end Behavior() and remove entity
double ActivationTime()
get activation time of entity - iff scheduled it is here, because Entity has no knowledge of calend...
ServicePriority_t _SPrio
priority of service in Facility
friend void SIMLIB_DoActions()
virtual void Out() override
remove entity from queue
virtual void Passivate()
deactivation
unsigned long _Ident
unique identification number of entity
friend struct EventNotice
abstract base class for events Event behavior is simple function (can not be interrupted)
virtual void Output() const override
print object to default output
virtual void Behavior()=0
behavior description
virtual void Terminate() override
passivate event, it will be destroyed if not activated later in Behavior() Should not be used.
virtual void Activate(double t) override
activate at time t (schedule)
virtual std::string Name() const override
name of object
virtual void _Run() noexcept override
activation method, called from simulation control algorithm
Event(Priority_t p=DEFAULT_PRIORITY)
constructor, default priority if not specified
(SOL-like) facility Facility with exclusive access and service priority
virtual void QueueIn2(Entity *e)
virtual void QueueIn(Entity *e, ServicePriority_t sp)
bool Busy() const
in service
virtual void Seize(Entity *e, ServicePriority_t sp=DEFAULT_PRIORITY)
virtual void Release(Entity *e)
unsigned char _Qflag
true if facility is owner of input queue
virtual void Clear()
initialize
TStat tstat
usage statistics
virtual void Output() const override
print statistics
Queue * Q2
Interrupted requests queue.
Entity * in
Entity currently in service.
bool OwnQueue() const
test for default queue
void SetQueue(Queue *queue1)
change input queue
unsigned QueueLen() const
Entity * In() const
current entity or nullptr
nonlinear block: friction
virtual void _Eval() override
evaluation with algebraic loop detection
virtual double Value() override
Frict(Input in, double l, double h, double tga=1.0)
friction constructor
virtual double Value() override
Function1 & operator=(const Function1 &)=delete
Function1(const Function1 &)=delete
Function2(const Function2 &)=delete
Function2 & operator=(const Function2 &)=delete
virtual double Value() override
double(*) f(double, double)
unsigned operator[](unsigned i) const
void operator()(double x)
virtual void Output() const override
print to default output
void Init(double low, double step, unsigned count)
nonlinear block - hysteresis
virtual void Eval() override
evaluate without loop detection
Hyst(Input i, double p1, double p2, double y1, double y2, double tga)
hysteresis constructor
nonlinear block: dead zone
virtual void _Eval() override
evaluation with algebraic loop detection
Insv(Input in, double l, double h, double tga=1.0, double tgb=1.0)
dead space
virtual double Value() override
static const size_t page_size
std::list< Memory * >::iterator it_list
Memory(const Memory &)=delete
double & operator[](size_t ind)
std::list< Memory * > * ListPtr
Memory & operator=(const Memory &)=delete
IntegrationMethod - Abstract base class for integration methods.
virtual void Resize(size_t size)
resize all the memories to the given size
static std::list< Memory * > * PtrMList
static IntegrationMethod * CurrentMethodPtr
pointer to the method currently used "rke" is a predefined method (historical reasons,...
virtual bool IsSingleStep(void)=0
static void Summarize(void)
set up new state after execution of integration step
static Iterator LastIntegrator(void)
virtual void Integrate(void)=0
virtual void TurnOff(void)
turn off integration method: flush memories etc...
static void SetErrNo(int num)
static void Iterate(void)
compute new values of state blocks in model without integrators
IntegrationMethod(IntegrationMethod &)
static bool IsEndStepEvent
static int GetErrNo(void)
static const char * GetMethod(void)
static bool Prepare(void)
initialize integration step
IntegrationMethod & operator=(const IntegrationMethod &)=delete
static void InitStep(double step_frag)
initialize step
IntegrationMethod(const IntegrationMethod &)=delete
static IntegrationMethod * SearchMethod(const char *name)
search method in the list of registrated methods
IntegratorContainer::iterator Iterator
static std::list< IntegrationMethod * > * MthLstPtr
static bool StateCond(void)
check on changes of state conditions
virtual bool PrepareStep(void)
prepare object for integration step
static bool IsConditionFlag(void)
static void IntegrationDone(void)
static void SetMethod(const char *name)
set method which will be used
static void SetOptStep(double opt_step)
static void StepSim(void)
step of numerical integration method
std::list< Memory * > MList
static void SetStepSize(double step_size)
static Iterator FirstIntegrator(void)
std::list< IntegrationMethod * >::iterator ItList
static void FunCall(double step_frag)
static iterator Insert(Integrator *ptr)
static void Erase(iterator it)
static void EvaluateAll()
static std::list< Integrator * > * ListPtr
list of integrators
static iterator End(void)
static iterator Begin(void)
std::list< Integrator * >::iterator iterator
static std::list< Integrator * > * Instance(void)
block for numerical integration input is derivative, output is state
double Value() override
the state of integrator
void SetOldState(double s)
Input SetInput(Input inp)
set integrator input block expression
double initval
initial value: y(t0)
void Set(double value)
set the integrator status value (step change)
Integrator()
constructor for special cases (arrays of integrators) Input can be set using method Integrator::Set
void SetOldDiff(double d)
double InputValue()
current input value
IntegratorContainer::iterator it_list
position in list of integrators
Input input
input expression: f(t,y)
void Eval() override
evaluate integrator input
void Init(double initvalue)
set initial value of integrator
void Init()
use preset initial value
Integrator & operator=(const Integrator &x)=delete
virtual double Value() override
Iterations(Input i, double eps, unsigned long max_it, double t_min, double t_max, double t0)
nonlinear block: limitation
virtual void _Eval() override
evaluation with algebraic loop detection
virtual double Value() override
Lim(Input in, double l, double h, double tga=1.0)
constructor of limitation block
base class for all double-linked list items item can be at single place only (identified by where()...
List * head
pointer to List (if any)
virtual bool isInQueue()
present in queue
Link * succ
next object in List
Link(Link *p, Link *s, List *h)
List * Where()
where is linked
virtual void Out()
remove from list
Link * pred
previous object in List
virtual void Into(List *l)
insert last
iterator(const iterator &x)
iterator & operator=(const iterator &x)
bool operator==(iterator q) const
bool operator!=(iterator q) const
list of Link* items, uses data from Link
virtual Link * Get(iterator pos)
remove at position
Link * GetLast()
remove last
void PredIns(Link *e, iterator pos)
static Link * next(Link *p)
void PostIns(Link *e, iterator pos)
virtual void Output() const override
print object to default output
static Link * previous(Link *p)
Link * GetFirst()
remove first
MultiStepMethod(const char *name, const char *slave_name)
initialize multistep method
SingleStepMethod * Slave_Ptr
SingleStepMethod * SlavePtr(void)
return pointer to the starting method (initialize it also)
static const char * GetStarter(const char *name)
obtain the name of the starting method of given method
static void SetStarter(const char *name, const char *slave_name)
set starting method for given multi-step method
virtual void TurnOff(void) override
turn off integration method and its slave (starter)
virtual bool PrepareStep(void) override
prepare the object for the step of integration
virtual bool IsSingleStep(void) override
virtual double Value() override
Newton(Input i, double eps, unsigned long max_it, double t_min, double t_max, double t0)
block: parameter (can not be changed during simulation run)
Parameter & operator=(double x)
virtual double Value() override
Abstract base class for all simulation processesProcess behavior is specified by Behavior method and ...
void Leave(Store &s, unsigned long ReqCap=1)
return some capacity
bool _WaitUntil(bool test)
wait for condition (slow!)
virtual void Terminate() override
kill process
ProcessStatus_t
possible process status values
virtual void Wait(double dtime)
wait for dtime interval
void Release(Facility &f)
release facility
void Seize(Facility &f, ServicePriority_t sp=0)
seize facility
bool isTerminated() const
virtual void Activate(double t) override
activate at time t (schedule)
virtual void Into(Queue &q)
insert process into queue
virtual void Passivate() override
process deactivation (sleep)
virtual void _Run() noexcept override
Process dispatch method.
virtual void Output() const override
print object to default output
enum simlib3::Process::ProcessStatus_t _status
bool isInterrupted() const
void Enter(Store &s, unsigned long ReqCap=1)
acquire some capacity
friend class WaitUntilList
void * _context
process context pointer
Process(Priority_t p=DEFAULT_PRIORITY)
Process constructor sets state to PREPARED.
void Interrupt()
test of WaitUntil list, allow running others
virtual void Behavior()=0
behavior description
virtual std::string Name() const override
name of object
nonlinear block: quantizer
virtual void _Eval() override
evaluation with algebraic loop detection
Qntzr(Input in, double qstep=1.0)
quantizer constructor
virtual double Value() override
virtual void Output() const override
print statistics
virtual Entity * Get(iterator pos)
remove at position
void PredIns(Entity *e, iterator pos)
virtual void Insert(Entity *e)
void PostIns(Entity *e, iterator pos)
virtual double Value() override
RegulaFalsi(Input i, double eps, unsigned long max_it, double t_min, double t_max)
Relay this implementation detects exact time of switch.
Relay(Input i, double p1, double p2, double p3, double p4, double y1, double y2)
relay constructor
virtual void Eval() override
block evaluation
virtual double Value() override
virtual void _Eval() override
evaluation with algebraic loop detection
Rline(Input in, int num, double *X, double *Y)
constructor of class Rline implements table-defined function (linear interpolation)
objects of this class call global function periodically (typicaly used for output of continuous model...
double SetStep(double dt=0.0)
change step
static void InitAll()
initialize all samplers (Init)
void(*) function()
function to call periodically
Sampler(void(*pf)(), double dt=0.0)
double step
step of sampling
double last
last sample time – prevents sample duplication
virtual void Output() const override
print object to default output
void Start()
start + sample
virtual void Behavior() override
behavior description
static void ActivateAll()
start all samplers (Run)
void Sample()
performs sample (function call)
double GetStep() const
get current step
basic synchronization tool for processes simplified implementation
virtual void V()
V operation.
virtual void Output() const override
print object to default output
virtual void P()
P operation.
void Clear()
initialization
Base class for almost all SIMLIB classes.
bool TestAndSetFlag(bool new_value, unsigned n)
internal method for flag manipulation is used for algebraic loop checking in continuous blocks
@ _CLEAR_ALL_FLAGS
internal flags (bitmasks: 1bit set)
virtual void Output() const
print object to default output
unsigned _flags
bool flags for internal use (TODO bitfield?)
virtual std::string Name() const
get object name
SimObject(const SimObject &)=delete
disable copy operation
SimObject & operator=(const SimObject &)=delete
disable assign operation
base for single-step integration methods
virtual bool IsSingleStep(void) override
void SetStartMode(bool start_mode)
SingleStepMethod(const char *name)
class for statistical information gathering
unsigned long Number() const
virtual void Clear()
initialize
void operator()(double x)
record the value
virtual void Output() const override
print statistics
static std::list< Status * > * Instance(void)
static iterator Insert(Status *ptr)
static iterator Begin(void)
std::list< Status * >::iterator iterator
static void EvaluateAll()
static std::list< Status * > * ListPtr
list of status variables
static iterator End(void)
static void ClearAllValueOK()
static void Erase(iterator it)
StatusMemory(const StatusMemory &)=delete
StatusMemory(std::list< Memory * > *PtrList=PtrStatusMList)
void operator=(const StatusMemory &)=delete
static void StoreState(Memory &di, Memory &si, StatusMemory &xi)
store state of integrators and status variables
static StatusIterator LastStatus(void)
StatusMethod(const StatusMethod &)=delete
StatusContainer::iterator StatusIterator
std::list< Memory * > StatusMList
static std::list< Memory * > * PtrStatusMList
virtual void StatusResize(size_t size)
resize status memories to the given size
static void RestoreState(double dthlf, Memory &di, Memory &si, StatusMemory &xi)
restore state of integrators and status variables
virtual void TurnOff(void) override
turn off integration method: flush memories etc...
static void GoToState(Memory &di, Memory &si, StatusMemory &xi)
move startpoint to given state
virtual bool PrepareStep(void) override
prepare object for integration step
static StatusIterator FirstStatus(void)
State variables (memory) base for blocks with internal state (Relay, ...).
virtual void Eval() override
evaluate without loop detection
void SetOldState(double s)
void Set(double value)
set state variable value (step change)
virtual double Value() override
value of state variable
double stl
status from previous step
void Init(double initvalue)
set initial value
Status(Input i, double initvalue=0)
double initval
initial value
StatusContainer::iterator it_list
position in list of status variables
(SOL-like) store store capacity can be changed dynamically
void SetQueue(Queue *queue)
change input queue
void SetCapacity(unsigned long _capacity)
change the capacity
unsigned char _Qflag
true if store is owner of input queue
unsigned long Capacity() const
max capacity
bool Full() const
store is full
virtual void Output() const override
print statistics
virtual void Leave(unsigned long rcap)
deallocate capacity
unsigned long capacity
Capacity of store.
virtual void Enter(Entity *e, unsigned long rcap)
allocate capacity
bool OwnQueue() const
OwnQueue.
unsigned long Free() const
free capacity
TStat tstat
usage statistics
bool Empty() const
store is empty
unsigned long Used() const
used capacity
unsigned QueueLen() const
virtual void Clear()
initialize
unsigned long used
Currently used capacity.
virtual void QueueIn(Entity *e, unsigned long c)
insert entity into queue
virtual void operator()(double x)
record the value
TStat(double initval=0.0)
virtual void Clear(double initval=0.0)
initialize
virtual void Output() const override
print object to default output
unsigned long Number() const
block: variable (value can be changed)
virtual double Value() override
Variable & operator=(double x)
abstract base class for all blocksblocks/SimObject have not copy semantics (TODO: add move semantics)
abstract base class for all state-condition blocks State event in combined model is executed at the t...
static aCondition * First
aCondition(const aCondition &)=delete
virtual void Action()=0
state event description
virtual bool Test()=0
test of the condition
virtual void SetNewStatus()=0
update
virtual void Init()=0
initialize
void operator=(const aCondition &)=delete
aContiBlock1(Input i)
constructor for blocks with single input
aContiBlock2(Input i1, Input i2)
ctr for blocks with 2 inputs
aContiBlock3(Input i1, Input i2, Input i3)
ctr for blocks with 3 inputs
abstract base for continuous blocks with single output suitable for expression-tree building and eval...
virtual void Eval()
evaluate without loop detection
virtual void _Eval()
evaluation with algebraic loop detection
void SetStarter(const char *name, const char *slave_name)
const char * GetStarter(const char *name)
void InstallBreak(void(*f)())
InstallBreak — set function for checking if user breaks simulation.
const char * GetMethod(void)
void SetMethod(const char *name)
Implementation of class CalendarList interface is static - using global functions in SQS namespace.
void Activate(Entity *e)
activate entity e
const double & Time
model time (is NOT the block)
const double & StepSize
actual integration step
void Stop()
stop current simulation run
const double & NextTime
next-event time
Input Max(Input x, Input y)
double Gamma(double alfa, double beta)
Gamma distribution generator.
void DebugOFF()
stop debugging output
void Abort()
end simulation program
double Rayle(double delta)
const double & StartTime
time of simulation start
Input operator-(Input a, Input b)
block operator -
Input Min(Input x, Input y)
const double & RelativeError
max. rel. error
aContiBlock & T
simulation time block reference
const unsigned SIMLIB_version
library version
std::string GetName(SimObject &o)
get name of object
void Passivate(Entity *e)
passivate entity e
Input operator+(Input a, Input b)
block operator +
const double & MaxStep
maximal integration step
double Triag(double mod, double min, double max)
const double & AbsoluteError
max. abs. error of integration
void DebugON()
start debugging output
void SetOutput(const char *name)
double Beta(double th, double fi, double min, double max)
Beta distribution generator.
const double & EndTime
time of simulation end
void SetCalendar(const char *name)
choose calendar implementation default is list
double Uniform(double l, double h)
Uniform distribution generator.
void RemoveName(SimObject &o)
remove name
int NegBinM(double p, int m)
double Weibul(double lambda, double alfa)
Weibul distribution generator.
Input operator*(Input a, Input b)
block operator *
Input ATan2(Input y, Input x)
unsigned char ServicePriority_t
Service priority (see Facility::Seize).
unsigned long Debug(unsigned long mode)
Input Pow(Input x, Input y)
int _Print(const char *fmt,...)
double min(double a, double b)
int NegBin(double q, int k)
const double SIMLIB_MINTIME
minimal time value
double max(double a, double b)
void SetName(SimObject &o, const std::string &name)
assign name to object
void SetStep(double _dtmin, double _dtmax)
void Error(const char *fmt,...)
print message and terminate program
void Run()
run simulation experiment
const double & MinStep
minimal integration step
signed char EntityPriority_t
Priority of the process/event.
int Print(const char *fmt,...)
for Output methods, can be redirected
void SIMLIB_Init(double T0, double T1, unsigned version)
double Erlang(double alfa, int beta)
Erlang distribution generator.
const double & OptStep
optimal integration step
double Normal(double mi, double sigma)
Gauss distribution generator.
int HyperGeom(double p, int n, int m)
void RandomSeed(long seed)
double Exponential(double mv)
Exponential distribution generator.
int Poisson(double lambda)
Poisson distribution generator.
void Init(double t0, double t1=SIMLIB_MAXTIME)
void SetAccuracy(double _abserr, double _relerr)
const double SIMLIB_MAXTIME
maximum time (1e30 works for float, too)
double Logar(double mi, double delta)
Input Sqr(Input x)
square function
Entity *const & Current
pointer to active (now running) entity
Input operator/(Input a, Input b)
block operator /
void ContractStep()
contract step of integration
const SIMLIB_statistics_t & SIMLIB_statistics
interface to internal run-time statistics structure
const char * SIMLIB_version_string()
void SetBaseRandomGenerator(double(*new_gen)())
#define UnRegisterReference(aContiBlockPtr)
#define RegisterReference(aContiBlockPtr)
double Value() override
Evaluate expression and return the value.
internal statistics structure contains basic statistics of simulator execution
void Output() const
print run-time statistics to output
SIMLIB_statistics_t()
constructor runs SIMLIB_statistics_t::Init()
void Init()
initialize - used at the start of each Run()