LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
EventCache.m
1classdef EventCache
2 % EventCache Event caching utilities for SSA solver optimization
3 %
4 % EventCache provides static methods to create and manage event caching
5 % for the Stochastic State-space Analysis (SSA) solver. Event caching
6 % improves performance by storing computed events to avoid redundant
7 % calculations during simulation.
8 %
9 % @brief Event caching system for SSA solver performance optimization
10 %
11 % The cache stores mappings of state transitions and their associated
12 % events, enabling faster simulation execution by reusing previously
13 % computed results.
14
15 methods (Static)
16 function eventCache = create(enabled,sn)
17 % CREATE Create an event cache container
18 %
19 % @brief Creates a containers.Map for event caching if enabled
20 % @param enabled Boolean flag to enable/disable caching
21 % @param sn Network structure containing model information
22 % @return eventCache containers.Map instance or empty array
23 if enabled
24% for i=1:sn.nstateful
25% for r=1:sn.nclasses
26 eventCache = containers.Map('KeyType', 'char', 'ValueType', 'any');
27% end
28% end
29 else
30 eventCache = [];
31 end
32 end
33 end
34end