A base class for all nodes from which systems models are constructed.
More...
#include <system_node.h>
Inherited by sydevs::systems::atomic_node, sydevs::systems::collection_node_base, sydevs::systems::composite_node, and sydevs::systems::function_node.
|
std::mt19937 & | rng |
| Reference to the random number generator. More...
|
|
A base class for all nodes from which systems models are constructed.
The system_node
abstract base class is inherited by classes representing various types of system nodes:
Concrete derived classes must implement the following pure virtual member functions:
node_dmode
, which distinguishes between flow
(data flow, untimed) nodes and message
(message passing, timed) nodes;
time_precision
, which indicates the time quantum that must evenly divide all planned and elapsed durations associated with the node (unless the time precision is no_scale
);
adopt_component_print_flags
, which copies print flags from the components of another node to the components of this
node.
handle_initialization_event
, which is called at the beginning of a simulation;
handle_unplanned_event
, which is called whenever a message is received;
handle_planned_event
, which is called when the planned duration elapses;
handle_finalization_event
, which is called at the end of a simulation.
sydevs::systems::system_node::system_node |
( |
const system_node & |
| ) |
|
|
delete |
sydevs::systems::system_node::system_node |
( |
system_node && |
| ) |
|
|
delete |
virtual sydevs::systems::system_node::~system_node |
( |
| ) |
|
|
virtualdefault |
sydevs::systems::system_node::system_node |
( |
const std::string & |
node_name, |
|
|
const node_context & |
external_context |
|
) |
| |
|
inlineprotected |
Constructs a system_node
.
Constructs the system node and its associated node_interface
object that associates the node with its surrounding context. The rng
reference is connected with the main random number generator.
- Parameters
-
node_name | The name of the node within the encompassing context. |
external_context | The context in which the node is constructed. |
void sydevs::systems::system_node::adopt_print_flags |
( |
const system_node & |
node | ) |
const |
Adopts the print flags of node
.
timer & sydevs::systems::system_node::ET |
( |
| ) |
const |
|
inlineprotected |
Returns a non-const reference to the node's event timer.
const timer & sydevs::systems::system_node::event_timer |
( |
| ) |
const |
|
inline |
Returns the object that accumulated wallclock event durations.
const node_interface & sydevs::systems::system_node::external_interface |
( |
| ) |
const |
|
inline |
Returns the object responsible for exchanging information between the node and its surrounding context.
Returns a non-const reference to the node's external interface.
const std::string & sydevs::systems::system_node::full_name |
( |
| ) |
const |
|
inline |
Returns the full name of the node, including parent nodes.
virtual data_mode sydevs::systems::system_node::node_dmode |
( |
| ) |
const |
|
pure virtual |
int64 sydevs::systems::system_node::node_index |
( |
| ) |
const |
|
inline |
Returns the index of the node within the parent node.
const std::string & sydevs::systems::system_node::node_name |
( |
| ) |
const |
|
inline |
Returns the name of the node.
template<typename T >
void sydevs::systems::system_node::print |
( |
const T & |
X | ) |
|
|
inline |
Prints X
while indicating the simulation time and node.
void sydevs::systems::system_node::print |
( |
const char * |
raw_text | ) |
|
|
inline |
Prints raw_text
while indicating the simulation time and node.
void sydevs::systems::system_node::print |
( |
const std::string & |
text | ) |
|
|
inline |
Prints text
while indicating the simulation time and node.
void sydevs::systems::system_node::print_on_event |
( |
bool |
flag = true | ) |
const |
|
inline |
If flag
is true
, all event types are printed for this node.
void sydevs::systems::system_node::process_finalization_event |
( |
duration |
elapsed_dt | ) |
|
|
inline |
Processes a finalization event after an elapsed duration elapsed_dt
.
duration sydevs::systems::system_node::process_initialization_event |
( |
| ) |
|
|
inline |
Processes an initialization event; returns a planned duration.
duration sydevs::systems::system_node::process_planned_event |
( |
duration |
elapsed_dt | ) |
|
|
inline |
Processes a planned event after an elapsed duration elapsed_dt
; returns a planned duration.
duration sydevs::systems::system_node::process_unplanned_event |
( |
duration |
elapsed_dt | ) |
|
|
inline |
Processes an unplanned event after an elapsed duration elapsed_dt
; returns a planned duration.
duration sydevs::systems::system_node::scale_planned_dt |
( |
duration |
planned_dt | ) |
const |
|
protected |
Adjusts the planned duration obtained from other nodes' event handlers.
Checks for errors in the planned duration planned_dt
including e.g. invalidity, negativity, and loss of precision. Returns a duration that is equal except that the precision level is set to the node's time precision.
- Parameters
-
planned_dt | The unscaled planned duration value. |
- Returns
- A planned duration with a value equal to
planned_dt
, but where the precision level may be changed to match time_precision()
.
virtual scale sydevs::systems::system_node::time_precision |
( |
| ) |
const |
|
pure virtual |
std::mt19937& sydevs::systems::system_node::rng |
|
protected |
Reference to the random number generator.
The documentation for this class was generated from the following files: