Skip to content

VectorReadablePort

export interface VectorReadablePort extends SnapshotPort {
vector(): Readonly<number[]>;
}

A port providing an n-dimensional numeric array. By specifying it as SimulationContext.target, you define the target vector that KineticsPort will follow.

MethodDescription
vector()Returns the vector value at the time of snapshot

Must inherit from SnapshotPort. When snapshot() is called, the port must capture the array at that moment and maintain it internally. Within a single tick, vector() must return the same array object (equivalent by ===). If array contents don’t change, the same reference may be returned across multiple snapshots.