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

The parameters of a Cache node, MATLAB's sn.nodeparam{ind} for a Cache. More...

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

Inheritance diagram for line::qn::CacheParam< T >:
Collaboration diagram for line::qn::CacheParam< T >:

Classes

struct  Popularity
 The popularity LAW each class declared, beside the pmf it expands to. More...

Public Attributes

std::size_t nitems = 0
std::vector< int > itemcap
std::vector< std::size_t > classitem
 Item read by each per-item class of a cache network (MATLAB Cache.setItemReadClasses, sn.nodeparam{i}.classitem), 1-based, 0 where the class is not one.
std::vector< int > itemsize
 Per-item storage cost (size) and per-list cap on the total cost of the resident items (ton21cache Sec.
std::vector< int > costcap
bool costcapglobal = false
std::vector< std::vector< T > > pread
 (u) x (n), empty row = NaN
std::vector< Popularity > preadkind
 per class, parallel to pread
lang::ReplacementStrategy replacestrat = lang::ReplacementStrategy::RR
std::vector< std::size_t > hitclass
std::vector< std::size_t > missclass
std::vector< std::vector< Matrix< T > > > accost
 (u) x (n) of (h+1)x(h+1), or empty
T qlru = num_traits<T>::from_int(1)
 q-LRU admission probability; 1 admits every miss (plain LRU).
int retrieval_capacity = 0
 Delayed-hit retrieval system (Cache.setRetrievalSystem).
std::map< std::size_t, std::vector< std::size_t > > retrieval_queues
 read class(0-based)->nodes
std::vector< std::vector< std::size_t > > retrieval_classes
 (nitems x nclasses), 1-based
std::vector< T > initstate
 The DECLARED initial contents of the cache, as the reference dumps the node's state row: the per-class job counts, then the list contents, then the retrieval bitmap.
long max_pending_retrieval = -1
 Truncation level of block B: how many secondary requests may be merged onto the in-flight fetches of this cache at once.

Detailed Description

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

The parameters of a Cache node, MATLAB's sn.nodeparam{ind} for a Cache.

itemcap is the capacity of each of the h cache lists (a single-level cache has one entry). nitems is the item population n.

pread[v] is the read distribution of class v over the n items; an EMPTY row is MATLAB's NaN placeholder, "class v does not read this cache", and leaves that class's rates at zero. accost[v][k] is the ((h+1) x (h+1)) list-to-list routing matrix of class v on item k; an EMPTY accost selects the reference default, the linear cache in which an item moves from list l to l+1 on a hit. These two match da::CacheParam exactly, so da_cache_isolate consumes them without a conversion.

hitclass and missclass are the 1-based classes a job of class r switches into on a hit and on a miss, 0 meaning the transition is disabled.

Definition at line 554 of file network_struct.h.

Member Data Documentation

◆ accost

◆ classitem

template<class T>
std::vector<std::size_t> line::qn::CacheParam< T >::classitem

Item read by each per-item class of a cache network (MATLAB Cache.setItemReadClasses, sn.nodeparam{i}.classitem), 1-based, 0 where the class is not one.

Stored rather than inferred from a one-hot pread, which is ambiguous against a genuine single-item popularity.

Definition at line 563 of file network_struct.h.

Referenced by line::io::build_network_from_json(), line::io::network_to_json(), line::qn::Network< double >::set_item_read_classes(), and line::qn::Network< double >::set_miss_cache().

◆ costcap

template<class T>
std::vector<int> line::qn::CacheParam< T >::costcap

◆ costcapglobal

template<class T>
bool line::qn::CacheParam< T >::costcapglobal = false

◆ hitclass

◆ initstate

template<class T>
std::vector<T> line::qn::CacheParam< T >::initstate

The DECLARED initial contents of the cache, as the reference dumps the node's state row: the per-class job counts, then the list contents, then the retrieval bitmap.

Empty means the cache starts empty, which is what initDefault builds; a warm cache is not derivable from anything else.

Definition at line 611 of file network_struct.h.

Referenced by line::io::build_network_from_json(), and line::io::network_to_json().

◆ itemcap

◆ itemsize

template<class T>
std::vector<int> line::qn::CacheParam< T >::itemsize

Per-item storage cost (size) and per-list cap on the total cost of the resident items (ton21cache Sec.

IX). BOTH EMPTY = unconstrained, the classic model. costcapglobal records that the caps came from a single cache-wide value.

Definition at line 570 of file network_struct.h.

Referenced by line::io::build_network_from_json(), line::da::da_cacheqn(), line::nc::nc_cache_missrate(), and line::io::network_to_json().

◆ max_pending_retrieval

template<class T>
long line::qn::CacheParam< T >::max_pending_retrieval = -1

Truncation level of block B: how many secondary requests may be merged onto the in-flight fetches of this cache at once.

-1 is UNBOUNDED, which is what a sample path needs and what State.afterEventCache calls the isSimulation branch; a non-negative value is the enumeration bound an exact solver generates its local state space under.

Definition at line 619 of file network_struct.h.

Referenced by line::qn::after_event_cache(), and line::qn::from_marginal_node().

◆ missclass

◆ nitems

◆ pread

◆ preadkind

◆ qlru

template<class T>
T line::qn::CacheParam< T >::qlru = num_traits<T>::from_int(1)

q-LRU admission probability; 1 admits every miss (plain LRU).

Definition at line 594 of file network_struct.h.

Referenced by line::qn::after_event_cache(), line::io::build_network_from_json(), and line::io::network_to_json().

◆ replacestrat

◆ retrieval_capacity

template<class T>
int line::qn::CacheParam< T >::retrieval_capacity = 0

Delayed-hit retrieval system (Cache.setRetrievalSystem).

Zero capacity = none. retrieval_queues[r] are the 1-based retrieval-station node indices a read of class r (0-based key) circulates on a miss; retrieval_classes is (nitems x nclasses), item i of read class r -> the per-item retrieval class (1-based), 0 where none. Built by set_retrieval_system.

Definition at line 602 of file network_struct.h.

Referenced by line::qn::after_event_cache(), line::io::build_network_from_json(), line::retrieval::cache_retrieval_inputs(), line::mc::ctmc_state_space_logsize(), line::qn::from_marginal_node(), line::qn::from_marginal_node_first(), line::qn::Network< double >::link(), line::io::network_to_json(), and line::qn::Network< double >::set_retrieval_system().

◆ retrieval_classes

◆ retrieval_queues

template<class T>
std::map<std::size_t, std::vector<std::size_t> > line::qn::CacheParam< T >::retrieval_queues

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