|
SIMLIB/C++ 3.09
|
objects of this class call global function periodically (typicaly used for output of continuous model) More...
#include <simlib.h>


Public Member Functions | |
| Sampler (void(*pf)(), double dt=0.0) | |
| virtual | ~Sampler () |
| virtual void | Output () const override |
| print object to default output | |
| void | Start () |
| start + sample | |
| void | Stop () |
| sample + stop | |
| void | Sample () |
| performs sample (function call) | |
| double | SetStep (double dt=0.0) |
| change step | |
| double | GetStep () const |
| get current step | |
Public Member Functions inherited from simlib3::Event | |
| Event (Priority_t p=DEFAULT_PRIORITY) | |
| constructor, default priority if not specified | |
| virtual | ~Event () |
| destructor | |
| virtual void | Behavior ()=0 |
| behavior description | |
| virtual void | Output () const override |
| print object to default output | |
| virtual std::string | Name () const override |
| name of object | |
| virtual void | Activate (double t) override |
| activate at time t (schedule) | |
| void | Activate () |
| activate now | |
| virtual void | Activate (double t) |
| activate at time t (schedule) | |
Public Member Functions inherited from simlib3::Entity | |
| unsigned long | id () const |
| Entity (Priority_t p=DEFAULT_PRIORITY) | |
| constructor | |
| virtual | ~Entity () |
| destructor | |
| operator Entity * () | |
| double | ActivationTime () |
| get activation time of entity - iff scheduled it is here, because Entity has no knowledge of calendar activation record structure | |
| void | Activate () |
| activate now | |
| virtual void | Activate (double t) |
| activate at time t (schedule) | |
| virtual void | Passivate () |
| deactivation | |
| virtual void | Terminate ()=0 |
| end Behavior() and remove entity | |
| bool | Idle () |
| entity activation is not scheduled in calendar | |
| void | Cancel () |
| end Behavior() and remove entity | |
| virtual void | Out () override |
| remove entity from queue | |
| EventNotice * | GetEventNotice () |
Public Member Functions inherited from simlib3::Link | |
| Link () | |
| virtual | ~Link () |
| virtual void | Into (List *l) |
| insert last | |
| virtual void | Out () |
| remove from list | |
| List * | Where () |
| where is linked | |
| virtual bool | isInQueue () |
| present in queue | |
Public Member Functions inherited from simlib3::SimObject | |
| bool | TestAndSetFlag (bool new_value, unsigned n) |
| internal method for flag manipulation is used for algebraic loop checking in continuous blocks | |
| SimObject () | |
| constructor | |
| virtual | ~SimObject () |
| virtual destructor | |
| void * | operator new (size_t size) |
| allocate object, set _flags | |
| void | operator delete (void *ptr) |
| deallocate object | |
| void * | operator new[] (size_t size)=delete |
| void | operator delete[] (void *ptr)=delete |
| bool | isAllocated () const |
| virtual std::string | Name () const |
| get object name | |
| bool | HasName () const |
| void | SetName (const std::string &name) |
| assign the name | |
| virtual void | Output () const |
| print object to default output | |
Protected Member Functions | |
| virtual void | Behavior () override |
| behavior description | |
Protected Member Functions inherited from simlib3::Link | |
| Link (Link *p, Link *s, List *h) | |
Protected Attributes | |
| void(* | function )() |
| function to call periodically | |
| double | last |
| last sample time – prevents sample duplication | |
| double | step |
| step of sampling | |
| bool | on |
| switch on/off | |
Protected Attributes inherited from simlib3::Entity | |
| unsigned long | _Ident |
| unique identification number of entity | |
| double | _MarkTime |
| union { | |
| double _RemainingTime | |
| unsigned long _RequiredCapacity | |
| }; | |
| ServicePriority_t | _SPrio |
| priority of service in Facility | |
Protected Attributes inherited from simlib3::SimObject | |
| unsigned | _flags |
| bool flags for internal use (TODO bitfield?) | |
Static Private Member Functions | |
| static void | InitAll () |
| initialize all samplers (Init) | |
| static void | ActivateAll () |
| start all samplers (Run) | |
Private Attributes | |
| Sampler * | Next |
Static Private Attributes | |
| static Sampler * | First = 0 |
Additional Inherited Members | |
Public Types inherited from simlib3::Entity | |
| typedef EntityPriority_t | Priority_t |
Public Types inherited from simlib3::SimObject | |
| enum | _Flags { _CLEAR_ALL_FLAGS = 0 , _ALLOCATED_FLAG = 1<<0 , _EVAL_FLAG = 1<<1 , _HAS_NAME_FLAG = 1<<2 } |
Public Attributes inherited from simlib3::Entity | |
| Priority_t | Priority |
| priority of the entity (scheduling,queues) | |
Static Protected Attributes inherited from simlib3::Entity | |
| static unsigned long | _Number = 0L |
| current number of entities | |
objects of this class call global function periodically (typicaly used for output of continuous model)
| simlib3::Sampler::Sampler | ( | void(*)() | pf, |
| double | dt = 0.0 |
||
| ) |
Definition at line 39 of file sampler.cc.
References ActivateAll(), Dprintf, First, InitAll(), INSTALL_HOOK, and Next.
|
virtual |
Definition at line 59 of file sampler.cc.
References Dprintf, First, function, INSTALL_HOOK, and Next.
|
staticprivate |
|
overrideprotectedvirtual |
behavior description
Implements simlib3::Event.
Definition at line 90 of file sampler.cc.
References simlib3::Event::Activate(), Dprintf, on, simlib3::Entity::Passivate(), Sample(), step, and simlib3::Time.
|
inline |
|
staticprivate |
|
overridevirtual |
print object to default output
Reimplemented from simlib3::Event.
Definition at line 80 of file sampler.cc.
References function, last, on, and simlib3::Print().
| void simlib3::Sampler::Sample | ( | ) |
performs sample (function call)
Definition at line 147 of file sampler.cc.
References function, last, and simlib3::Time.
Referenced by Behavior().
| double simlib3::Sampler::SetStep | ( | double | dt = 0.0 | ) |
| void simlib3::Sampler::Start | ( | ) |
start + sample
Definition at line 126 of file sampler.cc.
References simlib3::Event::Activate(), and on.
| void simlib3::Sampler::Stop | ( | ) |
sample + stop
Definition at line 135 of file sampler.cc.
References simlib3::Event::Activate(), last, on, simlib3::Entity::Passivate(), and simlib3::Time.
|
staticprivate |
Definition at line 507 of file simlib.h.
Referenced by ActivateAll(), InitAll(), Sampler(), and ~Sampler().
|
protected |
function to call periodically
Definition at line 510 of file simlib.h.
Referenced by Output(), Sample(), and ~Sampler().
|
protected |
|
private |
Definition at line 508 of file simlib.h.
Referenced by ActivateAll(), InitAll(), Sampler(), and ~Sampler().
|
protected |
|
protected |
step of sampling
Definition at line 512 of file simlib.h.
Referenced by Behavior(), GetStep(), and SetStep().