SlotFlow API Documentation

TimedQuantityState
in package

FinalYes

Quantity distribution over timed slots.

Table of Contents

Properties

$space  : TimedSlotSpace
$quantities  : array<string, int|float>

Methods

__construct()  : mixed
Create one timed quantity state from timed-slot quantity tuples.
add()  : void
Add a signed quantity delta to one timed slot.
all()  : array<string, int|float>
Return all stored timed-slot quantities keyed by canonical `slot@time`.
copy()  : self
Return a shallow copy of this timed quantity state.
fromQuantityState()  : self
Expand a base QuantityState into one timed state at the given origin time.
get()  : int|float
Return the quantity currently stored at one timed slot, defaulting to zero.
resolveTimedSlot()  : TimedSlot
Resolve constructor tuple input into one concrete timed slot instance.

Properties

Methods

__construct()

Create one timed quantity state from timed-slot quantity tuples.

public __construct(TimedSlotSpace $space[, array<int, DateTimeImmutable|int|string|null}$tuples = [] ]) : mixed
Parameters
$space : TimedSlotSpace
$tuples : array<int, DateTimeImmutable|int|string|null}> = []

all()

Return all stored timed-slot quantities keyed by canonical `slot@time`.

public all() : array<string, int|float>
Return values
array<string, int|float>

copy()

Return a shallow copy of this timed quantity state.

public copy() : self
Return values
self

get()

Return the quantity currently stored at one timed slot, defaulting to zero.

public get(TimedSlot|string $slot) : int|float
Parameters
$slot : TimedSlot|string
Return values
int|float

resolveTimedSlot()

Resolve constructor tuple input into one concrete timed slot instance.

private resolveTimedSlot(TimedSlot|Slot|string|null $slot, DateTimeImmutable|int|string|null $time) : TimedSlot
Parameters
$slot : TimedSlot|Slot|string|null
$time : DateTimeImmutable|int|string|null
Return values
TimedSlot

        
On this page

Search results