LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::qn::PollingInfo< T > Struct Template Reference

Port of State.pollingInfo: the derived description of a polling controller. More...

#include <line/lang/qn/polling_info.h>

Collaboration diagram for line::qn::PollingInfo< T >:

Public Attributes

lang::PollingType ptype = lang::PollingType::EXHAUSTIVE
std::size_t pk = 1
std::vector< bool > polled
std::vector< bool > has_sw
std::vector< std::size_t > ksw
std::vector< Matrix< T > > sw_d0
std::vector< Matrix< T > > sw_d1
std::vector< std::vector< T > > sw_pie
std::size_t off = 0
std::size_t width = 0
std::size_t ipos = static_cast<std::size_t>(-1)
std::size_t iswk = static_cast<std::size_t>(-1)
std::size_t ictr = static_cast<std::size_t>(-1)
bool valid = false

Detailed Description

template<class T>
struct line::qn::PollingInfo< T >

Port of State.pollingInfo: the derived description of a polling controller.

The controller lives in the shared node block of the local variables and holds, in order, [pos, swk, ctr]. Each column is materialized ONLY when the discipline needs it, so a polling station never carries state its dynamics cannot distinguish:

pos the buffer the server is at or heading to. Needed only when some switchover is non-immediate: while a job is in service pos equals that job's class, and while the station is empty with immediate switchovers the position is unobservable. swk 0 when the server sits at pos, else the phase of the switchover into it. Same condition as pos. ctr the visit budget. Every discipline except EXHAUSTIVE bounds a visit.

An Immediate switchover is deliberately NOT a state: its rate is ~1e8, and taking that literally would make the generator stiff and add a spurious state per buffer. polling_next folds it into the enclosing transition.

EVERY POLLING STATION HAS A CONTROLLER, whichever API declared it and even when none did. The reference returns [] only for a node that is not a polling station and otherwise defaults to EXHAUSTIVE with every switchover immediate, so NetworkStruct::effective_polling resolves the two C++ spellings – set_polling writing sn.pollingparam, and setPollingType / setSwitchover writing the Station fields – into one description.

BUILDING NO CONTROLLER WAS NOT A DEGRADED MODEL BUT A CRASH. Reading only pollingparam left every station declared the other way (the JSON reader included) with valid = false and, with it, an EMPTY polled. polling_next indexes polled[pos-1] with no size test, and an empty std::vector<bool> holds a NULL word pointer, so that index segfaults rather than returning a garbage bit – which is why the failure surfaced as a SIGSEGV inside after_event_station_arv and not as a wrong number.

Definition at line 73 of file polling_info.h.

Member Data Documentation

◆ has_sw

◆ ictr

template<class T>
std::size_t line::qn::PollingInfo< T >::ictr = static_cast<std::size_t>(-1)

◆ ipos

template<class T>
std::size_t line::qn::PollingInfo< T >::ipos = static_cast<std::size_t>(-1)

◆ iswk

template<class T>
std::size_t line::qn::PollingInfo< T >::iswk = static_cast<std::size_t>(-1)

◆ ksw

template<class T>
std::vector<std::size_t> line::qn::PollingInfo< T >::ksw

◆ off

template<class T>
std::size_t line::qn::PollingInfo< T >::off = 0

◆ pk

template<class T>
std::size_t line::qn::PollingInfo< T >::pk = 1

◆ polled

template<class T>
std::vector<bool> line::qn::PollingInfo< T >::polled

◆ ptype

◆ sw_d0

template<class T>
std::vector<Matrix<T> > line::qn::PollingInfo< T >::sw_d0

Definition at line 78 of file polling_info.h.

Referenced by line::qn::after_event_station_switch(), and line::qn::polling_info().

◆ sw_d1

template<class T>
std::vector<Matrix<T> > line::qn::PollingInfo< T >::sw_d1

Definition at line 78 of file polling_info.h.

Referenced by line::qn::after_event_station_switch(), and line::qn::polling_info().

◆ sw_pie

template<class T>
std::vector<std::vector<T> > line::qn::PollingInfo< T >::sw_pie

Definition at line 79 of file polling_info.h.

Referenced by line::qn::polling_info(), and line::qn::polling_land().

◆ valid

◆ width

template<class T>
std::size_t line::qn::PollingInfo< T >::width = 0

Definition at line 80 of file polling_info.h.

Referenced by line::qn::append_local_vars(), and line::qn::polling_info().


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