DistancePolicy
in package
implements
EdgeFilterPolicyInterface, EdgeOrderingPolicyInterface
FinalYes
Filters or orders edges by a caller-provided distance metric.
Table of Contents
Interfaces
- EdgeFilterPolicyInterface
- Removes edges from a step before ordering and allocation.
- EdgeOrderingPolicyInterface
- Reorders candidate edges for one cascade step.
Properties
- $max : int|float|null
Methods
- __construct() : mixed
- filterEdges() : array<int, MovementEdge>
- Return the subset of edges that should remain available.
- orderEdges() : array<int, MovementEdge>
- Return the candidate edges in preferred execution order.
- distanceFor() : int|float
Properties
$max read-only
private
int|float|null
$max
= null
Methods
__construct()
public
__construct([int|float|null $max = null ]) : mixed
Parameters
- $max : int|float|null = null
filterEdges()
Return the subset of edges that should remain available.
public
filterEdges(FlowContext $ctx) : array<int, MovementEdge>
Parameters
- $ctx : FlowContext
Attributes
- #[Override]
Return values
array<int, MovementEdge>orderEdges()
Return the candidate edges in preferred execution order.
public
orderEdges(FlowContext $ctx) : array<int, MovementEdge>
Parameters
- $ctx : FlowContext
Attributes
- #[Override]
Return values
array<int, MovementEdge>distanceFor()
private
distanceFor(MovementEdge $edge, FlowContext $ctx) : int|float
Parameters
- $edge : MovementEdge
- $ctx : FlowContext