AnimationLayout

@Serializable
data class AnimationLayout(val title: String? = null, val baseTimeUnit: String? = null, val width: Double = 1000.0, val height: Double = 700.0, val objectClasses: List<ObjectClassDefinition> = emptyList(), val background: List<BackgroundElement> = emptyList(), val paths: List<PathDefinition> = emptyList(), val queues: List<QueueLayoutElement> = emptyList(), val resources: List<ResourceLayoutElement> = emptyList(), val stations: List<NetworkStationLayoutElement> = emptyList(), val bars: List<BarDisplayElement> = emptyList(), val plots: List<PlotDisplayElement> = emptyList(), val clocks: List<ClockDisplayElement> = emptyList(), val spaces: List<SpatialSpaceDescriptor> = emptyList(), val values: List<ValueDisplayElement> = emptyList(), val agentStateColors: Map<String, String> = emptyMap(), val summaries: List<SummaryDisplayElement> = emptyList(), val histograms: List<HistogramDisplayElement> = emptyList(), val storages: List<StorageLayoutElement> = emptyList(), val movableResources: List<MovableResourceLayoutElement> = emptyList(), val processColors: Map<String, String> = emptyMap(), val conveyors: List<ConveyorLayoutElement> = emptyList(), val labels: List<ElementLabel> = emptyList(), val spaceGeometry: List<GridGeometrySpec> = emptyList(), val locations: List<LocationLayoutElement> = emptyList())(source)

The static layout that, together with a .atf trace, lets a renderer draw an animation. Written once (before simulate()) to a .lay.json file. The format is self-describing (NF6): a renderer can produce a basic animation from only the layout and the trace.

Constructors

Link copied to clipboard
constructor(title: String? = null, baseTimeUnit: String? = null, width: Double = 1000.0, height: Double = 700.0, objectClasses: List<ObjectClassDefinition> = emptyList(), background: List<BackgroundElement> = emptyList(), paths: List<PathDefinition> = emptyList(), queues: List<QueueLayoutElement> = emptyList(), resources: List<ResourceLayoutElement> = emptyList(), stations: List<NetworkStationLayoutElement> = emptyList(), bars: List<BarDisplayElement> = emptyList(), plots: List<PlotDisplayElement> = emptyList(), clocks: List<ClockDisplayElement> = emptyList(), spaces: List<SpatialSpaceDescriptor> = emptyList(), values: List<ValueDisplayElement> = emptyList(), agentStateColors: Map<String, String> = emptyMap(), summaries: List<SummaryDisplayElement> = emptyList(), histograms: List<HistogramDisplayElement> = emptyList(), storages: List<StorageLayoutElement> = emptyList(), movableResources: List<MovableResourceLayoutElement> = emptyList(), processColors: Map<String, String> = emptyMap(), conveyors: List<ConveyorLayoutElement> = emptyList(), labels: List<ElementLabel> = emptyList(), spaceGeometry: List<GridGeometrySpec> = emptyList(), locations: List<LocationLayoutElement> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Maps an agent statechart state name (matched by substring) to a hex color, for state-based agent styling (8F.1); e.g. "Working" -> "#2ca02c".

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Author-controlled conveyor belt routes (10.5): per-segment polylines anchored at stations/locations. Appended last so positional AnimationLayout(...) callers are unaffected.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Per-element text-label overrides (10.8/C3): retitle, reposition (dx,dy from the glyph), or hide a label. Appended last so positional AnimationLayout(...) callers are unaffected.

Link copied to clipboard

Named spatial locations (LocationIfc): move endpoints, conveyor anchors, agent landmarks — the animation counterpart of a NetworkStation. Appended last (defaulted) for positional-constructor and wire safety, so old layouts keep loading and old code keeps constructing.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Maps an entity's current process name (matched by substring) to a hex color, for process/activity styling (10.1e); e.g. "Triage" -> "#ff7f0e". The entity analogue of agentStateColors. Appended at the end of the constructor so positional AnimationLayout(...) callers are unaffected.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Grid obstacle/cost overlays extracted from (or authored for) the model's geometry, keyed by space name (P5a/G2). Appended last so positional AnimationLayout(...) callers are unaffected.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

The placed position of anchor ref — the location (else the network station) of that name, falling back to the other kind when the declared one isn't placed — or null if neither is placed.

Link copied to clipboard

The grid obstacle/cost overlay for the space named spaceName, or null — the consume-side lookup (P5b/G2).

Link copied to clipboard

The full poly-line for path in drawing order: for a functional path (its from/to anchors set) the resolved anchor endpoints bracket the waypoints (fromPos, then the waypoints, then toPos); for a legacy decorative path (no anchors) just its own points. Endpoints resolve via anchorPosition, so an endpoints-only functional path (no waypoints) still yields a drawable two-point segment.

Link copied to clipboard
fun toJson(): String

Serializes this layout to pretty-printed JSON (the .lay.json content).

Link copied to clipboard
fun toToml(): String

Serializes this layout to TOML (an alternate, human-friendly layout format, 8E.2).

Link copied to clipboard

Validates this layout against inventory: every queue/resource/movableResource/response binding is checked against the names the model exposes (the same element kinds the animation emitters attach to), and unmatched names are reported with a nearest-name "did you mean?" hint (8K.2a). Response-style bindings (bar/plot/value/summary/histogram) match against responses ∪ counters (both emit response values).

Validates this layout against model by delegating to the AnimationInventory path (validateAgainst(inventory)) — the inventory is the single identifier space (9A.3/9A.5) that both capture selection and layout binding key off, so validation can't drift from what the emitters expose.

Link copied to clipboard

Separates scaffold-placed glyphs that landed on top of each other — e.g. a resource-column position that coincides with an MDS-placed DistancesModel station, which made the resource impossible to find (item 5). Stations keep their positions (they anchor agent/transporter rendering); colliding resources and queues are nudged out along a golden-angle spiral until clear.

Link copied to clipboard
fun writeToFile(path: Path)

Writes this layout to path (typically a .lay.json file), UTF-8, pretty-printed.

Link copied to clipboard

Writes this layout to path (typically a .lay.toml file) as TOML.