AnimationBuilder

The top-level animation-layout DSL builder. See animation.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun agentStateColor(state: String, color: String)

Colors agents whose current statechart state name contains state (case-insensitive) with color (e.g. agentStateColor("Working", "#2ca02c")). State styling overrides the agent's type color while it is in that state (8F.1).

Link copied to clipboard
fun bar(responseName: String, x: Double, y: Double, block: BarBuilder.() -> Unit = {})

Binds a live bar to a response/counter (by trace name).

fun bar(counter: CounterCIfc, x: Double, y: Double, block: BarBuilder.() -> Unit = {})

Binds a live bar by passing the counter itself; its name is taken from it (8K.1).

fun bar(response: ResponseCIfc, x: Double, y: Double, block: BarBuilder.() -> Unit = {})

Binds a live bar by passing the response/counter itself; its name is taken from it (8K.1).

Link copied to clipboard
fun blockingQueue(name: String, x: Double, y: Double, growthDegrees: Double = 0.0, showSender: Boolean = false, showRequest: Boolean = false, gap: Double = 40.0, block: QueueBuilder.() -> Unit = {})

Places a BlockingQueue's waiting items: the channel queue ("$name:ChannelQ", items parked waiting to be received) at (x, y). Optionally also the sender (:SenderQ) and request (:RequestQ) queues, stacked gap units below (8K.3). Binds by KSL's naming convention.

fun blockingQueue(bq: BlockingQueue<*>, x: Double, y: Double, growthDegrees: Double = 0.0, showSender: Boolean = false, showRequest: Boolean = false, gap: Double = 40.0, block: QueueBuilder.() -> Unit = {})

Places a BlockingQueue by passing it directly; the queue trace names are read from bq (8K.3).

Link copied to clipboard
Link copied to clipboard
fun clock(x: Double, y: Double, label: String? = "Time", format: String = "0.0", fontSize: Double = 12.0)

Adds a clock display.

Link copied to clipboard
fun continuousSpace(name: String, xMin: Double, xMax: Double, yMin: Double, yMax: Double, torus: Boolean = false)

Describes a continuous (Euclidean) agent space with the given bounds (torus wraps edges).

Link copied to clipboard
fun frequency(responseName: String, x: Double, y: Double, block: HistogramBuilder.() -> Unit = {})

A live integer-frequency chart of a response's observed values, tallied in the viewer from the raw value stream (D12) — for integer-valued responses.

fun frequency(counter: CounterCIfc, x: Double, y: Double, block: HistogramBuilder.() -> Unit = {})

A live integer-frequency chart by passing the counter itself; its name is taken from it (8K.1).

fun frequency(response: ResponseCIfc, x: Double, y: Double, block: HistogramBuilder.() -> Unit = {})

A live integer-frequency chart by passing the response itself; its name is taken from it (8K.1).

Link copied to clipboard

Authors grid obstacle/cost geometry for the space named in spec (P5a/G2).

Link copied to clipboard
fun gridSpace(name: String, cols: Int, rows: Int, cellSize: Double, originX: Double = 0.0, originY: Double = 0.0, torus: Boolean = false)

Describes a grid agent space (torus wraps edges).

Link copied to clipboard
fun histogram(responseName: String, x: Double, y: Double, bins: Int = 10, block: HistogramBuilder.() -> Unit = {})

A live histogram of a response's observed values, binned in the viewer from the raw value stream (D12). bins equal-width bins over the observed range.

fun histogram(response: ResponseCIfc, x: Double, y: Double, bins: Int = 10, block: HistogramBuilder.() -> Unit = {})

A live histogram by passing the response itself; its name is taken from it (8K.1).

Link copied to clipboard
fun holdingArea(name: String, x: Double, y: Double, block: StorageBuilder.() -> Unit = {})

Alias for storage (8K.4) — reads naturally for synchronization-style waits.

Link copied to clipboard
fun holdQueue(name: String, x: Double, y: Double, block: QueueBuilder.() -> Unit = {})

Places a HoldQueue (a Queue) by trace name — readable sugar for queue (8K.3).

fun holdQueue(holdQueue: HoldQueue, x: Double, y: Double, block: QueueBuilder.() -> Unit = {})

Places a HoldQueue by passing it directly; its trace name is read from holdQueue (8K.3).

Link copied to clipboard
fun image(path: String, x1: Double, y1: Double, x2: Double, y2: Double)

Adds a background image drawn into the world rectangle from top-left (x1, y1) to bottom-right (x2, y2). path is resolved relative to the layout file's directory (absolute paths are used as-is).

Link copied to clipboard
fun line(vararg points: Pair<Double, Double>, color: String = "#000000", strokeWidth: Double = 1.0)

Adds a static line/poly-line.

Link copied to clipboard
fun location(name: String, label: String? = null)

Declares a named location without a position (placed later, or proposed by MDS auto-layout).

fun location(name: String, x: Double, y: Double, label: String? = null)

Places a named spatial location (a LocationIfc) at (x, y) — a move endpoint / conveyor anchor / landmark. Distinct from a flow-network station(...); drawn with its own glyph.

Link copied to clipboard
fun locationPosition(locationName: String): Pair<Double, Double>

The position of a previously-placed location (e.g. from placeLocations), for positioning elements relative to it — the location analogue of stationPosition (Phase 6).

Link copied to clipboard
fun movableResource(name: String, block: MovableResourceBuilder.() -> Unit = {})

Declares a movable/transport resource to animate (8K.5). It has no fixed position — the renderer draws it at its interpolated location from SpatialElementMoved events, including empty repositioning. Keyed by the resource's trace name.

Declares a movable resource by passing it directly; its trace name is taken from it (8K.1/8K.5).

Link copied to clipboard
fun networkSpace(name: String, block: NetworkSpaceBuilder.() -> Unit)

Describes a network space of nodes and edges.

Link copied to clipboard
fun objectClass(typeName: String, block: ObjectClassBuilder.() -> Unit = {})

Defines the visual template for an entity/agent type (matches its trace type name).

Link copied to clipboard
fun obstaclesFrom(spaceName: String, graph: GridGraph, originX: Double? = null, originY: Double? = null, cellSize: Double? = null)

Authors obstacles/costs for spaceName by extracting them from graph — the model-driven walls (P5a/G2).

Link copied to clipboard
fun path(name: String, vararg points: Pair<Double, Double>)

Defines a named movement path from a list of (x, y) points.

Link copied to clipboard
fun pathBetween(name: String, from: AnchorRef, to: AnchorRef, vararg waypoints: Pair<Double, Double>, bidirectional: Boolean = true)

Defines a functional path between two anchors (network stations or locations): the waypoints are the intermediate points, and at replay a move between the two anchors follows the polyline. When bidirectional (the default), the reverse move reuses the waypoints reversed. See PathDefinition. Use AnchorRef.location / AnchorRef.station for the endpoints.

Link copied to clipboard
fun pathThrough(name: String, vararg stationNames: String)

Defines a path through already-placed stations by name, reusing their positions (8B.3) so the belt/route geometry isn't re-authored. The referenced stations must be declared first.

Link copied to clipboard
fun placeLocations(distancesModel: DistancesModel, margin: Double = 60.0)

Places a location(...) for every location of a DistancesModel at coordinates derived from its distance matrix via classical MDS (8K.6b) — so a coordinate-free distance model is laid out without hand-picking positions. Coordinates fit the canvas with margin padding; MDS orientation is arbitrary (rotation/reflection-invariant). The location names match the move events' location names, so entity / movable-resource moves resolve against these markers (8H.3).

Link copied to clipboard
fun placeStations(distancesModel: DistancesModel, margin: Double = 60.0)

MDS-places a DistancesModel's named places as station(...) markers. Deprecated: these are locations, not network stations — use placeLocations (its markers are read back with a location accessor, not stationPosition). Kept station-emitting so existing layouts that read positions back still work.

Link copied to clipboard
fun plot(responseName: String, x: Double, y: Double, block: PlotBuilder.() -> Unit = {})

Binds a live time-series plot to a response/counter (by trace name).

fun plot(counter: CounterCIfc, x: Double, y: Double, block: PlotBuilder.() -> Unit = {})

Binds a live plot by passing the counter itself; its name is taken from it (8K.1).

fun plot(response: ResponseCIfc, x: Double, y: Double, block: PlotBuilder.() -> Unit = {})

Binds a live plot by passing the response/counter itself; its name is taken from it (8K.1).

Link copied to clipboard
fun queue(name: String, x: Double, y: Double, block: QueueBuilder.() -> Unit = {})

Places a queue (by trace name).

fun queue(queue: QueueCIfc<*>, x: Double, y: Double, block: QueueBuilder.() -> Unit = {})

Places a queue by passing the queue itself; its trace name is taken from queue (8K.1).

Link copied to clipboard
fun rect(x1: Double, y1: Double, x2: Double, y2: Double, color: String = "#000000", strokeWidth: Double = 1.0)

Adds a static rectangle from one corner to the opposite corner.

Link copied to clipboard
fun resource(name: String, x: Double, y: Double, block: ResourceBuilder.() -> Unit = {})

Places a resource (by trace name).

fun resource(resource: ResourceCIfc, x: Double, y: Double, block: ResourceBuilder.() -> Unit = {})

Places a resource by passing the resource itself; its trace name is taken from resource (8K.1).

Link copied to clipboard
fun resourcePool(pool: ResourcePoolCIfc, x: Double, y: Double, unitGap: Double = 36.0, growthDegrees: Double = 0.0, withBusyValue: Boolean = true, block: ResourceBuilder.() -> Unit = {})

Places each member of a ResourcePool as its own resource glyph (the pool itself is not a Resource), laid out from (x, y) along growthDegrees with unitGap spacing; each member animates its own busy/idle state. When withBusyValue is true, also shows the pool's busy-count (numBusyUnits, "$pool:NumBusy") just above the row (8K.3). Object-only: member names come from the pool.

Link copied to clipboard
fun resourcePoolWithQ(pool: ResourcePoolWithQ, x: Double, y: Double, queueGap: Double = 60.0, queueGrowthDegrees: Double = 180.0, unitGap: Double = 36.0, unitGrowthDegrees: Double = 0.0, withBusyValue: Boolean = true, block: ResourceBuilder.() -> Unit = {})

Places a ResourcePoolWithQ: its member units (via resourcePool) plus the pool's waiting queue ("$pool:Q") whose head leads to the units, using the 8I.6 head placement (8K.3).

Link copied to clipboard
fun resourceWithQ(name: String, x: Double, y: Double, growthDegrees: Double = 180.0, queueGap: Double = 60.0, block: ResourceBuilder.() -> Unit = {})

Composes a ResourceWithQ: a resource at (x, y) plus its waiting queue, auto-named "$name:Q" (KSL's convention). The queue head is placed queueGap units from the resource along growthDegrees and the line extends further that way, so the front of the line is nearest the server (8B.1/8I.6). growthDegrees: 0° = right, clockwise (default 180° = line extends left, head at the resource). Saves authoring the resource and queue separately and keeping them in sync.

fun resourceWithQ(resource: ResourceWithQCIfc, x: Double, y: Double, growthDegrees: Double = 180.0, queueGap: Double = 60.0, block: ResourceBuilder.() -> Unit = {})

Composes a ResourceWithQ by passing the resource itself (8K.1). The resource trace name and its actual waiting-queue name are taken from resource (so a custom queue name stays correct, 8K.1b); placement matches the name-based resourceWithQ.

Link copied to clipboard
fun signal(name: String, x: Double, y: Double, growthDegrees: Double = 0.0, block: QueueBuilder.() -> Unit = {})

Places a Signal's waiting set: its hold queue ("$name:HoldQ") at (x, y) (8K.3).

fun signal(signal: Signal, x: Double, y: Double, growthDegrees: Double = 0.0, block: QueueBuilder.() -> Unit = {})

Places a Signal by passing it directly; the hold-queue trace name is read from signal (8K.3).

Link copied to clipboard
fun size(width: Double, height: Double)

Sets the drawing canvas size.

Link copied to clipboard
fun station(name: String, x: Double, y: Double, label: String? = null)

Places a station (by trace name).

fun station(station: Station, x: Double, y: Double, label: String? = null)

Places a station by passing the station itself; its trace name is taken from station (8K.1).

Link copied to clipboard
fun stationPosition(stationName: String): Pair<Double, Double>

The position of a previously-placed station, for positioning elements relative to it (8B.3).

Link copied to clipboard
fun storage(name: String, x: Double, y: Double, block: StorageBuilder.() -> Unit = {})

A holding area showing entities currently in a delay (8K.4). name matches a delay's suspensionName; for unnamed delays, bind to the entity's type name instead (the renderer keys those by type — a stable, shared default). Default style is a progress belt (entities drift from entry to exit as the delay elapses). See StorageBuilder for style/capacity/layout options.

Link copied to clipboard
fun summary(responseName: String, x: Double, y: Double, label: String? = null, decimals: Int = 2)

Displays the live within-replication statistics (count, mean, min, max) of a response, emitted by the engine (D11). Bound by trace responseName.

fun summary(response: ResponseCIfc, x: Double, y: Double, label: String? = null, decimals: Int = 2)

Within-replication statistics summary by passing the response itself; name taken from it (8K.1).

Link copied to clipboard
fun text(text: String, x: Double, y: Double, color: String = "#000000")

Adds static text.

Link copied to clipboard
fun value(responseName: String, x: Double, y: Double, label: String? = null, decimals: Int = 1)

Displays a labeled numeric readout of a response/counter value (no bar) — the display primitive that bar composes. Bound by trace responseName.

fun value(counter: CounterCIfc, x: Double, y: Double, label: String? = null, decimals: Int = 1)

Displays a counter's value by passing the counter itself; its name is taken from it (8K.1).

fun value(response: ResponseCIfc, x: Double, y: Double, label: String? = null, decimals: Int = 1)

Displays a response's value by passing the response itself; its name is taken from it (8K.1).