SyDEVS  v0.6.7
Multiscale Simulation and Systems Modeling Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sydevs::systems::parameter_node< T > Class Template Reference

A class template for nodes which supply parameter values. More...

#include <parameter_node.h>

Inherits sydevs::systems::function_node.

Public Member Functions

 parameter_node (const std::string &node_name, const node_context &external_context)
 Constructs a parameter_node. More...
 
 parameter_node (const std::string &node_name, const node_context &external_context, const T &X)
 Constructs a parameter_node with a parameter value. More...
 
const T & value () const
 Returns the parameter value. More...
 
void set_value (const T &X)
 Sets the parameter value to X. More...
 
- Public Member Functions inherited from sydevs::systems::function_node
 function_node (const std::string &node_name, const node_context &external_context)
 Constructs a function_node. More...
 
virtual ~function_node ()=default
 Destructor. More...
 
data_mode node_dmode () const
 Returns message for all atomic nodes. More...
 
scale time_precision () const
 Returns no_scale for all function nodes. More...
 
duration handle_initialization_event ()
 Invoked when all flow input ports have values; calls flow_event. More...
 
duration handle_unplanned_event (duration elapsed_dt)
 Never invoked for function nodes. More...
 
duration handle_planned_event (duration elapsed_dt)
 Never invoked for function nodes. More...
 
void handle_finalization_event (duration elapsed_dt)
 Never invoked for function nodes. More...
 
- Public Member Functions inherited from sydevs::systems::system_node
 system_node (const system_node &)=delete
 No copy constructor. More...
 
system_nodeoperator= (const system_node &)=delete
 No copy assignment. More...
 
 system_node (system_node &&)=delete
 No move constructor. More...
 
system_nodeoperator= (system_node &&)=delete
 No move assignment. More...
 
virtual ~system_node ()=default
 Destructor. More...
 
const std::string & node_name () const
 Returns the name of the node. More...
 
const std::string & full_name () const
 Returns the full name of the node, including parent nodes. More...
 
int64 node_index () const
 Returns the index of the node within the parent node. More...
 
const node_interfaceexternal_interface () const
 Returns the object responsible for exchanging information between the node and its surrounding context. More...
 
const timerevent_timer () const
 Returns the object that accumulated wallclock event durations. More...
 
template<typename T >
void print (const T &X)
 Prints X while indicating the simulation time and node. More...
 
void print (const char *raw_text)
 Prints raw_text while indicating the simulation time and node. More...
 
void print (const std::string &text)
 Prints text while indicating the simulation time and node. More...
 
void print_on_event (bool flag=true) const
 If flag is true, all event types are printed for this node. More...
 
void adopt_print_flags (const system_node &node) const
 Adopts the print flags of node. More...
 
duration process_initialization_event ()
 Processes an initialization event; returns a planned duration. More...
 
duration process_unplanned_event (duration elapsed_dt)
 Processes an unplanned event after an elapsed duration elapsed_dt; returns a planned duration. More...
 
duration process_planned_event (duration elapsed_dt)
 Processes a planned event after an elapsed duration elapsed_dt; returns a planned duration. More...
 
void process_finalization_event (duration elapsed_dt)
 Processes a finalization event after an elapsed duration elapsed_dt. More...
 

Public Attributes

port< flow, output, T > parameter
 The flow output port on which the parameter value is provided. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sydevs::systems::system_node
 system_node (const std::string &node_name, const node_context &external_context)
 Constructs a system_node. More...
 
node_interfaceexternal_IO () const
 Returns a non-const reference to the node's external interface. More...
 
timerET () const
 Returns a non-const reference to the node's event timer. More...
 
duration scale_planned_dt (duration planned_dt) const
 Adjusts the planned duration obtained from other nodes' event handlers. More...
 
- Protected Attributes inherited from sydevs::systems::system_node
std::mt19937 & rng
 Reference to the random number generator. More...
 

Detailed Description

template<typename T>
class sydevs::systems::parameter_node< T >

A class template for nodes which supply parameter values.

The parameter_node class template is instantiated by classes that provide a single value as a flow output. The value is specified on construction or by the set_value member function.

Constructor & Destructor Documentation

template<typename T >
sydevs::systems::parameter_node< T >::parameter_node ( const std::string &  node_name,
const node_context external_context 
)
inline

Constructs a parameter_node.

The parameter node is created along with its associated node_interface object.

Parameters
node_nameThe name of the node within the encompassing context.
external_contextThe context in which the node is constructed.
Template Parameters
TThe type of the parameter value.
template<typename T >
sydevs::systems::parameter_node< T >::parameter_node ( const std::string &  node_name,
const node_context external_context,
const T &  X 
)
inline

Constructs a parameter_node with a parameter value.

The parameter node is created along with its associated node_interface object.

Parameters
node_nameThe name of the node within the encompassing context.
external_contextThe context in which the node is constructed.
XThe parameter value.
Template Parameters
TThe type of the parameter value.

Member Function Documentation

template<typename T >
void sydevs::systems::parameter_node< T >::set_value ( const T &  X)
inline

Sets the parameter value to X.

template<typename T >
const T & sydevs::systems::parameter_node< T >::value ( ) const
inline

Returns the parameter value.

Member Data Documentation

template<typename T >
port<flow, output, T> sydevs::systems::parameter_node< T >::parameter

The flow output port on which the parameter value is provided.


The documentation for this class was generated from the following file: