TimedSlotSpace
in package
FinalYes
Time-expanded view of a base SlotSpace.
Table of Contents
Properties
- $axis : TimeAxis
- $baseSpace : SlotSpace
- $dispatchCalendar : DispatchCalendarInterface|null
- $durationResolver : TimedDurationResolverInterface|null
- $slots : array<string, TimedSlot>
Methods
- __construct() : mixed
- Create one timed view over a base slot space and a discrete time axis.
- fromBaseSpace() : self
- Build a timed view over one base slot space, defaulting to the space's declared time axis.
- getEdgesFrom() : array<int, TimedMovementEdge>
- Expand one timed slot into the timed holdover edge plus any reachable timed movement edges.
- slot() : TimedSlot
- Resolve one timed slot from either `(slot, time)` input or a serialized `slot@time` key.
- slotsAt() : array<int, TimedSlot>
- Return every timed slot in the expanded space for one resolved time index.
- timedQuantityState() : TimedQuantityState
- Expand a base quantity state into this timed slot space at one origin time.
- defaultDurationValue() : int|string
- dispatchTime() : int
- duration() : int
- Resolve one base-edge duration into canonical bucket count.
- normalizeDispatchCalendar() : DispatchCalendarInterface
- normalizeDurationResolver() : TimedDurationResolverInterface
Properties
$axis read-only
public
TimeAxis
$axis
$baseSpace read-only
public
SlotSpace
$baseSpace
$dispatchCalendar read-only
private
DispatchCalendarInterface|null
$dispatchCalendar
$durationResolver read-only
private
TimedDurationResolverInterface|null
$durationResolver
$slots
private
array<string, TimedSlot>
$slots
= []
Methods
__construct()
Create one timed view over a base slot space and a discrete time axis.
public
__construct(SlotSpace $baseSpace, TimeAxis $axis[, callable|null $durationResolver = null ][, DispatchCalendarInterface|callable|null $dispatchCalendar = null ]) : mixed
Parameters
- $baseSpace : SlotSpace
- $axis : TimeAxis
- $durationResolver : callable|null = null
- $dispatchCalendar : DispatchCalendarInterface|callable|null = null
fromBaseSpace()
Build a timed view over one base slot space, defaulting to the space's declared time axis.
public
static fromBaseSpace(SlotSpace $baseSpace[, TimeAxis|null $axis = null ][, callable|null $durationResolver = null ][, DispatchCalendarInterface|callable|null $dispatchCalendar = null ]) : self
Parameters
- $baseSpace : SlotSpace
- $axis : TimeAxis|null = null
- $durationResolver : callable|null = null
- $dispatchCalendar : DispatchCalendarInterface|callable|null = null
Return values
selfgetEdgesFrom()
Expand one timed slot into the timed holdover edge plus any reachable timed movement edges.
public
getEdgesFrom(TimedSlot $from) : array<int, TimedMovementEdge>
Return holdover and duration-expanded movement edges from one timed slot.
Parameters
- $from : TimedSlot
Return values
array<int, TimedMovementEdge>slot()
Resolve one timed slot from either `(slot, time)` input or a serialized `slot@time` key.
public
slot(Slot|string|null $slot[, DateTimeImmutable|int|string|null $time = null ]) : TimedSlot
Parameters
- $slot : Slot|string|null
- $time : DateTimeImmutable|int|string|null = null
Return values
TimedSlotslotsAt()
Return every timed slot in the expanded space for one resolved time index.
public
slotsAt(DateTimeImmutable|int|string $time) : array<int, TimedSlot>
Parameters
- $time : DateTimeImmutable|int|string
Return values
array<int, TimedSlot>timedQuantityState()
Expand a base quantity state into this timed slot space at one origin time.
public
timedQuantityState(QuantityState $state[, DateTimeImmutable|int|string $time = 0 ]) : TimedQuantityState
Parameters
- $state : QuantityState
- $time : DateTimeImmutable|int|string = 0
Return values
TimedQuantityStatedefaultDurationValue()
private
defaultDurationValue(MovementEdge $edge) : int|string
Parameters
- $edge : MovementEdge
Return values
int|stringdispatchTime()
private
dispatchTime(MovementEdge $edge, TimedSlot $from) : int
Parameters
- $edge : MovementEdge
- $from : TimedSlot
Return values
intduration()
Resolve one base-edge duration into canonical bucket count.
private
duration(MovementEdge $edge, TimedSlot $from, int $dispatchTime) : int
Parameters
- $edge : MovementEdge
- $from : TimedSlot
- $dispatchTime : int
Return values
intnormalizeDispatchCalendar()
private
static normalizeDispatchCalendar(callable|DispatchCalendarInterface $dispatchCalendar) : DispatchCalendarInterface
Parameters
- $dispatchCalendar : callable|DispatchCalendarInterface
Return values
DispatchCalendarInterfacenormalizeDurationResolver()
private
static normalizeDurationResolver(callable $durationResolver) : TimedDurationResolverInterface
Parameters
- $durationResolver : callable