SIMLIB/C++ 3.09
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
simlib3 Namespace Reference

Implementation of class CalendarList
interface is static - using global functions in SQS namespace. More...

Namespaces

namespace  SQS
 Special namespace for calendar implementation.
 

Classes

class  _Abs2D
 
class  _Abs3D
 
class  _Add
 block sum of two inputs More...
 
class  _Add2D
 
class  _Add3D
 
class  _Div
 divider block More...
 
class  _Div2D
 
class  _Div3D
 
class  _FileWrap
 
class  _Mul
 multiplier block More...
 
class  _Mul2D1D
 
class  _Mul3D
 
class  _Mul3D1D
 
class  _Norm2D
 
class  _Norm3D
 
class  _ScalarProduct2D
 
class  _ScalarProduct3D
 
class  _Sub
 block to subtract two inputs More...
 
class  _Sub2D
 
class  _Sub3D
 
class  _Time
 block wrapper for simulation time More...
 
class  _UMinus
 unary minus block More...
 
class  _UMinus2D
 
class  _UMinus3D
 
class  _XYpart
 
class  _XYZpart
 
class  aBlock
 abstract base class for all blocksblocks/SimObject have not copy semantics (TODO: add move semantics) More...
 
class  ABM4
 
class  aCondition
 abstract base class for all state-condition blocks State event in combined model is executed at the time when the condition changes its boolean value More...
 
class  aContiBlock
 abstract base for continuous blocks with single output suitable for expression-tree building and evaluation More...
 
class  aContiBlock1
 base for continuous blocks with single input and algebraic loop check More...
 
class  aContiBlock2
 base for continuous blocks with two inputs More...
 
class  aContiBlock2D
 Abstract 2D block with single 2D output. More...
 
class  aContiBlock2D1
 continuous block with single input and alg. More...
 
class  aContiBlock2D2
 continuous block vith 2 inputs and alg. More...
 
class  aContiBlock2D3
 continuous block with 3 inputs and alg. More...
 
class  aContiBlock3
 base for continuous blocks vith three inputs and algebraic loop check More...
 
class  aContiBlock3D
 Abstract 3D block with single 3D output. More...
 
class  aContiBlock3D1
 continuous 3D block with single input More...
 
class  aContiBlock3D2
 continuous block vith 2 inputs and alg. More...
 
class  aContiBlock3D3
 continuous block with 3 inputs and alg. More...
 
class  Adaptor2D
 Convert 2 scalar inputs to single 2D vector output. More...
 
class  Adaptor3D
 Converts 3 scalar inputs to single 3D vector output. More...
 
class  AlgLoop
 abstract base for algebraic loop solvers More...
 
class  AlgLoopDetector
 class for algebraic loop detection AlgLoopDetector object should be used in Value() method only it checks for recursion in continuous block expression evaluation
User should remove algebraic loop manualy using special block (see AlgLoop solvers) More...
 
class  Barrier
 synchronization tool for processes More...
 
class  Bisect
 solve using bisection method More...
 
class  Blash
 nonlinear block - backlash More...
 
class  Calendar
 common interface for all calendar (PES) implementations More...
 
class  CalendarList
 class CalendarList — list implementation of calendar More...
 
class  CalendarListImplementation
 class CalendarListImplementation — sorted list More...
 
class  CalendarQueue
 CQ implementation of calendar. More...
 
class  Condition
 change detector - Boolean version (int) More...
 
class  ConditionDown
 detector of TRUE-->FALSE More...
 
class  ConditionUp
 detector of FALSE-->TRUE More...
 
class  Constant
 block: constant (value can not be changed) More...
 
class  Constant2D
 2D vector value that can't be changed More...
 
class  Constant3D
 3D vector value that can't be changed More...
 
class  Delay
 continuous signal delay block More...
 
class  Entity
 abstract base class for active entities (Process, Event) instances of derived classes provide Behavior() method implementation, execution can be scheduled in calendar More...
 
class  EULER
 
class  Event
 abstract base class for events Event behavior is simple function (can not be interrupted) More...
 
struct  EventNotice
 activation record More...
 
class  EventNoticeAllocator
 allocate activation records fast More...
 
struct  EventNoticeLinkBase
 calendar item - PRIVATE for any implementation
we use double-linked circular list More...
 
struct  Expression
 reference to block expression This block can be used as handle for block expression trees More...
 
struct  Expression2D
 Reference to 2D vector block-expression. More...
 
struct  Expression3D
 3D vector block-expression handle More...
 
class  Facility
 (SOL-like) facility Facility with exclusive access and service priority More...
 
class  Frict
 nonlinear block: friction More...
 
class  Function1
 block parametrized by function with single argument More...
 
class  Function2
 block parametrized by function with two arguments More...
 
class  FW
 
class  Histogram
 histogram statistics More...
 
class  Hyst
 nonlinear block - hysteresis More...
 
class  Input
 continuous block connection (transparent reference) wrapper for pointer to objects of aContiBlock derived classes
(small object, without virtual methods)
It is used for referencing of continuous blocks in block-expressions. More...
 
class  Input2D
 Continuous block connection (transparent reference) More...
 
class  Input3D
 Continuous block connection (transparent reference) More...
 
class  Insv
 nonlinear block: dead zone More...
 
class  IntegrationMethod
 IntegrationMethod - Abstract base class for integration methods. More...
 
class  Integrator
 block for numerical integration input is derivative, output is state More...
 
class  Integrator2D
 2D vector integrator More...
 
class  Integrator3D
 3D vector integrator More...
 
class  IntegratorContainer
 IntegratorContainer - internal container of integrators (singleton) More...
 
class  Iterations
 solve using iterations More...
 
class  Lim
 nonlinear block: limitation More...
 
class  Link
 base class for all double-linked list items
item can be at single place only (identified by where() method)
used for Queue implementation More...
 
class  List
 list of Link* items, uses data from Link More...
 
class  MultiStepMethod
 base for multi-step integration method More...
 
class  NameDict
 
class  Newton
 solve using modified Newton's method More...
 
struct  P_Context_t
 internal structure for storing of Process::Behavior() context More...
 
class  Param
 
class  Parameter
 block: parameter (can not be changed during simulation run) More...
 
class  Parameter2D
 Special variable (can't be changed at simulation time) More...
 
class  Parameter3D
 Special variable (can't be changed at simulation time) More...
 
class  ParameterVector
 
class  Process
 Abstract base class for all simulation processesProcess behavior is specified by Behavior method and can be interrupted during execution by e.g. More...
 
class  Qntzr
 nonlinear block: quantizer More...
 
class  Queue
 priority queue More...
 
class  RegulaFalsi
 solve using regula falsi method More...
 
class  Relay
 Relay this implementation detects exact time of switch. More...
 
class  RKE
 
class  RKF3
 
class  RKF5
 
class  RKF8
 
class  Rline
 nonlinear block: function defined by given table of values More...
 
class  Sampler
 objects of this class call global function periodically (typicaly used for output of continuous model) More...
 
class  Semaphore
 basic synchronization tool for processes simplified implementation More...
 
class  SIMLIB_Delay
 continuous delay block More...
 
class  SIMLIB_DelayBuffer
 memory for delayed pairs (Time,value) More...
 
class  SIMLIB_module
 Class for internal registration of modules. More...
 
struct  SIMLIB_statistics_t
 internal statistics structure
contains basic statistics of simulator execution More...
 
class  SIMLIB_ZDelayTimer
 
class  SimObject
 Base class for almost all SIMLIB classes. More...
 
class  SingleStepMethod
 base for single-step integration methods More...
 
class  Stat
 class for statistical information gathering More...
 
class  Status
 State variables (memory) base for blocks with internal state (Relay, ...) More...
 
class  StatusContainer
 StatusContainer - internal container of status variables (singleton) More...
 
class  StatusMethod
 Abstract base class for integration methods with status auxiliary memories. More...
 
class  Store
 (SOL-like) store store capacity can be changed dynamically More...
 
class  TStat
 time dependent statistic More...
 
class  Value2D
 2D vector value More...
 
class  Value3D
 3D vector value More...
 
class  Variable
 block: variable (value can be changed) More...
 
class  Variable2D
 2D vector variable More...
 
class  Variable3D
 3D vector variable More...
 
class  WaitUntilList
 
class  ZDelay
 
class  ZDelayTimer
 

Typedefs

typedef void(* SIMLIB_atexit_function_t) ()
 
typedef void(* VoidFunctionPtr) ()
 
typedef double(* opt_function_t) (const ParameterVector &p)
 
typedef long myint32
 
typedef signed char EntityPriority_t
 Priority of the process/event.
 
typedef unsigned char ServicePriority_t
 Service priority (see Facility::Seize)
 
typedef Hyst Hysteresis
 
typedef Blash Backlash
 
typedef Lim Limitation
 
typedef Insv DeadZone
 
typedef Qntzr Quantizer
 
typedef Frict Friction
 

Enumerations

enum  SIMLIB_Phase_t {
  START , INITIALIZATION , SIMULATION , TERMINATION ,
  ERROREXIT
}
 values indicate current phase of experiment More...
 
enum  { LOWEST_PRIORITY = -127 , HIGHEST_PRIORITY = 127 , DEFAULT_PRIORITY = 0 }
 entity/process priority values
(Warning: changed from 0..255 in SIMLIB v 3.03) More...
 

Functions

void SIMLIB_atexit (SIMLIB_atexit_function_t p)
 
static void SIMLIB_atexit_call ()
 
void SetCalendar (const char *name)
 choose calendar implementation default is list
 
void SIMLIB_DoConditions ()
 
void SIMLIB_Dynamic ()
 performs evaluation of integrators and status blocks
 
Input operator+ (Input a, Input b)
 block operator +
 
Input operator- (Input a, Input b)
 block operator -
 
Input operator* (Input a, Input b)
 block operator *
 
Input operator/ (Input a, Input b)
 block operator /
 
Input Sqr (Input x)
 square function
 
Input operator- (Input a)
 unary - block operator
 
void DebugON ()
 start debugging output
 
void DebugOFF ()
 stop debugging output
 
unsigned long Debug (unsigned long mode)
 
void SIMLIB_error (const enum _ErrEnum N)
 print error message and abort program
 
void SIMLIB_error (const char *fmt,...)
 print error message and abort program
 
void SIMLIB_error (const char *filename, const int linenum)
 print error message and abort program
 
void SIMLIB_warning (const enum _ErrEnum N)
 print warning message and continue
 
void SIMLIB_warning (const char *fmt,...)
 print warning message and continue
 
const char * _ErrMsg (enum _ErrEnum N)
 
static double sign (double x)
 
Input Abs (Input x)
 
Input Sin (Input x)
 
Input Cos (Input x)
 
Input Tan (Input x)
 
Input ASin (Input x)
 
Input ACos (Input x)
 
Input ATan (Input x)
 
Input ATan2 (Input y, Input x)
 
Input Exp (Input x)
 
Input Log10 (Input x)
 
Input Ln (Input x)
 
Input Pow (Input x, Input y)
 
Input Sign (Input x)
 
Input Sqrt (Input x)
 
Input Min (Input x, Input y)
 
Input Max (Input x, Input y)
 
static unsigned * Alloc (unsigned n)
 
void SIMLIB_DoActions ()
 
void SIMLIB_ContinueInit ()
 
void SIMLIB_WUClear ()
 
double min (double a, double b)
 
double max (double a, double b)
 
std::string SIMLIB_create_tmp_name (const char *fmt,...)
 printf-like function to create temporary name (the length of temporary names is limited)
used only for printing
 
void ContractStep ()
 contract step of integration
 
void ContractStep (double time)
 contract step of integration to end step time
 
void SetStep (double dtmin, double dtmax)
 Set integration step interval.
 
void SetAccuracy (double abserr, double relerr)
 set max.
 
void SetAccuracy (double relerr)
 set max.
 
void SetName (SimObject &o, const std::string &name)
 assign name to object
 
void SetName (SimObject *o, const std::string &name)
 assign name to object
 
void RemoveName (SimObject &o)
 remove name
 
void RemoveName (SimObject *o)
 remove name
 
std::string GetName (SimObject &o)
 get name of object
 
std::string GetName (SimObject *o)
 get name of object
 
void SetErrNo (int num)
 
static double hooke_step (double *delta, opt_function_t f, ParameterVector &p, double min0)
 
double Optimize_hooke (opt_function_t f, ParameterVector &parameter, double rho, double epsilon, int itermax)
 
bool operator== (const ParameterVector &p1, const ParameterVector &p2)
 
bool accept_bad (double eps)
 
void move_to_next_point (ParameterVector &p, double eps)
 
double Optimize_simann (double(*f)(const ParameterVector &p), ParameterVector &p, int MAXT)
 
double Optimize_simann (opt_function_t f, ParameterVector &p, int MAXT)
 
double Optimize_gradient (opt_function_t f, ParameterVector &p, double MAXITER)
 
void SetOutput (const char *name)
 redirects Output(), Print() to file
 
int _Print (const char *fmt,...)
 output of messages to stdout, too
 
int Print (const char *fmt,...)
 for Output methods, can be redirected
 
int Print (const double x)
 output single value
 
int Print (const double x, const double y)
 output 2 values
 
int Print (const double x, const double y, const double z)
 output 3 values
 
void Error (const char *fmt,...)
 print message and terminate program
 
static void PROCESS_INTERRUPT_f ()
 Special function called from Process::Behavior() directly or indirectly.
 
static void ALLOC_CONTEXT (size_t sz) noexcept
 
static void FREE_CONTEXT () noexcept
 deallocate saved process context
 
static void restore_context2 (volatile char *) noexcept
 This function overwrites stack contents. It never returns, see longjmp.
 
static void restore_context (size_t data_size) noexcept
 This elliminates the need for explicit stack pointer adjustment.
 
void RandomSeed (long seed)
 initialize random number seed
 
double Random ()
 base uniform generator (range 0-0.999999...) the default implementation is simple LCG 32bit
 
void SetBaseRandomGenerator (double(*new_gen)())
 set another random generator default Random() implementation can be replaced
 
double SIMLIB_RandomBase ()
 
static double _gam (double AK)
 
double Uniform (double l, double h)
 Uniform distribution generator.
 
double Normal (double mi, double sigma)
 Gauss distribution generator.
 
double Weibul (double lambda, double alfa)
 Weibul distribution generator.
 
double Erlang (double alfa, int beta)
 Erlang distribution generator.
 
int NegBin (double q, int k)
 
double Gamma (double alfa, double beta)
 Gamma distribution generator.
 
double Exponential (double mv)
 Exponential distribution generator.
 
int NegBinM (double p, int m)
 
double Beta (double th, double fi, double min, double max)
 Beta distribution generator.
 
double Triag (double mod, double min, double max)
 
double Logar (double mi, double delta)
 
double Rayle (double delta)
 
int Poisson (double lambda)
 Poisson distribution generator.
 
int Geom (double q)
 
int HyperGeom (double p, int n, int m)
 
 DEFINE_HOOK (Delay)
 
 DEFINE_HOOK (DelayInit)
 
void SampleDelays ()
 
 DEFINE_HOOK (ZDelayTimerInit)
 
 DEFINE_HOOK (Break)
 
void InstallBreak (void(*f)())
 InstallBreak — set function for checking if user breaks simulation.
 
 DEFINE_HOOK (SamplerAct)
 
 DEFINE_HOOK (SamplerInit)
 
 DEFINE_HOOK (WUclear)
 
 DEFINE_HOOK (WUget_next)
 
void Stop ()
 stop current simulation run
 
void Abort ()
 end simulation program
 
void SIMLIB_Init (double T0, double T1, unsigned version)
 
void Run ()
 run simulation experiment
 
const char * SIMLIB_version_string ()
 Get version of SIMLIB.
 
void Init (double t0, double t1=SIMLIB_MAXTIME)
 Initialize simulator and model time.
 
void SetStep (double dt)
 set fixed integration step
 
void Activate (Entity *e)
 activate entity e
 
void Passivate (Entity *e)
 passivate entity e
 
void SetMethod (const char *name)
 select the integration method
 
const char * GetMethod (void)
 get the name of the method which is used
 
void SetStarter (const char *name, const char *slave_name)
 set the method which will be used to start given multistep method
 
void SetStarter (const char *slave_name)
 set the method which will be used to start currently used multistep method
 
const char * GetStarter (const char *name)
 get the name of the method which is used to start given multistep method
 
const char * GetStarter (void)
 get the name of the method which is used to start currently used multistep method
 
double abs (const Value2D &a)
 
Value2D operator+ (const Value2D &a, const Value2D &b)
 
Value2D operator- (const Value2D &a, const Value2D &b)
 
Value2D operator- (const Value2D &a)
 
Value2D operator* (const Value2D &a, const double b)
 
Value2D operator* (const double a, const Value2D &b)
 
double scalar_product (const Value2D &a, const Value2D &b)
 
Value2D operator/ (const Value2D &a, const double b)
 
Input2D operator+ (Input2D a, Input2D b)
 
Input2D operator- (Input2D a, Input2D b)
 
Input2D operator* (Input2D a, Input b)
 
Input2D operator* (Input a, Input2D b)
 
Input2D operator/ (Input2D a, Input b)
 
Input2D operator- (Input2D a)
 
Input Abs (Input2D x)
 absolute value of vector (1D block)
 
Input2D UnitVector (Input2D v)
 make unit vector from input (Abs(output_vec)==1)
 
Input ScalarProduct (Input2D x, Input2D y)
 dot product: xvec . yvec
 
Input Xpart (Input2D a)
 get x part of (x,y) vector value
 
Input Ypart (Input2D a)
 get y part of (x,y) vector value
 
void Print (Value2D a)
 
double abs (const Value3D &a)
 
Value3D operator+ (const Value3D &a, const Value3D &b)
 
Value3D operator- (const Value3D &a, const Value3D &b)
 
Value3D operator- (const Value3D &a)
 
Value3D operator* (const Value3D &a, const Value3D &b)
 
Value3D operator* (const Value3D &a, const double b)
 
Value3D operator* (const double a, const Value3D &b)
 
double scalar_product (const Value3D &a, const Value3D &b)
 
Value3D operator/ (const Value3D &a, const double b)
 
Input3D operator+ (Input3D a, Input3D b)
 
Input3D operator- (Input3D a, Input3D b)
 
Input3D operator* (Input3D a, Input3D b)
 
Input3D operator* (Input3D a, Input b)
 
Input3D operator* (Input a, Input3D b)
 
Input3D operator/ (Input3D a, Input b)
 
Input3D operator- (Input3D a)
 
Input Abs (Input3D x)
 absolute value of vector (1D block)
 
Input3D UnitVector (Input3D x)
 make unit vector from input (Abs(output_vec)==1)
 
Input ScalarProduct (Input3D x, Input3D y)
 dot product: xvec . yvec
 
Input Xpart (Input3D a)
 get x part of (x,y,z) vector value
 
Input Ypart (Input3D a)
 get y part of (x,y,z) vector value
 
Input Zpart (Input3D a)
 get z part of (x,y,z) vector value
 
void Print (Value3D a)
 
void WU_print ()
 

Variables

 SIMLIB_IMPLEMENTATION
 
static const int MAX_ATEXIT = 10
 
static int counter = 0
 
static SIMLIB_atexit_function_t atexit_array [MAX_ATEXIT] = { 0, }
 
class simlib3::EventNoticeAllocator allocator
 
const unsigned LIST_MAX = 512
 
const unsigned MINBUCKETS = LIST_MAX>4?LIST_MAX:4
 
const unsigned LIST_MIN = LIST_MAX/2
 
const double COEF_PAR = 1.5
 
const double MUL_PAR = 1.0
 
bool SIMLIB_ConditionFlag = false
 
static class _Time _T
 block – simulation time
 
aContiBlockT = _T
 simulation time block reference
 
unsigned long SIMLIB_debug_flag = 0UL
 
static unsigned long SIMLIB_Entity_Count = 0L
 current number of entities in model
 
static const char _Errors []
 
const unsigned MAXHISTOCOUNT = 10000
 
static SIMLIB_module SIMLIB_module_id
 Create single global registration object in each SIMLIB module.
 
const SIMLIB_Phase_tPhase = SIMLIB_Phase
 This variable contains the current phase of experiment (used for internal checking)
 
double SIMLIB_Time
 
bool SIMLIB_DynamicFlag = false
 in dynamic section
 
bool SIMLIB_ResetStatus = false
 flag set if there is a need for integration method restart
 
SIMLIB_Phase_t SIMLIB_Phase = START
 
EntitySIMLIB_Current = NULL
 
int SIMLIB_ERRNO =0
 
bool SIMLIB_ContractStepFlag = false
 requests shorter step
 
double SIMLIB_ContractStep = SIMLIB_MAXTIME
 requested step size
 
double SIMLIB_StepStartTime
 last step time
 
double SIMLIB_DeltaTime
 Time-SIMLIB_StepStartTime.
 
double SIMLIB_OptStep
 optimal step
 
double SIMLIB_MinStep =1e-10
 minimal step
 
double SIMLIB_MaxStep =1
 max. step
 
double SIMLIB_StepSize
 actual step
 
double SIMLIB_AbsoluteError =0
 absolute error
 
double SIMLIB_RelativeError =0.001
 relative error
 
double SIMLIB_StartTime
 
double SIMLIB_NextTime
 
double SIMLIB_EndTime
 
const double & MinStep =SIMLIB_MinStep
 minimal integration step
 
const double & MaxStep =SIMLIB_MaxStep
 maximal integration step
 
const double & StepSize =SIMLIB_StepSize
 actual integration step
 
const double & OptStep =SIMLIB_OptStep
 optimal integration step
 
const double & AbsoluteError =SIMLIB_AbsoluteError
 max. abs. error of integration
 
const double & RelativeError =SIMLIB_RelativeError
 max. rel. error
 
Constant SIMLIB_Integrator_0input (0)
 dummy input with zero value
 
const int abm_ord =4
 
ABM4 abm4 ("abm4", "rkf5")
 Adams-Bashforth-Moulton, 4th order.
 
EULER euler ("euler")
 Euler method.
 
FW fw ("fw")
 Fowler-Warten (Warning: needs testing, do not use)
 
RKE rke ("rke")
 Runge-Kutta-England, 4th order?
 
RKF3 rkf3 ("rkf3")
 Runge-Kutta-Fehlberg, 3rd order.
 
RKF5 rkf5 ("rkf5")
 Runge-Kutta-Fehlberg, 5th order.
 
RKF8 rkf8 ("rkf8")
 Runge-Kutta-Fehlberg, 8th order.
 
static bool SimObject_allocated = false
 
static NameDict name_dict
 
class simlib3::_FileWrap OutFile
 
static jmp_buf P_DispatcherStatusBuffer
 setjmp() state before dispatch
 
static char *volatile P_StackBase = 0
 global start of stack area
 
static char *volatile P_StackBase2 = 0
 used for checking only
 
static P_Context_t *volatile P_Context = 0
 temporary global process state
 
static volatile size_t P_StackSize = 0
 temporary global stack size
 
const myint32 INICONST = 1537L
 
const myint32 MULCONST = 1220703125L
 
const myint32 MAXLONGINT = 0x7FFFFFFFUL
 
const myint32 SIGNBIT = 0x80000000UL
 
static myint32 SIMLIB_RandomSeed = INICONST
 
static double(* SIMLIB_RandomBasePtr )() = SIMLIB_RandomBase
 
const double & StartTime = SIMLIB_StartTime
 time of simulation start
 
const double & Time = SIMLIB_Time
 model time (is NOT the block)
 
const double & NextTime = SIMLIB_NextTime
 next-event time
 
const double & EndTime = SIMLIB_EndTime
 time of simulation end
 
Entity *const & Current = SIMLIB_Current
 pointer to active (now running) entity
 
unsigned long SIMLIB_experiment_no = 0
 
static SIMLIB_statistics_t SIMLIB_run_statistics
 
const SIMLIB_statistics_tSIMLIB_statistics = SIMLIB_run_statistics
 interface to internal run-time statistics structure
 
static bool StopFlag = false
 
const unsigned SIMLIB_version = __SIMLIB__
 library version
 
const double SIMLIB_MINTIME = 0.0
 minimal time value
 
const double SIMLIB_MAXTIME = 1.0e30
 maximum time (1e30 works for float, too)
 
static Constant2D Zero2D (0, 0)
 
static Constant3D Zero3D (0, 0, 0)
 
static bool flag = false
 

Detailed Description

Implementation of class CalendarList
interface is static - using global functions in SQS namespace.

Main SIMLIB (version 3+) namespace.


uses double-linked list and dynamic calendar queue [brown1988]

Usage: using namespace simlib3;

Typedef Documentation

◆ Backlash

Definition at line 1396 of file simlib.h.

◆ DeadZone

Definition at line 1584 of file simlib.h.

◆ EntityPriority_t

typedef signed char simlib3::EntityPriority_t

Priority of the process/event.

Definition at line 363 of file simlib.h.

◆ Friction

Definition at line 1617 of file simlib.h.

◆ Hysteresis

Definition at line 1380 of file simlib.h.

◆ Limitation

Definition at line 1567 of file simlib.h.

◆ myint32

typedef long simlib3::myint32

Definition at line 39 of file random1.cc.

◆ opt_function_t

typedef double(* simlib3::opt_function_t) (const ParameterVector &p)

Definition at line 83 of file optimize.h.

◆ Quantizer

Definition at line 1600 of file simlib.h.

◆ ServicePriority_t

typedef unsigned char simlib3::ServicePriority_t

Service priority (see Facility::Seize)

Definition at line 365 of file simlib.h.

◆ SIMLIB_atexit_function_t

typedef void(* simlib3::SIMLIB_atexit_function_t) ()

Definition at line 150 of file internal.h.

◆ VoidFunctionPtr

typedef void(* simlib3::VoidFunctionPtr) ()

Definition at line 177 of file internal.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

entity/process priority values
(Warning: changed from 0..255 in SIMLIB v 3.03)

Enumerator
LOWEST_PRIORITY 
HIGHEST_PRIORITY 
DEFAULT_PRIORITY 

Definition at line 357 of file simlib.h.

◆ SIMLIB_Phase_t

values indicate current phase of experiment

Enumerator
START 
INITIALIZATION 
SIMULATION 
TERMINATION 
ERROREXIT 

Definition at line 76 of file internal.h.

Function Documentation

◆ _ErrMsg()

const char * simlib3::_ErrMsg ( enum _ErrEnum  N)

Definition at line 97 of file errors.cc.

References _Errors.

Referenced by SIMLIB_error(), and SIMLIB_warning().

◆ _gam()

static double simlib3::_gam ( double  AK)
static

Definition at line 35 of file random2.cc.

References Random().

Referenced by Beta(), and Gamma().

◆ _Print()

int simlib3::_Print ( const char *  fmt,
  ... 
)

output of messages to stdout, too

Parameters
fmtformat string (the same as for printf() )

Definition at line 68 of file print.cc.

References OutFile.

Referenced by Error(), simlib3::ABM4::Integrate(), simlib3::EULER::Integrate(), simlib3::FW::Integrate(), simlib3::RKE::Integrate(), simlib3::RKF3::Integrate(), simlib3::RKF5::Integrate(), simlib3::RKF8::Integrate(), SIMLIB_error(), and SIMLIB_warning().

◆ Abort()

void simlib3::Abort ( )

end simulation program

Definition at line 159 of file run.cc.

References Dprintf, ERROREXIT, and SIMLIB_Phase.

◆ abs() [1/2]

double simlib3::abs ( const Value2D a)

◆ abs() [2/2]

double simlib3::abs ( const Value3D a)

Definition at line 38 of file simlib3D.cc.

◆ Abs() [1/3]

Input simlib3::Abs ( Input  x)

Definition at line 94 of file fun.cc.

◆ Abs() [2/3]

Input simlib3::Abs ( Input2D  x)

absolute value of vector (1D block)

Definition at line 387 of file simlib2D.cc.

◆ Abs() [3/3]

Input simlib3::Abs ( Input3D  x)

absolute value of vector (1D block)

Definition at line 406 of file simlib3D.cc.

◆ accept_bad()

bool simlib3::accept_bad ( double  eps)

Definition at line 30 of file opt-simann.cc.

References Random().

Referenced by Optimize_simann().

◆ ACos()

Input simlib3::ACos ( Input  x)

Definition at line 101 of file fun.cc.

◆ Activate()

void simlib3::Activate ( Entity e)
inline

activate entity e

Definition at line 431 of file simlib.h.

References simlib3::Entity::Activate().

Referenced by main().

◆ Alloc()

static unsigned * simlib3::Alloc ( unsigned  n)
static

Definition at line 35 of file histo.cc.

Referenced by simlib3::Histogram::Histogram(), and simlib3::Histogram::Init().

◆ ALLOC_CONTEXT()

static void simlib3::ALLOC_CONTEXT ( size_t  sz)
staticnoexcept

Definition at line 155 of file process.cc.

References P_Context, and simlib3::P_Context_t::size.

Referenced by PROCESS_INTERRUPT_f().

◆ ASin()

Input simlib3::ASin ( Input  x)

Definition at line 100 of file fun.cc.

◆ ATan()

Input simlib3::ATan ( Input  x)

Definition at line 102 of file fun.cc.

◆ ATan2()

Input simlib3::ATan2 ( Input  y,
Input  x 
)

Definition at line 103 of file fun.cc.

◆ Beta()

double simlib3::Beta ( double  th,
double  fi,
double  min,
double  max 
)

Beta distribution generator.

Parameters
th

param fi

Parameters
min

param max

Definition at line 181 of file random2.cc.

References _gam(), max(), and min().

◆ ContractStep() [1/2]

void simlib3::ContractStep ( )

contract step of integration

request for shorter step of num. integ.

Definition at line 64 of file intg.cc.

References SIMLIB_ContractStepFlag.

Referenced by simlib3::Relay::Eval(), and simlib3::Condition::Test().

◆ ContractStep() [2/2]

void simlib3::ContractStep ( double  time)

contract step of integration to end step time

request for step end (at most) at given time

Parameters
timeexpected end of step time

Definition at line 72 of file intg.cc.

References SIMLIB_ContractStep, SIMLIB_ContractStepFlag, SIMLIB_MinStep, and SIMLIB_StepStartTime.

◆ Cos()

Input simlib3::Cos ( Input  x)

Definition at line 97 of file fun.cc.

◆ Debug()

unsigned long simlib3::Debug ( unsigned long  mode)

Definition at line 48 of file debug.cc.

References NoDebugErr, SIMLIB_debug_flag, and SIMLIB_warning().

Referenced by DebugOFF(), and DebugON().

◆ DebugOFF()

void simlib3::DebugOFF ( )

stop debugging output

Definition at line 42 of file debug.cc.

References Debug().

◆ DebugON()

void simlib3::DebugON ( )

start debugging output

Definition at line 36 of file debug.cc.

References Debug().

◆ DEFINE_HOOK() [1/8]

simlib3::DEFINE_HOOK ( Break  )

◆ DEFINE_HOOK() [2/8]

simlib3::DEFINE_HOOK ( Delay  )

◆ DEFINE_HOOK() [3/8]

simlib3::DEFINE_HOOK ( DelayInit  )

◆ DEFINE_HOOK() [4/8]

simlib3::DEFINE_HOOK ( SamplerAct  )

◆ DEFINE_HOOK() [5/8]

simlib3::DEFINE_HOOK ( SamplerInit  )

◆ DEFINE_HOOK() [6/8]

simlib3::DEFINE_HOOK ( WUclear  )

◆ DEFINE_HOOK() [7/8]

simlib3::DEFINE_HOOK ( WUget_next  )

◆ DEFINE_HOOK() [8/8]

simlib3::DEFINE_HOOK ( ZDelayTimerInit  )

◆ Erlang()

double simlib3::Erlang ( double  alfa,
int  beta 
)

Erlang distribution generator.

Parameters
alfa

param beta

Definition at line 109 of file random2.cc.

References ErlangError, Random(), and SIMLIB_error().

◆ Error()

void simlib3::Error ( const char *  fmt,
  ... 
)

print message and terminate program

Definition at line 123 of file print.cc.

References _Print(), OutFile, SIMLIB_error(), and UserError.

Referenced by simlib3::Barrier::ChangeHeight(), and simlib3::Barrier::Init().

◆ Exp()

Input simlib3::Exp ( Input  x)

Definition at line 105 of file fun.cc.

◆ Exponential()

double simlib3::Exponential ( double  mv)

Exponential distribution generator.

Parameters
mvmean value

Definition at line 152 of file random2.cc.

References Random().

◆ FREE_CONTEXT()

simlib3::FREE_CONTEXT ( )
staticnoexcept

deallocate saved process context

Definition at line 165 of file process.cc.

References P_Context.

Referenced by PROCESS_INTERRUPT_f().

◆ Gamma()

double simlib3::Gamma ( double  alfa,
double  beta 
)

Gamma distribution generator.

Parameters
alfa

param beta

Definition at line 141 of file random2.cc.

References _gam().

◆ Geom()

int simlib3::Geom ( double  q)

Definition at line 257 of file random2.cc.

References GeomError, Random(), and SIMLIB_error().

◆ GetName() [1/2]

std::string simlib3::GetName ( SimObject o)

get name of object

Definition at line 66 of file name.cc.

References simlib3::SimObject::Name().

◆ GetName() [2/2]

std::string simlib3::GetName ( SimObject o)

get name of object

Definition at line 72 of file name.cc.

References simlib3::SimObject::Name().

◆ hooke_step()

static double simlib3::hooke_step ( double *  delta,
opt_function_t  f,
ParameterVector p,
double  min0 
)
static

Definition at line 29 of file opt-hooke.cc.

References simlib3::ParameterVector::size().

Referenced by Optimize_hooke().

◆ HyperGeom()

int simlib3::HyperGeom ( double  p,
int  n,
int  m 
)

Definition at line 270 of file random2.cc.

References HyperGeomError1, HyperGeomError2, Random(), and SIMLIB_error().

◆ Init()

void simlib3::Init ( double  t0,
double  t1 = SIMLIB_MAXTIME 
)
inline

Initialize simulator and model time.

Parameters
t0simulation start time
t1simulation end time

Definition at line 181 of file simlib.h.

References __SIMLIB__, and SIMLIB_Init().

Referenced by main().

◆ Ln()

Input simlib3::Ln ( Input  x)

Definition at line 107 of file fun.cc.

◆ Log10()

Input simlib3::Log10 ( Input  x)

Definition at line 106 of file fun.cc.

◆ Logar()

double simlib3::Logar ( double  mi,
double  delta 
)

Definition at line 210 of file random2.cc.

References Normal().

◆ max()

double simlib3::max ( double  a,
double  b 
)
inline

◆ Max()

Input simlib3::Max ( Input  x,
Input  y 
)

Definition at line 115 of file fun.cc.

References max().

◆ min()

double simlib3::min ( double  a,
double  b 
)
inline

◆ Min()

Input simlib3::Min ( Input  x,
Input  y 
)

Definition at line 114 of file fun.cc.

References min().

◆ move_to_next_point()

void simlib3::move_to_next_point ( ParameterVector p,
double  eps 
)

Definition at line 39 of file opt-simann.cc.

References Random(), and simlib3::ParameterVector::size().

Referenced by Optimize_simann().

◆ NegBin()

int simlib3::NegBin ( double  q,
int  k 
)

Definition at line 121 of file random2.cc.

References NegBinError, Random(), and SIMLIB_error().

◆ NegBinM()

int simlib3::NegBinM ( double  p,
int  m 
)

Definition at line 164 of file random2.cc.

References NegBinMError1, NegBinMError2, Random(), and SIMLIB_error().

◆ Normal()

double simlib3::Normal ( double  mi,
double  sigma 
)

Gauss distribution generator.

Parameters
mimean value
sigmastd. deviation

Definition at line 82 of file random2.cc.

References Random().

Referenced by Logar(), and Poisson().

◆ operator*() [1/11]

Value2D simlib3::operator* ( const double  a,
const Value2D b 
)

Definition at line 73 of file simlib2D.cc.

◆ operator*() [2/11]

Value3D simlib3::operator* ( const double  a,
const Value3D b 
)

Definition at line 71 of file simlib3D.cc.

◆ operator*() [3/11]

Value2D simlib3::operator* ( const Value2D a,
const double  b 
)

Definition at line 68 of file simlib2D.cc.

◆ operator*() [4/11]

Value3D simlib3::operator* ( const Value3D a,
const double  b 
)

Definition at line 66 of file simlib3D.cc.

◆ operator*() [5/11]

Value3D simlib3::operator* ( const Value3D a,
const Value3D b 
)

Definition at line 58 of file simlib3D.cc.

◆ operator*() [6/11]

Input simlib3::operator* ( Input  a,
Input  b 
)

block operator *

Definition at line 228 of file continuous.cc.

◆ operator*() [7/11]

Input2D simlib3::operator* ( Input  a,
Input2D  b 
)

Definition at line 313 of file simlib2D.cc.

◆ operator*() [8/11]

Input3D simlib3::operator* ( Input  a,
Input3D  b 
)

Definition at line 332 of file simlib3D.cc.

◆ operator*() [9/11]

Input2D simlib3::operator* ( Input2D  a,
Input  b 
)

Definition at line 312 of file simlib2D.cc.

◆ operator*() [10/11]

Input3D simlib3::operator* ( Input3D  a,
Input  b 
)

Definition at line 331 of file simlib3D.cc.

◆ operator*() [11/11]

Input3D simlib3::operator* ( Input3D  a,
Input3D  b 
)

Definition at line 330 of file simlib3D.cc.

◆ operator+() [1/5]

Value2D simlib3::operator+ ( const Value2D a,
const Value2D b 
)

Definition at line 43 of file simlib2D.cc.

◆ operator+() [2/5]

Value3D simlib3::operator+ ( const Value3D a,
const Value3D b 
)

Definition at line 43 of file simlib3D.cc.

◆ operator+() [3/5]

Input simlib3::operator+ ( Input  a,
Input  b 
)

block operator +

Definition at line 224 of file continuous.cc.

◆ operator+() [4/5]

Input2D simlib3::operator+ ( Input2D  a,
Input2D  b 
)

Definition at line 310 of file simlib2D.cc.

◆ operator+() [5/5]

Input3D simlib3::operator+ ( Input3D  a,
Input3D  b 
)

Definition at line 328 of file simlib3D.cc.

◆ operator-() [1/10]

Value2D simlib3::operator- ( const Value2D a)

Definition at line 53 of file simlib2D.cc.

◆ operator-() [2/10]

Value2D simlib3::operator- ( const Value2D a,
const Value2D b 
)

Definition at line 48 of file simlib2D.cc.

◆ operator-() [3/10]

Value3D simlib3::operator- ( const Value3D a)

Definition at line 53 of file simlib3D.cc.

◆ operator-() [4/10]

Value3D simlib3::operator- ( const Value3D a,
const Value3D b 
)

Definition at line 48 of file simlib3D.cc.

◆ operator-() [5/10]

Input simlib3::operator- ( Input  a)

unary - block operator

Definition at line 262 of file continuous.cc.

◆ operator-() [6/10]

Input simlib3::operator- ( Input  a,
Input  b 
)

block operator -

Definition at line 226 of file continuous.cc.

◆ operator-() [7/10]

Input2D simlib3::operator- ( Input2D  a)

Definition at line 334 of file simlib2D.cc.

◆ operator-() [8/10]

Input2D simlib3::operator- ( Input2D  a,
Input2D  b 
)

Definition at line 311 of file simlib2D.cc.

◆ operator-() [9/10]

Input3D simlib3::operator- ( Input3D  a)

Definition at line 353 of file simlib3D.cc.

◆ operator-() [10/10]

Input3D simlib3::operator- ( Input3D  a,
Input3D  b 
)

Definition at line 329 of file simlib3D.cc.

◆ operator/() [1/5]

Value2D simlib3::operator/ ( const Value2D a,
const double  b 
)

Definition at line 83 of file simlib2D.cc.

◆ operator/() [2/5]

Value3D simlib3::operator/ ( const Value3D a,
const double  b 
)

Definition at line 81 of file simlib3D.cc.

◆ operator/() [3/5]

Input simlib3::operator/ ( Input  a,
Input  b 
)

block operator /

Definition at line 230 of file continuous.cc.

◆ operator/() [4/5]

Input2D simlib3::operator/ ( Input2D  a,
Input  b 
)

Definition at line 314 of file simlib2D.cc.

◆ operator/() [5/5]

Input3D simlib3::operator/ ( Input3D  a,
Input  b 
)

Definition at line 333 of file simlib3D.cc.

◆ operator==()

bool simlib3::operator== ( const ParameterVector p1,
const ParameterVector p2 
)

Definition at line 86 of file opt-param.cc.

◆ Optimize_gradient()

double simlib3::Optimize_gradient ( opt_function_t  f,
ParameterVector p,
double  MAXITER 
)

◆ Optimize_hooke()

double simlib3::Optimize_hooke ( opt_function_t  f,
ParameterVector parameter,
double  rho,
double  epsilon,
int  itermax 
)

◆ Optimize_simann() [1/2]

double simlib3::Optimize_simann ( double(*)(const ParameterVector &p)  f,
ParameterVector p,
int  MAXT 
)

Definition at line 52 of file opt-simann.cc.

References accept_bad(), move_to_next_point(), and Print().

◆ Optimize_simann() [2/2]

double simlib3::Optimize_simann ( opt_function_t  f,
ParameterVector p,
int  MAXT 
)

◆ Passivate()

void simlib3::Passivate ( Entity e)
inline

passivate entity e

Definition at line 432 of file simlib.h.

References simlib3::Entity::Passivate().

Referenced by simlib3::Semaphore::P().

◆ Poisson()

int simlib3::Poisson ( double  lambda)

Poisson distribution generator.

Parameters
lambda

Definition at line 229 of file random2.cc.

References Normal(), PoissonError, Random(), and SIMLIB_error().

◆ Pow()

Input simlib3::Pow ( Input  x,
Input  y 
)

Definition at line 108 of file fun.cc.

◆ Print() [1/6]

int simlib3::Print ( const char *  fmt,
  ... 
)

◆ Print() [2/6]

int simlib3::Print ( const double  x)

output single value

Parameters
xvalue to print

Definition at line 105 of file print.cc.

References Print().

◆ Print() [3/6]

int simlib3::Print ( const double  x,
const double  y 
)

output 2 values

Parameters
xvalue to print
yvalue to print

Definition at line 110 of file print.cc.

References Print().

◆ Print() [4/6]

int simlib3::Print ( const double  x,
const double  y,
const double  z 
)

output 3 values

Parameters
xvalue to print
yvalue to print
zvalue to print

Definition at line 115 of file print.cc.

References Print().

◆ Print() [5/6]

void simlib3::Print ( Value2D  a)
inline

Definition at line 237 of file simlib2D.h.

References simlib3::Value2D::Print().

◆ Print() [6/6]

void simlib3::Print ( Value3D  a)
inline

Definition at line 245 of file simlib3D.h.

References simlib3::Value3D::Print().

◆ PROCESS_INTERRUPT_f()

static void simlib3::PROCESS_INTERRUPT_f ( )
static

Special function called from Process::Behavior() directly or indirectly.

This function: 1) computes stack data size, 2) allocates memory for stack data, 3) saves stack data to allocated memory, 4) saves CPU context using setjmp(), and 5) interrupts execution of current function using longjmp() to process dispatcher code, == (now runs dispatcher and other code) 6) continues execution after longjmp from dispatcher. 7) frees memory allocated at 2)

Warning: This function is critical to process switching code and should not be inlined! It is never called directly by SIMLIB user.

Definition at line 559 of file process.cc.

References ALLOC_CONTEXT(), CANARY2, DEBUG_PROCESS, FREE_CONTEXT(), P_Context, P_DispatcherStatusBuffer, P_StackBase, P_StackSize, SIMLIB_error(), simlib3::P_Context_t::stack, and simlib3::P_Context_t::status.

◆ Random()

double simlib3::Random ( )

base uniform generator (range 0-0.999999...) the default implementation is simple LCG 32bit

Definition at line 95 of file random1.cc.

References SIMLIB_RandomBasePtr.

Referenced by _gam(), accept_bad(), Erlang(), Exponential(), Geom(), HyperGeom(), move_to_next_point(), NegBin(), NegBinM(), Normal(), Poisson(), Rayle(), Triag(), Uniform(), and Weibul().

◆ RandomSeed()

void simlib3::RandomSeed ( long  seed)

initialize random number seed

Parameters
seedinitial value of generator state

Definition at line 64 of file random1.cc.

References SIMLIB_RandomSeed.

◆ Rayle()

double simlib3::Rayle ( double  delta)

Definition at line 219 of file random2.cc.

References Random().

◆ RemoveName() [1/2]

void simlib3::RemoveName ( SimObject o)

remove name

Definition at line 54 of file name.cc.

References simlib3::SimObject::SetName().

◆ RemoveName() [2/2]

void simlib3::RemoveName ( SimObject o)

remove name

Definition at line 60 of file name.cc.

References simlib3::SimObject::SetName().

◆ restore_context()

static void simlib3::restore_context ( size_t  data_size)
staticnoexcept

This elliminates the need for explicit stack pointer adjustment.

The local array should not be optimized away. Parameters, return address and local variables will be overwritten. Never returns.

Definition at line 366 of file process.cc.

References DEBUG_PROCESS, MAX_PROCESS_STACK_SIZE, P_StackBase2, restore_context2(), and SIMLIB_error().

Referenced by simlib3::Process::_Run().

◆ restore_context2()

static void simlib3::restore_context2 ( volatile char *  )
staticnoexcept

This function overwrites stack contents. It never returns, see longjmp.

Definition at line 379 of file process.cc.

References DEBUG_PROCESS, P_Context, P_StackBase, P_StackSize, simlib3::P_Context_t::stack, and simlib3::P_Context_t::status.

Referenced by restore_context().

◆ Run()

void simlib3::Run ( )

◆ SampleDelays()

void simlib3::SampleDelays ( )

Definition at line 92 of file run.cc.

References CALL_HOOK.

Referenced by SIMLIB_DoConditions().

◆ scalar_product() [1/2]

double simlib3::scalar_product ( const Value2D a,
const Value2D b 
)

◆ scalar_product() [2/2]

double simlib3::scalar_product ( const Value3D a,
const Value3D b 
)

Definition at line 76 of file simlib3D.cc.

◆ ScalarProduct() [1/2]

Input simlib3::ScalarProduct ( Input2D  x,
Input2D  y 
)

dot product: xvec . yvec

Definition at line 389 of file simlib2D.cc.

◆ ScalarProduct() [2/2]

Input simlib3::ScalarProduct ( Input3D  x,
Input3D  y 
)

dot product: xvec . yvec

Definition at line 408 of file simlib3D.cc.

◆ SetAccuracy() [1/2]

void simlib3::SetAccuracy ( double  abserr,
double  relerr 
)

set max.

error estimate for numerical integration method used for adaptive stepsize control

Parameters
abserrabsolute tolerance
relerrtolerance relative to integrator value

Definition at line 106 of file intg.cc.

References Dprintf, SetAccuracyError, SIMLIB_AbsoluteError, SIMLIB_error(), and SIMLIB_RelativeError.

Referenced by main(), and SetAccuracy().

◆ SetAccuracy() [2/2]

void simlib3::SetAccuracy ( double  relerr)

set max.

relative error estimate for numerical integration method

Parameters
relerrtolerance relative to integrator value

Definition at line 116 of file intg.cc.

References SetAccuracy().

◆ SetBaseRandomGenerator()

void simlib3::SetBaseRandomGenerator ( double(*)()  new_gen)

set another random generator default Random() implementation can be replaced

Parameters
new_genpointer to user-defined function

Definition at line 103 of file random1.cc.

References SIMLIB_RandomBase(), and SIMLIB_RandomBasePtr.

◆ SetCalendar()

void simlib3::SetCalendar ( const char *  name)

choose calendar implementation default is list

Set calendar implementation.

Parameters
nameString identification of calendar: "list", "cq"

Definition at line 1250 of file calendar.cc.

◆ SetErrNo()

void simlib3::SetErrNo ( int  num)

Definition at line 327 of file numint.cc.

References SIMLIB_ERRNO.

◆ SetName() [1/2]

void simlib3::SetName ( SimObject o,
const std::string &  name 
)

assign name to object

Definition at line 42 of file name.cc.

References simlib3::SimObject::SetName().

Referenced by simlib3::List::List(), and simlib3::Queue::Queue().

◆ SetName() [2/2]

void simlib3::SetName ( SimObject o,
const std::string &  name 
)

assign name to object

Definition at line 48 of file name.cc.

References simlib3::SimObject::SetName().

◆ SetOutput()

void simlib3::SetOutput ( const char *  name)

redirects Output(), Print() to file

Parameters
namename of output file

Definition at line 50 of file print.cc.

References OutFile.

◆ SetStep() [1/2]

void simlib3::SetStep ( double  dt)
inline

set fixed integration step

Parameters
dt(almost) fixed step size

Definition at line 196 of file simlib.h.

References SetStep().

◆ SetStep() [2/2]

void simlib3::SetStep ( double  dtmin,
double  dtmax 
)

Set integration step interval.

Parameters
dtminmin. step size
dtmaxmax. step size (can be slightly increased)

Definition at line 92 of file intg.cc.

References Dprintf, SetStepError, SIMLIB_error(), SIMLIB_MaxStep, and SIMLIB_MinStep.

Referenced by main(), and SetStep().

◆ sign()

static double simlib3::sign ( double  x)
static

Definition at line 78 of file fun.cc.

Referenced by Sign().

◆ Sign()

Input simlib3::Sign ( Input  x)

Definition at line 110 of file fun.cc.

References sign().

◆ SIMLIB_atexit()

void simlib3::SIMLIB_atexit ( SIMLIB_atexit_function_t  p)

◆ SIMLIB_atexit_call()

static void simlib3::SIMLIB_atexit_call ( )
static

Definition at line 39 of file atexit.cc.

References atexit_array, DBG_ATEXIT, DEBUG, and MAX_ATEXIT.

Referenced by simlib3::SIMLIB_module::~SIMLIB_module().

◆ SIMLIB_ContinueInit()

void simlib3::SIMLIB_ContinueInit ( )

◆ SIMLIB_create_tmp_name()

std::string simlib3::SIMLIB_create_tmp_name ( const char *  fmt,
  ... 
)

printf-like function to create temporary name (the length of temporary names is limited)
used only for printing

Definition at line 80 of file name.cc.

Referenced by simlib3::Process::Name(), and simlib3::Event::Name().

◆ SIMLIB_DoActions()

void simlib3::SIMLIB_DoActions ( )

Definition at line 135 of file run.cc.

Referenced by Run().

◆ SIMLIB_DoConditions()

void simlib3::SIMLIB_DoConditions ( )

◆ SIMLIB_Dynamic()

void simlib3::SIMLIB_Dynamic ( )

◆ SIMLIB_error() [1/3]

void simlib3::SIMLIB_error ( const char *  filename,
const int  linenum 
)

print error message and abort program

print internal error messages

Definition at line 61 of file error.cc.

References _ABORT_TXT, _ErrMsg(), _INT_ERR_TXT, _Print(), ERROREXIT, InternalError, SIMLIB_DynamicFlag, SIMLIB_Phase, and Time.

◆ SIMLIB_error() [2/3]

void simlib3::SIMLIB_error ( const char *  fmt,
  ... 
)

print error message and abort program

print formatted error messages

Definition at line 48 of file error.cc.

References _ABORT_TXT, _ERR_TXT, _Print(), and Time.

◆ SIMLIB_error() [3/3]

void simlib3::SIMLIB_error ( const enum _ErrEnum  N)

print error message and abort program

print specific error messages

Definition at line 38 of file error.cc.

References _ABORT_TXT, _ERR_TXT, _ErrMsg(), _Print(), ERROREXIT, SIMLIB_DynamicFlag, SIMLIB_Phase, and Time.

Referenced by simlib3::aContiBlock::_Eval(), simlib3::aContiBlock2D::_Eval(), simlib3::aContiBlock3D::_Eval(), simlib3::Process::_Run(), simlib3::aContiBlock1::aContiBlock1(), simlib3::aContiBlock2::aContiBlock2(), simlib3::aContiBlock2D1::aContiBlock2D1(), simlib3::aContiBlock2D2::aContiBlock2D2(), simlib3::aContiBlock2D3::aContiBlock2D3(), simlib3::aContiBlock3::aContiBlock3(), simlib3::aContiBlock3D1::aContiBlock3D1(), simlib3::aContiBlock3D2::aContiBlock3D2(), simlib3::aContiBlock3D3::aContiBlock3D3(), simlib3::AlgLoop::AlgLoop(), simlib3::Integrator::CtrInit(), simlib3::Status::CtrInit(), simlib3::Store::Enter(), Erlang(), Error(), simlib3::CalendarQueue::estimate_bucket_width(), simlib3::Frict::Frict(), Geom(), simlib3::SIMLIB_DelayBuffer::get(), simlib3::CalendarList::Get(), simlib3::CalendarQueue::Get(), simlib3::List::Get(), simlib3::CalendarList::GetFirst(), simlib3::CalendarQueue::GetFirst(), simlib3::Histogram::Histogram(), HyperGeom(), simlib3::Histogram::Init(), simlib3::Insv::Insv(), simlib3::IntegrationMethod::IntegrationMethod(), simlib3::Store::Leave(), simlib3::Lim::Lim(), simlib3::AlgLoopDetector::lock(), simlib3::Stat::MeanValue(), simlib3::TStat::MeanValue(), NegBin(), NegBinM(), simlib3::Parameter2D::operator=(), simlib3::Parameter3D::operator=(), simlib3::Link::Out(), Poisson(), simlib3::List::PostIns(), simlib3::List::PredIns(), simlib3::IntegrationMethod::Prepare(), PROCESS_INTERRUPT_f(), simlib3::Qntzr::Qntzr(), simlib3::Facility::Release(), restore_context(), simlib3::Rline::Rline(), Run(), simlib3::SQS::ScheduleAt(), simlib3::CalendarList::ScheduleAt(), simlib3::CalendarQueue::ScheduleAt(), simlib3::IntegrationMethod::SearchMethod(), simlib3::CalendarQueue::SearchMinTime(), simlib3::Facility::Seize(), simlib3::AlgLoop::Set(), SetAccuracy(), simlib3::Store::SetCapacity(), simlib3::IntegrationMethod::SetMethod(), simlib3::MultiStepMethod::SetStarter(), SetStep(), SIMLIB_Init(), simlib3::MultiStepMethod::SlavePtr(), simlib3::Stat::StdDev(), Stop(), Uniform(), simlib3::Semaphore::V(), simlib3::Iterations::Value(), simlib3::Bisect::Value(), simlib3::RegulaFalsi::Value(), simlib3::Newton::Value(), Weibul(), simlib3::Integrator::~Integrator(), simlib3::Link::~Link(), and simlib3::Status::~Status().

◆ SIMLIB_Init()

void simlib3::SIMLIB_Init ( double  T0,
double  T1,
unsigned  version 
)

◆ SIMLIB_RandomBase()

double simlib3::SIMLIB_RandomBase ( )

Definition at line 75 of file random1.cc.

References MAXLONGINT, MULCONST, and SIMLIB_RandomSeed.

Referenced by SetBaseRandomGenerator().

◆ SIMLIB_version_string()

const char * simlib3::SIMLIB_version_string ( )

Get version of SIMLIB.

Returns
string with version of SIMLIB/C++

Definition at line 13 of file version.cc.

References SIMLIB_VERSION.

◆ SIMLIB_warning() [1/2]

void simlib3::SIMLIB_warning ( const char *  fmt,
  ... 
)

print warning message and continue

print warnings

Definition at line 80 of file error.cc.

References _ERR_TXT, _Print(), and Time.

◆ SIMLIB_warning() [2/2]

void simlib3::SIMLIB_warning ( const enum _ErrEnum  N)

◆ SIMLIB_WUClear()

void simlib3::SIMLIB_WUClear ( )

Definition at line 123 of file run.cc.

References CALL_HOOK.

Referenced by SIMLIB_Init().

◆ Sin()

Input simlib3::Sin ( Input  x)

Definition at line 96 of file fun.cc.

◆ Sqr()

Input simlib3::Sqr ( Input  x)

square function

Definition at line 233 of file continuous.cc.

◆ Sqrt()

Input simlib3::Sqrt ( Input  x)

Definition at line 112 of file fun.cc.

◆ Stop()

void simlib3::Stop ( )

stop current simulation run

Definition at line 147 of file run.cc.

References Dprintf, SFunctionUseError, SIMLIB_error(), SIMLIB_Phase, SIMULATION, and StopFlag.

◆ Tan()

Input simlib3::Tan ( Input  x)

Definition at line 98 of file fun.cc.

◆ Triag()

double simlib3::Triag ( double  mod,
double  min,
double  max 
)

Definition at line 193 of file random2.cc.

References max(), min(), and Random().

◆ Uniform()

double simlib3::Uniform ( double  l,
double  h 
)

Uniform distribution generator.

Parameters
llow limit
hhigh limit

Definition at line 71 of file random2.cc.

References BadUniformParam, Random(), and SIMLIB_error().

◆ UnitVector() [1/2]

Input2D simlib3::UnitVector ( Input2D  x)

make unit vector from input (Abs(output_vec)==1)

Definition at line 388 of file simlib2D.cc.

◆ UnitVector() [2/2]

Input3D simlib3::UnitVector ( Input3D  x)

make unit vector from input (Abs(output_vec)==1)

Definition at line 407 of file simlib3D.cc.

◆ Weibul()

double simlib3::Weibul ( double  lambda,
double  alfa 
)

Weibul distribution generator.

Parameters
lambda

param alfa

Definition at line 94 of file random2.cc.

References Random(), SIMLIB_error(), and WeibullError.

◆ WU_print()

void simlib3::WU_print ( )

Definition at line 75 of file waitunti.cc.

◆ Xpart() [1/2]

Input simlib3::Xpart ( Input2D  a)

get x part of (x,y) vector value

Definition at line 420 of file simlib2D.cc.

References simlib3::_XYpart::x.

◆ Xpart() [2/2]

Input simlib3::Xpart ( Input3D  a)

get x part of (x,y,z) vector value

Definition at line 440 of file simlib3D.cc.

References simlib3::_XYZpart::x.

◆ Ypart() [1/2]

Input simlib3::Ypart ( Input2D  a)

get y part of (x,y) vector value

Definition at line 421 of file simlib2D.cc.

References simlib3::_XYpart::y.

◆ Ypart() [2/2]

Input simlib3::Ypart ( Input3D  a)

get y part of (x,y,z) vector value

Definition at line 441 of file simlib3D.cc.

References simlib3::_XYZpart::y.

◆ Zpart()

Input simlib3::Zpart ( Input3D  a)

get z part of (x,y,z) vector value

Definition at line 442 of file simlib3D.cc.

References simlib3::_XYZpart::z.

Variable Documentation

◆ _Errors

const char simlib3::_Errors[]
static

Definition at line 13 of file errors.cc.

Referenced by _ErrMsg().

◆ _T

class _Time simlib3::_T
static

block – simulation time

Definition at line 274 of file continuous.cc.

◆ abm4

ABM4 simlib3::abm4("abm4", "rkf5") ( "abm4"  ,
"rkf5"   
)

Adams-Bashforth-Moulton, 4th order.

◆ abm_ord

const int simlib3::abm_ord =4

Definition at line 20 of file ni_abm4.h.

Referenced by simlib3::ABM4::Integrate().

◆ AbsoluteError

const double & simlib3::AbsoluteError =SIMLIB_AbsoluteError

max. abs. error of integration

max absolute error

Definition at line 53 of file intg.cc.

◆ allocator

class simlib3::EventNoticeAllocator simlib3::allocator

◆ atexit_array

SIMLIB_atexit_function_t simlib3::atexit_array[MAX_ATEXIT] = { 0, }
static

Definition at line 23 of file atexit.cc.

Referenced by SIMLIB_atexit(), and SIMLIB_atexit_call().

◆ COEF_PAR

const double simlib3::COEF_PAR = 1.5

◆ counter

int simlib3::counter = 0
static

◆ Current

Entity *const & simlib3::Current = SIMLIB_Current

pointer to active (now running) entity

Definition at line 54 of file run.cc.

Referenced by simlib3::Barrier::Enter(), simlib3::Store::Enter(), simlib3::Semaphore::P(), simlib3::Facility::Seize(), and simlib3::Barrier::Wait().

◆ EndTime

const double & simlib3::EndTime = SIMLIB_EndTime

time of simulation end

Definition at line 50 of file run.cc.

Referenced by Run(), and SIMLIB_Init().

◆ euler

EULER simlib3::euler("euler") ( "euler"  )

Euler method.

◆ flag

bool simlib3::flag = false
static

◆ fw

FW simlib3::fw("fw") ( "fw"  )

Fowler-Warten (Warning: needs testing, do not use)

◆ INICONST

const myint32 simlib3::INICONST = 1537L

Definition at line 48 of file random1.cc.

◆ LIST_MAX

const unsigned simlib3::LIST_MAX = 512

Definition at line 535 of file calendar.cc.

Referenced by simlib3::CalendarQueue::ScheduleAt().

◆ LIST_MIN

const unsigned simlib3::LIST_MIN = LIST_MAX/2

Definition at line 537 of file calendar.cc.

Referenced by simlib3::CalendarQueue::Get(), and simlib3::CalendarQueue::GetFirst().

◆ MAX_ATEXIT

const int simlib3::MAX_ATEXIT = 10
static

Definition at line 21 of file atexit.cc.

Referenced by SIMLIB_atexit(), and SIMLIB_atexit_call().

◆ MAXHISTOCOUNT

const unsigned simlib3::MAXHISTOCOUNT = 10000

Definition at line 30 of file histo.cc.

Referenced by simlib3::Histogram::Histogram(), and simlib3::Histogram::Init().

◆ MAXLONGINT

const myint32 simlib3::MAXLONGINT = 0x7FFFFFFFUL

Definition at line 52 of file random1.cc.

Referenced by SIMLIB_RandomBase().

◆ MaxStep

const double & simlib3::MaxStep =SIMLIB_MaxStep

maximal integration step

maximal step size

Definition at line 47 of file intg.cc.

◆ MINBUCKETS

const unsigned simlib3::MINBUCKETS = LIST_MAX>4?LIST_MAX:4

Definition at line 536 of file calendar.cc.

Referenced by simlib3::CalendarQueue::Resize().

◆ MinStep

const double & simlib3::MinStep =SIMLIB_MinStep

minimal integration step

minimal step size

Definition at line 46 of file intg.cc.

◆ MUL_PAR

const double simlib3::MUL_PAR = 1.0

◆ MULCONST

const myint32 simlib3::MULCONST = 1220703125L

Definition at line 49 of file random1.cc.

Referenced by SIMLIB_RandomBase().

◆ name_dict

NameDict simlib3::name_dict
static

◆ NextTime

const double & simlib3::NextTime = SIMLIB_NextTime

◆ OptStep

const double & simlib3::OptStep =SIMLIB_OptStep

◆ OutFile

class simlib3::_FileWrap simlib3::OutFile

Referenced by _Print(), Error(), Print(), and SetOutput().

◆ P_Context

P_Context_t* volatile simlib3::P_Context = 0
static

temporary global process state

Definition at line 72 of file process.cc.

Referenced by simlib3::Process::_Run(), ALLOC_CONTEXT(), FREE_CONTEXT(), PROCESS_INTERRUPT_f(), and restore_context2().

◆ P_DispatcherStatusBuffer

jmp_buf simlib3::P_DispatcherStatusBuffer
static

setjmp() state before dispatch

Definition at line 68 of file process.cc.

Referenced by simlib3::Process::_Run(), and PROCESS_INTERRUPT_f().

◆ P_StackBase

char* volatile simlib3::P_StackBase = 0
static

global start of stack area

Definition at line 69 of file process.cc.

Referenced by simlib3::Process::_Run(), PROCESS_INTERRUPT_f(), and restore_context2().

◆ P_StackBase2

char* volatile simlib3::P_StackBase2 = 0
static

used for checking only

Definition at line 70 of file process.cc.

Referenced by simlib3::Process::_Run(), and restore_context().

◆ P_StackSize

volatile size_t simlib3::P_StackSize = 0
static

temporary global stack size

Definition at line 73 of file process.cc.

Referenced by simlib3::Process::_Run(), PROCESS_INTERRUPT_f(), and restore_context2().

◆ Phase

const SIMLIB_Phase_t & simlib3::Phase = SIMLIB_Phase

This variable contains the current phase of experiment (used for internal checking)

Definition at line 58 of file run.cc.

◆ RelativeError

const double & simlib3::RelativeError =SIMLIB_RelativeError

max. rel. error

max relative error

Definition at line 54 of file intg.cc.

◆ rke

RKE simlib3::rke("rke") ( "rke"  )

Runge-Kutta-England, 4th order?

◆ rkf3

RKF3 simlib3::rkf3("rkf3") ( "rkf3"  )

Runge-Kutta-Fehlberg, 3rd order.

◆ rkf5

RKF5 simlib3::rkf5("rkf5") ( "rkf5"  )

Runge-Kutta-Fehlberg, 5th order.

◆ rkf8

RKF8 simlib3::rkf8("rkf8") ( "rkf8"  )

Runge-Kutta-Fehlberg, 8th order.

◆ SIGNBIT

const myint32 simlib3::SIGNBIT = 0x80000000UL

Definition at line 53 of file random1.cc.

◆ SIMLIB_AbsoluteError

double simlib3::SIMLIB_AbsoluteError =0

◆ SIMLIB_ConditionFlag

bool simlib3::SIMLIB_ConditionFlag = false

◆ SIMLIB_ContractStep

double simlib3::SIMLIB_ContractStep = SIMLIB_MAXTIME

◆ SIMLIB_ContractStepFlag

bool simlib3::SIMLIB_ContractStepFlag = false

◆ SIMLIB_Current

Entity * simlib3::SIMLIB_Current = NULL

◆ SIMLIB_debug_flag

unsigned long simlib3::SIMLIB_debug_flag = 0UL

Definition at line 32 of file debug.cc.

Referenced by Debug().

◆ SIMLIB_DeltaTime

double simlib3::SIMLIB_DeltaTime

◆ SIMLIB_DynamicFlag

bool simlib3::SIMLIB_DynamicFlag = false

◆ SIMLIB_EndTime

double simlib3::SIMLIB_EndTime

Definition at line 43 of file run.cc.

◆ SIMLIB_Entity_Count

unsigned long simlib3::SIMLIB_Entity_Count = 0L
static

current number of entities in model

Definition at line 27 of file entity.cc.

◆ SIMLIB_ERRNO

int simlib3::SIMLIB_ERRNO =0

◆ SIMLIB_experiment_no

unsigned long simlib3::SIMLIB_experiment_no = 0

Definition at line 61 of file run.cc.

Referenced by SIMLIB_Init().

◆ SIMLIB_IMPLEMENTATION

simlib3::SIMLIB_IMPLEMENTATION

Definition at line 34 of file algloop.cc.

◆ SIMLIB_Integrator_0input

Constant simlib3::SIMLIB_Integrator_0input(0) ( )

dummy input with zero value

◆ SIMLIB_MaxStep

double simlib3::SIMLIB_MaxStep =1

◆ SIMLIB_MAXTIME

const double simlib3::SIMLIB_MAXTIME = 1.0e30

◆ SIMLIB_MinStep

double simlib3::SIMLIB_MinStep =1e-10

◆ SIMLIB_MINTIME

const double simlib3::SIMLIB_MINTIME = 0.0

minimal time value

Definition at line 147 of file simlib.h.

Referenced by SIMLIB_Init().

◆ SIMLIB_module_id

SIMLIB_module simlib3::SIMLIB_module_id
static

Create single global registration object in each SIMLIB module.

Should be first initialized object in the module

Definition at line 73 of file internal.h.

◆ SIMLIB_NextTime

double simlib3::SIMLIB_NextTime

Definition at line 42 of file run.cc.

◆ SIMLIB_OptStep

double simlib3::SIMLIB_OptStep

◆ SIMLIB_Phase

SIMLIB_Phase_t simlib3::SIMLIB_Phase = START

◆ SIMLIB_RandomBasePtr

double(* simlib3::SIMLIB_RandomBasePtr) () ( ) = SIMLIB_RandomBase
static

Definition at line 88 of file random1.cc.

Referenced by Random(), and SetBaseRandomGenerator().

◆ SIMLIB_RandomSeed

myint32 simlib3::SIMLIB_RandomSeed = INICONST
static

Definition at line 59 of file random1.cc.

Referenced by RandomSeed(), and SIMLIB_RandomBase().

◆ SIMLIB_RelativeError

double simlib3::SIMLIB_RelativeError =0.001

◆ SIMLIB_ResetStatus

bool simlib3::SIMLIB_ResetStatus = false

flag set if there is a need for integration method restart

Definition at line 86 of file intg.cc.

Referenced by simlib3::Integrator::CtrInit(), simlib3::Status::CtrInit(), simlib3::Integrator::Init(), simlib3::IntegrationMethod::Prepare(), Run(), simlib3::Integrator::Set(), and SIMLIB_DoConditions().

◆ SIMLIB_run_statistics

SIMLIB_statistics_t simlib3::SIMLIB_run_statistics
static

Definition at line 77 of file run.cc.

Referenced by Run().

◆ SIMLIB_StartTime

double simlib3::SIMLIB_StartTime

Definition at line 40 of file run.cc.

◆ SIMLIB_statistics

const SIMLIB_statistics_t & simlib3::SIMLIB_statistics = SIMLIB_run_statistics

interface to internal run-time statistics structure

Definition at line 78 of file run.cc.

◆ SIMLIB_StepSize

double simlib3::SIMLIB_StepSize

◆ SIMLIB_StepStartTime

double simlib3::SIMLIB_StepStartTime

◆ SIMLIB_Time

double simlib3::SIMLIB_Time

Definition at line 209 of file internal.h.

Referenced by SIMLIB_ContinueInit().

◆ SIMLIB_version

const unsigned simlib3::SIMLIB_version = __SIMLIB__

library version

Definition at line 9 of file version.cc.

Referenced by SIMLIB_Init().

◆ SimObject_allocated

bool simlib3::SimObject_allocated = false
static

Definition at line 24 of file object.cc.

Referenced by simlib3::SimObject::operator new(), and simlib3::SimObject::SimObject().

◆ StartTime

const double & simlib3::StartTime = SIMLIB_StartTime

time of simulation start

Definition at line 47 of file run.cc.

Referenced by Run(), and SIMLIB_Init().

◆ StepSize

const double & simlib3::StepSize =SIMLIB_StepSize

actual integration step

current step size

Definition at line 48 of file intg.cc.

Referenced by Run().

◆ StopFlag

bool simlib3::StopFlag = false
static

Definition at line 83 of file run.cc.

Referenced by Run(), and Stop().

◆ T

aContiBlock & simlib3::T = _T

simulation time block reference

model time (continuous block)

Definition at line 276 of file continuous.cc.

Referenced by Sample().

◆ Time

const double & simlib3::Time = SIMLIB_Time

◆ Zero2D

Constant2D simlib3::Zero2D(0, 0) ( ,
 
)
static

◆ Zero3D

Constant3D simlib3::Zero3D(0, 0, 0) ( ,
,
 
)
static