![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
EventCache: the per-state enabled-event memo of the serial SSA engine. More...
#include <line/solvers/ssa/ssa_event_cache.h>
Public Member Functions | |
| SsaEventCache () | |
| SsaEventCache (bool enabled, const qn::NetworkStruct< T > *sn) | |
| bool | enabled () const |
| qn::EventOutcome< T > | after_event (const qn::NetworkStruct< T > &sn, std::size_t ind, const std::vector< T > &inspace, lang::EventType event, std::size_t cls, bool no_promote=false, const T &aux_rate=num_traits< T >::from_int(0)) |
| State.afterEvent with the lookup in front of it. | |
| std::size_t | hits () const |
| Hits and misses, so a caller can report the memo's effect. | |
| std::size_t | misses () const |
| std::size_t | size () const |
| void | clear () |
Static Public Member Functions | |
| static SsaEventCache | create (bool enabled, const qn::NetworkStruct< T > &sn) |
| EventCache.create(enabled, sn). | |
EventCache: the per-state enabled-event memo of the serial SSA engine.
Definition at line 94 of file ssa_event_cache.h.
|
inline |
Definition at line 107 of file ssa_event_cache.h.
Referenced by create().
|
inline |
Definition at line 108 of file ssa_event_cache.h.
References enabled().
|
inline |
State.afterEvent with the lookup in front of it.
sn is passed rather than taken from the binding so the signature is the free function's and a caller can switch between them by changing one token; the binding is only there to catch the mistake of reusing a cache across structs.
Definition at line 120 of file ssa_event_cache.h.
References line::qn::after_event(), line::ssa::SsaEventKey::aux_rate, line::ssa::SsaEventKey::cls, line::ssa::SsaEventKey::event, line::ssa::SsaEventKey::ind, line::InputError::InputError(), line::ssa::SsaEventKey::inspace, and line::ssa::SsaEventKey::no_promote.
|
inline |
Definition at line 165 of file ssa_event_cache.h.
|
inlinestatic |
EventCache.create(enabled, sn).
The struct is held by pointer, so the cache must not outlive it. Every caller in this port constructs the cache inside the scope that already holds sn by const reference for the run.
Definition at line 103 of file ssa_event_cache.h.
References enabled(), and SsaEventCache().
|
inline |
Definition at line 110 of file ssa_event_cache.h.
Referenced by create(), and SsaEventCache().
|
inline |
Hits and misses, so a caller can report the memo's effect.
They are counters and not a hit RATIO because the ratio alone hides the denominator, and a 100% hit rate over three lookups says nothing.
Definition at line 161 of file ssa_event_cache.h.
|
inline |
Definition at line 162 of file ssa_event_cache.h.
|
inline |
Definition at line 163 of file ssa_event_cache.h.