Skip to main content

Module planner

Module planner 

Source

StructsΒ§

PathPlanner
Path planner that resolves [DestinationRouting] to [ResolvedTransportRouting].
PathPlannerConfig
Configuration for PathPlanner’s internal path cache.
WeightingParams πŸ”’
Parameters that shape how per-path aggregates modulate the WeightedCollection weight.

ConstantsΒ§

MIN_SHARE_SHIFT πŸ”’
Smallest change in a candidate’s share of the draws that counts as traffic having moved.

FunctionsΒ§

capacity_factor πŸ”’
Continuous, monotonically increasing capacity factor, bounded in (0.05, 1.0].
composite_weight πŸ”’
Composite selection weight for a candidate path.
latency_factor πŸ”’
Continuous, monotonically decreasing latency factor, bounded in (0, 1].
pick_uniform_index πŸ”’
Picks a uniformly random index over len entries.
pick_weighted_index πŸ”’
Picks an index into weights with probability proportional to the weight; None if all are non-positive.
rebuild_candidates πŸ”’
Rebuilds the weighted candidate collection for one (source, destination, hops) triple from whatever the graph currently says.
shares_by_route πŸ”’
Each candidate’s share of the total weight, keyed by the route it takes.
should_explore πŸ”’
Whether this draw should explore β€” ignore the weights and pick uniformly.
temper_weights πŸ”’
Flattens weights by raising each to temper, compressing the spread between good and bad candidates without reordering them.
validate_unit_interval πŸ”’
validate_weight_temper πŸ”’
Rejects a temper exponent outside (0, 1].
weights_moved πŸ”’
Whether re-weighting would send a materially different share of the draws somewhere else.

Type AliasesΒ§

PlannerCacheKey πŸ”’
Cache key for the path planner: (source, destination, hops).
PlannerCacheValue πŸ”’