LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::lal::EmbeddedEnvironment Class Reference

A LINE Environment embedded as a stage agent plus its stage networks (EmbeddedEnvironment). More...

#include <line/lang/lal/embed.h>

Inheritance diagram for line::lal::EmbeddedEnvironment:
Collaboration diagram for line::lal::EmbeddedEnvironment:

Public Member Functions

 EmbeddedEnvironment (const env::Environment< double > &e, const std::string &prefix, std::optional< double > cutoff)
const std::string & name () const override
 The part name (the prefix, or the model name).
const std::string & prefix () const override
 The embedding prefix, empty when none was given.
std::size_t initial () override
 The global index of the initial state.
const std::vector< NodeEvent > & labels () override
 Every node key an arc carries, in first-seen order.
bool is_vanishing (std::size_t s) override
 True when s is a vanishing state of the embedded model.
bool has_vanishing () override
 True when the embedded model has any vanishing state.
void refresh () override
 Re-read the embedded model on next use.
NodeEvent resolve (const std::string &node, lang::EventType event, const std::optional< std::string > &jobclass, const std::optional< std::string > &mode) override
 The key of a node action, validated against the model's names.
std::string node_name (std::size_t node) override
 Name of the 1-based node index of the model.
std::string class_name (std::size_t cls) override
 Name of the 1-based class index of the model.
void check_injection (const NodeEvent &) override
 Refuse a key that a hand agent cannot drive.
std::vector< std::pair< std::size_t, double > > inject (std::size_t, const NodeEvent &key) override
 Passive response to an injected arrival: [(target, probability)]; empty blocks it.
std::vector< std::pair< std::string, std::size_t > > node_states () override
 [(node name, isf)] of the stateful node agents (isf is 1-based).
std::string node_state_label (std::size_t s, std::size_t isf) override
 The state row of stateful node isf in global state s, as [v1 v2 ...].
std::vector< double > node_row (std::size_t s, const std::string &node) override
 The state row of a stateful node in global state s.
double node_jobs (std::size_t s, const std::string &node, const std::string &jobclass) override
 Jobs at a station in global state s: the total, or those of class jobclass when nonempty.
bool has_stages () override
 True for an embedded Environment, whose stage is an agent of its own.
std::size_t stage_of (std::size_t s) override
 The stage of global state s (Environment only).
std::vector< std::string > stage_names () override
 The stage names (Environment only).
std::vector< EmbeddedArc > outgoing (std::size_t s) override
 Arcs leaving global state s.
Public Member Functions inherited from line::lal::EmbeddedPart
virtual ~EmbeddedPart ()
virtual bool matches (const NodeEvent &key, const NodeEvent &pattern) const
 True when key is pattern, or pattern leaves the index open.
virtual void set_injected (const std::set< std::string > &)
 Record the classes hand agents inject (names); a change invalidates the enumeration.

Detailed Description

A LINE Environment embedded as a stage agent plus its stage networks (EmbeddedEnvironment).

The joint state is (clock, x): clock is the stage together with the phases of its running stage clocks, x a global state of that stage's network. In stage e the network evolves with stage e's own arcs; a stage clock ringing moves to the destination stage, starts its clocks afresh, and carries the network state across under the arc's reset policy: no reset (keep) matches every node's state row in the destination stage's space; a queue-length reset q -> f(q) moves to the destination state with queue lengths f(q), keeping the service phases where such a state exists; a resetStateFun (Environment::set_state_reset) gives the entry law of the exit state as the image of its unit vector over the tangible states. Competing arcs are racing phase-type clocks; kernel arcs draw the destination on entry and then run that arc's sojourn clock. Stage changes carry the key Env.STAGE[e->h].

Definition at line 834 of file embed.h.

Constructor & Destructor Documentation

◆ EmbeddedEnvironment()

line::lal::EmbeddedEnvironment::EmbeddedEnvironment ( const env::Environment< double > & e,
const std::string & prefix,
std::optional< double > cutoff )
inline

Definition at line 836 of file embed.h.

References line::ErrorKind::ErrorKind(), name(), and prefix().

Member Function Documentation

◆ check_injection()

void line::lal::EmbeddedEnvironment::check_injection ( const NodeEvent & key)
inlineoverridevirtual

Refuse a key that a hand agent cannot drive.

Implements line::lal::EmbeddedPart.

Definition at line 885 of file embed.h.

References line::ErrorKind::ErrorKind(), and line::UnsupportedError::UnsupportedError().

Referenced by inject().

◆ class_name()

std::string line::lal::EmbeddedEnvironment::class_name ( std::size_t cls)
inlineoverridevirtual

Name of the 1-based class index of the model.

Implements line::lal::EmbeddedPart.

Definition at line 883 of file embed.h.

◆ has_stages()

bool line::lal::EmbeddedEnvironment::has_stages ( )
inlineoverridevirtual

True for an embedded Environment, whose stage is an agent of its own.

Reimplemented from line::lal::EmbeddedPart.

Definition at line 912 of file embed.h.

◆ has_vanishing()

bool line::lal::EmbeddedEnvironment::has_vanishing ( )
inlineoverridevirtual

True when the embedded model has any vanishing state.

Implements line::lal::EmbeddedPart.

Definition at line 863 of file embed.h.

◆ initial()

std::size_t line::lal::EmbeddedEnvironment::initial ( )
inlineoverridevirtual

The global index of the initial state.

Implements line::lal::EmbeddedPart.

Definition at line 850 of file embed.h.

◆ inject()

std::vector< std::pair< std::size_t, double > > line::lal::EmbeddedEnvironment::inject ( std::size_t s,
const NodeEvent & key )
inlineoverridevirtual

Passive response to an injected arrival: [(target, probability)]; empty blocks it.

Implements line::lal::EmbeddedPart.

Definition at line 890 of file embed.h.

References check_injection().

◆ is_vanishing()

bool line::lal::EmbeddedEnvironment::is_vanishing ( std::size_t s)
inlineoverridevirtual

True when s is a vanishing state of the embedded model.

Implements line::lal::EmbeddedPart.

Definition at line 858 of file embed.h.

◆ labels()

const std::vector< NodeEvent > & line::lal::EmbeddedEnvironment::labels ( )
inlineoverridevirtual

Every node key an arc carries, in first-seen order.

Implements line::lal::EmbeddedPart.

Definition at line 854 of file embed.h.

◆ name()

const std::string & line::lal::EmbeddedEnvironment::name ( ) const
inlineoverridevirtual

The part name (the prefix, or the model name).

Implements line::lal::EmbeddedPart.

Definition at line 847 of file embed.h.

Referenced by EmbeddedEnvironment().

◆ node_jobs()

double line::lal::EmbeddedEnvironment::node_jobs ( std::size_t s,
const std::string & node,
const std::string & jobclass )
inlineoverridevirtual

Jobs at a station in global state s: the total, or those of class jobclass when nonempty.

Implements line::lal::EmbeddedPart.

Definition at line 906 of file embed.h.

◆ node_name()

std::string line::lal::EmbeddedEnvironment::node_name ( std::size_t node)
inlineoverridevirtual

Name of the 1-based node index of the model.

Implements line::lal::EmbeddedPart.

Definition at line 882 of file embed.h.

◆ node_row()

std::vector< double > line::lal::EmbeddedEnvironment::node_row ( std::size_t s,
const std::string & node )
inlineoverridevirtual

The state row of a stateful node in global state s.

Implements line::lal::EmbeddedPart.

Definition at line 901 of file embed.h.

◆ node_state_label()

std::string line::lal::EmbeddedEnvironment::node_state_label ( std::size_t s,
std::size_t isf )
inlineoverridevirtual

The state row of stateful node isf in global state s, as [v1 v2 ...].

Implements line::lal::EmbeddedPart.

Definition at line 896 of file embed.h.

◆ node_states()

std::vector< std::pair< std::string, std::size_t > > line::lal::EmbeddedEnvironment::node_states ( )
inlineoverridevirtual

[(node name, isf)] of the stateful node agents (isf is 1-based).

Implements line::lal::EmbeddedPart.

Definition at line 895 of file embed.h.

◆ outgoing()

std::vector< EmbeddedArc > line::lal::EmbeddedEnvironment::outgoing ( std::size_t s)
inlineoverridevirtual

◆ prefix()

const std::string & line::lal::EmbeddedEnvironment::prefix ( ) const
inlineoverridevirtual

The embedding prefix, empty when none was given.

Implements line::lal::EmbeddedPart.

Definition at line 848 of file embed.h.

Referenced by EmbeddedEnvironment().

◆ refresh()

void line::lal::EmbeddedEnvironment::refresh ( )
inlineoverridevirtual

Re-read the embedded model on next use.

Implements line::lal::EmbeddedPart.

Definition at line 869 of file embed.h.

◆ resolve()

NodeEvent line::lal::EmbeddedEnvironment::resolve ( const std::string & node,
lang::EventType event,
const std::optional< std::string > & jobclass,
const std::optional< std::string > & mode )
inlineoverridevirtual

The key of a node action, validated against the model's names.

Implements line::lal::EmbeddedPart.

Definition at line 877 of file embed.h.

References line::lang::STAGE.

◆ stage_names()

std::vector< std::string > line::lal::EmbeddedEnvironment::stage_names ( )
inlineoverridevirtual

The stage names (Environment only).

Reimplemented from line::lal::EmbeddedPart.

Definition at line 917 of file embed.h.

◆ stage_of()

std::size_t line::lal::EmbeddedEnvironment::stage_of ( std::size_t s)
inlineoverridevirtual

The stage of global state s (Environment only).

Reimplemented from line::lal::EmbeddedPart.

Definition at line 913 of file embed.h.


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