|
SIMLIB/C++
3.07
|
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 More... | |
| void | Start () |
| start + sample More... | |
| void | Stop () |
| sample + stop More... | |
| void | Sample () |
| performs sample (function call) More... | |
| double | SetStep (double dt=0.0) |
| change step More... | |
| double | GetStep () const |
| get current step More... | |
Public Member Functions inherited from simlib3::Event | |
| Event (Priority_t p=DEFAULT_PRIORITY) | |
| constructor, default priority if not specified More... | |
| virtual | ~Event () |
| destructor More... | |
| virtual std::string | Name () const override |
| name of object More... | |
| virtual void | Activate (double t) override |
| activate at time t (schedule) More... | |
Public Member Functions inherited from simlib3::Entity | |
| unsigned long | id () const |
| Entity (Priority_t p=DEFAULT_PRIORITY) | |
| constructor More... | |
| virtual | ~Entity () |
| destructor More... | |
| operator Entity * () | |
| double | ActivationTime () |
| get activation time of entity - iff scheduled it is here, because Entity has no knowledge of calendar activation record structure More... | |
| void | Activate () |
| activate now More... | |
| virtual void | Passivate () |
| deactivation More... | |
| bool | Idle () |
| entity activation is not scheduled in calendar More... | |
| void | Cancel () |
| end Behavior() and remove entity More... | |
| virtual void | Out () override |
| remove entity from queue More... | |
| EventNotice * | GetEventNotice () |
Public Member Functions inherited from simlib3::Link | |
| Link () | |
| virtual | ~Link () |
| virtual void | Into (List *l) |
| insert last More... | |
| List * | Where () |
| where is linked More... | |
| virtual bool | isInQueue () |
| present in queue More... | |
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 More... | |
| SimObject () | |
| constructor More... | |
| virtual | ~SimObject () |
| virtual destructor More... | |
| void * | operator new (size_t size) |
| allocate object, set _flags More... | |
| void | operator delete (void *ptr) |
| deallocate object More... | |
| void * | operator new[] (size_t size)=delete |
| void | operator delete[] (void *ptr)=delete |
| bool | isAllocated () const |
| bool | HasName () const |
| void | SetName (const std::string &name) |
| assign the name More... | |
Protected Member Functions | |
| virtual void | Behavior () override |
| behavior description More... | |
Protected Member Functions inherited from simlib3::Link | |
| Link (Link *p, Link *s, List *h) | |
Protected Attributes | |
| void(* | function )() |
| function to call periodically More... | |
| double | last |
| last sample time – prevents sample duplication More... | |
| double | step |
| step of sampling More... | |
| bool | on |
| switch on/off More... | |
Protected Attributes inherited from simlib3::Entity | |
| unsigned long | _Ident |
| unique identification number of entity More... | |
| double | _MarkTime |
| union { | |
| double _RemainingTime | |
| unsigned long _RequiredCapacity | |
| }; | |
| ServicePriority_t | _SPrio |
| priority of service in Facility More... | |
Protected Attributes inherited from simlib3::SimObject | |
| unsigned | _flags |
| bool flags for internal use (TODO bitfield?) More... | |
Static Private Member Functions | |
| static void | InitAll () |
| initialize all samplers (Init) More... | |
| static void | ActivateAll () |
| start all samplers (Run) More... | |
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) More... | |
Static Protected Attributes inherited from simlib3::Entity | |
| static unsigned long | _Number = 0L |
| current number of entities More... | |
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, INSTALL_HOOK, and Next.
|
staticprivate |
|
overrideprotectedvirtual |
behavior description
Implements simlib3::Event.
Definition at line 90 of file sampler.cc.
References simlib3::Entity::Activate(), Dprintf, on, simlib3::Entity::Passivate(), Sample(), step, and simlib3::Time.
|
inline |
get current step
Definition at line 523 of file simlib.h.
References simlib3::SQS::Clear(), simlib3::Max(), simlib3::max(), simlib3::Min(), simlib3::min(), and simlib3::SimObject::Output().
|
staticprivate |
|
overridevirtual |
print object to default output
Reimplemented from simlib3::Event.
Definition at line 80 of file sampler.cc.
References last, on, and simlib3::Print().
| void simlib3::Sampler::Sample | ( | ) |
performs sample (function call)
Definition at line 147 of file sampler.cc.
References 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::Entity::Activate(), and on.
| void simlib3::Sampler::Stop | ( | ) |
sample + stop
Definition at line 135 of file sampler.cc.
References simlib3::Entity::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 |
|
protected |
|
private |
Definition at line 508 of file simlib.h.
Referenced by ActivateAll(), InitAll(), Sampler(), and ~Sampler().
|
protected |
|
protected |
1.8.13