GreedyFlowSolver
in package
implements
ExecutionSolverInterface
uses
ResolvesFlowParameters
FinalYes
Executes movement flows directly with greedy semantics.
Tags
Table of Contents
Interfaces
- ExecutionSolverInterface
- Executes one flow against one quantity state.
Methods
- execute() : MovementResult
- Execute one resolved flow against one quantity state.
- resolveStringParameter() : string
- Resolve a single parameterized string using the provided scalar params.
- allocateEdges() : array<int, AllocationDecision>
- applyMove() : MovementEvent
- filterEdges() : array<int, MovementEdge>
- limitMovable() : int|float
- orderEdges() : array<int, MovementEdge>
- resolveMoveEdges() : array<int, MovementEdge>
- resolvePatternParameters() : string|array<string|int, mixed>|null
- resolveStringParams() : array<string, string>
Methods
execute()
Execute one resolved flow against one quantity state.
public
execute(QuantityState $state, SlotSpace $space, Flow $flow, int|float $quantity[, mixed $subject = null ][, array<string|int, mixed> $appContext = [] ][, array<string, scalar|null> $params = [] ]) : MovementResult
Parameters
- $state : QuantityState
- $space : SlotSpace
- $flow : Flow
- $quantity : int|float
- $subject : mixed = null
- $appContext : array<string|int, mixed> = []
- $params : array<string, scalar|null> = []
Attributes
- #[Override]
Return values
MovementResultresolveStringParameter()
Resolve a single parameterized string using the provided scalar params.
protected
resolveStringParameter(string $value, array<string, string> $params) : string
Parameters
- $value : string
- $params : array<string, string>
Return values
stringallocateEdges()
private
allocateEdges(callable(FlowContext): array<int, AllocationDecision>|AllocationPolicyInterface $policy, array<int, MovementEdge> $edges, FlowContext $context) : array<int, AllocationDecision>
Parameters
- $policy : callable(FlowContext): array<int, AllocationDecision>|AllocationPolicyInterface
- $edges : array<int, MovementEdge>
- $context : FlowContext
Return values
array<int, AllocationDecision>applyMove()
private
applyMove(QuantityState $state, MovementEdge $edge, int|float $quantity) : MovementEvent
Parameters
- $state : QuantityState
- $edge : MovementEdge
- $quantity : int|float
Return values
MovementEventfilterEdges()
private
filterEdges(callable(FlowContext): array<int, MovementEdge>|EdgeFilterPolicyInterface $policy, array<int, MovementEdge> $edges, FlowContext $context) : array<int, MovementEdge>
Parameters
- $policy : callable(FlowContext): array<int, MovementEdge>|EdgeFilterPolicyInterface
- $edges : array<int, MovementEdge>
- $context : FlowContext
Return values
array<int, MovementEdge>limitMovable()
private
limitMovable(QuantityState $state, MovementEdge $edge, int|float $requested, int|float $quantity, FlowStep $step, mixed $subject, array<string|int, mixed> $context) : int|float
Parameters
- $state : QuantityState
- $edge : MovementEdge
- $requested : int|float
- $quantity : int|float
- $step : FlowStep
- $subject : mixed
- $context : array<string|int, mixed>
Return values
int|floatorderEdges()
private
orderEdges(callable(FlowContext): array<int, MovementEdge>|EdgeOrderingPolicyInterface $policy, array<int, MovementEdge> $edges, FlowContext $context) : array<int, MovementEdge>
Parameters
- $policy : callable(FlowContext): array<int, MovementEdge>|EdgeOrderingPolicyInterface
- $edges : array<int, MovementEdge>
- $context : FlowContext
Return values
array<int, MovementEdge>resolveMoveEdges()
private
resolveMoveEdges(SlotSpace $space, FlowStep $step, array<string|int, mixed> $context) : array<int, MovementEdge>
Parameters
- $space : SlotSpace
- $step : FlowStep
- $context : array<string|int, mixed>
Return values
array<int, MovementEdge>resolvePatternParameters()
private
resolvePatternParameters(Slot|string|array<string|int, mixed>|null $pattern, array<string|int, mixed> $context) : string|array<string|int, mixed>|null
Parameters
- $pattern : Slot|string|array<string|int, mixed>|null
- $context : array<string|int, mixed>
Tags
Return values
string|array<string|int, mixed>|nullresolveStringParams()
private
resolveStringParams(array<string|int, mixed> $context) : array<string, string>
Parameters
- $context : array<string|int, mixed>