Interface SimulationNodeDatum

The base data structure for the datum of a Simulation Node. The optional properties contained in this data structure are internally assigned by the Simulation upon (re-)initialization.

When defining a data type to use for node data, it should be an extension of this interface and respect the already "earmarked" properties used by the simulation.

IMPORTANT: Prior to initialization, the following properties are optional: index, x, y, vx, and vy. After initialization they will be defined. The optional properties fx and fy are ONLY defined, if the node's position has been fixed.

interface SimulationNodeDatum {
    fx?: number;
    fy?: number;
    index?: number;
    vx?: number;
    vy?: number;
    x?: number;
    y?: number;
}

Properties

Properties

fx?: number

Node’s fixed x-position (if position was fixed)

fy?: number

Node’s fixed y-position (if position was fixed)

index?: number

Node’s zero-based index into nodes array. This property is set during the initialization process of a simulation.

vx?: number

Node’s current x-velocity

vy?: number

Node’s current y-velocity

x?: number

Node’s current x-position

y?: number

Node’s current y-position