Class CacheModel
-
- All Implemented Interfaces:
public class CacheModel
Examples of caching models
-
-
Constructor Summary
Constructors Constructor Description CacheModel()
-
Method Summary
Modifier and Type Method Description static Network
cache_replc_rr()
Basic open cache model with Round Robin (RR) replacement strategy. static Network
cache_replc_fifo()
Closed cache model with feedback from hits and misses. static Network
cache_replc_routing()
Cache model with multiple delay nodes and random routing. static Network
cache_compare_replc()
Cache model with Zipf access pattern and Round Robin replacement. static LayeredNetwork
lcq_singlehost()
Layered cache queueing model example 1. static Network
cache_replc_lru()
Closed cache model with LRU replacement strategy. static LayeredNetwork
lcq_threehosts()
Layered cache queueing model example 2 with multi-level cache and downstream service. static void
main(Array<String> args)
Main method for testing and demonstrating cache model examples. -
-
Method Detail
-
cache_replc_rr
static Network cache_replc_rr()
Basic open cache model with Round Robin (RR) replacement strategy.
Features: - Cache with 5 items, capacity 2, RR replacement - Three classes: InitClass (requests), HitClass, MissClass - Zipf access pattern with alpha=1.4 (skewed popularity) - Simple Source → Cache → Sink topology - Exponential arrival process with rate 2
- Returns:
configured cache network model
-
cache_replc_fifo
static Network cache_replc_fifo()
Closed cache model with feedback from hits and misses.
Features: - Cache with 5 items, capacity 2, FIFO replacement - Closed system with 1 job circulating - Delay node with exponential service (rate 1.0) - Both hits and misses return to delay node as same class - Uniform access pattern across all items
- Returns:
configured closed cache model
-
cache_replc_routing
static Network cache_replc_routing()
Cache model with multiple delay nodes and random routing.
Features: - Cache with 5 items, capacity 2, LRU replacement - Router node directing hits/misses to two different delay nodes - Different service rates for hits vs misses at each delay - Random routing strategy for load balancing - Demonstrates cache integration with complex topologies
- Returns:
configured cache network with routing
-
cache_compare_replc
static Network cache_compare_replc()
Cache model with Zipf access pattern and Round Robin replacement.
Features: - Cache with 5 items, multi-level capacity [2,1], RR replacement - Zipf distribution for realistic access patterns (skewed popularity) - Alpha parameter controls skewness (1.0 = moderately skewed) - Round Robin replacement strategy instead of FIFO - Exponential arrivals with rate 1
- Returns:
configured cache model with Zipf access
-
lcq_singlehost
static LayeredNetwork lcq_singlehost()
Layered cache queueing model example 1.
Features: - Layered network with client processor and cache processor - Client task (T1) with reference scheduling and PS processor - Cache task (C2) with 4 items, capacity 2, Round Robin replacement - Item entry (I2) with uniform access pattern - Activities: A1 (client), AC2 (cache access), AC2h (hit), AC2m (miss) - Cache access precedence with hit and miss paths - SolverLN with MVA backend for solution
- Returns:
configured layered cache queueing model
-
cache_replc_lru
static Network cache_replc_lru()
Closed cache model with LRU replacement strategy.
Features: - Cache with 5 items, capacity 2, LRU replacement - Closed system with 1 job circulating - Delay node with exponential service (rate 1.0) - Both hits and misses return to delay node as same class - Uniform access pattern across all items
- Returns:
configured closed cache model with LRU
-
lcq_threehosts
static LayeredNetwork lcq_threehosts()
Layered cache queueing model example 2 with multi-level cache and downstream service.
Features: - Layered network with client, cache, and downstream service processors - Client task (T1) with 1 user, reference scheduling - Cache task (CT) with 4 items, multi-level capacity [1,1], Round Robin replacement - Item entry (IE) with uniform access pattern - Downstream service task (T2) with FCFS scheduling and exponential service - Cache miss calls downstream service synchronously - Activities: A1 (client), Ac (cache access), Ac_hit (hit), Ac_miss (miss with service call) - Cache access precedence with hit and miss paths - SolverLN with NC and MVA backends for solution
- Returns:
configured layered cache queueing model with downstream service
-
main
static void main(Array<String> args)
Main method for testing and demonstrating cache model examples.
Currently configured to: - Set MATLAB-compatible random number generation - Test both regular cache models and layered cache queueing models - Solve using multiple solvers for comparison - Measure and display execution time
- Parameters:
args
- command line arguments (not used)
-
-
-
-