Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
CCHMetricFamily< E, V, K > Class Template Reference

per-vehicle-type CCH metric store over a shared CCHGraph More...

#include <CCHMetricFamily.h>

Collaboration diagram for CCHMetricFamily< E, V, K >:
[legend]

Data Structures

struct  LiveMetric
 per-type LIVE metric state. Heap-owned: the atomic makes it non-movable, so it cannot live in a map by value. More...
 
struct  StaticMetric
 per-(type, period) STATIC metric state. RoutingKit metrics BORROW their input-weight buffer, so buffer and metric live together in the map (std::map nodes are address-stable). More...
 

Public Types

typedef Graph::EffortOperation EffortOperation
 
typedef CCHGraph< E, V > Graph
 
typedef const RoutingKit::CustomizableContractionHierarchyMetricMetricPtr
 
typedef V *(* RefVehicleFactory) (const K *, int)
 builds an OWNED effort-reference vehicle for a type: never registered, counted or inserted – it exists only so every fill of that type's metric evaluates the same reference (deterministic speed factor and frozen random realization are the factory's business). The second argument is the ensemble slot (see the LIVE constructor); slot 0 must reproduce the pre-ensemble reference exactly, further slots give distinct frozen weights.random-factor realizations (typically by varying the reference vehicle's id, which seeds them)
 
typedef void(* WeightPatch) (const Graph *, const V *, std::vector< unsigned > &)
 post-fill hook on the input weights (STATIC mode), e.g. duarouter masking the edges that restrict a type to inf_weight
 

Public Member Functions

 CCHMetricFamily (const Graph *graph, EffortOperation fillEffort, EffortOperation gateEffort, double updateFactor, double updateConstant, RefVehicleFactory factory, int ensembleK=1)
 construct a LIVE family (double-buffered, barrier-customized)
 
 CCHMetricFamily (const Graph *graph, EffortOperation fillEffort, SUMOTime begin, SUMOTime weightPeriod, RefVehicleFactory factory, WeightPatch patch)
 construct a STATIC family (lazy build per (type, period))
 
 ~CCHMetricFamily ()
 
STATIC mode
MetricPtr get (const K *key, SUMOVehicleClass vClass, SUMOTime time, const V *veh)
 the metric for (type key, period of time), built on the first query of the pair; nullptr before init. Thread-safe: the mutex serialises concurrent first queries from parallel routing threads (satisfying primeClassMask's synchronization contract); afterwards the map is read-only for that key (map references are address-stable). A pending flagStale() first refills and re-customizes every cached metric from the live efforts and permissions – in place, so the flagging host guarantees that no query is in flight (the simulation's main thread, marouter's reset between two iterations).
 
SUMOTime periodEnd (SUMOTime time) const
 the end of the weight period containing the given time (SUMOTime_MAX when the weights are static); CCHRouter's PeriodEnd hook
 
void flagStale ()
 the efforts behind the cached metrics changed – a runtime permission change in the simulation (the caller must also invalidate the graph's class masks), or marouter's travel times after an assignment iteration (CCHRouter::reset): every cached metric is refilled and re-customized on the next get().
 
void flagPermissionsStale ()
 flagStale() under the simulation's name for the permission case
 
LIVE mode
void seedKey (const K *key)
 allocate the metric state (all ensemble slots) for one type; call only while no query is in flight (seeding at init, or the customization barrier)
 
void markDirty (const E *e)
 queue an edge whose gate effort changed (both buffers; the deadband applies later, at the customize barrier)
 
void invalidateEdge (const E *e)
 a runtime permission change (closure / re-opening) hit this edge: queue it bypassing the deadband and divert every query to the exact fallback until customize() has refilled both buffers wholesale (the sparse path cannot repair tail-side arcs of a connection-level change). The caller must also invalidate the graph's class masks.
 
void atBarrier (double now, bool effortsMoved)
 the owner's customization barrier: bump the speed epoch when an effort moved and re-customize when it matters. Lazy, following the CH weightPeriod pattern: metric state is only built for types somebody routes on (myLiveMetrics stays empty in a run that never routes, which then pays nothing here). Once any metric exists, every barrier where an effort moved re-customizes, so a query never sees a metric more than one barrier old – CH's weightPeriod bound. The queried flag only bootstraps type creation; a pending permission flip forces the customize even without queries.
 
void customize (double now)
 refill + customize + publish every type's metric from the live efforts and permissions. Call only while no query is in flight (the publish itself is lock-free: release store here, acquire loads on the query hot path).
 
MetricPtr published (const K *key, const std::string &vehID)
 the published metric for a type key and querying vehicle id (the id picks the ensemble slot – see the LIVE constructor), or nullptr if the query must route on the exact fallback. Query hot path, any thread.
 
bool empty () const
 whether any type has live metric state yet
 

Private Member Functions

LiveMetricbuildLiveMetric (const K *key, int slot)
 allocate LIVE metric state for one (type, ensemble slot) (owner's thread only)
 
 CCHMetricFamily (const CCHMetricFamily &)=delete
 
void fillStatic (StaticMetric &sm, int period, SUMOTime time, const V *ref, const V *veh)
 (re)fill a STATIC metric's input weights from the live efforts. A weight-period grid evaluates at the period's begin, so each pair is customized once per fill; a single period evaluates at the query time – free-flow efforts are time-invariant anyway, and marouter's per-iteration travel times are exactly what a Dijkstra query at that time sees. The patch runs once, on the first fill, and what it wrote is re-applied on every refill: the masked set depends only on the metric's type, whereas the vehicle triggering a refill may be of another type.
 
CCHMetricFamilyoperator= (const CCHMetricFamily &)=delete
 
int periodOf (SUMOTime time) const
 the weight period containing time: 0 is everything before begin and the whole run when the weights are static
 

Static Private Member Functions

static uint64_t fnv1a (const std::string &s)
 stable 64-bit FNV-1a for the ensemble slot assignment
 

Private Attributes

RefVehicleFactory myFactory
 reference-vehicle factory (required LIVE, optional STATIC)
 
EffortOperation myFillEffort
 the effort the metrics are filled from
 
EffortOperation myGateEffort
 the type-independent effort of the LIVE deadband
 
const GraphmyGraph
 the immutable shared topology
 
const bool myLive
 LIVE or STATIC (fixed at construction)
 
WeightPatch myPatch
 post-fill weight hook (STATIC)
 
STATIC state
SUMOTime myBegin
 
SUMOTime myWeightPeriod
 
std::map< std::pair< const K *, int >, StaticMetricmyStaticMetrics
 
std::mutex myStaticLock
 
bool myStale = false
 the efforts changed behind the cached metrics: refill and re-customize them all on the next get() (see flagStale)
 
LIVE state

the deadband bounds (see the LIVE constructor)

double myUpdateFactor
 
double myUpdateConstant
 
int myEnsembleK = 1
 frozen random-factor realizations per type (see the LIVE ctor)
 
std::vector< LiveMetric * > myLiveMetrics
 every type's state, in creation order (barrier iteration) and by key (query lookup; only mutated while no query is in flight)
 
std::map< const K *, std::vector< LiveMetric * > > myByKey
 
std::vector< const K * > myWantedKeys
 types that queried but have no metric yet (demand streams, so types can appear after seeding); queries register them under the lock and route via the fallback until the next barrier builds their state
 
std::mutex myWantedLock
 
std::atomic< bool > myQueried {false}
 whether a query arrived since the last barrier (bootstraps type creation and re-arms after resets – see atBarrier)
 
std::atomic< bool > myMetricStale {false}
 a permission flip has not yet been customized into the published metrics (queries divert to the exact fallback while set)
 
std::atomic< uint64_t > mySpeedEpoch {0}
 barrier counter of the tracked efforts and the counter value the published metrics were customized from: the staleness bound's safety invariant (see atBarrier / published). Both only change on the owner's thread at the barrier – no query is in flight there – the atomics just publish the values to the query threads.
 
std::atomic< uint64_t > myPublishedEpoch {0}
 
int myFullFillsPending = 0
 how many customize passes must run a FULL refill after a permission flip: 2 = both ping-pong buffers (the sparse path cannot repair connection-level mask changes: arcsOfEdge deliberately omits the tail side)
 
std::vector< double > myAppliedEffort [2]
 per-buffer edge state for the sparse path: the gate effort each edge's arcs were last filled from (NaN = never applied / forced), the pending-dirty flag, and the pending list
 
std::vector< char > myPendingFlag [2]
 
std::vector< const E * > myPendingList [2]
 

Detailed Description

template<class E, class V, class K>
class CCHMetricFamily< E, V, K >

per-vehicle-type CCH metric store over a shared CCHGraph

Template Parameters
Ethe edge type (MSEdge / ROEdge)
Vthe vehicle type of the effort callback (SUMOVehicle / ROVehicle)
Kthe vehicle-type key (MSVehicleType / SUMOVTypeParameter); used only as a stable map key, never dereferenced

Definition at line 85 of file CCHMetricFamily.h.

Member Typedef Documentation

◆ EffortOperation

template<class E , class V , class K >
typedef Graph::EffortOperation CCHMetricFamily< E, V, K >::EffortOperation

Definition at line 88 of file CCHMetricFamily.h.

◆ Graph

template<class E , class V , class K >
typedef CCHGraph<E, V> CCHMetricFamily< E, V, K >::Graph

Definition at line 87 of file CCHMetricFamily.h.

◆ MetricPtr

template<class E , class V , class K >
typedef const RoutingKit::CustomizableContractionHierarchyMetric* CCHMetricFamily< E, V, K >::MetricPtr

Definition at line 89 of file CCHMetricFamily.h.

◆ RefVehicleFactory

template<class E , class V , class K >
typedef V *(* CCHMetricFamily< E, V, K >::RefVehicleFactory) (const K *, int)

builds an OWNED effort-reference vehicle for a type: never registered, counted or inserted – it exists only so every fill of that type's metric evaluates the same reference (deterministic speed factor and frozen random realization are the factory's business). The second argument is the ensemble slot (see the LIVE constructor); slot 0 must reproduce the pre-ensemble reference exactly, further slots give distinct frozen weights.random-factor realizations (typically by varying the reference vehicle's id, which seeds them)

Definition at line 98 of file CCHMetricFamily.h.

◆ WeightPatch

template<class E , class V , class K >
typedef void(* CCHMetricFamily< E, V, K >::WeightPatch) (const Graph *, const V *, std::vector< unsigned > &)

post-fill hook on the input weights (STATIC mode), e.g. duarouter masking the edges that restrict a type to inf_weight

Definition at line 101 of file CCHMetricFamily.h.

Constructor & Destructor Documentation

◆ CCHMetricFamily() [1/3]

template<class E , class V , class K >
CCHMetricFamily< E, V, K >::CCHMetricFamily ( const Graph graph,
EffortOperation  fillEffort,
SUMOTime  begin,
SUMOTime  weightPeriod,
RefVehicleFactory  factory,
WeightPatch  patch 
)
inline

construct a STATIC family (lazy build per (type, period))

Parameters
[in]graphthe shared topology
[in]fillEffortthe effort the weights are computed from
[in]beginbegin of the weight-period grid
[in]weightPeriodperiod length; SUMOTime_MAX = a single period
[in]factoryreference-vehicle factory; nullptr = fill with the QUERYING vehicle (each pair is customized exactly once, so the first vehicle of a type is that type's reference – duarouter's contract)
[in]patchoptional post-fill weight hook

Definition at line 112 of file CCHMetricFamily.h.

◆ CCHMetricFamily() [2/3]

template<class E , class V , class K >
CCHMetricFamily< E, V, K >::CCHMetricFamily ( const Graph graph,
EffortOperation  fillEffort,
EffortOperation  gateEffort,
double  updateFactor,
double  updateConstant,
RefVehicleFactory  factory,
int  ensembleK = 1 
)
inline

construct a LIVE family (double-buffered, barrier-customized)

Parameters
[in]graphthe shared topology
[in]fillEffortthe (possibly per-type) effort the weights are computed from, evaluated with the type's reference vehicle
[in]gateEffortthe type-INDEPENDENT effort used by the deadband (evaluated with a null vehicle: per-type extras are static multipliers that cancel out of the moved-or-not decision)
[in]updateFactor/ updateConstant the deadband: an edge's arcs are only refilled when its gate effort moved by MORE than BOTH the relative factor AND the absolute constant (seconds) since this buffer last applied it – the sufficientSaving() analog. The moving-average speed filter smears every traffic event into many ticks of sub-percent drift; without a deadband that drift marks thousands of arcs per barrier and partial re-customization degenerates (RoutingKit documents it for the sparse "new traffic jam" case). 1/0 = every change propagates. Rejected edges stay pending and their drift accumulates against the same applied value, so a slow trend eventually passes while filter jitter never does.
[in]factoryreference-vehicle factory (required in LIVE mode)
[in]ensembleKhow many frozen weights.random-factor realizations (= metrics) to keep per type. The exact routers draw a fresh perturbation per vehicle; a shared metric freezes ONE realization, losing the feature's route diversity. With K > 1 every type keeps K metrics – each filled with its own reference vehicle (factory slot k) and therefore its own frozen realization – and a vehicle is assigned its slot by a stable hash of its id, so each vehicle persistently routes on one of K perturbed networks: K = 1 is exactly the single-realization behavior, growing K converges toward the exact routers' per-vehicle diversity at K x customization and memory cost. Pointless without weights.random-factor (the K references fill identical weights).

Definition at line 152 of file CCHMetricFamily.h.

References CCHGraph< E, V >::edgeIdSpace(), CCHMetricFamily< E, V, K >::myAppliedEffort, CCHMetricFamily< E, V, K >::myGraph, and CCHMetricFamily< E, V, K >::myPendingFlag.

◆ ~CCHMetricFamily()

◆ CCHMetricFamily() [3/3]

template<class E , class V , class K >
CCHMetricFamily< E, V, K >::CCHMetricFamily ( const CCHMetricFamily< E, V, K > &  )
privatedelete

Member Function Documentation

◆ atBarrier()

template<class E , class V , class K >
void CCHMetricFamily< E, V, K >::atBarrier ( double  now,
bool  effortsMoved 
)
inline

the owner's customization barrier: bump the speed epoch when an effort moved and re-customize when it matters. Lazy, following the CH weightPeriod pattern: metric state is only built for types somebody routes on (myLiveMetrics stays empty in a run that never routes, which then pays nothing here). Once any metric exists, every barrier where an effort moved re-customizes, so a query never sees a metric more than one barrier old – CH's weightPeriod bound. The queried flag only bootstraps type creation; a pending permission flip forces the customize even without queries.

Definition at line 305 of file CCHMetricFamily.h.

References CCHMetricFamily< E, V, K >::customize(), CCHMetricFamily< E, V, K >::myLiveMetrics, CCHMetricFamily< E, V, K >::myMetricStale, CCHMetricFamily< E, V, K >::myQueried, and CCHMetricFamily< E, V, K >::mySpeedEpoch.

Referenced by MSRoutingEngine::adaptEdgeEfforts().

Here is the caller graph for this function:

◆ buildLiveMetric()

template<class E , class V , class K >
LiveMetric * CCHMetricFamily< E, V, K >::buildLiveMetric ( const K key,
int  slot 
)
inlineprivate

allocate LIVE metric state for one (type, ensemble slot) (owner's thread only)

Definition at line 594 of file CCHMetricFamily.h.

References CCHGraph< E, V >::arcCount(), CCHGraph< E, V >::cch(), CCHMetricFamily< E, V, K >::myFactory, CCHMetricFamily< E, V, K >::myGraph, CCHMetricFamily< E, V, K >::myLiveMetrics, CCHMetricFamily< E, V, K >::LiveMetric::partial, CCHMetricFamily< E, V, K >::LiveMetric::refVehicle, CCHMetricFamily< E, V, K >::LiveMetric::vClass, and CCHMetricFamily< E, V, K >::LiveMetric::weight.

Referenced by CCHMetricFamily< E, V, K >::seedKey().

Here is the caller graph for this function:

◆ customize()

◆ empty()

template<class E , class V , class K >
bool CCHMetricFamily< E, V, K >::empty ( ) const
inline

whether any type has live metric state yet

Definition at line 505 of file CCHMetricFamily.h.

References CCHMetricFamily< E, V, K >::myLiveMetrics.

◆ fillStatic()

template<class E , class V , class K >
void CCHMetricFamily< E, V, K >::fillStatic ( StaticMetric sm,
int  period,
SUMOTime  time,
const V *  ref,
const V *  veh 
)
inlineprivate

(re)fill a STATIC metric's input weights from the live efforts. A weight-period grid evaluates at the period's begin, so each pair is customized once per fill; a single period evaluates at the query time – free-flow efforts are time-invariant anyway, and marouter's per-iteration travel times are exactly what a Dijkstra query at that time sees. The patch runs once, on the first fill, and what it wrote is re-applied on every refill: the masked set depends only on the metric's type, whereas the vehicle triggering a refill may be of another type.

Definition at line 561 of file CCHMetricFamily.h.

References CCHMetricFamily< E, V, K >::StaticMetric::filled, CCHGraph< E, V >::fillInputWeights(), CCHMetricFamily< E, V, K >::myBegin, CCHMetricFamily< E, V, K >::myFillEffort, CCHMetricFamily< E, V, K >::myGraph, CCHMetricFamily< E, V, K >::myPatch, CCHMetricFamily< E, V, K >::myWeightPeriod, CCHMetricFamily< E, V, K >::StaticMetric::patched, STEPS2TIME, SUMOTime_MAX, CCHMetricFamily< E, V, K >::StaticMetric::vClass, and CCHMetricFamily< E, V, K >::StaticMetric::weights.

Referenced by CCHMetricFamily< E, V, K >::get().

Here is the caller graph for this function:

◆ flagPermissionsStale()

template<class E , class V , class K >
void CCHMetricFamily< E, V, K >::flagPermissionsStale ( )
inline

flagStale() under the simulation's name for the permission case

Definition at line 242 of file CCHMetricFamily.h.

References CCHMetricFamily< E, V, K >::flagStale().

Referenced by MSRoutingEngine::invalidateCCHEdge().

Here is the caller graph for this function:

◆ flagStale()

template<class E , class V , class K >
void CCHMetricFamily< E, V, K >::flagStale ( )
inline

the efforts behind the cached metrics changed – a runtime permission change in the simulation (the caller must also invalidate the graph's class masks), or marouter's travel times after an assignment iteration (CCHRouter::reset): every cached metric is refilled and re-customized on the next get().

Definition at line 236 of file CCHMetricFamily.h.

References CCHMetricFamily< E, V, K >::myStale, and CCHMetricFamily< E, V, K >::myStaticLock.

Referenced by CCHMetricFamily< E, V, K >::flagPermissionsStale(), and ROCCHMetrics::reset().

Here is the caller graph for this function:

◆ fnv1a()

template<class E , class V , class K >
static uint64_t CCHMetricFamily< E, V, K >::fnv1a ( const std::string &  s)
inlinestaticprivate

stable 64-bit FNV-1a for the ensemble slot assignment

Definition at line 584 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::published().

Here is the caller graph for this function:

◆ get()

template<class E , class V , class K >
MetricPtr CCHMetricFamily< E, V, K >::get ( const K key,
SUMOVehicleClass  vClass,
SUMOTime  time,
const V *  veh 
)
inline

the metric for (type key, period of time), built on the first query of the pair; nullptr before init. Thread-safe: the mutex serialises concurrent first queries from parallel routing threads (satisfying primeClassMask's synchronization contract); afterwards the map is read-only for that key (map references are address-stable). A pending flagStale() first refills and re-customizes every cached metric from the live efforts and permissions – in place, so the flagging host guarantees that no query is in flight (the simulation's main thread, marouter's reset between two iterations).

Definition at line 192 of file CCHMetricFamily.h.

References CCHGraph< E, V >::cch(), CCHMetricFamily< E, V, K >::fillStatic(), CCHMetricFamily< E, V, K >::StaticMetric::metric, CCHMetricFamily< E, V, K >::myFactory, CCHMetricFamily< E, V, K >::myGraph, CCHMetricFamily< E, V, K >::myStale, CCHMetricFamily< E, V, K >::myStaticLock, CCHMetricFamily< E, V, K >::myStaticMetrics, CCHMetricFamily< E, V, K >::periodOf(), CCHMetricFamily< E, V, K >::StaticMetric::refVehicle, CCHMetricFamily< E, V, K >::StaticMetric::vClass, and CCHMetricFamily< E, V, K >::StaticMetric::weights.

Referenced by ROCCHMetrics::get(), and MSRoutingEngine::getFreeflowCCHMetric().

Here is the caller graph for this function:

◆ invalidateEdge()

template<class E , class V , class K >
void CCHMetricFamily< E, V, K >::invalidateEdge ( const E *  e)
inline

a runtime permission change (closure / re-opening) hit this edge: queue it bypassing the deadband and divert every query to the exact fallback until customize() has refilled both buffers wholesale (the sparse path cannot repair tail-side arcs of a connection-level change). The caller must also invalidate the graph's class masks.

Definition at line 282 of file CCHMetricFamily.h.

References CCHMetricFamily< E, V, K >::markDirty(), CCHMetricFamily< E, V, K >::myAppliedEffort, CCHMetricFamily< E, V, K >::myFullFillsPending, CCHMetricFamily< E, V, K >::myMetricStale, and CCHMetricFamily< E, V, K >::myPendingFlag.

Referenced by MSRoutingEngine::invalidateCCHEdge().

Here is the caller graph for this function:

◆ markDirty()

template<class E , class V , class K >
void CCHMetricFamily< E, V, K >::markDirty ( const E *  e)
inline

queue an edge whose gate effort changed (both buffers; the deadband applies later, at the customize barrier)

Definition at line 264 of file CCHMetricFamily.h.

References CCHMetricFamily< E, V, K >::myPendingFlag, and CCHMetricFamily< E, V, K >::myPendingList.

Referenced by MSRoutingEngine::adaptEdgeEfforts(), and CCHMetricFamily< E, V, K >::invalidateEdge().

Here is the caller graph for this function:

◆ operator=()

template<class E , class V , class K >
CCHMetricFamily & CCHMetricFamily< E, V, K >::operator= ( const CCHMetricFamily< E, V, K > &  )
privatedelete

◆ periodEnd()

template<class E , class V , class K >
SUMOTime CCHMetricFamily< E, V, K >::periodEnd ( SUMOTime  time) const
inline

the end of the weight period containing the given time (SUMOTime_MAX when the weights are static); CCHRouter's PeriodEnd hook

Definition at line 224 of file CCHMetricFamily.h.

References CCHMetricFamily< E, V, K >::myBegin, CCHMetricFamily< E, V, K >::myWeightPeriod, CCHMetricFamily< E, V, K >::periodOf(), and SUMOTime_MAX.

Referenced by ROCCHMetrics::periodEnd().

Here is the caller graph for this function:

◆ periodOf()

template<class E , class V , class K >
int CCHMetricFamily< E, V, K >::periodOf ( SUMOTime  time) const
inlineprivate

the weight period containing time: 0 is everything before begin and the whole run when the weights are static

Definition at line 545 of file CCHMetricFamily.h.

References CCHMetricFamily< E, V, K >::myBegin, CCHMetricFamily< E, V, K >::myWeightPeriod, and SUMOTime_MAX.

Referenced by CCHMetricFamily< E, V, K >::get(), and CCHMetricFamily< E, V, K >::periodEnd().

Here is the caller graph for this function:

◆ published()

template<class E , class V , class K >
MetricPtr CCHMetricFamily< E, V, K >::published ( const K key,
const std::string &  vehID 
)
inline

the published metric for a type key and querying vehicle id (the id picks the ensemble slot – see the LIVE constructor), or nullptr if the query must route on the exact fallback. Query hot path, any thread.

Definition at line 459 of file CCHMetricFamily.h.

References CCHMetricFamily< E, V, K >::fnv1a(), CCHMetricFamily< E, V, K >::LiveMetric::front, CCHMetricFamily< E, V, K >::myByKey, CCHMetricFamily< E, V, K >::myEnsembleK, CCHMetricFamily< E, V, K >::myMetricStale, CCHMetricFamily< E, V, K >::myPublishedEpoch, CCHMetricFamily< E, V, K >::myQueried, CCHMetricFamily< E, V, K >::mySpeedEpoch, CCHMetricFamily< E, V, K >::myWantedKeys, and CCHMetricFamily< E, V, K >::myWantedLock.

Referenced by MSRoutingEngine::getPublishedCCHMetric().

Here is the caller graph for this function:

◆ seedKey()

template<class E , class V , class K >
void CCHMetricFamily< E, V, K >::seedKey ( const K key)
inline

allocate the metric state (all ensemble slots) for one type; call only while no query is in flight (seeding at init, or the customization barrier)

Definition at line 253 of file CCHMetricFamily.h.

References CCHMetricFamily< E, V, K >::buildLiveMetric(), CCHMetricFamily< E, V, K >::myByKey, and CCHMetricFamily< E, V, K >::myEnsembleK.

Referenced by CCHMetricFamily< E, V, K >::customize(), and MSRoutingEngine::initCCH().

Here is the caller graph for this function:

Field Documentation

◆ myAppliedEffort

template<class E , class V , class K >
std::vector<double> CCHMetricFamily< E, V, K >::myAppliedEffort[2]
private

per-buffer edge state for the sparse path: the gate effort each edge's arcs were last filled from (NaN = never applied / forced), the pending-dirty flag, and the pending list

Definition at line 666 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::CCHMetricFamily(), CCHMetricFamily< E, V, K >::customize(), and CCHMetricFamily< E, V, K >::invalidateEdge().

◆ myBegin

◆ myByKey

template<class E , class V , class K >
std::map<const K*, std::vector<LiveMetric*> > CCHMetricFamily< E, V, K >::myByKey
private

◆ myEnsembleK

template<class E , class V , class K >
int CCHMetricFamily< E, V, K >::myEnsembleK = 1
private

frozen random-factor realizations per type (see the LIVE ctor)

Definition at line 635 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::published(), and CCHMetricFamily< E, V, K >::seedKey().

◆ myFactory

template<class E , class V , class K >
RefVehicleFactory CCHMetricFamily< E, V, K >::myFactory
private

reference-vehicle factory (required LIVE, optional STATIC)

Definition at line 612 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::buildLiveMetric(), and CCHMetricFamily< E, V, K >::get().

◆ myFillEffort

template<class E , class V , class K >
EffortOperation CCHMetricFamily< E, V, K >::myFillEffort
private

the effort the metrics are filled from

Definition at line 608 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::customize(), and CCHMetricFamily< E, V, K >::fillStatic().

◆ myFullFillsPending

template<class E , class V , class K >
int CCHMetricFamily< E, V, K >::myFullFillsPending = 0
private

how many customize passes must run a FULL refill after a permission flip: 2 = both ping-pong buffers (the sparse path cannot repair connection-level mask changes: arcsOfEdge deliberately omits the tail side)

Definition at line 662 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::customize(), and CCHMetricFamily< E, V, K >::invalidateEdge().

◆ myGateEffort

template<class E , class V , class K >
EffortOperation CCHMetricFamily< E, V, K >::myGateEffort
private

the type-independent effort of the LIVE deadband

Definition at line 610 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::customize().

◆ myGraph

◆ myLive

template<class E , class V , class K >
const bool CCHMetricFamily< E, V, K >::myLive
private

LIVE or STATIC (fixed at construction)

Definition at line 616 of file CCHMetricFamily.h.

◆ myLiveMetrics

template<class E , class V , class K >
std::vector<LiveMetric*> CCHMetricFamily< E, V, K >::myLiveMetrics
private

every type's state, in creation order (barrier iteration) and by key (query lookup; only mutated while no query is in flight)

Definition at line 638 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::atBarrier(), CCHMetricFamily< E, V, K >::buildLiveMetric(), CCHMetricFamily< E, V, K >::customize(), CCHMetricFamily< E, V, K >::empty(), and CCHMetricFamily< E, V, K >::~CCHMetricFamily().

◆ myMetricStale

template<class E , class V , class K >
std::atomic<bool> CCHMetricFamily< E, V, K >::myMetricStale {false}
private

a permission flip has not yet been customized into the published metrics (queries divert to the exact fallback while set)

Definition at line 650 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::atBarrier(), CCHMetricFamily< E, V, K >::customize(), CCHMetricFamily< E, V, K >::invalidateEdge(), and CCHMetricFamily< E, V, K >::published().

◆ myPatch

template<class E , class V , class K >
WeightPatch CCHMetricFamily< E, V, K >::myPatch
private

post-fill weight hook (STATIC)

Definition at line 614 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::fillStatic().

◆ myPendingFlag

◆ myPendingList

template<class E , class V , class K >
std::vector<const E*> CCHMetricFamily< E, V, K >::myPendingList[2]
private

◆ myPublishedEpoch

template<class E , class V , class K >
std::atomic<uint64_t> CCHMetricFamily< E, V, K >::myPublishedEpoch {0}
private

◆ myQueried

template<class E , class V , class K >
std::atomic<bool> CCHMetricFamily< E, V, K >::myQueried {false}
private

whether a query arrived since the last barrier (bootstraps type creation and re-arms after resets – see atBarrier)

Definition at line 647 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::atBarrier(), and CCHMetricFamily< E, V, K >::published().

◆ mySpeedEpoch

template<class E , class V , class K >
std::atomic<uint64_t> CCHMetricFamily< E, V, K >::mySpeedEpoch {0}
private

barrier counter of the tracked efforts and the counter value the published metrics were customized from: the staleness bound's safety invariant (see atBarrier / published). Both only change on the owner's thread at the barrier – no query is in flight there – the atomics just publish the values to the query threads.

Definition at line 656 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::atBarrier(), CCHMetricFamily< E, V, K >::customize(), and CCHMetricFamily< E, V, K >::published().

◆ myStale

template<class E , class V , class K >
bool CCHMetricFamily< E, V, K >::myStale = false
private

the efforts changed behind the cached metrics: refill and re-customize them all on the next get() (see flagStale)

Definition at line 626 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::flagStale(), and CCHMetricFamily< E, V, K >::get().

◆ myStaticLock

template<class E , class V , class K >
std::mutex CCHMetricFamily< E, V, K >::myStaticLock
private

◆ myStaticMetrics

template<class E , class V , class K >
std::map<std::pair<const K*, int>, StaticMetric> CCHMetricFamily< E, V, K >::myStaticMetrics
private

◆ myUpdateConstant

template<class E , class V , class K >
double CCHMetricFamily< E, V, K >::myUpdateConstant
private

Definition at line 633 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::customize().

◆ myUpdateFactor

template<class E , class V , class K >
double CCHMetricFamily< E, V, K >::myUpdateFactor
private

Definition at line 632 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::customize().

◆ myWantedKeys

template<class E , class V , class K >
std::vector<const K*> CCHMetricFamily< E, V, K >::myWantedKeys
private

types that queried but have no metric yet (demand streams, so types can appear after seeding); queries register them under the lock and route via the fallback until the next barrier builds their state

Definition at line 643 of file CCHMetricFamily.h.

Referenced by CCHMetricFamily< E, V, K >::customize(), and CCHMetricFamily< E, V, K >::published().

◆ myWantedLock

template<class E , class V , class K >
std::mutex CCHMetricFamily< E, V, K >::myWantedLock
private

◆ myWeightPeriod


The documentation for this class was generated from the following files: