LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
ldes_cache.h File Reference

The Cache node of the native LDES engine. More...

#include <algorithm>
#include <cstddef>
#include <list>
#include <string>
#include <vector>
#include "line/lang/lang_types.h"
Include dependency graph for ldes_cache.h:

Go to the source code of this file.

Classes

struct  line::ldes::engine::CacheState
 Live state of one Cache node. More...
struct  line::ldes::engine::CacheState::HeldRequest
 A request parked while its item was being fetched. More...

Namespaces

namespace  line
namespace  line::ldes
namespace  line::ldes::engine

Functions

bool line::ldes::engine::cache_refreshes (lang::ReplacementStrategy p)
 True for the policies that refresh recency on a hit.
void line::ldes::engine::cache_hit (CacheState &cs, std::size_t item, std::size_t at, double u_random)
 Serve a HIT in list at.
void line::ldes::engine::cache_miss (CacheState &cs, std::size_t item, double u_admit, double u_random)
 Serve a MISS: insert into the entry list, evicting if it is full.

Detailed Description

The Cache node of the native LDES engine.

A cache holds items in ORDERED LISTS, not one flat set. List l has its own capacity, an item hit in list l may be PROMOTED to a higher list, and the displaced occupant is DEMOTED back down. That structure is what distinguishes the segmented policies (HLRU, CLIMB, SFIFO) from the flat ones (LRU, FIFO, RR, QLRU), which are the same machinery with a single list.

THE HIT IS AN EXACT SAMPLE-PATH EVENT, not a probability. The engine holds the real list contents and looks the item up, so a hit is a hit; the analytical solvers estimate a hit RATE instead. That is the whole reason a simulator is asked about a cache at all.

A COST CAP IS SERVED, NOT REFUSED. When an insertion or a promotion would push a list past its storage-cost cap, the request is SERVED and the cache state is left unchanged – the "serve but do not swap" rule of RR-C(m) (Casale-Gast, IEEE/ACM ToN 29(2), 2021, Sec. IX). Refusing the request instead would drop a job the model never loses.

Definition in file ldes_cache.h.