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

An embedded LINE model seen by the LAL core (Python's EmbeddedNetwork / EmbeddedEnvironment duck type). More...

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

Inheritance diagram for line::lal::EmbeddedPart:

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.

Detailed Description

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.

Definition at line 197 of file core.h.

Constructor & Destructor Documentation

◆ ~EmbeddedPart()

virtual line::lal::EmbeddedPart::~EmbeddedPart ( )
inlinevirtual

Definition at line 199 of file core.h.

Member Function Documentation

◆ check_injection()

virtual void line::lal::EmbeddedPart::check_injection ( const NodeEvent & key)
pure virtual

Refuse a key that a hand agent cannot drive.

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

◆ class_name()

virtual std::string line::lal::EmbeddedPart::class_name ( std::size_t cls)
pure virtual

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

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

◆ has_stages()

virtual bool line::lal::EmbeddedPart::has_stages ( )
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().

◆ has_vanishing()

virtual bool line::lal::EmbeddedPart::has_vanishing ( )
pure virtual

True when the embedded model has any vanishing state.

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

◆ initial()

virtual std::size_t line::lal::EmbeddedPart::initial ( )
pure virtual

The global index of the initial state.

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

◆ inject()

virtual std::vector< std::pair< std::size_t, double > > line::lal::EmbeddedPart::inject ( std::size_t s,
const NodeEvent & key )
pure virtual

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

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

◆ is_vanishing()

virtual bool line::lal::EmbeddedPart::is_vanishing ( std::size_t s)
pure virtual

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

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

◆ labels()

virtual const std::vector< NodeEvent > & line::lal::EmbeddedPart::labels ( )
pure virtual

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

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

◆ matches()

virtual bool line::lal::EmbeddedPart::matches ( const NodeEvent & key,
const NodeEvent & pattern ) const
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().

◆ name()

virtual const std::string & line::lal::EmbeddedPart::name ( ) const
pure virtual

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

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

◆ node_jobs()

virtual double line::lal::EmbeddedPart::node_jobs ( std::size_t s,
const std::string & node,
const std::string & jobclass )
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.

◆ node_name()

virtual std::string line::lal::EmbeddedPart::node_name ( std::size_t node)
pure virtual

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

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

◆ node_row()

virtual std::vector< double > line::lal::EmbeddedPart::node_row ( std::size_t s,
const std::string & node )
pure virtual

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

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

◆ node_state_label()

virtual std::string line::lal::EmbeddedPart::node_state_label ( std::size_t s,
std::size_t isf )
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().

◆ node_states()

virtual std::vector< std::pair< std::string, std::size_t > > line::lal::EmbeddedPart::node_states ( )
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().

◆ outgoing()

virtual std::vector< EmbeddedArc > line::lal::EmbeddedPart::outgoing ( std::size_t s)
pure virtual

Arcs leaving global state s.

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

Referenced by line::lal::Events::outgoing().

◆ prefix()

virtual const std::string & line::lal::EmbeddedPart::prefix ( ) const
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().

◆ refresh()

virtual void line::lal::EmbeddedPart::refresh ( )
pure virtual

Re-read the embedded model on next use.

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

◆ resolve()

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

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

Implemented in line::lal::EmbeddedEnvironment, and line::lal::EmbeddedNetwork.

◆ set_injected()

virtual void line::lal::EmbeddedPart::set_injected ( const std::set< std::string > & )
inlinevirtual

Record the classes hand agents inject (names); a change invalidates the enumeration.

Reimplemented in line::lal::EmbeddedNetwork.

Definition at line 244 of file core.h.

◆ stage_names()

virtual std::vector< std::string > line::lal::EmbeddedPart::stage_names ( )
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().

◆ stage_of()

virtual std::size_t line::lal::EmbeddedPart::stage_of ( std::size_t )
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().


The documentation for this class was generated from the following file:
  • include/line/lang/lal/core.h