bloqade.lanes.heuristics.physical.target_generator.CongestionAwareTargetGenerator
classCongestionAwareTargetGenerator¶source
bloqade.lanes.heuristics.physical.target_generator.CongestionAwareTargetGenerator
Bases: TargetGeneratorABC
Joint, longest-first, congestion-aware target generator.
Signature
class CongestionAwareTargetGenerator(direction_factor: float = 0.5, shared_site_factor: float = 1.1)For each CZ pair, picks whether to move the control or the target based on schedule-time cost computed against a working placement that reflects all prior pairs’ committed moves and a running directional congestion record.
Per-lane weighting composes two orthogonal multiplicative factors
(see _make_weight_fn):
direction_factor ** (N - M)— signed net of same-direction (N) minus opposite-direction (M) prior commits on the lane. Withdirection_factor < 1, net-positive traffic rewards AOD-parallel reuse and net-negative traffic penalises contention; balanced traffic (N == M) is neutral.shared_site_factor— applied whenever an endpoint of the candidate lane is a site a prior committed path already traversed. Applies independently ofdirection_factor; the two signals compose multiplicatively.
Dijkstra requires non-negative edge weights. direction_factor
must be strictly positive (the negative exponent is otherwise
undefined); shared_site_factor must be >= 0. Defaults
reflect the canonical tuning; empirical retuning is a follow-up.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
direction_factor | float | 0.5 | |
shared_site_factor | float | 1.1 |
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
direction_factor | float | 0.5 | |
shared_site_factor | float | 1.1 |
methodgenerate¶source
bloqade.lanes.heuristics.physical.target_generator.CongestionAwareTargetGenerator.generate
def generate(ctx: TargetContext) -> list[dict[int, LocationAddress]]Parameters
| Name | Type | Description |
|---|---|---|
ctx | TargetContext |
Returns
list[dict[int, LocationAddress]]