![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
An embedded LINE model seen by the LAL core (Python's EmbeddedNetwork / EmbeddedEnvironment duck type). More...
#include <line/lang/lal/core.h>
Public Member Functions | |
| virtual | ~EmbeddedPart () |
| virtual const std::string & | name () const =0 |
| The part name (the prefix, or the model name). | |
| virtual const std::string & | prefix () const =0 |
| The embedding prefix, empty when none was given. | |
| virtual std::size_t | initial ()=0 |
| The global index of the initial state. | |
| virtual const std::vector< NodeEvent > & | labels ()=0 |
| Every node key an arc carries, in first-seen order. | |
| virtual std::vector< EmbeddedArc > | outgoing (std::size_t s)=0 |
| Arcs leaving global state s. | |
| virtual bool | is_vanishing (std::size_t s)=0 |
| True when s is a vanishing state of the embedded model. | |
| virtual bool | has_vanishing ()=0 |
| True when the embedded model has any vanishing state. | |
| virtual std::vector< std::pair< std::size_t, double > > | inject (std::size_t s, const NodeEvent &key)=0 |
| Passive response to an injected arrival: [(target, probability)]; empty blocks it. | |
| virtual void | check_injection (const NodeEvent &key)=0 |
| Refuse a key that a hand agent cannot drive. | |
| virtual NodeEvent | resolve (const std::string &node, lang::EventType event, const std::optional< std::string > &jobclass, const std::optional< std::string > &mode)=0 |
| The key of a node action, validated against the model's names. | |
| virtual std::string | node_name (std::size_t node)=0 |
| Name of the 1-based node index of the model. | |
| virtual std::string | class_name (std::size_t cls)=0 |
| Name of the 1-based class index of the model. | |
| virtual bool | matches (const NodeEvent &key, const NodeEvent &pattern) const |
| True when key is pattern, or pattern leaves the index open. | |
| virtual std::vector< std::pair< std::string, std::size_t > > | node_states ()=0 |
| [(node name, isf)] of the stateful node agents (isf is 1-based). | |
| virtual std::string | node_state_label (std::size_t s, std::size_t isf)=0 |
| The state row of stateful node isf in global state s, as [v1 v2 ...]. | |
| virtual std::vector< double > | node_row (std::size_t s, const std::string &node)=0 |
| The state row of a stateful node in global state s. | |
| virtual double | node_jobs (std::size_t s, const std::string &node, const std::string &jobclass)=0 |
| Jobs at a station in global state s: the total, or those of class jobclass when nonempty. | |
| virtual bool | has_stages () |
| True for an embedded Environment, whose stage is an agent of its own. | |
| virtual std::size_t | stage_of (std::size_t) |
| The stage of global state s (Environment only). | |
| virtual std::vector< std::string > | stage_names () |
| The stage names (Environment only). | |
| virtual void | set_injected (const std::set< std::string > &) |
| Record the classes hand agents inject (names); a change invalidates the enumeration. | |
| virtual void | refresh ()=0 |
| Re-read the embedded model on next use. | |
An embedded LINE model seen by the LAL core (Python's EmbeddedNetwork / EmbeddedEnvironment duck type).
The local states of the agent are the global state indices of the embedded model. The enumeration is LAZY: an implementation builds it on first use and drops it on refresh(), which is why the queries are not const.
|
inlinevirtual |
|
pure virtual |
Refuse a key that a hand agent cannot drive.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
pure virtual |
Name of the 1-based class index of the model.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
inlinevirtual |
True for an embedded Environment, whose stage is an agent of its own.
Reimplemented in line::lal::EmbeddedEnvironment.
Definition at line 238 of file core.h.
Referenced by line::lal::agent_state_rows().
|
pure virtual |
True when the embedded model has any vanishing state.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
pure virtual |
The global index of the initial state.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
pure virtual |
Passive response to an injected arrival: [(target, probability)]; empty blocks it.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
pure virtual |
True when s is a vanishing state of the embedded model.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
pure virtual |
Every node key an arc carries, in first-seen order.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
inlinevirtual |
True when key is pattern, or pattern leaves the index open.
Definition at line 226 of file core.h.
References line::lal::node_event_matches().
Referenced by line::lal::Events::outgoing().
|
pure virtual |
The part name (the prefix, or the model name).
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
pure virtual |
Jobs at a station in global state s: the total, or those of class jobclass when nonempty.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
pure virtual |
Name of the 1-based node index of the model.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
pure virtual |
The state row of a stateful node in global state s.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
pure virtual |
The state row of stateful node isf in global state s, as [v1 v2 ...].
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
Referenced by line::lal::agent_state_rows().
|
pure virtual |
[(node name, isf)] of the stateful node agents (isf is 1-based).
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
Referenced by line::lal::agent_state_rows().
|
pure virtual |
Arcs leaving global state s.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
Referenced by line::lal::Events::outgoing().
|
pure virtual |
The embedding prefix, empty when none was given.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
Referenced by line::lal::agent_state_rows().
|
pure virtual |
Re-read the embedded model on next use.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
pure virtual |
The key of a node action, validated against the model's names.
Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.
|
inlinevirtual |
Record the classes hand agents inject (names); a change invalidates the enumeration.
Reimplemented in line::lal::EmbeddedNetwork.
|
inlinevirtual |
The stage names (Environment only).
Reimplemented in line::lal::EmbeddedEnvironment.
Definition at line 242 of file core.h.
Referenced by line::lal::agent_state_rows().
|
inlinevirtual |
The stage of global state s (Environment only).
Reimplemented in line::lal::EmbeddedEnvironment.
Definition at line 240 of file core.h.
Referenced by line::lal::agent_state_rows().