Skip to content

bloqade.lanes.heuristics.physical.target_generator.AODClusterTargetGenerator

← Module overview

classAODClusterTargetGeneratorsource

bloqade.lanes.heuristics.physical.target_generator.AODClusterTargetGenerator

Bases: TargetGeneratorABC

Choose CZ directions to maximise AOD-shot packing.

class AODClusterTargetGenerator

For each CZ pair, enumerate both direction candidates (control-moves or target-moves) and classify each by the (move_type, zone_id, bus_id, direction) signature of its first path hop — the same signature the downstream move scheduler uses to batch lanes into one AOD shot. Directions are then assigned greedily: the signature appearing in the most candidate first-hops is filled first, then the next largest, and so on. When no further clustering gain is possible (largest remaining bucket has a single unresolved pair), remaining pairs default to control-direction for parity with DefaultTargetGenerator.

Rationale: CongAware rewards same-direction lane reuse per edge via a Dijkstra weight. That is a local proxy for shot-sharing; the scheduler actually batches by the 4-tuple above, not by individual lane reuse. Choosing CZ directions that align first-hops on shared signatures produces targets the scheduler can pack more tightly.

methodgeneratesource

bloqade.lanes.heuristics.physical.target_generator.AODClusterTargetGenerator.generate

def generate(ctx: TargetContext) -> list[dict[int, LocationAddress]]

Parameters

NameTypeDescription
ctxTargetContext

Returns

list[dict[int, LocationAddress]]

source