{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thematthub.github.io/naga/schema/model-v32.json",
  "title": "Model file, schema version 32",
  "description": "A discrete-event model: blocks, the links between them, the resources they seize, and the run settings. Generated from the live registries (nagasim.modelschema). RECORD kinds: count, tally, time_between, time_persistent, cost. CREATE arrival modes: Interarrival, Schedule, Orders.",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri",
      "description": "This schema's URL, for an editor's completion and checks; the engine ignores it."
    },
    "schema_version": {
      "type": "integer",
      "maximum": 32,
      "default": 32,
      "description": "Older files migrate on load; a newer one is refused."
    },
    "blocks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/block"
      }
    },
    "links": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/link"
      }
    },
    "scenarios": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/scenario"
      }
    },
    "orders": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/order"
      }
    },
    "resources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/resource"
      }
    },
    "resource_sets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/resource_set"
      }
    },
    "schedules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/schedule"
      }
    },
    "failures": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/failure"
      }
    },
    "tables": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/table"
      }
    },
    "sequences": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/sequence"
      }
    },
    "variables": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/variable"
      }
    },
    "entities": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/entity_type"
      }
    },
    "timeseries_inputs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/timeseries_input"
      }
    },
    "levels": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/level"
      }
    },
    "flows": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/flow"
      }
    },
    "conversions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/conversion"
      }
    },
    "fixed_costs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/fixed_cost"
      }
    },
    "fleets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/fleet"
      }
    },
    "motion_profiles": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/motion_profile"
      }
    },
    "robots": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/robot"
      }
    },
    "pallet_patterns": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/pallet_pattern"
      }
    },
    "zones": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/zone"
      }
    },
    "chargers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/charger"
      }
    },
    "auxiliaries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/auxiliary"
      }
    },
    "delays": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/delay"
      }
    },
    "subscripts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/subscript"
      }
    },
    "agent_types": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/agent_type"
      }
    },
    "populations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/population"
      }
    },
    "reality_checks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/reality_check"
      }
    },
    "network": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/network"
        }
      ]
    },
    "annotations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/annotation"
      }
    },
    "submodels": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/submodel"
      }
    },
    "background": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "properties": {
            "path": {
              "type": "string",
              "minLength": 1
            },
            "position": {
              "$ref": "#/$defs/point"
            },
            "scale": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "opacity": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "locked": {
              "type": "boolean"
            },
            "units_per_metre": {
              "type": [
                "number",
                "null"
              ],
              "exclusiveMinimum": 0
            }
          },
          "required": [
            "path"
          ],
          "additionalProperties": false
        }
      ],
      "description": "Optional floor-plan image behind the canvas; ignored by the engine."
    },
    "building": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/building"
        }
      ]
    },
    "cranes": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/crane"
          }
        }
      ]
    },
    "stockpiles": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/stockpiles"
        }
      ]
    },
    "info": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "description": "A short description of the model."
        },
        "author": {
          "type": "string",
          "description": "Who made the model."
        },
        "notes": {
          "type": "string",
          "description": "Free notes about the model."
        },
        "written_by": {
          "type": "string",
          "description": "The nagasim version that last saved the file, written on every save (D1193)."
        },
        "labels": {
          "enum": [
            "all",
            "assets",
            "none"
          ],
          "description": "Which blocks the editor labels: all, only assets, or none."
        },
        "node_names": {
          "enum": [
            "hover",
            "always"
          ],
          "description": "Whether the editor shows network node names on hover or always."
        }
      },
      "additionalProperties": true
    },
    "data_sources": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/data_source"
      }
    },
    "data_bindings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/data_binding"
      }
    },
    "initial_state": {
      "$ref": "#/$defs/initial_state"
    },
    "simulation": {
      "$ref": "#/$defs/simulation"
    },
    "investment": {
      "$ref": "#/$defs/investment"
    },
    "dispatch": {
      "$ref": "#/$defs/dispatch"
    },
    "outputs": {
      "type": "object",
      "description": "OPTIONAL extra output collection whose cost is opt-in . Absent, none of it runs.",
      "properties": {
        "bottleneck": {
          "type": "boolean",
          "default": false,
          "description": "Collect per-resource ACTIVE intervals for the Roser bottleneck analyser (\"bottleneck_summary\"). Off by default: the intervals cost memory proportional to the event count."
        },
        "schedule": {
          "type": "boolean",
          "default": false,
          "description": "Record one row per resource hold (\"schedule_log\") for the schedule Gantt and the plan export. Off by default; forced on in deterministic mode (\"simulation.deterministic\")."
        }
      },
      "additionalProperties": false
    },
    "assertions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/assertion"
      }
    },
    "path_checks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/path_check"
      }
    },
    "dashboard": {
      "$ref": "#/$defs/dashboard"
    },
    "view": {
      "type": "object",
      "description": "Editor view state, written by the editor on save; ignored by the engine. Absent keys are the defaults: Process tab, schematic, every tab fitted to its contents.",
      "properties": {
        "tab": {
          "enum": [
            "process",
            "stock_and_flow",
            "statechart"
          ],
          "description": "The editor tab in front when the file was saved."
        },
        "layout": {
          "type": "boolean",
          "description": "Whether the editor was in layout mode."
        },
        "view_3d": {
          "type": "boolean",
          "description": "Whether the 3D view was on."
        },
        "queue_display": {
          "enum": [
            "compact",
            "tall"
          ],
          "description": "How the 3D view stacks waiting items: compact (per-form limits, the default) or tall (layers without limit)."
        },
        "draw_guard": {
          "type": "object",
          "properties": {
            "on": {
              "type": "boolean"
            },
            "limit": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000000000
            },
            "limit_2d": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000000000
            }
          },
          "additionalProperties": false,
          "description": "The 3D view pauses playback before drawing more than limit items (default 20000); the 2D canvas draws every k-th new move over limit_2d tokens (default 30000). On by default."
        },
        "layers": {
          "type": "object",
          "additionalProperties": {
            "type": "boolean"
          },
          "description": "Which 3D layers show: a kind (equipment, tiles, names, pads, items, floor, building, network) or a block's user layer, to true or false; missing is shown."
        },
        "canvases": {
          "type": "object",
          "propertyNames": {
            "enum": [
              "process",
              "stock_and_flow",
              "statechart"
            ]
          },
          "additionalProperties": {
            "type": "object",
            "properties": {
              "zoom": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "center": {
                "$ref": "#/$defs/point"
              }
            },
            "additionalProperties": false
          },
          "description": "The zoom and centre of each canvas tab."
        }
      },
      "additionalProperties": false
    },
    "meta": {
      "$ref": "#/$defs/meta",
      "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "point": {
      "type": "array",
      "items": {
        "type": "number"
      },
      "minItems": 2,
      "maxItems": 2
    },
    "route_rule": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "fixed",
            "sequential",
            "cyclic",
            "round_robin",
            "least_loaded",
            "condition",
            "attribute",
            "item"
          ],
          "description": "How the exit is picked."
        },
        "exits": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "One name per exit, in exit order; \"name:target\" names the CONVEYOR a part counts as under way to. Empty: the exits' own names."
        },
        "conditions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "For \"condition\": one expression per exit, or one fewer (the last exit is the ELSE)."
        },
        "limit": {
          "type": "integer",
          "minimum": 0,
          "description": "Parts under way to one exit at most; 0: no limit."
        },
        "attribute": {
          "type": "string",
          "description": "For \"attribute\": the entity attribute whose value names the exit."
        }
      },
      "additionalProperties": false
    },
    "structural_argument": {
      "type": "object",
      "description": "Inside a submodel definition only: bind this param to the instance's argument of that name. Flattening replaces it with the argument's value, coerced to the param's declared type, so the engine never sees one.",
      "required": [
        "$arg"
      ],
      "properties": {
        "$arg": {
          "type": "string",
          "description": "A parameter the definition declares."
        }
      },
      "additionalProperties": false
    },
    "dist_params": {
      "type": "object",
      "description": "Parameters of the sibling `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential). Each value is a number or an expression string. See $defs/duration for the per-distribution parameter lists.",
      "additionalProperties": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "string"
          },
          {
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          {
            "$ref": "#/$defs/structural_argument"
          }
        ]
      }
    },
    "duration": {
      "description": "A duration spec: a distribution, its parameters and an optional unit. Used by link delays and failure uptime/downtime.",
      "oneOf": [
        {
          "title": "Bernoulli",
          "description": "A single yes/no outcome with a given probability, such as accept or reject, pass or fail, or rework or not. Param: p (success probability) in [0, 1].",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Bernoulli"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "p": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "success probability, in [0, 1]",
                  "default": 0.5
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Beta",
          "description": "A value between a minimum and a maximum with a flexible shape, such as a fraction, a proportion or a bounded time. Params: alpha, beta > 0; min < max.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Beta"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "min": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "lower bound, < max",
                  "default": 0.0
                },
                "max": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "upper bound, > min",
                  "default": 1.0
                },
                "alpha": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "shape, > 0",
                  "default": 1.0
                },
                "beta": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "shape, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Binomial",
          "description": "Count of successes (for example defective parts) in a fixed number of independent trials. Params: n (trials) >= 0, p in [0, 1].",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Binomial"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "n": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "number of trials, >= 0",
                  "default": 1.0
                },
                "p": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "success probability, in [0, 1]",
                  "default": 0.5
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "BoundedNormal",
          "description": "Bell-shaped variation around an average, cut off at a minimum and a maximum so a time cannot go negative or beyond a physical limit. Params: mean (central value), stddev (standard deviation) > 0; min < max.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "BoundedNormal"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "mean": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "central value",
                  "default": 0.0
                },
                "stddev": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "standard deviation, > 0",
                  "default": 1.0
                },
                "min": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "lower bound, < max",
                  "default": 0.0
                },
                "max": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "upper bound, > min",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Cauchy",
          "description": "Very heavy-tailed values with frequent extreme outliers in both directions; rarely right for times, and it often returns negative values. Params: x0 (location), gamma (scale) > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Cauchy"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "x0": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "location",
                  "default": 0.0
                },
                "gamma": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "scale, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "ChiSquare",
          "description": "Statistical diagnostics and sums of squared normal variations; rarely used for simulation times. Param: df (degrees of freedom) >= 1.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "ChiSquare"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "df": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "degrees of freedom, >= 1",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Constant",
          "description": "A fixed duration that never varies, for a deterministic service time, transit time or interval. Params: value (fixed duration) >= 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Constant"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "value": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "fixed duration, >= 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "CustomExpression",
          "description": "Any model expression, for example '2 + EXPO(3)', when no single distribution fits. Param: expression (string, e.g. '2 + EXPO(3)').",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "CustomExpression"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "expression": {
                  "type": "string",
                  "default": "1",
                  "description": "model expression, e.g. '2 + EXPO(3)'"
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "DiscreteUniform",
          "description": "A whole number between a minimum and a maximum, each equally likely, such as a random lot size from 1 to 6. Params: low (min) <= high (max), integers.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "DiscreteUniform"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "low": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "minimum integer, <= high",
                  "default": 0.0
                },
                "high": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "maximum integer, >= low",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "EmpiricalContinuous",
          "description": "Measured data as a histogram: a bin is picked by its weight, then a value is drawn evenly within it (a continuous draw, not a resample of points). Params: values (float list of bin edges, length = len(probs) + 1), probs (bin weights summing to 1); or quantiles alone (rising edges, equal mass per bin).",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "EmpiricalContinuous"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "default": [
                    0.0,
                    1.0
                  ],
                  "description": "bin edges, length = len(probs) + 1"
                },
                "probs": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "default": [
                    1.0
                  ],
                  "description": "bin weights, summing to 1"
                },
                "quantiles": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "description": "rising edges, equal mass per bin; instead of values and probs"
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "EmpiricalDiscrete",
          "description": "Whole-number values with their own measured probabilities, such as order sizes or the number of items per job. Params: values (int list), probs (weights summing to 1).",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "EmpiricalDiscrete"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "values": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "default": [
                    0
                  ],
                  "description": "candidate integer values"
                },
                "probs": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "default": [
                    1.0
                  ],
                  "description": "weight per value, summing to 1"
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Erlang",
          "description": "Time to finish k exponential steps in a row, giving a service time less variable than exponential but still random. Params: k (stages) >= 1, rate (lambda) > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Erlang"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "k": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "number of exponential stages, >= 1",
                  "default": 1.0
                },
                "rate": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "lambda, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Exponential",
          "description": "Time between random independent arrivals, or time to a random breakdown, when past events do not change the next one. Param: rate (lambda, event rate) > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Exponential"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "rate": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "event rate (lambda), > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "FixedSchedule",
          "description": "Exact listed times, for arrivals or events that follow a fixed timetable such as a roster or a delivery plan; an optional jitter shifts each arrival at random and keeps their order. Params: schedule (ordered list of times), jitter (standard deviation, 0 = off), jitter_law (Normal or Uniform).",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "FixedSchedule"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "schedule": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "default": [],
                  "description": "ordered list of absolute arrival/event times"
                },
                "jitter": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "standard deviation of each arrival's random shift, in the schedule's unit; 0 = exact times",
                  "default": 0.0
                },
                "jitter_law": {
                  "type": "string",
                  "enum": [
                    "Normal",
                    "Uniform"
                  ],
                  "default": "Normal",
                  "description": "shape of the shift: Normal or Uniform (same standard deviation)"
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Gamma",
          "description": "Right-skewed service or processing times that cannot go below zero, from very regular to very variable. Params: alpha (shape) > 0, beta (scale) > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Gamma"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "alpha": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "shape, > 0",
                  "default": 1.0
                },
                "beta": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "scale, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Geometric",
          "description": "Number of attempts until the first success, such as tries before a part passes inspection. Param: p in (0, 1].",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Geometric"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "p": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "success probability, in (0, 1]",
                  "default": 0.5
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Hypergeometric",
          "description": "Successes in a sample drawn without replacement from a finite lot, such as defectives found when inspecting a sample. Params: N (population) >= K (success states) >= n (sample) >= 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Hypergeometric"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "N": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "population size",
                  "default": 10.0
                },
                "K": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "number of success states in the population",
                  "default": 5.0
                },
                "n": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "sample size",
                  "default": 3.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "InverseGaussian",
          "description": "Right-skewed positive times such as a reaction or decision delay, or the time for a drifting quantity to reach a level. Params: mu (mean) > 0, lambda (shape) > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "InverseGaussian"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "mu": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "mean, > 0",
                  "default": 1.0
                },
                "lambda": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "shape, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "JohnsonSB",
          "description": "A skewed value that stays between a minimum and a maximum, such as a yield or fill percentage. Params: a1, a2 (shape), min < max.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "JohnsonSB"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "a1": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "shape",
                  "default": 0.0
                },
                "a2": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "shape",
                  "default": 1.0
                },
                "min": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "lower bound, < max",
                  "default": 0.0
                },
                "max": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "upper bound, > min",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "JohnsonSU",
          "description": "A flexible fit for skewed, heavy-tailed data when no simple distribution matches; it can return negative values. Params: a, b (shape), loc (center), scale > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "JohnsonSU"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "a": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "shape",
                  "default": 0.0
                },
                "b": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "shape",
                  "default": 1.0
                },
                "loc": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "center",
                  "default": 0.0
                },
                "scale": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "scale, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "LogLogistic",
          "description": "Right-skewed durations with a heavier tail than lognormal, such as repair or lifetime data that cannot go below zero. Params: c (shape) > 0, scale > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "LogLogistic"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "c": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "shape, > 0",
                  "default": 1.0
                },
                "scale": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "scale, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Lognormal",
          "description": "Right-skewed times that cannot go below zero, such as manual handling, picking or repair durations with an occasional long one. Params: mu (log-mean), sigma (log-stddev) > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Lognormal"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "mu": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "log-mean",
                  "default": 0.0
                },
                "sigma": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "log-stddev, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "NegativeBinomial",
          "description": "Number of failures before a set number of successes, each try with the same chance of success, such as rejected parts before r good ones. Params: r (target successes) >= 1, p in (0, 1].",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "NegativeBinomial"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "r": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "target number of successes, >= 1",
                  "default": 1.0
                },
                "p": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "success probability, in (0, 1]",
                  "default": 0.5
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Normal",
          "description": "Symmetric variation around an average, such as a cycle time that is rarely far from the mean; it can go negative unless the mean is much larger than the spread. Params: mean (central value), stddev (standard deviation) > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Normal"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "mean": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "central value",
                  "default": 0.0
                },
                "stddev": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "standard deviation, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "PearsonTypeV",
          "description": "Right-skewed positive delays or times to failure with a long tail, an alternative to lognormal. Params: a (shape) > 0, scale > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "PearsonTypeV"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "a": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "shape, > 0",
                  "default": 1.0
                },
                "scale": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "scale, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "PearsonTypeVI",
          "description": "A ratio of two gamma variables, such as cost per service, that is always positive; it can model times when the parameters suit. Params: a, b > 0, scale > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "PearsonTypeVI"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "a": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "shape, > 0",
                  "default": 1.0
                },
                "b": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "shape, > 0",
                  "default": 1.0
                },
                "scale": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "scale, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Poisson",
          "description": "Counts per period, such as the number of arrivals or events in a fixed time window. Param: lambda (average rate) > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Poisson"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "lambda": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "average rate, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Rayleigh",
          "description": "A positive magnitude such as movement noise or a positioning error, with a single scale parameter. Param: sigma (scale) > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Rayleigh"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "sigma": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "scale, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Triangular",
          "description": "Min, most likely and max are known, usually from expert estimates when there is no data. Params: low =< mode =< high.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Triangular"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "low": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "minimum, <= mode",
                  "default": 0.0
                },
                "high": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "maximum, >= mode",
                  "default": 1.0
                },
                "mode": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "most likely value, between low and high",
                  "default": 0.5
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Uniform",
          "description": "Any value between a minimum and a maximum is equally likely; use it when only the min and max are known. Params: low (min) =< high (max), both real numbers.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Uniform"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "low": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "minimum, <= high",
                  "default": 0.0
                },
                "high": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "maximum, >= low",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        },
        {
          "title": "Weibull",
          "description": "Equipment lifetimes and time to failure, where the breakdown rate can rise with age (wear-out) or fall (early failures). Params: scale (lambda) > 0, shape (k) > 0.",
          "type": "object",
          "properties": {
            "distribution": {
              "const": "Weibull"
            },
            "dist_params": {
              "type": "object",
              "properties": {
                "scale": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "lambda, > 0",
                  "default": 1.0
                },
                "shape": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "k, > 0",
                  "default": 1.0
                }
              },
              "additionalProperties": false
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit the sampled duration is expressed in."
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "distribution"
          ],
          "additionalProperties": false
        }
      ]
    },
    "block": {
      "oneOf": [
        {
          "title": "ASSIGN",
          "description": "Sets attributes on a part, order or customer, or a model variable, from expressions as it passes, for example a due date, a type or a counter. Takes an ordered list of assignments, each is `{\"target\": \"entity.<attr>\" | \"entity.agent.<attr>\" | \"<variable>\", \"expr\": \"<expression>\"}`. Assignments run in order, so a later one sees what an earlier one wrote. Targets and expressions both go through core/expressions.py -- a model file never executes Python.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "ASSIGN"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "assignments": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [],
                      "description": "Ordered list of {\"target\": \"entity.<attr>\" | \"entity.agent.<attr>\" | \"<variable>\", \"expr\": \"<expression>\"}; each runs in order."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "Ordered list of {\"target\": \"entity.<attr>\" | \"entity.agent.<attr>\" | \"<variable>\", \"expr\": \"<expression>\"}; each runs in order."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "BATCH",
          "description": "Groups parts or orders into batches, pallets or lots of a set size, or after a maximum wait, and sends the batch on as one entity. Groups entities by count: puts each arrival in the block's store and, as soon as `batch_size` items are waiting, takes exactly that many atomically to form one batch entity. Members leave live_entities and carry `in_batch` until a SEPARATE splits the batch again. With `max_wait` set, a PARTIAL batch leaves too: the timer is armed by the arrival that starts a new group and releases whatever is waiting once the oldest member has waited that long. TIE RULE: a batch that fills in the same instant as the timer expires wins and the timer releases nothing -- the same zero-delay re-check reneging uses, so the outcome never depends on the order SimPy happened to schedule two events at one timestamp. With `carrier_type` set, an arrival of that type is a CARRIER (a truck): it is not stored, and loads the stored arrivals one at a time, `member_time` each, until it holds `carrier_capacity` (default `batch_size`) or its `max_wait`, counted from its own arrival, has passed; then it leaves as itself, its members aboard. With a `pattern` too, the carrier is a pallet: each member takes the next slot of that pallet pattern, and the pallet closes when its slots are full or the next member would pass its weight limit (that member waits for the next pallet). The members carry `slot` and `layer`; the pallet carries `items`, `layers`, `load_weight`, `load_height` and `pattern`.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "BATCH"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "batch_size": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1,
                      "x-quantity": "count",
                      "default": 2,
                      "description": "Number of entities grouped into one batch entity."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 2,
                  "description": "Number of entities grouped into one batch entity.",
                  "x-quantity": "count"
                },
                "batched_entity_type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "BATCH",
                      "description": "Entity type assigned to the batch entity."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "BATCH",
                  "description": "Entity type assigned to the batch entity."
                },
                "max_wait": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "time",
                      "x-unit-key": "max_wait_time_unit",
                      "default": "",
                      "description": "How long a partial batch waits before it leaves anyway, e.g. \"30\" or \"entity.deadline\"; measured from the arrival that started the group. A batch that fills in the same instant wins. Empty, 0 or less = wait for a full batch for ever."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "How long a partial batch waits before it leaves anyway, e.g. \"30\" or \"entity.deadline\"; measured from the arrival that started the group. A batch that fills in the same instant wins. Empty, 0 or less = wait for a full batch for ever.",
                  "x-quantity": "time",
                  "x-unit-key": "max_wait_time_unit"
                },
                "max_wait_time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit `max_wait` is expressed in: \"base\" (the model's own unit) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit `max_wait` is expressed in: \"base\" (the model's own unit) or one of seconds/minutes/hours/days."
                },
                "carrier_type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Carrier mode: an arriving entity of this type (a truck) is a CARRIER that waits here and loads the other arrivals one at a time, until it is full or its max_wait (the cut-off, measured from the carrier's arrival) runs out, then leaves as itself. Empty = a plain BATCH."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Carrier mode: an arriving entity of this type (a truck) is a CARRIER that waits here and loads the other arrivals one at a time, until it is full or its max_wait (the cut-off, measured from the carrier's arrival) runs out, then leaves as itself. Empty = a plain BATCH."
                },
                "carrier_capacity": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "count",
                      "default": "",
                      "description": "Carrier mode: how many members a carrier takes, e.g. \"entity.capacity\", evaluated for each carrier when it arrives. Empty = batch_size."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Carrier mode: how many members a carrier takes, e.g. \"entity.capacity\", evaluated for each carrier when it arrives. Empty = batch_size.",
                  "x-quantity": "count"
                },
                "member_time": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "time",
                      "x-unit-key": "member_time_unit",
                      "default": "",
                      "description": "Carrier mode: time to load one member, evaluated in the member's own scope when its load starts. Empty = loading takes no time."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Carrier mode: time to load one member, evaluated in the member's own scope when its load starts. Empty = loading takes no time.",
                  "x-quantity": "time",
                  "x-unit-key": "member_time_unit"
                },
                "member_time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit `member_time` is expressed in: \"base\" (the model's own unit) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit `member_time` is expressed in: \"base\" (the model's own unit) or one of seconds/minutes/hours/days."
                },
                "pattern": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Carrier mode: the carrier is a pallet loaded by this record of \"pallet_patterns\", named outright (\"Euro\") or chosen per pallet by an expression in the carrier's scope. Each member takes the next slot; the pallet closes at the pattern's limits, and carrier_capacity is not used. Empty = no pattern."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Carrier mode: the carrier is a pallet loaded by this record of \"pallet_patterns\", named outright (\"Euro\") or chosen per pallet by an expression in the carrier's scope. Each member takes the next slot; the pallet closes at the pattern's limits, and carrier_capacity is not used. Empty = no pattern."
                },
                "place_per": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "item",
                      "description": "With a pattern: \"item\" loads one member per member_time; \"layer\" waits for a whole layer and places it in one member_time (a layer-forming palletizer)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "item",
                  "description": "With a pattern: \"item\" loads one member per member_time; \"layer\" waits for a whole layer and places it in one member_time (a layer-forming palletizer)."
                },
                "robot": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of a record in \"robots\": with a pattern, each item's time is this robot's cycle to that item's own slot, and member_time is not used. Empty = member_time."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of a record in \"robots\": with a pattern, each item's time is this robot's cycle to that item's own slot, and member_time is not used. Empty = member_time."
                },
                "robot_at": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [
                        0,
                        0,
                        0
                      ],
                      "description": "Where the robot stands, from this block (the pallet's place): [dx, dy, rotation] in the model's length unit and degrees, dx along the block's facing, dy toward the floor plan's +y side at rotation 0."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [
                    0,
                    0,
                    0
                  ],
                  "description": "Where the robot stands, from this block (the pallet's place): [dx, dy, rotation] in the model's length unit and degrees, dx along the block's facing, dy toward the floor plan's +y side at rotation 0."
                },
                "targets": {
                  "anyOf": [
                    {
                      "type": "object",
                      "default": {},
                      "description": "The robot's named targets, as on MOTION; \"slot\" (the item's place on the pallet) and \"slot_above\" (approach higher) are given per slot and are not defined here."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {},
                  "description": "The robot's named targets, as on MOTION; \"slot\" (the item's place on the pallet) and \"slot_above\" (approach higher) are given per slot and are not defined here."
                },
                "segments": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [],
                      "description": "The robot's cycle, as on MOTION: ptp and lin moves to targets, with timed pick and place segments, every time in seconds. A move without its own payload_kg carries the pattern's item weight."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "The robot's cycle, as on MOTION: ptp and lin moves to targets, with timed pick and place segments, every time in seconds. A move without its own payload_kg carries the pattern's item weight."
                },
                "approach": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "const": ""
                        }
                      ],
                      "x-quantity": "length",
                      "default": "",
                      "description": "How far slot_above is over the slot, in the model's length unit. Empty = 0.3 m."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "How far slot_above is over the slot, in the model's length unit. Empty = 0.3 m.",
                  "x-quantity": "length"
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "BUFFER",
          "description": "Finite storage of waiting places between two machines or stations; when all places are taken the upstream machine stays blocked, holding its finished part.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "BUFFER"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "capacity": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "x-quantity": "count",
                      "default": 1,
                      "description": "Places in the buffer, 0 or more. A part takes one on the way in and holds it until the next station accepts it, so an upstream machine blocks while the buffer is full. 0 means no place at all (blocking after service with no buffer); for an unlimited queue, do not draw a buffer."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 1,
                  "description": "Places in the buffer, 0 or more. A part takes one on the way in and holds it until the next station accepts it, so an upstream machine blocks while the buffer is full. 0 means no place at all (blocking after service with no buffer); for an unlimited queue, do not draw a buffer.",
                  "x-quantity": "count"
                },
                "level": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Optional level whose value mirrors the buffer's content, so an asset can draw it as a fill indicator. Empty = no level."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Optional level whose value mirrors the buffer's content, so an asset can draw it as a fill indicator. Empty = no level."
                }
              },
              "required": [
                "capacity"
              ],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "CHARGE",
          "description": "Charges an entity (an electric vehicle, a battery pack) with the energy it needs at up to its own power, sharing a site power cap with every other entity at this block; it leaves when full or when its time is up. The block's total grid kW (what the entities take over `efficiency`) is kept in `power_variable`, so a flow with `rate: VAR(\"name\")` puts it on the electricity bus; `site_limit` caps that grid kW. On leaving the entity carries `charged_kwh`, `charge_full` (1 or 0) and `charge_time` (entry to full, or to leaving when not full, in `time_limit_unit`).",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "CHARGE"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "energy": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "energy",
                      "default": "0",
                      "description": "Energy the entity needs, kWh: an expression, e.g. entity.need_kwh."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "0",
                  "description": "Energy the entity needs, kWh: an expression, e.g. entity.need_kwh.",
                  "x-quantity": "energy"
                },
                "max_power": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "power",
                      "default": "0",
                      "description": "Most power the entity takes, kW: an expression, e.g. min(11, entity.max_kw)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "0",
                  "description": "Most power the entity takes, kW: an expression, e.g. min(11, entity.max_kw).",
                  "x-quantity": "power"
                },
                "time_limit": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "time",
                      "x-unit-key": "time_limit_unit",
                      "default": "",
                      "description": "Longest time the entity stays (an expression); it leaves then, full or not. Empty = until full."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Longest time the entity stays (an expression); it leaves then, full or not. Empty = until full.",
                  "x-quantity": "time",
                  "x-unit-key": "time_limit_unit"
                },
                "time_limit_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit of `time_limit` and of the `charge_time` the entity carries: \"base\" (the model's) or one of its quantity's units."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit of `time_limit` and of the `charge_time` the entity carries: \"base\" (the model's) or one of its quantity's units."
                },
                "time_limit_from": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Instant, in model time, the time limit counts from: an expression such as entity.arrived_at. Empty = when the entity enters. A deadline already past sends it on at once, charged 0."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Instant, in model time, the time limit counts from: an expression such as entity.arrived_at. Empty = when the entity enters. A deadline already past sends it on at once, charged 0."
                },
                "leave_when_full": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": true,
                      "description": "Leave as soon as the need is met. Off: stay (drawing nothing) until the time limit, as a car stays plugged in."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": true,
                  "description": "Leave as soon as the need is met. Off: stay (drawing nothing) until the time limit, as a car stays plugged in."
                },
                "site_limit": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "power",
                      "default": 0.0,
                      "description": "Most power all entities at this block draw together from the grid, kW; 0 = no cap."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0.0,
                  "description": "Most power all entities at this block draw together from the grid, kW; 0 = no cap.",
                  "x-quantity": "power"
                },
                "efficiency": {
                  "anyOf": [
                    {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "maximum": 1,
                      "x-quantity": "ratio",
                      "default": 1.0,
                      "description": "Energy the entity stores per unit drawn from the grid (charger losses); 1 = none. The site limit and power_variable are grid side."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 1.0,
                  "description": "Energy the entity stores per unit drawn from the grid (charger losses); 1 = none. The site limit and power_variable are grid side.",
                  "x-quantity": "ratio"
                },
                "sharing": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "equal",
                      "description": "How the cap is shared: \"equal\" (an equal share each; what a slow entity cannot use goes to the others) or \"first_come\" (in order of arrival, each as much as it can take)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "equal",
                  "description": "How the cap is shared: \"equal\" (an equal share each; what a slow entity cannot use goes to the others) or \"first_come\" (in order of arrival, each as much as it can take)."
                },
                "power_variable": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Model variable kept equal to the block's total grid kW, for a flow rate VAR(\"name\") on the electricity bus. Empty = none."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Model variable kept equal to the block's total grid kW, for a flow rate VAR(\"name\") on the electricity bus. Empty = none."
                }
              },
              "required": [
                "energy",
                "max_power"
              ],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "CONVEYOR",
          "description": "Belt that carries parts end to end at a set speed, holds a limited number, and blocks the machine before it when full.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "CONVEYOR"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "length": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "length",
                      "x-unit-key": "length_unit",
                      "default": 0.0,
                      "description": "Belt length in layout units. 0 takes the network distance between `from_node` and `to_node`."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0.0,
                  "description": "Belt length in layout units. 0 takes the network distance between `from_node` and `to_node`.",
                  "x-quantity": "length",
                  "x-unit-key": "length_unit"
                },
                "length_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "millimeters",
                        "centimeters",
                        "meters",
                        "kilometers"
                      ],
                      "default": "base",
                      "description": "Unit of `length`: \"base\" (the model's) or one of its quantity's units."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit of `length`: \"base\" (the model's) or one of its quantity's units."
                },
                "speed": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "speed",
                      "x-unit-key": "speed_unit",
                      "default": 1.0,
                      "description": "Belt speed, length units per model time unit."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 1.0,
                  "description": "Belt speed, length units per model time unit.",
                  "x-quantity": "speed",
                  "x-unit-key": "speed_unit"
                },
                "speed_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(base|(mm|cm|m|km)/(ms|s|min|h|day|week|month|year))$",
                      "default": "base",
                      "description": "Unit of `speed`: \"base\" (the model's) or one of its quantity's units."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit of `speed`: \"base\" (the model's) or one of its quantity's units."
                },
                "spacing": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "length",
                      "x-unit-key": "spacing_unit",
                      "default": 1.0,
                      "description": "Belt length one entity occupies; capacity is floor(length / spacing) and the entry rhythm is spacing / speed."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 1.0,
                  "description": "Belt length one entity occupies; capacity is floor(length / spacing) and the entry rhythm is spacing / speed.",
                  "x-quantity": "length",
                  "x-unit-key": "spacing_unit"
                },
                "spacing_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "millimeters",
                        "centimeters",
                        "meters",
                        "kilometers"
                      ],
                      "default": "base",
                      "description": "Unit of `spacing`: \"base\" (the model's) or one of its quantity's units."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit of `spacing`: \"base\" (the model's) or one of its quantity's units."
                },
                "accumulating": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": true,
                      "description": "True: a blocked entity stops and the others pack behind it. False: the whole belt stops while the exit is blocked."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": true,
                  "description": "True: a blocked entity stops and the others pack behind it. False: the whole belt stops while the exit is blocked."
                },
                "exit_resource": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Resource an entity must take to leave the belt -- the end stop that makes accumulation happen. It carries the resource onward, so release it downstream (a PROCESS with action \"Delay Release\"). Empty: no end stop. Either way, a belt that feeds another belt keeps its end part until that belt has room (back-pressure)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Resource an entity must take to leave the belt -- the end stop that makes accumulation happen. It carries the resource onward, so release it downstream (a PROCESS with action \"Delay Release\"). Empty: no end stop. Either way, a belt that feeds another belt keeps its end part until that belt has room (back-pressure)."
                },
                "from_node": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Path-network node the belt starts at (drawing, and the length when `length` is 0)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Path-network node the belt starts at (drawing, and the length when `length` is 0)."
                },
                "to_node": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Path-network node the belt ends at."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Path-network node the belt ends at."
                },
                "stops": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [],
                      "description": "Points where each part halts on the belt: {\"at\": <distance from the entry, in the unit of `length`, between 0 and the length>, \"time\": <number or expression>, \"resource\"?: <seized for the stop>}. Parts behind pack against a stop on an accumulating belt; a non-accumulating belt stops while a part is at one. Empty: none."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "Points where each part halts on the belt: {\"at\": <distance from the entry, in the unit of `length`, between 0 and the length>, \"time\": <number or expression>, \"resource\"?: <seized for the stop>}. Parts behind pack against a stop on an accumulating belt; a non-accumulating belt stops while a part is at one. Empty: none."
                },
                "diverts": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "rule": {
                            "$ref": "#/$defs/route_rule"
                          },
                          "rule_group": {
                            "type": "string",
                            "minLength": 1,
                            "description": "The diverts that share one rule name the same group."
                          },
                          "angle": {
                            "type": "number",
                            "exclusiveMinimum": 0,
                            "exclusiveMaximum": 180,
                            "default": 90,
                            "description": "Degrees from the belt's travel to the exit port, on its side: 90 square, 45 leaning downstream."
                          }
                        }
                      },
                      "default": [],
                      "description": "Points where a part may leave the belt sideways: {\"at\": <distance from the entry, in the unit of `length`>, \"condition\": <expression, read once as the part reaches it>, \"time\"?: <push time, number or expression>, \"when_full\"?: \"wait\" (default: the part waits there for room) or \"pass\" (it rides on), \"intercept\"?: true (a robot on link k + 1 picks the part on the move; its first move targets this divert), \"on_late\"?: what the part does when that robot is busy: \"wait\" (default: it stands where the robot meets it), \"pass\" (it rides on) or an expression, true meaning wait}. Divert k leaves by outgoing link k + 1; link 0 is the belt's end. A link may name its exit instead: source_port \"out\" (the end) or \"d<k>\", each exit once. \"side\"?: \"left\" (default) or \"right\" of a part travelling along the belt as seen on screen, where the divert's exit port faces on the floor plan; \"angle\"?: degrees from the belt's travel to that exit, above 0 and below 180 (90, the default, is square; 45 leans downstream), floor geometry only. \"rule\"?: a routing rule in place of the condition, {\"kind\", \"exits\"?, \"conditions\"?, \"limit\"?, \"attribute\"?} as a Rule-mode DECIDE's, read once as the part reaches it; \"rule_group\"?: a name the diverts sharing one rule all give, the rule on the first of them along the belt only; the exits are the group's diverts in belt order (names default to their ports), and an exit named \"out\" passes them all to the belt's end. A part counts under way until it reaches its exit's target piece or leaves a belt on its way there by a divert; name an exit \"L1:L1\" to stop the count at branch L1. While every exit is at its limit the part waits at the group's first divert and the belt behind packs as at a stop. Empty: none."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "Points where a part may leave the belt sideways: {\"at\": <distance from the entry, in the unit of `length`>, \"condition\": <expression, read once as the part reaches it>, \"time\"?: <push time, number or expression>, \"when_full\"?: \"wait\" (default: the part waits there for room) or \"pass\" (it rides on), \"intercept\"?: true (a robot on link k + 1 picks the part on the move; its first move targets this divert), \"on_late\"?: what the part does when that robot is busy: \"wait\" (default: it stands where the robot meets it), \"pass\" (it rides on) or an expression, true meaning wait}. Divert k leaves by outgoing link k + 1; link 0 is the belt's end. A link may name its exit instead: source_port \"out\" (the end) or \"d<k>\", each exit once. \"side\"?: \"left\" (default) or \"right\" of a part travelling along the belt as seen on screen, where the divert's exit port faces on the floor plan; \"angle\"?: degrees from the belt's travel to that exit, above 0 and below 180 (90, the default, is square; 45 leans downstream), floor geometry only. \"rule\"?: a routing rule in place of the condition, {\"kind\", \"exits\"?, \"conditions\"?, \"limit\"?, \"attribute\"?} as a Rule-mode DECIDE's, read once as the part reaches it; \"rule_group\"?: a name the diverts sharing one rule all give, the rule on the first of them along the belt only; the exits are the group's diverts in belt order (names default to their ports), and an exit named \"out\" passes them all to the belt's end. A part counts under way until it reaches its exit's target piece or leaves a belt on its way there by a divert; name an exit \"L1:L1\" to stop the count at branch L1. While every exit is at its limit the part waits at the group's first divert and the belt behind packs as at a stop. Empty: none."
                },
                "merges": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [],
                      "description": "Points where parts from another block join the belt: {\"at\": <distance from the entry, in the unit of `length`>, \"from\": <the block linking to this belt whose parts join there>, \"priority\"?: \"belt\" (default: they wait for a gap of two spacings) or \"merge\" (parts on the belt make room)}. Accumulating belts only. Empty: none."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "Points where parts from another block join the belt: {\"at\": <distance from the entry, in the unit of `length`>, \"from\": <the block linking to this belt whose parts join there>, \"priority\"?: \"belt\" (default: they wait for a gap of two spacings) or \"merge\" (parts on the belt make room)}. Accumulating belts only. Empty: none."
                },
                "eyes": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [],
                      "description": "Photo-eyes, points that fire as a part passes: {\"at\": <distance from the entry, in the unit of `length`>, \"edge\"?: \"front\" (default: as the part's front reaches `at`) or \"back\" (as its back clears `at`, a `part_length` later), \"assign\"?: <rows {\"target\", \"expr\"} run on that part as ASSIGN runs them>, \"signal\"?: <signal raised, for HOLD blocks and item code>}. Each firing is counted and traced; a queue that stands short of an eye delays it. Empty: none."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "Photo-eyes, points that fire as a part passes: {\"at\": <distance from the entry, in the unit of `length`>, \"edge\"?: \"front\" (default: as the part's front reaches `at`) or \"back\" (as its back clears `at`, a `part_length` later), \"assign\"?: <rows {\"target\", \"expr\"} run on that part as ASSIGN runs them>, \"signal\"?: <signal raised, for HOLD blocks and item code>}. Each firing is counted and traced; a queue that stands short of an eye delays it. Empty: none."
                },
                "path": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [],
                      "description": "The belt as pieces laid end to end from its entry: {\"straight\": <length>} or {\"arc\": {\"radius\": <r>, \"angle\": <degrees, up to 360>, \"turn\": \"left\" or \"right\" as seen on screen}}, lengths in the unit of `length`. Their total is the belt's length, so set `length` to 0 and give no nodes. Empty: a straight belt of `length`."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "The belt as pieces laid end to end from its entry: {\"straight\": <length>} or {\"arc\": {\"radius\": <r>, \"angle\": <degrees, up to 360>, \"turn\": \"left\" or \"right\" as seen on screen}}, lengths in the unit of `length`. Their total is the belt's length, so set `length` to 0 and give no nodes. Empty: a straight belt of `length`."
                },
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "",
                        "belt",
                        "roller",
                        "chain",
                        "pallet",
                        "mdr"
                      ],
                      "default": "",
                      "description": "Conveyor type: \"belt\", \"roller\", \"chain\", \"pallet\" or \"mdr\". Empty: an untyped belt with `spacing`, one item per cell. A typed belt has cells of `cell` and an item takes ceil((its length + `gap`) / cell) of them; `spacing` is ignored and the results' Capacity counts cells."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Conveyor type: \"belt\", \"roller\", \"chain\", \"pallet\" or \"mdr\". Empty: an untyped belt with `spacing`, one item per cell. A typed belt has cells of `cell` and an item takes ceil((its length + `gap`) / cell) of them; `spacing` is ignored and the results' Capacity counts cells."
                },
                "gap": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "length",
                      "x-unit-key": "gap_unit",
                      "default": 0.0,
                      "description": "Free belt length kept between two items on a typed belt."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0.0,
                  "description": "Free belt length kept between two items on a typed belt.",
                  "x-quantity": "length",
                  "x-unit-key": "gap_unit"
                },
                "gap_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "millimeters",
                        "centimeters",
                        "meters",
                        "kilometers"
                      ],
                      "default": "base",
                      "description": "Unit of `gap`: \"base\" (the model's) or one of its quantity's units."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit of `gap`: \"base\" (the model's) or one of its quantity's units."
                },
                "cell": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "length",
                      "x-unit-key": "cell_unit",
                      "default": 0.0,
                      "description": "Length of one cell of a typed belt; an item takes as many as its length plus `gap` needs. 0: 1 cm in any length unit. Ignored on an untyped belt."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0.0,
                  "description": "Length of one cell of a typed belt; an item takes as many as its length plus `gap` needs. 0: 1 cm in any length unit. Ignored on an untyped belt.",
                  "x-quantity": "length",
                  "x-unit-key": "cell_unit"
                },
                "cell_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "millimeters",
                        "centimeters",
                        "meters",
                        "kilometers"
                      ],
                      "default": "base",
                      "description": "Unit of `cell`: \"base\" (the model's) or one of its quantity's units."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit of `cell`: \"base\" (the model's) or one of its quantity's units."
                },
                "zones": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "minimum": 1,
                          "description": "Zones of equal length, zone 1 at the exit."
                        },
                        "release_delay": {
                          "type": "number",
                          "minimum": 0,
                          "default": 0,
                          "description": "A zone's restart delay per zone from the exit, in `time_unit`."
                        },
                        "time_unit": {
                          "type": "string",
                          "enum": [
                            "base",
                            "milliseconds",
                            "seconds",
                            "minutes",
                            "hours",
                            "days",
                            "weeks",
                            "months",
                            "years"
                          ],
                          "default": "base",
                          "description": "Unit of `release_delay`: \"base\" (the model's) or one of seconds/minutes/hours/days."
                        }
                      },
                      "dependentRequired": {
                        "release_delay": [
                          "count"
                        ],
                        "time_unit": [
                          "count"
                        ]
                      },
                      "additionalProperties": false,
                      "default": {},
                      "description": "Accumulation zones: {\"count\": <zones of equal length, zone 1 at the exit>, \"release_delay\"?: <time, in the model's time unit unless \"time_unit\" says another>}. Parts accumulate as without zones; when the held exit frees, a standing part restarts release_delay times its front's zone later, never nearer than its own length to the part ahead; the end part keeps the exit unit through its delay, and a part handed to a next belt waits it before that belt takes it. Delay 0 is a belt without zones and releases the queue as one slug, as Emulate3D does at 0; Emulate3D's staggered headways at a 1 s delay (1.26 s and 0.96 s measured) differ, an open comparison. Accumulating belts with no stop or merge only. Empty: none."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {},
                  "description": "Accumulation zones: {\"count\": <zones of equal length, zone 1 at the exit>, \"release_delay\"?: <time, in the model's time unit unless \"time_unit\" says another>}. Parts accumulate as without zones; when the held exit frees, a standing part restarts release_delay times its front's zone later, never nearer than its own length to the part ahead; the end part keeps the exit unit through its delay, and a part handed to a next belt waits it before that belt takes it. Delay 0 is a belt without zones and releases the queue as one slug, as Emulate3D does at 0; Emulate3D's staggered headways at a 1 s delay (1.26 s and 0.96 s measured) differ, an open comparison. Accumulating belts with no stop or merge only. Empty: none."
                },
                "release": {
                  "anyOf": [
                    {
                      "type": "object",
                      "maxProperties": 1,
                      "properties": {
                        "metering": {
                          "type": "object",
                          "minProperties": 1,
                          "maxProperties": 1,
                          "properties": {
                            "gap": {
                              "type": "number",
                              "minimum": 0,
                              "description": "Free length from the last part's tail to the next part's front, in the unit of the belt's `length`."
                            },
                            "interval": {
                              "type": "number",
                              "minimum": 0,
                              "description": "Front-to-front distance, never less than the last part's length on the belt, in the unit of the belt's `length`."
                            }
                          },
                          "additionalProperties": false
                        },
                        "singulation": {
                          "type": "object",
                          "properties": {
                            "gap": {
                              "type": "number",
                              "minimum": 0,
                              "description": "Free length from the last part's tail to the next part's front, in the unit of the belt's `length`."
                            }
                          },
                          "required": [
                            "gap"
                          ],
                          "additionalProperties": false
                        },
                        "slug": {
                          "type": "object",
                          "properties": {
                            "count": {
                              "type": "integer",
                              "minimum": 1,
                              "description": "Parts queued before the end lets them go."
                            },
                            "timeout": {
                              "type": "number",
                              "minimum": 0,
                              "description": "Longest hold since the first part stood at the end, in `time_unit`."
                            },
                            "time_unit": {
                              "type": "string",
                              "enum": [
                                "base",
                                "milliseconds",
                                "seconds",
                                "minutes",
                                "hours",
                                "days",
                                "weeks",
                                "months",
                                "years"
                              ],
                              "default": "base",
                              "description": "Unit of `timeout`: \"base\" (the model's) or one of seconds/minutes/hours/days."
                            }
                          },
                          "required": [
                            "count",
                            "timeout"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false,
                      "default": {},
                      "description": "How parts leave the end, one form: {\"metering\": {\"gap\": <length>}} (a part leaves once the one before is that far past the end, measured from its tail), {\"metering\": {\"interval\": <length>}} (front to front, never nearer than the part before takes on the belt), {\"singulation\": {\"gap\": <length>}} (the same as metering by gap) or {\"slug\": {\"count\": <parts>, \"timeout\": <time>, \"time_unit\"?}} (the end holds until count parts are queued or timeout has passed since the first stood there, then lets them go nose to tail). Lengths are in the unit of `length` and travelled at the belt speed; the timeout is in the model's time unit unless time_unit says another. Held parts make the ones behind accumulate. A slug counts every part standing in the queue, behind a photo-eye or a stop too; a part whose place in the queue is behind a stop dwells there after the release. Each part's hold at the end is kept (in a slug the lead's; the parts let go with it hold 0). Accumulating belts without zones only. Empty: parts leave as soon as they can."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {},
                  "description": "How parts leave the end, one form: {\"metering\": {\"gap\": <length>}} (a part leaves once the one before is that far past the end, measured from its tail), {\"metering\": {\"interval\": <length>}} (front to front, never nearer than the part before takes on the belt), {\"singulation\": {\"gap\": <length>}} (the same as metering by gap) or {\"slug\": {\"count\": <parts>, \"timeout\": <time>, \"time_unit\"?}} (the end holds until count parts are queued or timeout has passed since the first stood there, then lets them go nose to tail). Lengths are in the unit of `length` and travelled at the belt speed; the timeout is in the model's time unit unless time_unit says another. Held parts make the ones behind accumulate. A slug counts every part standing in the queue, behind a photo-eye or a stop too; a part whose place in the queue is behind a stop dwells there after the release. Each part's hold at the end is kept (in a slug the lead's; the parts let go with it hold 0). Accumulating belts without zones only. Empty: parts leave as soon as they can."
                },
                "reversible": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "True: the belt can run backward during a run, turned by `reverse_signal` or by item code (item.reverse). Each part on it then rides back the distance it has travelled and leaves at the start by `reverse_to`; nothing gets on until it runs forward again. Reversible belts linked end to start, with nothing between them, are one chain that turns as one: a part crosses each joint the way the chain runs. A reversible belt has no stops, diverts, merges, photo-eyes, zones or release rule."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "True: the belt can run backward during a run, turned by `reverse_signal` or by item code (item.reverse). Each part on it then rides back the distance it has travelled and leaves at the start by `reverse_to`; nothing gets on until it runs forward again. Reversible belts linked end to start, with nothing between them, are one chain that turns as one: a part crosses each joint the way the chain runs. A reversible belt has no stops, diverts, merges, photo-eyes, zones or release rule."
                },
                "reverse_signal": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Signal that turns a reversible belt each time it is raised (forward, backward, forward...), with its whole chain. Empty: only item code turns it."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Signal that turns a reversible belt each time it is raised (forward, backward, forward...), with its whole chain. Empty: only item code turns it."
                },
                "reverse_to": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Exit of a reversible belt for parts leaving at its start: the target block of one of its links, or \"in\" (the link whose source_port is \"in\"); not a conveyor feeding this belt, since nothing boards a belt by its end. In a chain, only the first piece names it: a later piece hands back to the one before."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Exit of a reversible belt for parts leaving at its start: the target block of one of its links, or \"in\" (the link whose source_port is \"in\"); not a conveyor feeding this belt, since nothing boards a belt by its end. In a chain, only the first piece names it: a later piece hands back to the one before."
                },
                "one_load": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "True: the piece carries one load at a time, as a short divert or merge piece does. A load boards, at the start or at a merge, only once the piece is clear, which is when the load ahead has left, by the end or by a divert, and its tail is past the piece's end: its leave time plus (the length, less the place it left by, plus its occupied length) over the speed. Loads waiting at the start and at merges take turns in belt order; a merge with priority \"merge\" boards first only at the very first boarding (with several, the first by at). Not with zones, reversible, a divert with intercept or a release slug of count above 1."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "True: the piece carries one load at a time, as a short divert or merge piece does. A load boards, at the start or at a merge, only once the piece is clear, which is when the load ahead has left, by the end or by a divert, and its tail is past the piece's end: its leave time plus (the length, less the place it left by, plus its occupied length) over the speed. Loads waiting at the start and at merges take turns in belt order; a merge with priority \"merge\" boards first only at the very first boarding (with several, the first by at). Not with zones, reversible, a divert with intercept or a release slug of count above 1."
                },
                "part_length": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "length",
                      "x-unit-key": "part_length_unit",
                      "default": 0.0,
                      "description": "Length of one part along the belt, which a back-edge eye reads. 0: the spacing, or a typed belt's type zone length. On an untyped belt it is no longer than the spacing."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0.0,
                  "description": "Length of one part along the belt, which a back-edge eye reads. 0: the spacing, or a typed belt's type zone length. On an untyped belt it is no longer than the spacing.",
                  "x-quantity": "length",
                  "x-unit-key": "part_length_unit"
                },
                "part_length_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "millimeters",
                        "centimeters",
                        "meters",
                        "kilometers"
                      ],
                      "default": "base",
                      "description": "Unit of `part_length`: \"base\" (the model's) or one of its quantity's units."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit of `part_length`: \"base\" (the model's) or one of its quantity's units."
                },
                "expose": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "True: the belt writes its state as model variables, read with VAR(\"<belt>.running\") in a HOLD condition or item code: `running` (0 only while a non-accumulating belt stands for a part held at the exit it runs to), `forward` on a reversible belt (0 while it runs backward), `eye<k>.count` (eye k's firings so far) and `eye<k>.blocked` (1 while a part's body lies across eye k, front edge to back edge; not on a belt with both zones and diverts)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "True: the belt writes its state as model variables, read with VAR(\"<belt>.running\") in a HOLD condition or item code: `running` (0 only while a non-accumulating belt stands for a part held at the exit it runs to), `forward` on a reversible belt (0 while it runs backward), `eye<k>.count` (eye k's firings so far) and `eye<k>.blocked` (1 while a part's body lies across eye k, front edge to back edge; not on a belt with both zones and diverts)."
                },
                "look": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "width": {
                          "type": "number",
                          "minimum": 0.1,
                          "maximum": 3.0,
                          "description": "Metres, from 0.1 to 3, for belt, roller, chain, pallet, mdr."
                        },
                        "height": {
                          "type": "number",
                          "minimum": 0.095,
                          "maximum": 3.0,
                          "description": "Metres, from the frame's 0.1 (a lower type: its own height, 0.095 on a pallet) to 3, for belt, roller, chain, pallet, mdr."
                        },
                        "frame_color": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "steel",
                                "grey",
                                "blue",
                                "green",
                                "yellow",
                                "orange"
                              ]
                            },
                            {
                              "type": "string",
                              "pattern": "^#[0-9A-Fa-f]{6}$"
                            }
                          ],
                          "description": "Choice or a colour #RRGGBB, for belt, roller, chain, pallet, mdr."
                        },
                        "leg_spacing": {
                          "anyOf": [
                            {
                              "const": 0
                            },
                            {
                              "type": "number",
                              "minimum": 0.5,
                              "maximum": 10.0
                            }
                          ],
                          "description": "Metres, 0 for none or from 0.5 to 10, for belt, roller, chain, pallet, mdr."
                        },
                        "drive_side": {
                          "type": "string",
                          "enum": [
                            "under",
                            "left",
                            "right",
                            "none"
                          ],
                          "description": "Choice for belt, roller, chain, pallet."
                        },
                        "guide_left": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1.5,
                          "description": "Metres, 0 to 1.5, for belt, roller, chain, pallet, mdr."
                        },
                        "guide_right": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1.5,
                          "description": "Metres, 0 to 1.5, for belt, roller, chain, pallet, mdr."
                        },
                        "guide_style": {
                          "type": "string",
                          "enum": [
                            "round",
                            "flat",
                            "panel"
                          ],
                          "description": "Choice for belt, roller, chain, pallet, mdr."
                        },
                        "roller_pitch": {
                          "type": "number",
                          "minimum": 0.03,
                          "maximum": 1.0,
                          "description": "Metres, from 0.03 to 1, for roller, mdr, pallet."
                        },
                        "roller_diameter": {
                          "type": "number",
                          "minimum": 0.02,
                          "maximum": 0.3,
                          "description": "Metres, from 0.02 to 0.3, for roller, mdr, pallet."
                        },
                        "roller_finish": {
                          "type": "string",
                          "enum": [
                            "zinc",
                            "grey",
                            "blue_sleeve"
                          ],
                          "description": "Choice for roller, mdr, pallet."
                        },
                        "belt_kind": {
                          "type": "string",
                          "enum": [
                            "black_rubber",
                            "green_pvc",
                            "white_food",
                            "plastic_modular"
                          ],
                          "description": "Choice for belt."
                        },
                        "pulley_diameter": {
                          "type": "number",
                          "minimum": 0.03,
                          "maximum": 0.5,
                          "description": "Metres, from 0.03 to 0.5, for belt."
                        },
                        "chain_strands": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 6,
                          "description": "Count, for chain."
                        },
                        "strand_spacing": {
                          "type": "number",
                          "minimum": 0.05,
                          "maximum": 1.5,
                          "description": "Metres, from 0.05 to 1.5, for chain."
                        },
                        "openings": {
                          "type": "array",
                          "description": "Gaps in the side guides, in the belt's length unit.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "side": {
                                "type": "string",
                                "enum": [
                                  "left",
                                  "right",
                                  "both"
                                ]
                              },
                              "start": {
                                "type": "number",
                                "minimum": 0
                              },
                              "end": {
                                "type": "number",
                                "exclusiveMinimum": 0
                              }
                            },
                            "required": [
                              "side",
                              "start",
                              "end"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false,
                      "description": "How a typed belt looks, only the settings that differ from its type's. Dimensions are in metres: width, height (the top of the conveying surface), leg_spacing (0: no legs), guide_left and guide_right (guide height above the top, 0: none), roller_pitch, roller_diameter, pulley_diameter and strand_spacing. Choices: frame_color, drive_side, guide_style, roller_finish and belt_kind. chain_strands is a count. `openings` is a list of {side: left, right or both, start, end}: gaps in the side guides, in the unit of `length`.",
                      "default": {}
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {},
                  "description": "How a typed belt looks, only the settings that differ from its type's. Dimensions are in metres: width, height (the top of the conveying surface), leg_spacing (0: no legs), guide_left and guide_right (guide height above the top, 0: none), roller_pitch, roller_diameter, pulley_diameter and strand_spacing. Choices: frame_color, drive_side, guide_style, roller_finish and belt_kind. chain_strands is a count. `openings` is a list of {side: left, right or both, start, end}: gaps in the side guides, in the unit of `length`."
                },
                "look_set": {
                  "anyOf": [
                    {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "type": "string",
                        "enum": [
                          "width",
                          "height",
                          "frame_color",
                          "leg_spacing",
                          "drive_side",
                          "guide_left",
                          "guide_right",
                          "guide_style",
                          "roller_pitch",
                          "roller_diameter",
                          "roller_finish",
                          "belt_kind",
                          "pulley_diameter",
                          "chain_strands",
                          "strand_spacing"
                        ]
                      },
                      "description": "The names of the look settings kept on this piece alone when a change spreads along its line of pieces. Never `openings`.",
                      "default": []
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "The names of the look settings kept on this piece alone when a change spreads along its line of pieces. Never `openings`."
                }
              },
              "required": [
                "speed",
                "spacing"
              ],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "CONVEYOR_TRANSFER",
          "description": "Conveyor transfer module that moves each load onto one of several exits: a pop-up transfer, a turntable or a lift, busy until the load reaches the next conveyor's photo-eye.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "CONVEYOR_TRANSFER"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "mechanism": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "popup",
                        "turntable",
                        "lift"
                      ],
                      "default": "popup",
                      "description": "\"popup\" (a pop-up transfer: chains or rollers lift and carry the load sideways), \"turntable\" (turns the load to its exit) or \"lift\" (carries the load to another level)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "popup",
                  "description": "\"popup\" (a pop-up transfer: chains or rollers lift and carry the load sideways), \"turntable\" (turns the load to its exit) or \"lift\" (carries the load to another level)."
                },
                "exits": {
                  "anyOf": [
                    {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "port": {
                            "type": "string",
                            "minLength": 1,
                            "description": "The exit's name; a link out of the module gives it as its source_port."
                          },
                          "angle": {
                            "type": "number",
                            "description": "Degrees from the entry heading, clockwise on screen: 0 straight on, 90 or -90 to a side."
                          }
                        },
                        "required": [
                          "port",
                          "angle"
                        ],
                        "additionalProperties": false
                      },
                      "default": [],
                      "description": "The module's exits, in exit order: {\"port\": <name a link gives as its source_port>, \"angle\": <degrees from the entry heading, clockwise on screen: 0 straight on, 90 or -90 to a side>}. Links without a port take the exits in this order. Empty: one straight exit \"out\"."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "The module's exits, in exit order: {\"port\": <name a link gives as its source_port>, \"angle\": <degrees from the entry heading, clockwise on screen: 0 straight on, 90 or -90 to a side>}. Links without a port take the exits in this order. Empty: one straight exit \"out\"."
                },
                "rule": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/route_rule",
                      "default": {},
                      "description": "Routing rule picking the exit, {\"kind\", \"exits\"?, \"conditions\"?, \"limit\"?, \"attribute\"?} as a Rule-mode DECIDE's; its exits default to the exits' ports. Empty: round robin over two or more exits, else the one exit. While every exit is at its limit the load waits on the module."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {},
                  "description": "Routing rule picking the exit, {\"kind\", \"exits\"?, \"conditions\"?, \"limit\"?, \"attribute\"?} as a Rule-mode DECIDE's; its exits default to the exits' ports. Empty: round robin over two or more exits, else the one exit. While every exit is at its limit the load waits on the module."
                },
                "lift_time": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "time",
                      "x-unit-key": "lift_time_unit",
                      "default": 0.1,
                      "description": "A pop-up's lift time each way, up before a side or angled exit and down after its handshake; a straight exit has none."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0.1,
                  "description": "A pop-up's lift time each way, up before a side or angled exit and down after its handshake; a straight exit has none.",
                  "x-quantity": "time",
                  "x-unit-key": "lift_time_unit"
                },
                "lift_time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "seconds",
                      "description": "Unit of `lift_time`: one of its quantity's units; \"base\" or absent means seconds, the unit its default was measured in."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "seconds",
                  "description": "Unit of `lift_time`: one of its quantity's units; \"base\" or absent means seconds, the unit its default was measured in."
                },
                "transfer_speed": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "speed",
                      "x-unit-key": "transfer_speed_unit",
                      "default": 0.0,
                      "description": "Speed of the chains or rollers that carry the load on the module. 0: the speed of the CONVEYOR feeding it."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0.0,
                  "description": "Speed of the chains or rollers that carry the load on the module. 0: the speed of the CONVEYOR feeding it.",
                  "x-quantity": "speed",
                  "x-unit-key": "transfer_speed_unit"
                },
                "transfer_speed_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(base|(mm|cm|m|km)/(ms|s|min|h|day|week|month|year))$",
                      "default": "m/s",
                      "description": "Unit of `transfer_speed`: one of its quantity's units; \"base\" or absent means m/s, the unit its default was measured in."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "m/s",
                  "description": "Unit of `transfer_speed`: one of its quantity's units; \"base\" or absent means m/s, the unit its default was measured in."
                },
                "cross_length": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "length",
                      "x-unit-key": "cross_length_unit",
                      "default": 0.6,
                      "description": "A pop-up's travel from the entry to the module edge on a side or angled exit, at transfer_speed."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0.6,
                  "description": "A pop-up's travel from the entry to the module edge on a side or angled exit, at transfer_speed.",
                  "x-quantity": "length",
                  "x-unit-key": "cross_length_unit"
                },
                "cross_length_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "millimeters",
                        "centimeters",
                        "meters",
                        "kilometers"
                      ],
                      "default": "meters",
                      "description": "Unit of `cross_length`: one of its quantity's units; \"base\" or absent means meters, the unit its default was measured in."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "meters",
                  "description": "Unit of `cross_length`: one of its quantity's units; \"base\" or absent means meters, the unit its default was measured in."
                },
                "entry_length": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "length",
                      "x-unit-key": "entry_length_unit",
                      "default": 0.0,
                      "description": "Travel from the entry to the load's position on the module, at transfer_speed, before it moves to its exit."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0.0,
                  "description": "Travel from the entry to the load's position on the module, at transfer_speed, before it moves to its exit.",
                  "x-quantity": "length",
                  "x-unit-key": "entry_length_unit"
                },
                "entry_length_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "millimeters",
                        "centimeters",
                        "meters",
                        "kilometers"
                      ],
                      "default": "meters",
                      "description": "Unit of `entry_length`: one of its quantity's units; \"base\" or absent means meters, the unit its default was measured in."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "meters",
                  "description": "Unit of `entry_length`: one of its quantity's units; \"base\" or absent means meters, the unit its default was measured in."
                },
                "turn_rate": {
                  "anyOf": [
                    {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "x-quantity": "rate",
                      "x-unit-key": "turn_rate_unit",
                      "default": 18.0,
                      "description": "A turntable's turning speed in degrees per time unit (per second by default); a turn of a degrees takes a / turn_rate + turn_ramp, the shorter way."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 18.0,
                  "description": "A turntable's turning speed in degrees per time unit (per second by default); a turn of a degrees takes a / turn_rate + turn_ramp, the shorter way.",
                  "x-quantity": "rate",
                  "x-unit-key": "turn_rate_unit"
                },
                "turn_rate_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "seconds",
                      "description": "Unit of `turn_rate`: one of its quantity's units; \"base\" or absent means seconds, the unit its default was measured in."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "seconds",
                  "description": "Unit of `turn_rate`: one of its quantity's units; \"base\" or absent means seconds, the unit its default was measured in."
                },
                "turn_ramp": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "time",
                      "x-unit-key": "turn_ramp_unit",
                      "default": 0.3,
                      "description": "Time a turntable's turn adds to speed up and slow down."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0.3,
                  "description": "Time a turntable's turn adds to speed up and slow down.",
                  "x-quantity": "time",
                  "x-unit-key": "turn_ramp_unit"
                },
                "turn_ramp_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "seconds",
                      "description": "Unit of `turn_ramp`: one of its quantity's units; \"base\" or absent means seconds, the unit its default was measured in."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "seconds",
                  "description": "Unit of `turn_ramp`: one of its quantity's units; \"base\" or absent means seconds, the unit its default was measured in."
                },
                "lift_height": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "length",
                      "x-unit-key": "lift_height_unit",
                      "default": 1.0,
                      "description": "A lift's travel between its two levels; the lift travels it up and back on every exit, whatever its angle."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 1.0,
                  "description": "A lift's travel between its two levels; the lift travels it up and back on every exit, whatever its angle.",
                  "x-quantity": "length",
                  "x-unit-key": "lift_height_unit"
                },
                "lift_height_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "millimeters",
                        "centimeters",
                        "meters",
                        "kilometers"
                      ],
                      "default": "meters",
                      "description": "Unit of `lift_height`: one of its quantity's units; \"base\" or absent means meters, the unit its default was measured in."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "meters",
                  "description": "Unit of `lift_height`: one of its quantity's units; \"base\" or absent means meters, the unit its default was measured in."
                },
                "lift_speed": {
                  "anyOf": [
                    {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "x-quantity": "speed",
                      "x-unit-key": "lift_speed_unit",
                      "default": 0.5,
                      "description": "A lift's travel speed; each way takes lift_height / lift_speed."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0.5,
                  "description": "A lift's travel speed; each way takes lift_height / lift_speed.",
                  "x-quantity": "speed",
                  "x-unit-key": "lift_speed_unit"
                },
                "lift_speed_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(base|(mm|cm|m|km)/(ms|s|min|h|day|week|month|year))$",
                      "default": "m/s",
                      "description": "Unit of `lift_speed`: one of its quantity's units; \"base\" or absent means m/s, the unit its default was measured in."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "m/s",
                  "description": "Unit of `lift_speed`: one of its quantity's units; \"base\" or absent means m/s, the unit its default was measured in."
                },
                "return_home": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": true,
                      "description": "A turntable turns back to its entry after each handshake, before the next load. False: it stays at the exit and turns back only once the next load waits."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": true,
                  "description": "A turntable turns back to its entry after each handshake, before the next load. False: it stays at the exit and turns back only once the next load waits."
                },
                "expose": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "True: the module writes `<module>.state` as a model variable, read with VAR(\"<module>.state\") in a HOLD condition or item code: 0 idle (or a load standing), 1 lifting (a pop-up's lift, a lift's travel), 2 transferring (the entry travel, a pop-up's cross, boarding the exit's piece until the handshake), 3 turning (a turntable)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "True: the module writes `<module>.state` as a model variable, read with VAR(\"<module>.state\") in a HOLD condition or item code: 0 idle (or a load standing), 1 lifting (a pop-up's lift, a lift's travel), 2 transferring (the entry travel, a pop-up's cross, boarding the exit's piece until the handshake), 3 turning (a turntable)."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "CREATE",
          "description": "Source of arrivals: creates parts, orders, customers or jobs at random intervals or on an hourly arrival schedule. Either samples the inter-arrival gap from `distribution` (`arrival_mode = \"Interarrival\"`, the classic behaviour) or drives a non-homogeneous Poisson process from an arrival `Schedule` by thinning (`arrival_mode = \"Schedule\"`). Every model needs at least one CREATE block.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "CREATE"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "e_type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "DEFAULT",
                      "description": "Entity type assigned to every entity this block creates."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "DEFAULT",
                  "description": "Entity type assigned to every entity this block creates."
                },
                "arrival_mode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "Interarrival",
                      "description": "\"Interarrival\": sample the gap from `distribution`. \"Schedule\": a non-homogeneous Poisson process driven by `schedule_name`. \"Orders\": release the model's declared orders, each at its own release time with its due date, quantity and routing."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Interarrival",
                  "description": "\"Interarrival\": sample the gap from `distribution`. \"Schedule\": a non-homogeneous Poisson process driven by `schedule_name`. \"Orders\": release the model's declared orders, each at its own release time with its due date, quantity and routing."
                },
                "schedule_name": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of an arrival Schedule to drive from, when arrival_mode is \"Schedule\"."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of an arrival Schedule to drive from, when arrival_mode is \"Schedule\"."
                },
                "distribution": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "Bernoulli",
                        "Beta",
                        "Binomial",
                        "BoundedNormal",
                        "Cauchy",
                        "ChiSquare",
                        "Constant",
                        "CustomExpression",
                        "DiscreteUniform",
                        "EmpiricalContinuous",
                        "EmpiricalDiscrete",
                        "Erlang",
                        "Exponential",
                        "FixedSchedule",
                        "Gamma",
                        "Geometric",
                        "Hypergeometric",
                        "InverseGaussian",
                        "JohnsonSB",
                        "JohnsonSU",
                        "LogLogistic",
                        "Lognormal",
                        "NegativeBinomial",
                        "Normal",
                        "PearsonTypeV",
                        "PearsonTypeVI",
                        "Poisson",
                        "Rayleigh",
                        "Triangular",
                        "Uniform",
                        "Weibull"
                      ],
                      "description": "Name of a registered distribution (see the distribution reference).",
                      "default": "Constant"
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Constant",
                  "description": "Name of a registered distribution (see the distribution reference)."
                },
                "dist_params": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/dist_params",
                      "x-quantity": "time",
                      "x-unit-key": "time_unit",
                      "default": {
                        "value": 1.0
                      },
                      "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {
                    "value": 1.0
                  },
                  "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential).",
                  "x-quantity": "time",
                  "x-unit-key": "time_unit"
                },
                "time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                },
                "entities_per_arrival": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1,
                      "x-quantity": "count",
                      "default": 1,
                      "description": "Number of entities created per arrival event."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 1,
                  "description": "Number of entities created per arrival event.",
                  "x-quantity": "count"
                },
                "max_arrivals": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "x-quantity": "count",
                      "default": 0,
                      "description": "Number of arrival events before this block stops; 0 = unlimited."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0,
                  "description": "Number of arrival events before this block stops; 0 = unlimited.",
                  "x-quantity": "count"
                },
                "start_time": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "time",
                      "x-unit-key": "start_time_unit",
                      "default": 0,
                      "description": "Simulation time of the first possible arrival."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0,
                  "description": "Simulation time of the first possible arrival.",
                  "x-quantity": "time",
                  "x-unit-key": "start_time_unit"
                },
                "start_time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit of `start_time`: \"base\" (the model's) or one of its quantity's units."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit of `start_time`: \"base\" (the model's) or one of its quantity's units."
                },
                "sequence": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of a declared routing sequence: every entity created here starts it at step 0. Empty = no routing. It is a literal name, not an expression -- use an ASSIGN to entity.sequence when the routing depends on the entity."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of a declared routing sequence: every entity created here starts it at step 0. Empty = no routing. It is a literal name, not an expression -- use an ASSIGN to entity.sequence when the routing depends on the entity."
                },
                "population": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of a declared population. When set, every entity created here also gets a new agent there (its statechart starts), and entity.agent points to it. Empty = off. A full population raises the same error a spawn action would."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of a declared population. When set, every entity created here also gets a new agent there (its statechart starts), and entity.agent points to it. Empty = off. A full population raises the same error a spawn action would."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "DECIDE",
          "description": "Routing decision: sends each part, order or customer down one of several links by percentage chance, by a condition (rework, type, size) or by a policy. \"Chance\" mode draws on the block's own RNG against `probs`, one probability per branch (not cumulative); \"Condition\" mode evaluates each of `conditions` in order and takes the first true one. Both modes take the last outgoing link as an ELSE branch when there is one more link than probs/conditions; otherwise an uncovered draw or condition fails loud rather than silently dropping the entity. \"Policy\" mode hands the choice to `ctx.controllers[policy]`: the number of actions is simply the number of outgoing links. A plain (synchronous) controller is called inline, in zero simulated time, exactly like Chance/Condition above. A `PausingController` (used by `nagasim.rl. SimEnv` to drive the policy from outside the run) is different: this block yields on a simpy event instead, so the whole simulation genuinely pauses until something resolves it. With no controller attached for `policy`, the block falls back to `fallback` (\"first\" / \"random\" / \"shortest\") so a Policy-mode model still runs and validates headless. \"Rule\" mode asks a routing rule (`rule`, core/routing.py) whose exits are the outgoing links; while every exit is at its limit the entity waits here, first come first served, and the rule runs again when an exit's count drops.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "DECIDE"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "mode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "Chance",
                      "description": "\"Chance\": branch by probability. \"Condition\": branch by expression. \"Policy\": branch by a controller attached to `policy`. \"Rule\": branch by the routing `rule`."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Chance",
                  "description": "\"Chance\": branch by probability. \"Condition\": branch by expression. \"Policy\": branch by a controller attached to `policy`. \"Rule\": branch by the routing `rule`."
                },
                "probs": {
                  "anyOf": [
                    {
                      "type": "array",
                      "x-quantity": "ratio",
                      "default": [],
                      "description": "One probability per branch, in link order (not cumulative), used when mode is \"Chance\"."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "One probability per branch, in link order (not cumulative), used when mode is \"Chance\".",
                  "x-quantity": "ratio"
                },
                "conditions": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [],
                      "description": "Ordered list of boolean expressions, used when mode is \"Condition\"."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "Ordered list of boolean expressions, used when mode is \"Condition\"."
                },
                "policy": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Decision-point name; used when mode is \"Policy\". Several DECIDE blocks may share one."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Decision-point name; used when mode is \"Policy\". Several DECIDE blocks may share one."
                },
                "observation": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [],
                      "description": "Expressions (evaluated with the arriving entity) forming the observation handed to the controller, when mode is \"Policy\"."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "Expressions (evaluated with the arriving entity) forming the observation handed to the controller, when mode is \"Policy\"."
                },
                "fallback": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "first",
                      "description": "\"first\"/\"random\"/\"shortest\": used when mode is \"Policy\" and no controller is attached for `policy`."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "first",
                  "description": "\"first\"/\"random\"/\"shortest\": used when mode is \"Policy\" and no controller is attached for `policy`."
                },
                "queue_exprs": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [],
                      "description": "One expression per outgoing link; used by fallback \"shortest\" to pick the argmin."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "One expression per outgoing link; used by fallback \"shortest\" to pick the argmin."
                },
                "rule": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/route_rule",
                      "default": {},
                      "description": "Routing rule, used when mode is \"Rule\": {\"kind\": \"fixed\", \"sequential\", \"cyclic\", \"round_robin\", \"least_loaded\", \"condition\", \"attribute\" or \"item\", \"exits\"?: one name per outgoing link (default: the linked blocks' names; \"name:target\" names the CONVEYOR a part counts as under way to), \"conditions\"?: for \"condition\", one per exit or one fewer (the last exit is the ELSE), \"limit\"?: parts under way to one exit at most (0: no limit), \"attribute\"?: for \"attribute\", the entity attribute naming the exit}. A part is under way from its routing until it reaches its exit's target piece (the first photo-eye of the last CONVEYOR of that branch, else that belt's end) or leaves a belt on its way there by a divert; name an exit \"L1:L1\" to stop the count at branch L1; an exit with no CONVEYOR counts nothing. With no true condition and no ELSE the run stops. While every exit is at its limit, parts wait here first come first served: one waiting for a full exit holds back those behind it. Empty: none."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {},
                  "description": "Routing rule, used when mode is \"Rule\": {\"kind\": \"fixed\", \"sequential\", \"cyclic\", \"round_robin\", \"least_loaded\", \"condition\", \"attribute\" or \"item\", \"exits\"?: one name per outgoing link (default: the linked blocks' names; \"name:target\" names the CONVEYOR a part counts as under way to), \"conditions\"?: for \"condition\", one per exit or one fewer (the last exit is the ELSE), \"limit\"?: parts under way to one exit at most (0: no limit), \"attribute\"?: for \"attribute\", the entity attribute naming the exit}. A part is under way from its routing until it reaches its exit's target piece (the first photo-eye of the last CONVEYOR of that branch, else that belt's end) or leaves a belt on its way there by a divert; name an exit \"L1:L1\" to stop the count at branch L1; an exit with no CONVEYOR counts nothing. With no true condition and no ELSE the run stops. While every exit is at its limit, parts wait here first come first served: one waiting for a full exit holds back those behind it. Empty: none."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "DELAY",
          "description": "Pure waiting time (transit, curing, travel, a pause) that holds the entity for a sampled duration without using any machine, operator or other resource. Seizes nothing, then forwards it. Use PROCESS instead when the delay is a resource-backed service.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "DELAY"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "distribution": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "Bernoulli",
                        "Beta",
                        "Binomial",
                        "BoundedNormal",
                        "Cauchy",
                        "ChiSquare",
                        "Constant",
                        "CustomExpression",
                        "DiscreteUniform",
                        "EmpiricalContinuous",
                        "EmpiricalDiscrete",
                        "Erlang",
                        "Exponential",
                        "FixedSchedule",
                        "Gamma",
                        "Geometric",
                        "Hypergeometric",
                        "InverseGaussian",
                        "JohnsonSB",
                        "JohnsonSU",
                        "LogLogistic",
                        "Lognormal",
                        "NegativeBinomial",
                        "Normal",
                        "PearsonTypeV",
                        "PearsonTypeVI",
                        "Poisson",
                        "Rayleigh",
                        "Triangular",
                        "Uniform",
                        "Weibull"
                      ],
                      "description": "Name of a registered distribution (see the distribution reference).",
                      "default": "Constant"
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Constant",
                  "description": "Name of a registered distribution (see the distribution reference)."
                },
                "dist_params": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/dist_params",
                      "x-quantity": "time",
                      "x-unit-key": "time_unit",
                      "default": {
                        "value": 0.0
                      },
                      "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {
                    "value": 0.0
                  },
                  "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential).",
                  "x-quantity": "time",
                  "x-unit-key": "time_unit"
                },
                "time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "DISPOSE",
          "description": "End of the flow: parts, orders or customers leave the system here, and their throughput time and holding cost are recorded. Waits an optional deletion delay, stamps deletion_time and throughput_time, accrues the entity type's WIP holding cost, and removes the entity from live_entities. Every model needs at least one DISPOSE block, and every flow that does not lead back to a CREATE must end in one (schema.validate_graph_structured).",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "DISPOSE"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "distribution": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "Bernoulli",
                        "Beta",
                        "Binomial",
                        "BoundedNormal",
                        "Cauchy",
                        "ChiSquare",
                        "Constant",
                        "CustomExpression",
                        "DiscreteUniform",
                        "EmpiricalContinuous",
                        "EmpiricalDiscrete",
                        "Erlang",
                        "Exponential",
                        "FixedSchedule",
                        "Gamma",
                        "Geometric",
                        "Hypergeometric",
                        "InverseGaussian",
                        "JohnsonSB",
                        "JohnsonSU",
                        "LogLogistic",
                        "Lognormal",
                        "NegativeBinomial",
                        "Normal",
                        "PearsonTypeV",
                        "PearsonTypeVI",
                        "Poisson",
                        "Rayleigh",
                        "Triangular",
                        "Uniform",
                        "Weibull"
                      ],
                      "description": "Name of a registered distribution (see the distribution reference).",
                      "default": "Constant"
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Constant",
                  "description": "Name of a registered distribution (see the distribution reference)."
                },
                "dist_params": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/dist_params",
                      "x-quantity": "time",
                      "x-unit-key": "time_unit",
                      "default": {
                        "value": 0.0
                      },
                      "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {
                    "value": 0.0
                  },
                  "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential).",
                  "x-quantity": "time",
                  "x-unit-key": "time_unit"
                },
                "time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                },
                "remove_agent": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "When true, also remove the entity's agent (AgentSystem.remove_agent) at disposal, if it still has a live one. An entity with none, or whose agent already died, is a no-op."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "When true, also remove the entity's agent (AgentSystem.remove_agent) at disposal, if it still has a live one. An entity with none, or whose agent already died, is a no-op."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "DUPLICATE",
          "description": "Makes copies of an entity, for example to model one job spawning several; the original goes on unchanged. All copies leave by the one output link: follow it with a DECIDE to send them down different branches. Forwards the original entity unchanged, then forwards `number_of_duplicates - 1` shallow copies, each a fresh Entity with its own id and name (never a deepcopy: that used to clone the entity manager and any live resource requests).",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "DUPLICATE"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "number_of_duplicates": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "x-quantity": "count",
                      "default": 2,
                      "description": "Total number of entities leaving this block, original included (>= 2)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 2,
                  "description": "Total number of entities leaving this block, original included (>= 2).",
                  "x-quantity": "count"
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "HOLD",
          "description": "Holds entities waiting in a queue until a named signal fires, a condition becomes true (a buffer has room, a machine is idle), or for good. Infinite mode never releases: the entity stays held in the store for the rest of the run. That is the documented semantics, not a leak.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "HOLD"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "mode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "Signal",
                      "description": "\"Signal\": wait for a named signal. \"Condition\": wait until every condition is true, re-checked whenever something it reads changes. \"Infinite\": never release."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Signal",
                  "description": "\"Signal\": wait for a named signal. \"Condition\": wait until every condition is true, re-checked whenever something it reads changes. \"Infinite\": never release."
                },
                "signal_name": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of the signal to wait for, when mode is \"Signal\"."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of the signal to wait for, when mode is \"Signal\"."
                },
                "conditions": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [],
                      "description": "Boolean expressions that must all be true to release, when mode is \"Condition\"."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "Boolean expressions that must all be true to release, when mode is \"Condition\"."
                },
                "scan_interval": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "x-quantity": "time",
                      "x-unit-key": "scan_interval_unit",
                      "default": 1.0,
                      "description": "Fallback re-check interval, when mode is \"Condition\": used only when a condition reads something no event announces (TNOW, TS(), RAND(), a level between events). Variables, NQ/NR/MR/IDLE, NS and threshold writes wake it at once."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 1.0,
                  "description": "Fallback re-check interval, when mode is \"Condition\": used only when a condition reads something no event announces (TNOW, TS(), RAND(), a level between events). Variables, NQ/NR/MR/IDLE, NS and threshold writes wake it at once.",
                  "x-quantity": "time",
                  "x-unit-key": "scan_interval_unit"
                },
                "scan_interval_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit of `scan_interval`: \"base\" (the model's) or one of its quantity's units."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit of `scan_interval`: \"base\" (the model's) or one of its quantity's units."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "LOGIC",
          "description": "Custom routing written in Python: sends each entity to one of several outgoing links by your own rule when chance or a condition is not enough. Routes an entity through a user-supplied, plain (non-BaseProcess) class defined in nagasim.core.custom_logic, or first in the module the caller passes as `run_model(logic=...)`. The class only needs an `execute(self, entity, ctx) -> int` method returning the outgoing link index; `execute(self, entity)` (no ctx) is also accepted.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "LOGIC"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "logic_class": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "SampleLogic",
                      "description": "Name of a class in nagasim.core.custom_logic implementing execute(entity, ctx) -> int."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "SampleLogic",
                  "description": "Name of a class in nagasim.core.custom_logic implementing execute(entity, ctx) -> int."
                },
                "hook": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Inside an item with code: call its on_entry (route by its answer) or its on_exit (then go on by the first link). Empty: use logic_class."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Inside an item with code: call its on_entry (route by its answer) or its on_exit (then go on by the first link). Empty: use logic_class."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "MATCH",
          "description": "Waits until one entity of each of several kinds is present (a part and its kit, an order and its customer), then releases them together. Match `number_to_match` *distinct* entity types; with `match_on` set, only entities whose value of that attribute is equal (Arena's attribute match). The arriving entity is always stored first, so it can never be dropped ; the match is then taken atomically from the stores, oldest waiting type first, FIFO within a type (and within a value).",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "MATCH"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "number_to_match": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 2,
                      "x-quantity": "count",
                      "default": 2,
                      "description": "Number of distinct entity types to match together."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 2,
                  "description": "Number of distinct entity types to match together.",
                  "x-quantity": "count"
                },
                "batch_option": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "True: combine the matched entities into one batch entity. False: forward them separately."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "True: combine the matched entities into one batch entity. False: forward them separately."
                },
                "batched_entity_type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "BATCH",
                      "description": "Entity type assigned to the batch entity, when batch_option is True."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "BATCH",
                  "description": "Entity type assigned to the batch entity, when batch_option is True."
                },
                "type_store_map": {
                  "anyOf": [
                    {
                      "type": "object",
                      "default": {},
                      "description": "Optional {e_type: store index} mapping; default is automatic assignment."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {},
                  "description": "Optional {e_type: store index} mapping; default is automatic assignment."
                },
                "match_on": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "An entity attribute (e.g. \"order\"); entities are matched only with others whose value of it is equal -- Arena's attribute match -- still one per distinct type, FIFO within a value. Empty = match by type alone."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "An entity attribute (e.g. \"order\"); entities are matched only with others whose value of it is equal -- Arena's attribute match -- still one per distinct type, FIFO within a value. Empty = match by type alone."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "MOTION",
          "description": "Robot or cobot station whose service is a cycle of timed moves, picks, places and tool changes, so cycle time comes from motion data, not a distribution. A station whose service is a cycle of motions -- moves timed from a motion profile (trapezoidal, payload-derated, slowed for human-robot collaboration) plus picks, places, tool changes, dwells and process steps. Seizing, setups, failures, preemption, workers and blocking are PROCESS's.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "MOTION"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "action": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "Seize Delay Release",
                      "description": "Which of seize/delay/release run: \"Seize Delay Release\", \"Seize Delay\", \"Delay Release\" or \"Delay\"."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Seize Delay Release",
                  "description": "Which of seize/delay/release run: \"Seize Delay Release\", \"Seize Delay\", \"Delay Release\" or \"Delay\"."
                },
                "profile": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of a record in \"motion_profiles\": speed, acceleration, payload derating and collaborative speed of whoever does the motions."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of a record in \"motion_profiles\": speed, acceleration, payload derating and collaborative speed of whoever does the motions."
                },
                "robot": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of a record in \"robots\": the robot whose ptp and lin moves are timed from its axis speeds and accelerations."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of a record in \"robots\": the robot whose ptp and lin moves are timed from its axis speeds and accelerations."
                },
                "targets": {
                  "anyOf": [
                    {
                      "type": "object",
                      "default": {},
                      "description": "Named targets of the ptp and lin moves, in cell coordinates (the floor plan's x and y in metres, z up): {\"joints\": [...]}, {\"xyz\": [x, y, z], \"yaw_deg\"?, \"rpy_deg\"?} with the tool pointing down unless rpy_deg says otherwise, or {\"on\": <block>, \"at\"?: centre|start|end, \"offset\"?: [dx, dy, dz], \"yaw_deg\"?} in that block's own frame: dx along its facing, dy toward the floor plan's +y side at rotation 0 (as x and y), dz up; or {\"belt\": <CONVEYOR>, \"divert\": <index>, \"z\"?: <metres above the floor>, \"yaw_deg\"?}, a part met on the moving belt, the target of the cycle's first move."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {},
                  "description": "Named targets of the ptp and lin moves, in cell coordinates (the floor plan's x and y in metres, z up): {\"joints\": [...]}, {\"xyz\": [x, y, z], \"yaw_deg\"?, \"rpy_deg\"?} with the tool pointing down unless rpy_deg says otherwise, or {\"on\": <block>, \"at\"?: centre|start|end, \"offset\"?: [dx, dy, dz], \"yaw_deg\"?} in that block's own frame: dx along its facing, dy toward the floor plan's +y side at rotation 0 (as x and y), dz up; or {\"belt\": <CONVEYOR>, \"divert\": <index>, \"z\"?: <metres above the floor>, \"yaw_deg\"?}, a part met on the moving belt, the target of the cycle's first move."
                },
                "hrc": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "none",
                      "description": "Human-robot collaboration: \"none\", \"collaborative\" (every move at the profile's collaborative_speed) or \"separation\" (a move starts at collaborative_speed when a worker-fleet unit is within the zone's radius of its node, by path or straight distance)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "none",
                  "description": "Human-robot collaboration: \"none\", \"collaborative\" (every move at the profile's collaborative_speed) or \"separation\" (a move starts at collaborative_speed when a worker-fleet unit is within the zone's radius of its node, by path or straight distance)."
                },
                "zone": {
                  "anyOf": [
                    {
                      "type": "object",
                      "default": {},
                      "description": "With hrc \"separation\": {\"name\": <a \"zones\" record>} -- the record's node and radius win -- or, with no name, {\"node\": <network node>, \"radius_m\": <metres>, \"measure\"?: \"path\"|\"straight\"}."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {},
                  "description": "With hrc \"separation\": {\"name\": <a \"zones\" record>} -- the record's node and radius win -- or, with no name, {\"node\": <network node>, \"radius_m\": <metres>, \"measure\"?: \"path\"|\"straight\"}."
                },
                "segments": {
                  "anyOf": [
                    {
                      "type": "array",
                      "x-quantity": "time",
                      "x-unit-key": "time_unit",
                      "default": [],
                      "description": "The cycle, in order: {\"kind\": \"move\", \"distance_m\", \"payload_kg\"?}, {\"kind\": pick|place|tool_change|dwell|process, \"time\": <number or expression>}, or a robot move {\"kind\": ptp|lin, \"to\": <target>, \"time\"?: <number, at least what the move needs>, \"payload_kg\"?}. The service time is their sum."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "The cycle, in order: {\"kind\": \"move\", \"distance_m\", \"payload_kg\"?}, {\"kind\": pick|place|tool_change|dwell|process, \"time\": <number or expression>}, or a robot move {\"kind\": ptp|lin, \"to\": <target>, \"time\"?: <number, at least what the move needs>, \"payload_kg\"?}. The service time is their sum.",
                  "x-quantity": "time",
                  "x-unit-key": "time_unit"
                },
                "time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "seconds",
                      "description": "Unit of every segment `time`: \"base\" or seconds/minutes/hours/days. Moves are always computed in seconds."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "seconds",
                  "description": "Unit of every segment `time`: \"base\" or seconds/minutes/hours/days. Moves are always computed in seconds."
                },
                "priority": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "default": 0,
                      "description": "Lower draws first when the resource's queue is contested. One number for the block (an entity attribute is not read): to rank entity types, route each to its own block on the shared resource."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0,
                  "description": "Lower draws first when the resource's queue is contested. One number for the block (an entity attribute is not read): to rank entity types, route each to its own block on the shared resource."
                },
                "quantity": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1,
                      "x-quantity": "count",
                      "default": 1,
                      "description": "Number of resource units requested/released."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 1,
                  "description": "Number of resource units requested/released.",
                  "x-quantity": "count"
                },
                "resource_name": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of the resource or resource set; required unless action is \"Delay\" or a worker_fleet does the work alone."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of the resource or resource set; required unless action is \"Delay\" or a worker_fleet does the work alone."
                },
                "setup": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "time",
                      "x-unit-key": "setup_unit",
                      "default": "",
                      "description": "Sequence-dependent setup time: an expression charged after the seize when this block's resource changes over, e.g. TABLE(\"Setups\", previous_key, key). `previous_key` and `key` are in scope here only. Empty = no setup."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Sequence-dependent setup time: an expression charged after the seize when this block's resource changes over, e.g. TABLE(\"Setups\", previous_key, key). `previous_key` and `key` are in scope here only. Empty = no setup.",
                  "x-quantity": "time",
                  "x-unit-key": "setup_unit"
                },
                "setup_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit of `setup`: \"base\" (the model's) or one of its quantity's units."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit of `setup`: \"base\" (the model's) or one of its quantity's units."
                },
                "setup_key": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Expression identifying what a job is set up for; empty uses the entity type. A setup is charged only when it differs from the previous job's key at this block."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Expression identifying what a job is set up for; empty uses the entity type. A setup is charged only when it differs from the previous job's key at this block."
                },
                "initial_key": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "What the resource is already set up for at time 0; empty means the first job is charged no setup."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "What the resource is already set up for at time 0; empty means the first job is charged no setup."
                },
                "setup_cost": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "money",
                      "default": "",
                      "description": "Money charged ONCE PER CHANGEOVER, not per job -- an expression like TABLE(\"Changeover cost\", previous_key, key), with `previous_key` and `key` in scope exactly as in \"setup\". It becomes an event cost item named after the block, joins Total Cost and resets at warm-up. Empty = free changeovers."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Money charged ONCE PER CHANGEOVER, not per job -- an expression like TABLE(\"Changeover cost\", previous_key, key), with `previous_key` and `key` in scope exactly as in \"setup\". It becomes an event cost item named after the block, joins Total Cost and resets at warm-up. Empty = free changeovers.",
                  "x-quantity": "money"
                },
                "setup_cost_category": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Cost category the changeover cost is grouped under in the cost_summary frame (default \"Changeover\")."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Cost category the changeover cost is grouped under in the cost_summary frame (default \"Changeover\")."
                },
                "balk_if": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Condition evaluated on arrival; when true the entity does not join the queue and leaves by the second outgoing link, e.g. \"queue_length >= 5\". `queue_length` is the queue it would have joined. Empty = never balk."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Condition evaluated on arrival; when true the entity does not join the queue and leaves by the second outgoing link, e.g. \"queue_length >= 5\". `queue_length` is the queue it would have joined. Empty = never balk."
                },
                "renege_after": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "time",
                      "x-unit-key": "renege_time_unit",
                      "default": "",
                      "description": "How long the entity waits before giving up, e.g. \"EXPO(15)\" or \"entity.patience\"; it then leaves by the second outgoing link. A grant in the same instant wins. Empty = wait for ever."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "How long the entity waits before giving up, e.g. \"EXPO(15)\" or \"entity.patience\"; it then leaves by the second outgoing link. A grant in the same instant wins. Empty = wait for ever.",
                  "x-quantity": "time",
                  "x-unit-key": "renege_time_unit"
                },
                "renege_time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit `renege_after` is expressed in: \"base\" (the model's own unit) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit `renege_after` is expressed in: \"base\" (the model's own unit) or one of seconds/minutes/hours/days."
                },
                "preempt": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "When no unit is free, interrupt the lowest-priority job in service on this resource (a strictly higher priority wins). Only with action \"Seize Delay Release\", and not on a resource set."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "When no unit is free, interrupt the lowest-priority job in service on this resource (a strictly higher priority wins). Only with action \"Seize Delay Release\", and not on a resource set."
                },
                "queue_capacity": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "x-quantity": "count",
                      "default": 0,
                      "description": "Places in this station's own input queue. 0 (the default) is an unlimited queue; with a positive value a part takes a place on arrival and frees it when service starts, so an upstream machine with nowhere to put its finished part stays blocked. `balk_if` sees the places taken as `queue_length`, which is how a LOSS system is written instead of a blocking one."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0,
                  "description": "Places in this station's own input queue. 0 (the default) is an unlimited queue; with a positive value a part takes a place on arrival and frees it when service starts, so an upstream machine with nowhere to put its finished part stays blocked. `balk_if` sees the places taken as `queue_length`, which is how a LOSS system is written instead of a blocking one.",
                  "x-quantity": "count"
                },
                "hold_until_space": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "Blocking BEFORE service: after seizing, do not start the job until the downstream space has a free place, and reserve it for this part. The station waits idle (reported as Blocked %). Needs a downstream BUFFER with capacity > 0 or a SEIZE/PROCESS with queue_capacity > 0. Off (the default) is blocking AFTER service."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "Blocking BEFORE service: after seizing, do not start the job until the downstream space has a free place, and reserve it for this part. The station waits idle (reported as Blocked %). Needs a downstream BUFFER with capacity > 0 or a SEIZE/PROCESS with queue_capacity > 0. Off (the default) is blocking AFTER service."
                },
                "space_of": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Which block's space `hold_until_space` reserves in; empty = the target of this block's first outgoing link. The part must reach that block."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Which block's space `hold_until_space` reserves in; empty = the target of this block's first outgoing link. The part must reach that block."
                },
                "worker_fleet": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "A fleet with kind \"worker\". After this block's own resource (if any) is seized, a worker is requested, walks EMPTY on the network to `node`, and is held for the service. Empty = no worker."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "A fleet with kind \"worker\". After this block's own resource (if any) is seized, a worker is requested, walks EMPTY on the network to `node`, and is held for the service. Empty = no worker."
                },
                "worker_skill": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Only a worker whose skills contain this name may serve; empty = any worker of the fleet."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Only a worker whose skills contain this name may serve; empty = any worker of the fleet."
                },
                "node": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Network node this block sits on; required with worker_fleet (where the worker walks to)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Network node this block sits on; required with worker_fleet (where the worker walks to)."
                },
                "worker_when_blocked": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "leaves",
                      "description": "What the worker does while this station holds a finished part that nothing downstream has room for. \"leaves\" (the default): the worker is free when the work ends. \"stays\": the worker waits with the part and is free when it is accepted downstream. The same either way where nothing downstream is finite."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "leaves",
                  "description": "What the worker does while this station holds a finished part that nothing downstream has room for. \"leaves\" (the default): the worker is free when the work ends. \"stays\": the worker waits with the part and is free when it is accepted downstream. The same either way where nothing downstream is finite."
                },
                "on_preempt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "resume",
                      "description": "What THIS block's job does when something interrupts it and it gets the resource back: \"resume\" (finish the remaining time) or \"restart\" (the whole service again, same sample). Set on the block being interrupted, not on the one doing the interrupting."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "resume",
                  "description": "What THIS block's job does when something interrupts it and it gets the resource back: \"resume\" (finish the remaining time) or \"restart\" (the whole service again, same sample). Set on the block being interrupted, not on the one doing the interrupting."
                },
                "resample": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "With on_preempt \"restart\" only: draw a FRESH service time from this block's own random stream on each restart, instead of repeating the same sample. Off (the default) repeats it."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "With on_preempt \"restart\" only: draw a FRESH service time from this block's own random stream on each restart, instead of repeating the same sample. Off (the default) repeats it."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "PROCESS",
          "description": "Machine, workstation or service step: a part, order or customer waits for a resource (machine, operator, server), is processed for a time, then frees it. Seize, delay and release fused in one block; `action` selects which of the three steps run (\"Seize Delay Release\", \"Seize Delay\", \"Delay Release\", \"Delay\"), so the same block type covers a self-contained service, the start or end of a hold split across two blocks, or a plain timed delay. The most-used block for a simple resource-backed service step.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "PROCESS"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "action": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "Seize Delay Release",
                      "description": "Which of seize/delay/release run: \"Seize Delay Release\", \"Seize Delay\", \"Delay Release\" or \"Delay\"."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Seize Delay Release",
                  "description": "Which of seize/delay/release run: \"Seize Delay Release\", \"Seize Delay\", \"Delay Release\" or \"Delay\"."
                },
                "distribution": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "Bernoulli",
                        "Beta",
                        "Binomial",
                        "BoundedNormal",
                        "Cauchy",
                        "ChiSquare",
                        "Constant",
                        "CustomExpression",
                        "DiscreteUniform",
                        "EmpiricalContinuous",
                        "EmpiricalDiscrete",
                        "Erlang",
                        "Exponential",
                        "FixedSchedule",
                        "Gamma",
                        "Geometric",
                        "Hypergeometric",
                        "InverseGaussian",
                        "JohnsonSB",
                        "JohnsonSU",
                        "LogLogistic",
                        "Lognormal",
                        "NegativeBinomial",
                        "Normal",
                        "PearsonTypeV",
                        "PearsonTypeVI",
                        "Poisson",
                        "Rayleigh",
                        "Triangular",
                        "Uniform",
                        "Weibull"
                      ],
                      "description": "Name of a registered distribution (see the distribution reference).",
                      "default": "Constant"
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Constant",
                  "description": "Name of a registered distribution (see the distribution reference)."
                },
                "dist_params": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/dist_params",
                      "x-quantity": "time",
                      "x-unit-key": "time_unit",
                      "default": {
                        "value": 0.0
                      },
                      "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {
                    "value": 0.0
                  },
                  "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential).",
                  "x-quantity": "time",
                  "x-unit-key": "time_unit"
                },
                "time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                },
                "priority": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "default": 0,
                      "description": "Lower draws first when the resource's queue is contested. One number for the block (an entity attribute is not read): to rank entity types, route each to its own block on the shared resource."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0,
                  "description": "Lower draws first when the resource's queue is contested. One number for the block (an entity attribute is not read): to rank entity types, route each to its own block on the shared resource."
                },
                "quantity": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1,
                      "x-quantity": "count",
                      "default": 1,
                      "description": "Number of resource units requested/released."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 1,
                  "description": "Number of resource units requested/released.",
                  "x-quantity": "count"
                },
                "resource_name": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of the resource or resource set; required unless action is \"Delay\" or a worker_fleet does the work alone."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of the resource or resource set; required unless action is \"Delay\" or a worker_fleet does the work alone."
                },
                "setup": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "time",
                      "x-unit-key": "setup_unit",
                      "default": "",
                      "description": "Sequence-dependent setup time: an expression charged after the seize when this block's resource changes over, e.g. TABLE(\"Setups\", previous_key, key). `previous_key` and `key` are in scope here only. Empty = no setup."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Sequence-dependent setup time: an expression charged after the seize when this block's resource changes over, e.g. TABLE(\"Setups\", previous_key, key). `previous_key` and `key` are in scope here only. Empty = no setup.",
                  "x-quantity": "time",
                  "x-unit-key": "setup_unit"
                },
                "setup_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit of `setup`: \"base\" (the model's) or one of its quantity's units."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit of `setup`: \"base\" (the model's) or one of its quantity's units."
                },
                "setup_key": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Expression identifying what a job is set up for; empty uses the entity type. A setup is charged only when it differs from the previous job's key at this block."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Expression identifying what a job is set up for; empty uses the entity type. A setup is charged only when it differs from the previous job's key at this block."
                },
                "initial_key": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "What the resource is already set up for at time 0; empty means the first job is charged no setup."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "What the resource is already set up for at time 0; empty means the first job is charged no setup."
                },
                "setup_cost": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "money",
                      "default": "",
                      "description": "Money charged ONCE PER CHANGEOVER, not per job -- an expression like TABLE(\"Changeover cost\", previous_key, key), with `previous_key` and `key` in scope exactly as in \"setup\". It becomes an event cost item named after the block, joins Total Cost and resets at warm-up. Empty = free changeovers."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Money charged ONCE PER CHANGEOVER, not per job -- an expression like TABLE(\"Changeover cost\", previous_key, key), with `previous_key` and `key` in scope exactly as in \"setup\". It becomes an event cost item named after the block, joins Total Cost and resets at warm-up. Empty = free changeovers.",
                  "x-quantity": "money"
                },
                "setup_cost_category": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Cost category the changeover cost is grouped under in the cost_summary frame (default \"Changeover\")."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Cost category the changeover cost is grouped under in the cost_summary frame (default \"Changeover\")."
                },
                "balk_if": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Condition evaluated on arrival; when true the entity does not join the queue and leaves by the second outgoing link, e.g. \"queue_length >= 5\". `queue_length` is the queue it would have joined. Empty = never balk."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Condition evaluated on arrival; when true the entity does not join the queue and leaves by the second outgoing link, e.g. \"queue_length >= 5\". `queue_length` is the queue it would have joined. Empty = never balk."
                },
                "renege_after": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "time",
                      "x-unit-key": "renege_time_unit",
                      "default": "",
                      "description": "How long the entity waits before giving up, e.g. \"EXPO(15)\" or \"entity.patience\"; it then leaves by the second outgoing link. A grant in the same instant wins. Empty = wait for ever."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "How long the entity waits before giving up, e.g. \"EXPO(15)\" or \"entity.patience\"; it then leaves by the second outgoing link. A grant in the same instant wins. Empty = wait for ever.",
                  "x-quantity": "time",
                  "x-unit-key": "renege_time_unit"
                },
                "renege_time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit `renege_after` is expressed in: \"base\" (the model's own unit) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit `renege_after` is expressed in: \"base\" (the model's own unit) or one of seconds/minutes/hours/days."
                },
                "preempt": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "When no unit is free, interrupt the lowest-priority job in service on this resource (a strictly higher priority wins). Only with action \"Seize Delay Release\", and not on a resource set."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "When no unit is free, interrupt the lowest-priority job in service on this resource (a strictly higher priority wins). Only with action \"Seize Delay Release\", and not on a resource set."
                },
                "queue_capacity": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "x-quantity": "count",
                      "default": 0,
                      "description": "Places in this station's own input queue. 0 (the default) is an unlimited queue; with a positive value a part takes a place on arrival and frees it when service starts, so an upstream machine with nowhere to put its finished part stays blocked. `balk_if` sees the places taken as `queue_length`, which is how a LOSS system is written instead of a blocking one."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0,
                  "description": "Places in this station's own input queue. 0 (the default) is an unlimited queue; with a positive value a part takes a place on arrival and frees it when service starts, so an upstream machine with nowhere to put its finished part stays blocked. `balk_if` sees the places taken as `queue_length`, which is how a LOSS system is written instead of a blocking one.",
                  "x-quantity": "count"
                },
                "hold_until_space": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "Blocking BEFORE service: after seizing, do not start the job until the downstream space has a free place, and reserve it for this part. The station waits idle (reported as Blocked %). Needs a downstream BUFFER with capacity > 0 or a SEIZE/PROCESS with queue_capacity > 0. Off (the default) is blocking AFTER service."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "Blocking BEFORE service: after seizing, do not start the job until the downstream space has a free place, and reserve it for this part. The station waits idle (reported as Blocked %). Needs a downstream BUFFER with capacity > 0 or a SEIZE/PROCESS with queue_capacity > 0. Off (the default) is blocking AFTER service."
                },
                "space_of": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Which block's space `hold_until_space` reserves in; empty = the target of this block's first outgoing link. The part must reach that block."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Which block's space `hold_until_space` reserves in; empty = the target of this block's first outgoing link. The part must reach that block."
                },
                "worker_fleet": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "A fleet with kind \"worker\". After this block's own resource (if any) is seized, a worker is requested, walks EMPTY on the network to `node`, and is held for the service. Empty = no worker."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "A fleet with kind \"worker\". After this block's own resource (if any) is seized, a worker is requested, walks EMPTY on the network to `node`, and is held for the service. Empty = no worker."
                },
                "worker_skill": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Only a worker whose skills contain this name may serve; empty = any worker of the fleet."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Only a worker whose skills contain this name may serve; empty = any worker of the fleet."
                },
                "node": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Network node this block sits on; required with worker_fleet (where the worker walks to)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Network node this block sits on; required with worker_fleet (where the worker walks to)."
                },
                "worker_when_blocked": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "leaves",
                      "description": "What the worker does while this station holds a finished part that nothing downstream has room for. \"leaves\" (the default): the worker is free when the work ends. \"stays\": the worker waits with the part and is free when it is accepted downstream. The same either way where nothing downstream is finite."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "leaves",
                  "description": "What the worker does while this station holds a finished part that nothing downstream has room for. \"leaves\" (the default): the worker is free when the work ends. \"stays\": the worker waits with the part and is free when it is accepted downstream. The same either way where nothing downstream is finite."
                },
                "on_preempt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "resume",
                      "description": "What THIS block's job does when something interrupts it and it gets the resource back: \"resume\" (finish the remaining time) or \"restart\" (the whole service again, same sample). Set on the block being interrupted, not on the one doing the interrupting."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "resume",
                  "description": "What THIS block's job does when something interrupts it and it gets the resource back: \"resume\" (finish the remaining time) or \"restart\" (the whole service again, same sample). Set on the block being interrupted, not on the one doing the interrupting."
                },
                "resample": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "With on_preempt \"restart\" only: draw a FRESH service time from this block's own random stream on each restart, instead of repeating the same sample. Off (the default) repeats it."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "With on_preempt \"restart\" only: draw a FRESH service time from this block's own random stream on each restart, instead of repeating the same sample. Off (the default) repeats it."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "RECORD",
          "description": "Counts or measures something as entities pass (a count, a time between arrivals, a defect, a cost) in a user-named statistic, without delaying them. A zero-time block that updates a user-defined statistic and forwards the entity unchanged. Statistics live on the simulation context (`ctx.user_stats`), keyed by `stat_name`, so two RECORD blocks writing to the same name share one collector -- core/schema/ rejects a same-name pair with different `kind`s at load time, before a run can hit the mismatch here. `expr` is the increment for \"count\", the observed value for \"tally\", the new level for \"time_persistent\", and ignored for \"time_between\" (it tallies the gap since the statistic's last arrival; the first arrival records nothing). `kind=\"cost\"` is the one kind that builds no collector: `expr` is a MONEY amount added to the cost item `stat_name` every time an entity passes -- an ordering cost, a changeover cost, a lost-sale penalty. It joins the model's Total Cost and is itemised in the `cost_summary` frame.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "RECORD"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "stat_name": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of the user statistic; two RECORD blocks with the same name share one collector."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of the user statistic; two RECORD blocks with the same name share one collector."
                },
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "count",
                      "description": "\"count\" (running total of expr), \"tally\" (mean of expr), \"time_between\" (mean gap between arrivals), \"time_persistent\" (time-average level of expr) or \"cost\" (adds expr to a named cost item and to Total Cost)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "count",
                  "description": "\"count\" (running total of expr), \"tally\" (mean of expr), \"time_between\" (mean gap between arrivals), \"time_persistent\" (time-average level of expr) or \"cost\" (adds expr to a named cost item and to Total Cost)."
                },
                "expr": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "1",
                      "description": "Expression evaluated at each arrival; ignored for kind=time_between."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "1",
                  "description": "Expression evaluated at each arrival; ignored for kind=time_between."
                },
                "category": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Cost category this item is grouped under in the cost_summary frame; used by kind=cost only."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Cost category this item is grouped under in the cost_summary frame; used by kind=cost only."
                }
              },
              "required": [
                "stat_name"
              ],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "RELEASE",
          "description": "Frees a machine, operator or other resource that an earlier SEIZE gave the entity, after an optional delay. Release everything the entity holds under `resource_name` (a plain resource or a set member), after an optional delay. Pairs with SEIZE for a hold split across two blocks; raises if the entity never seized that name (fail-loud by design).",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "RELEASE"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "distribution": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "Bernoulli",
                        "Beta",
                        "Binomial",
                        "BoundedNormal",
                        "Cauchy",
                        "ChiSquare",
                        "Constant",
                        "CustomExpression",
                        "DiscreteUniform",
                        "EmpiricalContinuous",
                        "EmpiricalDiscrete",
                        "Erlang",
                        "Exponential",
                        "FixedSchedule",
                        "Gamma",
                        "Geometric",
                        "Hypergeometric",
                        "InverseGaussian",
                        "JohnsonSB",
                        "JohnsonSU",
                        "LogLogistic",
                        "Lognormal",
                        "NegativeBinomial",
                        "Normal",
                        "PearsonTypeV",
                        "PearsonTypeVI",
                        "Poisson",
                        "Rayleigh",
                        "Triangular",
                        "Uniform",
                        "Weibull"
                      ],
                      "description": "Name of a registered distribution (see the distribution reference).",
                      "default": "Constant"
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Constant",
                  "description": "Name of a registered distribution (see the distribution reference)."
                },
                "dist_params": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/dist_params",
                      "x-quantity": "time",
                      "x-unit-key": "time_unit",
                      "default": {
                        "value": 0.0
                      },
                      "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {
                    "value": 0.0
                  },
                  "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential).",
                  "x-quantity": "time",
                  "x-unit-key": "time_unit"
                },
                "time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                },
                "resource_name": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of the resource or resource set to release."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of the resource or resource set to release."
                },
                "worker_when_blocked": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "leaves",
                      "description": "What the worker does while this station holds a finished part that nothing downstream has room for. \"leaves\" (the default): the worker is free when the work ends. \"stays\": the worker waits with the part and is free when it is accepted downstream. The same either way where nothing downstream is finite."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "leaves",
                  "description": "What the worker does while this station holds a finished part that nothing downstream has room for. \"leaves\" (the default): the worker is free when the work ends. \"stays\": the worker waits with the part and is free when it is accepted downstream. The same either way where nothing downstream is finite."
                }
              },
              "required": [
                "resource_name"
              ],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "ROUTE",
          "description": "Sends a part or job to the next station on its own routing sequence (a job-shop or multi-step route) instead of along a fixed link. Send the entity to the next station of its `sequence`, applying that step's attribute values and advancing its `step` index; once the sequence is finished, forward along the block's own outgoing link instead.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "ROUTE"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "distribution": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "Bernoulli",
                        "Beta",
                        "Binomial",
                        "BoundedNormal",
                        "Cauchy",
                        "ChiSquare",
                        "Constant",
                        "CustomExpression",
                        "DiscreteUniform",
                        "EmpiricalContinuous",
                        "EmpiricalDiscrete",
                        "Erlang",
                        "Exponential",
                        "FixedSchedule",
                        "Gamma",
                        "Geometric",
                        "Hypergeometric",
                        "InverseGaussian",
                        "JohnsonSB",
                        "JohnsonSU",
                        "LogLogistic",
                        "Lognormal",
                        "NegativeBinomial",
                        "Normal",
                        "PearsonTypeV",
                        "PearsonTypeVI",
                        "Poisson",
                        "Rayleigh",
                        "Triangular",
                        "Uniform",
                        "Weibull"
                      ],
                      "description": "Name of a registered distribution (see the distribution reference).",
                      "default": "Constant"
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Constant",
                  "description": "Name of a registered distribution (see the distribution reference)."
                },
                "dist_params": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/dist_params",
                      "x-quantity": "time",
                      "x-unit-key": "time_unit",
                      "default": {
                        "value": 0.0
                      },
                      "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {
                    "value": 0.0
                  },
                  "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential).",
                  "x-quantity": "time",
                  "x-unit-key": "time_unit"
                },
                "time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                },
                "travel": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "time",
                      "description": "How the transfer time is found: \"time\" uses the distribution above, \"network\" divides the shortest path between the two stations' nodes by `speed`."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "time",
                  "description": "How the transfer time is found: \"time\" uses the distribution above, \"network\" divides the shortest path between the two stations' nodes by `speed`."
                },
                "speed": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "speed",
                      "x-unit-key": "speed_unit",
                      "default": "",
                      "description": "Travel speed for `travel = \"network\"`, an expression in distance per time unit (e.g. 1.2, or `entity.walk_speed`). Empty means 1."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Travel speed for `travel = \"network\"`, an expression in distance per time unit (e.g. 1.2, or `entity.walk_speed`). Empty means 1.",
                  "x-quantity": "speed",
                  "x-unit-key": "speed_unit"
                },
                "speed_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^(base|(mm|cm|m|km)/(ms|s|min|h|day|week|month|year))$",
                      "default": "base",
                      "description": "Unit of `speed`: \"base\" (the model's) or one of its quantity's units."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit of `speed`: \"base\" (the model's) or one of its quantity's units."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "SEIZE",
          "description": "Waits in a queue for a machine, operator, vehicle or other resource, takes it and keeps it until a later RELEASE, so one resource can span several steps. Request `quantity` units of `resource_name` (a plain resource or a resource set), honouring priority and the resource's queue discipline, then hold the block's own delay before forwarding. Pairs with RELEASE for a hold split across two blocks; PROCESS fuses the common Seize-Delay- Release case into one block. `balk_if` and `renege_after` let an entity leave without ever being served, by the block's second outgoing link. Preemption is PROCESS only: the service a SEIZE starts is finished somewhere else, so there is nothing here that could safely be interrupted.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "SEIZE"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "distribution": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "Bernoulli",
                        "Beta",
                        "Binomial",
                        "BoundedNormal",
                        "Cauchy",
                        "ChiSquare",
                        "Constant",
                        "CustomExpression",
                        "DiscreteUniform",
                        "EmpiricalContinuous",
                        "EmpiricalDiscrete",
                        "Erlang",
                        "Exponential",
                        "FixedSchedule",
                        "Gamma",
                        "Geometric",
                        "Hypergeometric",
                        "InverseGaussian",
                        "JohnsonSB",
                        "JohnsonSU",
                        "LogLogistic",
                        "Lognormal",
                        "NegativeBinomial",
                        "Normal",
                        "PearsonTypeV",
                        "PearsonTypeVI",
                        "Poisson",
                        "Rayleigh",
                        "Triangular",
                        "Uniform",
                        "Weibull"
                      ],
                      "description": "Name of a registered distribution (see the distribution reference).",
                      "default": "Constant"
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Constant",
                  "description": "Name of a registered distribution (see the distribution reference)."
                },
                "dist_params": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/dist_params",
                      "x-quantity": "time",
                      "x-unit-key": "time_unit",
                      "default": {
                        "value": 0.0
                      },
                      "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {
                    "value": 0.0
                  },
                  "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential).",
                  "x-quantity": "time",
                  "x-unit-key": "time_unit"
                },
                "time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                },
                "priority": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "default": 0,
                      "description": "Lower draws first when the resource's queue is contested. One number for the block (an entity attribute is not read): to rank entity types, route each to its own block on the shared resource."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0,
                  "description": "Lower draws first when the resource's queue is contested. One number for the block (an entity attribute is not read): to rank entity types, route each to its own block on the shared resource."
                },
                "quantity": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1,
                      "x-quantity": "count",
                      "default": 1,
                      "description": "Number of resource units requested."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 1,
                  "description": "Number of resource units requested.",
                  "x-quantity": "count"
                },
                "resource_name": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of the resource or resource set to seize."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of the resource or resource set to seize."
                },
                "queue_capacity": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "x-quantity": "count",
                      "default": 0,
                      "description": "Places in this block's own input queue. 0 (the default) is an unlimited queue; with a positive value a part takes a place on arrival and frees it when it seizes, so an upstream machine with nowhere to put its finished part stays blocked."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0,
                  "description": "Places in this block's own input queue. 0 (the default) is an unlimited queue; with a positive value a part takes a place on arrival and frees it when it seizes, so an upstream machine with nowhere to put its finished part stays blocked.",
                  "x-quantity": "count"
                },
                "hold_until_space": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "Blocking BEFORE service: after seizing, do not start the job until the downstream space has a free place, and reserve it for this part. The station waits idle (reported as Blocked %). Needs a downstream BUFFER with capacity > 0 or a SEIZE/PROCESS with queue_capacity > 0. Off (the default) is blocking AFTER service."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "Blocking BEFORE service: after seizing, do not start the job until the downstream space has a free place, and reserve it for this part. The station waits idle (reported as Blocked %). Needs a downstream BUFFER with capacity > 0 or a SEIZE/PROCESS with queue_capacity > 0. Off (the default) is blocking AFTER service."
                },
                "space_of": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Which block's space `hold_until_space` reserves in; empty = the target of this block's first outgoing link. The part must reach that block."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Which block's space `hold_until_space` reserves in; empty = the target of this block's first outgoing link. The part must reach that block."
                },
                "worker_fleet": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "A fleet with kind \"worker\". After this block's own resource (if any) is seized, a worker is requested, walks EMPTY on the network to `node`, and is held for the service. Empty = no worker."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "A fleet with kind \"worker\". After this block's own resource (if any) is seized, a worker is requested, walks EMPTY on the network to `node`, and is held for the service. Empty = no worker."
                },
                "worker_skill": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Only a worker whose skills contain this name may serve; empty = any worker of the fleet."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Only a worker whose skills contain this name may serve; empty = any worker of the fleet."
                },
                "node": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Network node this block sits on; required with worker_fleet (where the worker walks to)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Network node this block sits on; required with worker_fleet (where the worker walks to)."
                },
                "balk_if": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Condition evaluated on arrival; when true the entity does not join the queue and leaves by the second outgoing link, e.g. \"queue_length >= 5\". `queue_length` is the queue it would have joined. Empty = never balk."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Condition evaluated on arrival; when true the entity does not join the queue and leaves by the second outgoing link, e.g. \"queue_length >= 5\". `queue_length` is the queue it would have joined. Empty = never balk."
                },
                "renege_after": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "time",
                      "x-unit-key": "renege_time_unit",
                      "default": "",
                      "description": "How long the entity waits before giving up, e.g. \"EXPO(15)\" or \"entity.patience\"; it then leaves by the second outgoing link. A grant in the same instant wins. Empty = wait for ever."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "How long the entity waits before giving up, e.g. \"EXPO(15)\" or \"entity.patience\"; it then leaves by the second outgoing link. A grant in the same instant wins. Empty = wait for ever.",
                  "x-quantity": "time",
                  "x-unit-key": "renege_time_unit"
                },
                "renege_time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit `renege_after` is expressed in: \"base\" (the model's own unit) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit `renege_after` is expressed in: \"base\" (the model's own unit) or one of seconds/minutes/hours/days."
                }
              },
              "required": [
                "resource_name"
              ],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "SEND",
          "description": "Sends a message, with an optional payload, to agents of an agent-based model so they can react, for example a customer calling a driver.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "SEND"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "message": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of the message; an agent's \"message\" transition matches it."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of the message; an agent's \"message\" transition matches it."
                },
                "to": {
                  "anyOf": [
                    {
                      "default": "entity.agent",
                      "description": "Recipients: an expression giving an agent (entity.agent, AGENT(\"Pop\", i)) or {\"population\": \"Pop\"[, \"where\": \"<condition on self>\"][, \"random\": true]}."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "entity.agent",
                  "description": "Recipients: an expression giving an agent (entity.agent, AGENT(\"Pop\", i)) or {\"population\": \"Pop\"[, \"where\": \"<condition on self>\"][, \"random\": true]}."
                },
                "payload": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Optional expression evaluated for the entity; the receiving transition reads it as `payload`."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Optional expression evaluated for the entity; the receiving transition reads it as `payload`."
                }
              },
              "required": [
                "message"
              ],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "SEPARATE",
          "description": "Splits a batch, pallet or lot back into its individual parts, orders or customers, optionally copying the batch's attributes to each. Parameters ---------- mode : {'retain','all','specific'} - 'retain' children keep their own attributes - 'all' copy *all* parent attributes to each child - 'specific' copy only the names listed in *attrs* attrs : list[str] | str | None Comma-separated string or list used when *mode* == 'specific'. carrier : {'dispose','keep'} 'keep': the parent is a CARRIER (a truck) that lives on. Its members leave one at a time on exit 0, each after its own `member_time`, and the carrier leaves on exit 1 once it is empty. release_order : {'pattern','fifo','lifo'} 'pattern' (the default): a pallet loaded by a pallet pattern comes off top layer first, its slots in reverse order; any other carrier fifo.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "SEPARATE"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "mode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "Retain original entity values",
                      "description": "How children get their attributes: retain their own values, take all of the parent's, or take only the ones listed in attrs."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Retain original entity values",
                  "description": "How children get their attributes: retain their own values, take all of the parent's, or take only the ones listed in attrs."
                },
                "attrs": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [],
                      "description": "Attribute labels to copy from the parent, used when mode is \"specific\"."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "Attribute labels to copy from the parent, used when mode is \"specific\"."
                },
                "carrier": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "dispose",
                      "description": "\"dispose\": the batch ends here and its parts leave together. \"keep\": the batch is a carrier (a truck) that lives on -- its members leave one at a time by the first link, each after member_time, and the carrier leaves by the SECOND link once it is empty."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "dispose",
                  "description": "\"dispose\": the batch ends here and its parts leave together. \"keep\": the batch is a carrier (a truck) that lives on -- its members leave one at a time by the first link, each after member_time, and the carrier leaves by the SECOND link once it is empty."
                },
                "member_time": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number",
                          "minimum": 0
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-quantity": "time",
                      "x-unit-key": "member_time_unit",
                      "default": "",
                      "description": "Keep mode only: time for one member to come off, e.g. \"2\" or \"TRIA(1, 2, 3)\", evaluated for each member in its own scope when its turn starts. Empty = every member leaves in the same instant."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Keep mode only: time for one member to come off, e.g. \"2\" or \"TRIA(1, 2, 3)\", evaluated for each member in its own scope when its turn starts. Empty = every member leaves in the same instant.",
                  "x-quantity": "time",
                  "x-unit-key": "member_time_unit"
                },
                "member_time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit `member_time` is expressed in: \"base\" (the model's own unit) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit `member_time` is expressed in: \"base\" (the model's own unit) or one of seconds/minutes/hours/days."
                },
                "release_order": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "pattern",
                      "description": "Order the members leave in: \"pattern\" (a pallet loaded by a pallet pattern comes off top layer first, any other carrier as fifo), \"fifo\" (the order they were loaded) or \"lifo\" (last loaded first off, a rear-door truck)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "pattern",
                  "description": "Order the members leave in: \"pattern\" (a pallet loaded by a pallet pattern comes off top layer first, any other carrier as fifo), \"fifo\" (the order they were loaded) or \"lifo\" (last loaded first off, a rear-door truck)."
                },
                "place_per": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "item",
                      "description": "Keep mode, a pattern pallet: \"item\" unloads one member per member_time; \"layer\" a whole layer in one member_time."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "item",
                  "description": "Keep mode, a pattern pallet: \"item\" unloads one member per member_time; \"layer\" a whole layer in one member_time."
                },
                "pattern": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "With a robot: the record of \"pallet_patterns\" its cycle is planned for, one cycle per slot; a pallet of another pattern is a run error."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "With a robot: the record of \"pallet_patterns\" its cycle is planned for, one cycle per slot; a pallet of another pattern is a run error."
                },
                "robot": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of a record in \"robots\": with a pattern, each item's time is this robot's cycle to that item's own slot, and member_time is not used. Empty = member_time."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of a record in \"robots\": with a pattern, each item's time is this robot's cycle to that item's own slot, and member_time is not used. Empty = member_time."
                },
                "robot_at": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [
                        0,
                        0,
                        0
                      ],
                      "description": "Where the robot stands, from this block (the pallet's place): [dx, dy, rotation] in the model's length unit and degrees, dx along the block's facing, dy toward the floor plan's +y side at rotation 0."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [
                    0,
                    0,
                    0
                  ],
                  "description": "Where the robot stands, from this block (the pallet's place): [dx, dy, rotation] in the model's length unit and degrees, dx along the block's facing, dy toward the floor plan's +y side at rotation 0."
                },
                "targets": {
                  "anyOf": [
                    {
                      "type": "object",
                      "default": {},
                      "description": "The robot's named targets, as on MOTION; \"slot\" (the item's pick on the pallet) and \"slot_above\" (approach higher) are given per slot and are not defined here."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {},
                  "description": "The robot's named targets, as on MOTION; \"slot\" (the item's pick on the pallet) and \"slot_above\" (approach higher) are given per slot and are not defined here."
                },
                "segments": {
                  "anyOf": [
                    {
                      "type": "array",
                      "default": [],
                      "description": "The robot's cycle, as on MOTION: ptp and lin moves to targets, with timed pick and place segments, every time in seconds. A move without its own payload_kg carries the pattern's item weight."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": [],
                  "description": "The robot's cycle, as on MOTION: ptp and lin moves to targets, with timed pick and place segments, every time in seconds. A move without its own payload_kg carries the pattern's item weight."
                },
                "approach": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "const": ""
                        }
                      ],
                      "x-quantity": "length",
                      "default": "",
                      "description": "How far slot_above is over the slot, in the model's length unit. Empty = 0.3 m."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "How far slot_above is over the slot, in the model's length unit. Empty = 0.3 m.",
                  "x-quantity": "length"
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "SIGNAL",
          "description": "Broadcasts a named signal that releases every entity waiting at a HOLD block for it, for example a shift start, a gate opening or a green light. After an optional delay, succeeds the named signal event (releasing every HOLD block currently waiting on it) and immediately replaces it with a fresh one -- broadcast, edge-triggered, auto-reset.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "SIGNAL"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "distribution": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "Bernoulli",
                        "Beta",
                        "Binomial",
                        "BoundedNormal",
                        "Cauchy",
                        "ChiSquare",
                        "Constant",
                        "CustomExpression",
                        "DiscreteUniform",
                        "EmpiricalContinuous",
                        "EmpiricalDiscrete",
                        "Erlang",
                        "Exponential",
                        "FixedSchedule",
                        "Gamma",
                        "Geometric",
                        "Hypergeometric",
                        "InverseGaussian",
                        "JohnsonSB",
                        "JohnsonSU",
                        "LogLogistic",
                        "Lognormal",
                        "NegativeBinomial",
                        "Normal",
                        "PearsonTypeV",
                        "PearsonTypeVI",
                        "Poisson",
                        "Rayleigh",
                        "Triangular",
                        "Uniform",
                        "Weibull"
                      ],
                      "description": "Name of a registered distribution (see the distribution reference).",
                      "default": "Constant"
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "Constant",
                  "description": "Name of a registered distribution (see the distribution reference)."
                },
                "dist_params": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/dist_params",
                      "x-quantity": "time",
                      "x-unit-key": "time_unit",
                      "default": {
                        "value": 0.0
                      },
                      "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential)."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {
                    "value": 0.0
                  },
                  "description": "Parameters for `distribution`, by name (e.g. {\"rate\": 0.5} for Exponential).",
                  "x-quantity": "time",
                  "x-unit-key": "time_unit"
                },
                "time_unit": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "base",
                        "milliseconds",
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks",
                        "months",
                        "years"
                      ],
                      "default": "base",
                      "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "base",
                  "description": "Unit the sampled duration is expressed in: \"base\" (the model's own unit, no conversion) or one of seconds/minutes/hours/days."
                },
                "signal_name": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of the signal to succeed; matches a HOLD block's signal_name."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of the signal to succeed; matches a HOLD block's signal_name."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "STATION",
          "description": "Named stop on a job-shop or multi-step routing where a ROUTE block delivers parts, orders or jobs and sets their current location. Named entry point of a routing. Entities arrive here from a ROUTE block whose sequence step names this block, or along an ordinary link; either way `entity.station` becomes this block's name and the entity continues along the station's single outgoing link.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "STATION"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "station": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Optional station name this block answers to, shown as `entity.station` and usable in a sequence step. Empty: the block's own name is the station name."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Optional station name this block answers to, shown as `entity.station` and usable in a sequence step. Empty: the block's own name is the station name."
                },
                "node": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Optional path-network node this station sits on. With one, travel to and from this station is the shortest path along the network and `DISTANCE(\"...\", \"...\")` can name it."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Optional path-network node this station sits on. With one, travel to and from this station is the shortest path along the network and `DISTANCE(\"...\", \"...\")` can name it."
                },
                "tending": {
                  "anyOf": [
                    {
                      "type": "object",
                      "default": {},
                      "description": "Machine tending by a fleet with an `arm`: {\"place\": [segments], \"pick\": [segments], \"time_unit\": \"seconds\", \"hrc\": \"none\", \"zone\": {}, \"cobot\": \"leave\"|\"stay\"}. Segments, hrc and zone are a MOTION block's, timed with the fleet's arm profile; a missing cycle uses the fleet's flat unload/load time. The machine keeps a finished part until the cobot has picked it, and the cobot holds a part until the machine accepts it; \"stay\" keeps the cobot at the station until the part moves on. Empty: an ordinary station."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {},
                  "description": "Machine tending by a fleet with an `arm`: {\"place\": [segments], \"pick\": [segments], \"time_unit\": \"seconds\", \"hrc\": \"none\", \"zone\": {}, \"cobot\": \"leave\"|\"stay\"}. Segments, hrc and zone are a MOTION block's, timed with the fleet's arm profile; a missing cycle uses the fleet's flat unload/load time. The machine keeps a finished part until the cobot has picked it, and the cobot holds a part until the machine accepts it; \"stay\" keeps the cobot at the station until the part moves on. Empty: an ordinary station."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "SUBMODEL",
          "description": "Editor-only blocks (SUBMODEL, SUB_ENTRY, SUB_EXIT) that group blocks into a reusable sub-model with named ports, expanded away before the run. Editor-only placeholder shared by three types, never run directly -- `core/submodels.flatten()` expands them away before the engine builds any process. SUB_ENTRY: an input port of a submodel definition (`port` names it; exactly one outgoing link inside the definition, none incoming). SUB_EXIT: an output port of a definition (`port` names it; incoming links only). SUBMODEL: an instance of a definition dropped on the canvas (`definition` names it, `arguments` binds its parameters).",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "SUBMODEL"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "definition": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of the submodel definition"
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of the submodel definition"
                },
                "arguments": {
                  "anyOf": [
                    {
                      "type": "object",
                      "default": {},
                      "description": "Parameter bindings: {name: number | expression | bool}"
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": {},
                  "description": "Parameter bindings: {name: number | expression | bool}"
                },
                "preset": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Provenance only: the catalogue row whose values were written into `arguments`. The values are what the model uses, so editing one afterwards is fine and nothing re-reads the catalogue."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Provenance only: the catalogue row whose values were written into `arguments`. The values are what the model uses, so editing one afterwards is fine and nothing re-reads the catalogue."
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "SUB_ENTRY",
          "description": "Editor-only blocks (SUBMODEL, SUB_ENTRY, SUB_EXIT) that group blocks into a reusable sub-model with named ports, expanded away before the run. Editor-only placeholder shared by three types, never run directly -- `core/submodels.flatten()` expands them away before the engine builds any process. SUB_ENTRY: an input port of a submodel definition (`port` names it; exactly one outgoing link inside the definition, none incoming). SUB_EXIT: an output port of a definition (`port` names it; incoming links only). SUBMODEL: an instance of a definition dropped on the canvas (`definition` names it, `arguments` binds its parameters).",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "SUB_ENTRY"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "port": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "in",
                      "description": "Input port name of the definition"
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "in",
                  "description": "Input port name of the definition"
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "SUB_EXIT",
          "description": "Editor-only blocks (SUBMODEL, SUB_ENTRY, SUB_EXIT) that group blocks into a reusable sub-model with named ports, expanded away before the run. Editor-only placeholder shared by three types, never run directly -- `core/submodels.flatten()` expands them away before the engine builds any process. SUB_ENTRY: an input port of a submodel definition (`port` names it; exactly one outgoing link inside the definition, none incoming). SUB_EXIT: an output port of a definition (`port` names it; incoming links only). SUBMODEL: an instance of a definition dropped on the canvas (`definition` names it, `arguments` binds its parameters).",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "SUB_EXIT"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "port": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "out",
                      "description": "Output port name of the definition"
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "out",
                  "description": "Output port name of the definition"
                }
              },
              "required": [],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "TRANSFER",
          "description": "Adds to or takes from a continuous tank, stock or inventory level (fuel, material, a pool) as the entity passes, optionally waiting until it is available.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "TRANSFER"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "level": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of the level this block adds to or removes from."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of the level this block adds to or removes from."
                },
                "amount": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "number"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "default": "1",
                      "description": "How much to move: an expression, e.g. 20 or entity.quantity."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "1",
                  "description": "How much to move: an expression, e.g. 20 or entity.quantity."
                },
                "mode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "remove",
                      "description": "\"remove\" takes the amount out of the level, \"add\" puts it in."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "remove",
                  "description": "\"remove\" takes the amount out of the level, \"add\" puts it in."
                },
                "wait": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "Wait until the level can pay the full amount (the backorder pattern); otherwise move what it can and record the rest as unmet."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "Wait until the level can pay the full amount (the backorder pattern); otherwise move what it can and record the rest as unmet."
                }
              },
              "required": [
                "level"
              ],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        },
        {
          "title": "TRANSPORT",
          "description": "Moves a part, order or load between locations with a vehicle (truck, AGV, forklift, robot) from a fleet: fetch, carry, unload, free the vehicle.",
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "description": "Unique block name; the model's identifier for it."
            },
            "description": {
              "type": "string",
              "description": "Label shown on the canvas."
            },
            "type": {
              "const": "TRANSPORT"
            },
            "position": {
              "$ref": "#/$defs/point",
              "description": "Block CENTRE in scene units."
            },
            "layout_position": {
              "$ref": "#/$defs/point",
              "description": "Where the block sits on the FLOOR PLAN, in layout units. Absent for a block that has never been placed in layout mode, and unnecessary for one attached to a network node."
            },
            "layout_rotation": {
              "type": "number",
              "minimum": 0,
              "exclusiveMaximum": 360,
              "description": "How the block is turned on the FLOOR PLAN, in degrees CLOCKWISE as seen on screen (+x east, +y south); 0 or absent means unturned. Layout view only -- the schematic is never rotated. An asset's own network nodes are stored already turned."
            },
            "asset_3d": {
              "type": "string",
              "pattern": "^[a-z0-9_]+/[a-z0-9_]+$",
              "description": "The library mesh the 3D view draws for this block, written \"library/asset\" (for example \"automation/irb6700\"). Display only: a run never reads it. Absent means the view draws its own default shape."
            },
            "label_offset": {
              "$ref": "#/$defs/point",
              "description": "Where the block's NAME label was dragged to , in scene units from its default anchor, measured in the UNROTATED frame. Absent means the default position. Editor-only."
            },
            "counter_offsets": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/$defs/point"
              },
              "description": "Where the block's counters were dragged to, keyed `out`, `exit:<branch>` or `entry:<port>`, in scene units from each counter's default place. Absent means every counter is home. Editor-only."
            },
            "queue_row": {
              "type": "object",
              "minProperties": 1,
              "additionalProperties": false,
              "properties": {
                "anchor": {
                  "$ref": "#/$defs/point",
                  "description": "Where the row starts, [x, y] normalised over the asset's picture (-1..2)."
                },
                "direction": {
                  "type": "number",
                  "minimum": 0,
                  "exclusiveMaximum": 360,
                  "description": "Which way the row runs, in degrees clockwise from +x in the asset's own unturned frame (0 right, 90 down, 180 left, 270 up)."
                },
                "slots": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "How many places the row has, e.g. a roller table's; the 2D player draws them numbered with a 'label n/N' counter and an entity past the last one as an overflow."
                },
                "frees": {
                  "enum": [
                    "leave",
                    "move_end"
                  ],
                  "description": "When a slot frees: when its entity leaves (default) or when its timed move out ends (a lift that holds its spot)."
                },
                "label": {
                  "type": "string",
                  "description": "The counter's name, e.g. 'Exit'."
                },
                "count_at": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": -1000,
                      "maximum": 1000
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1000
                    }
                  ],
                  "items": false,
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D count label's offset, [dx, dz, h] in metres from its place on the floor: along the block's edge, outward, and a height (above 0 raises it)."
                },
                "cell": {
                  "type": "array",
                  "items": {
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1000
                  },
                  "minItems": 3,
                  "maxItems": 3,
                  "description": "The 3D pad cell, [w, d, h] in metres, over the block's own."
                }
              },
              "description": "A placed asset's own queue row: where its waiting entities line up past its seats, over the picture's queue_anchor and queue_direction, so a row can be turned away from a neighbour. Absent means the asset's own row. It never changes a run; with slots the run counts the arrivals that find them full (the slot_summary frame)."
            },
            "layer": {
              "type": "string",
              "description": "The block's user layer, which the 3D view shows or hides as one (view.layers). Display only."
            },
            "locals": {
              "type": "object",
              "description": "Submodel parameter bindings, written by flattening; not authored by hand."
            },
            "instance_place": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Written when a model is flattened, never by hand: [x, y, rotation] of the placed asset instance the block came from, on the floor plan; one written by hand is ignored."
            },
            "params": {
              "type": "object",
              "properties": {
                "fleet": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "Name of the mover fleet whose vehicles do the carrying."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "Name of the mover fleet whose vehicles do the carrying."
                },
                "destination": {
                  "anyOf": [
                    {
                      "type": "string",
                      "default": "",
                      "description": "STATION the entity is carried to. Empty: the next station of the entity's routing, exactly as ROUTE would choose it."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": "",
                  "description": "STATION the entity is carried to. Empty: the next station of the entity's routing, exactly as ROUTE would choose it."
                },
                "priority": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "default": 0,
                      "description": "Request priority for a vehicle; lower is served first, and outranks the fleet's dispatching rule."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": 0,
                  "description": "Request priority for a vehicle; lower is served first, and outranks the fleet's dispatching rule."
                },
                "keep_vehicle": {
                  "anyOf": [
                    {
                      "type": "boolean",
                      "default": false,
                      "description": "Keep the vehicle after the drop: it waits there, busy, and the entity's next TRANSPORT on this fleet drives it. A RELEASE naming the fleet, or the entity leaving the model, frees it."
                    },
                    {
                      "$ref": "#/$defs/structural_argument"
                    }
                  ],
                  "default": false,
                  "description": "Keep the vehicle after the drop: it waits there, busy, and the entity's next TRANSPORT on this fleet drives it. A RELEASE naming the fleet, or the entity leaving the model, frees it."
                }
              },
              "required": [
                "fleet"
              ],
              "additionalProperties": false
            },
            "meta": {
              "$ref": "#/$defs/meta",
              "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
            }
          },
          "required": [
            "name",
            "type"
          ],
          "additionalProperties": false
        }
      ]
    },
    "link": {
      "type": "object",
      "description": "A directed link. Array order is BRANCH order for a DECIDE/LOGIC. Several links may join the same pair of blocks (two branches to one target): they are separate entries, identified by source, target and which of the parallel links between that pair they are.",
      "properties": {
        "source": {
          "type": "string",
          "description": "Name of the source block."
        },
        "target": {
          "type": "string",
          "description": "Name of the target block."
        },
        "delay": {
          "anyOf": [
            {
              "$ref": "#/$defs/duration"
            },
            {
              "type": "null"
            }
          ],
          "description": "Optional transfer delay on this link; with a capacity, the time a part spends in an area link.",
          "x-quantity": "time",
          "x-unit-key": "delay.time_unit"
        },
        "source_port": {
          "type": [
            "string",
            "integer",
            "null"
          ],
          "description": "Out port: a SUBMODEL instance's port name (or a whole number, matched as its text); a CONVEYOR's exit, \"out\" (its end) or \"d<k>\" (divert k); other blocks branch by link order and ignore it."
        },
        "target_port": {
          "type": [
            "string",
            "integer",
            "null"
          ],
          "description": "In port: a SUBMODEL instance's port name (or a whole number, matched as its text), or a CONVEYOR's \"in\"; other blocks ignore it."
        },
        "capacity": {
          "type": "integer",
          "default": 0,
          "description": "Parts the link holds at once, 0 for no limit. A part keeps its place until the target takes it, so a full link holds the block feeding it. Read only on a link with a delay.",
          "x-quantity": "count",
          "minimum": 0
        }
      },
      "required": [
        "source",
        "target"
      ],
      "additionalProperties": false
    },
    "resource": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The resource's name; blocks seize it by this name."
        },
        "capacity": {
          "x-quantity": "count",
          "type": "integer",
          "minimum": 0,
          "default": 1,
          "description": "How many units can be held at the same time."
        },
        "discipline": {
          "type": "string",
          "enum": [
            "FIFO",
            "LIFO",
            "LowestValueFirst",
            "HighestValueFirst",
            "Plan"
          ],
          "default": "FIFO",
          "description": "Queue order. LowestValueFirst/HighestValueFirst need a ranking_expr; Plan works each station's planned order (entity.plan, cpsat.propose)."
        },
        "ranking_expr": {
          "type": "string",
          "description": "Expression ranking the queue, for a ranked discipline."
        },
        "rerank": {
          "type": "boolean",
          "default": false,
          "description": "Re-evaluate ranking_expr for every waiting request just before each grant, instead of once when it joins the queue; only meaningful with LowestValueFirst/HighestValueFirst."
        },
        "capacity_schedule": {
          "type": "string",
          "description": "Name of a \"capacity\" schedule staffing this resource."
        },
        "cost_busy": {
          "x-quantity": "rate",
          "x-unit-key": "cost_time_unit",
          "type": "number",
          "minimum": 0,
          "default": 0.0,
          "description": "Cost per time unit (see `cost_time_unit`) while a unit is held."
        },
        "cost_idle": {
          "x-quantity": "rate",
          "x-unit-key": "cost_time_unit",
          "type": "number",
          "minimum": 0,
          "default": 0.0,
          "description": "Cost per time unit (see `cost_time_unit`) while a unit is free."
        },
        "cost_per_use": {
          "x-quantity": "money",
          "type": "number",
          "minimum": 0,
          "default": 0.0,
          "description": "Cost added each time a unit is seized."
        },
        "cost_time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "hours",
          "description": "Unit cost_busy/cost_idle are quoted per."
        },
        "power": {
          "type": "object",
          "description": "kW per unit while busy/idle/blocked/down/off_shift; absent keys are 0, \"blocked\" defaults to \"busy\" (a blocked unit is seized).",
          "properties": {
            "busy": {
              "type": "number",
              "minimum": 0
            },
            "idle": {
              "type": "number",
              "minimum": 0
            },
            "blocked": {
              "type": "number",
              "minimum": 0
            },
            "down": {
              "type": "number",
              "minimum": 0
            },
            "off_shift": {
              "type": "number",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        "meta": {
          "$ref": "#/$defs/meta",
          "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "resource_set": {
      "type": "object",
      "description": "A named group of resources, seized as one pseudo-resource.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The set's name; a block seizes the set by this name."
        },
        "members": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "The resources in the set, in the order the rule \"PreferredOrder\" tries them."
        },
        "rule": {
          "type": "string",
          "enum": [
            "PreferredOrder",
            "Cyclical",
            "Random",
            "SmallestNumberBusy",
            "LargestRemainingCapacity"
          ],
          "default": "PreferredOrder",
          "description": "How the set picks a member when a request arrives."
        }
      },
      "required": [
        "name",
        "members"
      ],
      "additionalProperties": false
    },
    "entity_type": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The entity type's name, the `e_type` a CREATE block gives its entities."
        },
        "shape": {
          "type": "string",
          "description": "The shape the editor draws for these entities, such as \"circle\"."
        },
        "color": {
          "type": "string",
          "description": "The colour the editor draws these entities in, as a hex string such as \"#1f77b4\"."
        },
        "icon": {
          "type": "string",
          "description": "Path to an animation icon image."
        },
        "graphic": {
          "type": "string",
          "description": "Inline SVG token (24 x 24 artboard), usually copied from a library's entity preset; checked by core/svgsafe before it is drawn."
        },
        "size": {
          "type": "object",
          "description": "Item size on a conveyor, in the model's length unit (simulation.length_unit); on a typed belt an item takes ceil((length + gap) / cell) cells.",
          "properties": {
            "length": {
              "type": "number",
              "x-quantity": "length",
              "exclusiveMinimum": 0
            },
            "width": {
              "type": "number",
              "x-quantity": "length",
              "exclusiveMinimum": 0
            },
            "height": {
              "type": "number",
              "x-quantity": "length",
              "exclusiveMinimum": 0
            }
          },
          "additionalProperties": false
        },
        "holding_cost": {
          "description": "WIP cost per entity per base time unit.",
          "x-quantity": "rate",
          "x-unit-key": "holding_cost_time_unit",
          "type": "number",
          "minimum": 0,
          "default": 0.0
        },
        "holding_cost_time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit `holding_cost` is per."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "variable": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The variable's name; expressions read it as a bare name."
        },
        "initial": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            },
            {
              "type": "boolean"
            }
          ],
          "default": 0,
          "description": "Its value at the start of each replication: a number, a boolean or an expression."
        },
        "trace": {
          "type": "boolean",
          "description": "Written by flattening for a variable an asset's picture follows; not authored by hand."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "schedule": {
      "type": "object",
      "description": "Piecewise-constant arrival rate or capacity calendar.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The schedule's name; a block or a resource names it to follow the calendar."
        },
        "description": {
          "type": "string",
          "description": "What the schedule stands for; the run does not read it."
        },
        "kind": {
          "type": "string",
          "enum": [
            "arrival",
            "capacity"
          ],
          "default": "arrival",
          "description": "\"arrival\" for a rate of arrivals, \"capacity\" for a number of units available."
        },
        "repeat": {
          "type": "boolean",
          "default": false,
          "description": "Start over after the last point; when false the last value holds for ever."
        },
        "time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit the point durations are expressed in."
        },
        "points": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
              "type": "number"
            },
            "description": "[duration, value]; value is a rate (arrival) or a whole number of units (capacity)."
          },
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "description": "The calendar, one [duration, value] pair per period, in order."
        },
        "weekly": {
          "type": "object",
          "description": "Weekday grid in LOCAL wall-clock time, instead of \"points\" . Needs \"simulation.calendar\". Keyed by weekday (mon..sun); each value is a list of [\"06:00\", \"14:00\", value] bands. A day with no bands is off.",
          "propertyNames": {
            "enum": [
              "mon",
              "tue",
              "wed",
              "thu",
              "fri",
              "sat",
              "sun"
            ]
          },
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "array",
              "minItems": 3,
              "maxItems": 3
            }
          }
        },
        "off_value": {
          "description": "Value outside every band of a weekday schedule.",
          "type": "number",
          "default": 0.0
        },
        "exceptions": {
          "type": "array",
          "description": "Dated overrides of a weekday grid -- holidays, shutdowns. Whole LOCAL days, \"end\" inclusive; last match wins.",
          "items": {
            "type": "object",
            "properties": {
              "start": {
                "type": "string",
                "description": "First day, ISO (2026-12-24)."
              },
              "end": {
                "type": "string",
                "description": "Last day, inclusive; defaults to \"start\"."
              },
              "value": {
                "type": "number",
                "default": 0,
                "description": "Value held all day; 0 = closed."
              },
              "description": {
                "type": "string"
              }
            },
            "required": [
              "start"
            ],
            "additionalProperties": false
          }
        },
        "meta": {
          "$ref": "#/$defs/meta",
          "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "table": {
      "type": "object",
      "description": "A lookup table read by TABLE(\"name\", k1[, k2]) in any expression . 1-D: \"keys\" plus a flat \"values\" list. 2-D: also \"columns\", and \"values\" is one row per key. Keys are strings or numbers; values are numbers.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The table's name, the first argument of TABLE(\"name\", key)."
        },
        "description": {
          "type": "string",
          "description": "What the table holds; the run does not read it."
        },
        "keys": {
          "type": "array",
          "minItems": 1,
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "description": "Row keys (dimension 1)."
        },
        "columns": {
          "type": "array",
          "minItems": 1,
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          },
          "description": "Column keys (dimension 2); omit for a 1-D table."
        },
        "values": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            ]
          },
          "description": "One number per key (1-D), or one row of numbers per key (2-D)."
        },
        "key_mode": {
          "type": "string",
          "enum": [
            "exact",
            "step",
            "linear"
          ],
          "default": "exact",
          "description": "exact (the key must be present), step (largest numeric key <= x) or linear (interpolate); step and linear clamp at both ends."
        },
        "column_mode": {
          "type": "string",
          "enum": [
            "exact",
            "step",
            "linear"
          ],
          "default": "exact",
          "description": "How a lookup treats a column key between the listed ones: exact match, the step below, or linear."
        },
        "default": {
          "type": [
            "number",
            "null"
          ],
          "description": "Value for a missing exact key; without one a miss is a run-time model error."
        },
        "meta": {
          "$ref": "#/$defs/meta",
          "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
        }
      },
      "required": [
        "name",
        "keys",
        "values"
      ],
      "additionalProperties": false
    },
    "timeseries_input": {
      "type": "object",
      "description": "A named profile the model READS with TS(\"name\"[, t]) -- a PV curve, a site load, a tariff by hour. Give either \"times\" (irregular) or \"start\" + \"step\" (regular), plus \"values\".",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The profile's name, the first argument of TS(\"name\")."
        },
        "description": {
          "type": "string",
          "description": "What the profile holds; the run does not read it."
        },
        "values": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "number"
          },
          "description": "One number per sample."
        },
        "times": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "number"
          },
          "description": "Sample times, strictly increasing; exclusive with \"step\".",
          "x-quantity": "time",
          "x-unit-key": "time_unit"
        },
        "start": {
          "type": [
            "number",
            "string"
          ],
          "description": "Time of the first sample of a regular series. An ISO timestamp instead of a number dates the series against \"simulation.calendar\".",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "default": 0.0
        },
        "timestamps": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          },
          "description": "Real ISO sample instants instead of \"times\"; converted once at build."
        },
        "step": {
          "description": "Spacing of a regular series; exclusive with \"times\".",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "type": "number",
          "exclusiveMinimum": 0
        },
        "time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit the sample times are expressed in."
        },
        "interpolation": {
          "type": "string",
          "enum": [
            "step",
            "linear"
          ],
          "default": "step",
          "description": "step: piecewise constant (exact for a flow rate). linear: interpolate between samples."
        },
        "beyond": {
          "type": "string",
          "enum": [
            "hold",
            "repeat",
            "error"
          ],
          "default": "hold",
          "description": "Past the last sample: hold the last value, repeat the series with its period, or refuse."
        },
        "period": {
          "anyOf": [
            {
              "type": "number",
              "exclusiveMinimum": 0
            },
            {
              "type": "string",
              "enum": [
                "daily",
                "weekly",
                "yearly"
              ]
            }
          ],
          "description": "Cycle length \"repeat\" wraps on; defaults to step * len(values), or times[-1] - times[0]. \"daily\"/\"weekly\"/\"yearly\" need a calendar.",
          "x-quantity": "time",
          "x-unit-key": "time_unit"
        }
      },
      "required": [
        "name",
        "values"
      ],
      "additionalProperties": false
    },
    "level": {
      "type": "object",
      "description": "A continuous quantity with bounds -- battery energy, tank volume, an inventory position. Read by LEVEL(\"name\"); moved by the \"flows\" section and by TRANSFER blocks.",
      "properties": {
        "diagram": {
          "type": "object",
          "description": "Position in the stock-and-flow view; ignored by the engine."
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The level's name, the argument of LEVEL(\"name\")."
        },
        "dims": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true,
          "description": "Subscripts this record runs over: it is flattened into one record per element, named \"Name[north]\" (\"Name[north,young]\" for two). Inside, \"x[dim]\" in a LEVEL/FLOW/AUX/DELAY name reads the same element, and SUM(x)/MEAN(x) aggregate over \"x[*]\"."
        },
        "elements": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "number"
            ]
          },
          "description": "Per-element equations: {\"north\": \"2\", \"a,x\": \"3\"} replaces the record's first expression (a level's initial, a flow's rate, an auxiliary's expr, a delay's input) for those elements; the shared one covers the rest. Keys join one element per dim with a comma."
        },
        "description": {
          "type": "string",
          "description": "What the level stands for; the run does not read it."
        },
        "unit": {
          "type": "string",
          "description": "Label only, e.g. kWh or tonnes."
        },
        "capacity": {
          "type": [
            "number",
            "null"
          ],
          "description": "Upper bound; omit for an unbounded accumulator."
        },
        "min": {
          "type": [
            "number",
            "null"
          ],
          "description": "Lower bound; null for a stock unbounded below .",
          "default": 0.0
        },
        "initial": {
          "type": [
            "number",
            "string"
          ],
          "description": "Value at t=0, inside [min, capacity]; or an expression, evaluated once in dependency order .",
          "default": 0.0
        },
        "max_inflow": {
          "type": [
            "number",
            "null"
          ],
          "description": "Largest total rate that may be ADDED to the level (a charge-power limit).",
          "x-quantity": "rate",
          "x-unit-key": "rate_time_unit",
          "minimum": 0
        },
        "max_outflow": {
          "type": [
            "number",
            "null"
          ],
          "description": "Largest total rate that may be REMOVED from it (a discharge-power limit).",
          "x-quantity": "rate",
          "x-unit-key": "rate_time_unit",
          "minimum": 0
        },
        "rate_time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit the two power limits are per."
        },
        "thresholds": {
          "type": "array",
          "description": "Level values that fire discrete logic when crossed.",
          "items": {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "direction": {
                "type": "string",
                "enum": [
                  "falling",
                  "rising",
                  "both"
                ],
                "default": "falling"
              },
              "signal": {
                "type": "string",
                "description": "Signal succeeded at the crossing, releasing every HOLD block waiting on it."
              },
              "variable": {
                "type": "string",
                "description": "Model variable set to the level at the crossing."
              },
              "cost": {
                "type": "number",
                "default": 0,
                "description": "Lump charged once per crossing; it joins Total Cost and the cost_summary frame."
              },
              "cost_item": {
                "type": "string",
                "description": "Cost item the lump accrues into; defaults to the record's own name."
              },
              "category": {
                "type": "string",
                "description": "Grouping for that cost item."
              }
            },
            "required": [
              "value"
            ],
            "additionalProperties": false
          }
        },
        "components": {
          "type": "array",
          "description": "Named components the level's content is tracked in: a gas holder's ch4. Each inflow carries a share, each outflow draws at the level's own blend, and the component is conserved exactly. Read by FRACTION(name, component).",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "initial_fraction": {
                "type": "number",
                "minimum": 0,
                "maximum": 1,
                "default": 0,
                "description": "Share of the INITIAL content that is this component."
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          }
        },
        "blend_tolerance": {
          "default": 0.005,
          "description": "How far the fraction may drift from the value the outflows are drawing at before the engine re-evaluates. The crossing instant is solved in closed form; the component is conserved exactly whatever this is set to.",
          "x-quantity": "ratio",
          "type": "number",
          "exclusiveMinimum": 0
        },
        "storage": {
          "type": "object",
          "description": "A storage the `dispatch` plan may drive: its power limits, efficiencies and the variable the plan writes its bus-side setpoint to (positive charges). Rates are per this level's rate_time_unit. Inert without a `dispatch` section.",
          "properties": {
            "optimal": {
              "type": "boolean",
              "default": false,
              "description": "The plan drives this storage; false keeps it on its own rule."
            },
            "setpoint": {
              "type": "string",
              "description": "A declared variable; the plan writes charge minus discharge, bus-side."
            },
            "charge_max": {
              "description": "Largest power drawn while charging.",
              "type": "number",
              "minimum": 0
            },
            "discharge_max": {
              "description": "Largest power delivered while discharging.",
              "type": "number",
              "minimum": 0
            },
            "charge_efficiency": {
              "description": "Stored per unit drawn.",
              "x-quantity": "ratio",
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1,
              "default": 1.0
            },
            "discharge_efficiency": {
              "description": "Delivered per unit taken out.",
              "x-quantity": "ratio",
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 1,
              "default": 1.0
            },
            "loss": {
              "description": "Constant standby loss.",
              "type": "number",
              "minimum": 0,
              "default": 0.0
            }
          },
          "additionalProperties": false
        },
        "conveyor": {
          "type": "object",
          "description": "Makes the stock a Stella conveyor: material rides round(transit_time/dt) slats of the SD grid (euler only), leaves as the one primary outflow (rate \"\") and may leak on the way through \"leak\" flows. The stock is the sum of the slats and changes only at grid points.",
          "properties": {
            "transit_time": {
              "type": [
                "string",
                "number"
              ],
              "description": "Time on the belt, latched per batch at entry.",
              "x-quantity": "time",
              "x-unit-key": "time_unit",
              "minimum": 0
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit `transit_time` is in."
            },
            "capacity": {
              "type": [
                "string",
                "number"
              ],
              "description": "Most the belt holds; limits equation-driven inflow only."
            },
            "in_limit": {
              "type": [
                "string",
                "number"
              ],
              "description": "Most inflow per time unit (equation-driven inflow only)."
            },
            "arrest": {
              "type": [
                "string",
                "number"
              ],
              "description": "While nonzero nothing moves, enters or leaves."
            },
            "leak_kind": {
              "type": "string",
              "enum": [
                "linear",
                "exponential"
              ],
              "default": "linear",
              "description": "linear: a batch loses fraction * its entry amount spread evenly over the zone; exponential: content * fraction * dt per DT."
            }
          },
          "required": [
            "transit_time"
          ],
          "additionalProperties": false
        },
        "locals": {
          "type": "object",
          "description": "Submodel parameter bindings, written by flattening; not authored by hand."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "flow": {
      "type": "object",
      "description": "A rate-based transfer between levels. The rate is an expression re-evaluated only at events, so every level moves linearly in between and every crossing is solved in closed form.",
      "properties": {
        "diagram": {
          "type": "object",
          "description": "Position in the stock-and-flow view; ignored by the engine."
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The flow's name."
        },
        "dims": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true,
          "description": "Subscripts this record runs over: it is flattened into one record per element, named \"Name[north]\" (\"Name[north,young]\" for two). Inside, \"x[dim]\" in a LEVEL/FLOW/AUX/DELAY name reads the same element, and SUM(x)/MEAN(x) aggregate over \"x[*]\"."
        },
        "elements": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "number"
            ]
          },
          "description": "Per-element equations: {\"north\": \"2\", \"a,x\": \"3\"} replaces the record's first expression (a level's initial, a flow's rate, an auxiliary's expr, a delay's input) for those elements; the shared one covers the rest. Keys join one element per dim with a comma."
        },
        "description": {
          "type": "string",
          "description": "What the flow stands for; the run does not read it."
        },
        "from": {
          "type": [
            "string",
            "null"
          ],
          "description": "Level drawn from; omit for a source outside the model. A level at its min passes on no more than flows into it, so a rate needs no guard such as IF(LEVEL(\"x\") > 0, r, 0); on a step grid that guard reads the level a step late."
        },
        "to": {
          "type": [
            "string",
            "null"
          ],
          "description": "Level fed; omit for a sink outside the model."
        },
        "rate": {
          "type": [
            "string",
            "number"
          ],
          "description": "Quantity per time unit: an expression over variables, TS(), TABLE(), LEVEL() and FLOW(). A negative value is clamped to 0 -- declare the reverse flow instead, or set \"biflow\".",
          "x-quantity": "rate",
          "x-unit-key": "rate_time_unit",
          "default": "0"
        },
        "biflow": {
          "type": "boolean",
          "default": false,
          "description": "Bi-directional: a negative rate runs the flow backwards instead of being clamped to 0. Both ends must be outside the model or levels with \"min\": null and no capacity or power limit."
        },
        "rate_time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit the rate is per. FLOW(), FLOWSUM(), Avg Rate, Peak Rate, rate thresholds and peak_price read the flow in it too."
        },
        "efficiency": {
          "description": "out = in * efficiency; the rest is a loss.",
          "x-quantity": "ratio",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1,
          "default": 1.0
        },
        "price": {
          "type": [
            "string",
            "number"
          ],
          "description": "Money per unit moved; integrated exactly into the flow's Cost and the model's Total Cost.",
          "x-quantity": "money",
          "default": "0"
        },
        "emission_factor": {
          "type": [
            "string",
            "number"
          ],
          "description": "Impact per unit moved (emissions, water, waste), integrated into Total Impact.",
          "default": "0"
        },
        "tag": {
          "type": "string",
          "description": "Bus tag: every flow carrying it is summed by FLOWSUM(\"tag\"), so a site's generation or demand is one number however many assets contribute to it."
        },
        "priority": {
          "description": "Merit order within a tag: FLOWSUM(\"tag\", p) sums only the flows with a priority below p -- what the devices dispatched before this one actually took.",
          "type": "number",
          "default": 0
        },
        "peak_price": {
          "default": 0,
          "description": "Demand charge: money per unit of the flow's Peak Rate (per its rate_time_unit), billed ONCE at the end of the run. A time-varying tariff is \"price\".",
          "x-quantity": "money",
          "type": "number"
        },
        "grid": {
          "type": "object",
          "description": "This flow's role in the `dispatch` plan: the site's grid import or export. The plan prices it with this flow's own `price`. Inert without a `dispatch` section.",
          "properties": {
            "role": {
              "enum": [
                "import",
                "export"
              ]
            },
            "limit": {
              "description": "Largest rate, per this flow's rate_time_unit; omit for no limit.",
              "type": "number",
              "minimum": 0
            }
          },
          "required": [
            "role"
          ],
          "additionalProperties": false
        },
        "min_rate": {
          "description": "Minimum load: the flow runs at 0 or at least this rate, never in between. The gate is applied to the rate the expression ASKED for, before saturation, so it adds no event of its own and cannot chatter.",
          "x-quantity": "rate",
          "x-unit-key": "rate_time_unit",
          "type": "number",
          "minimum": 0
        },
        "components": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "number"
            ]
          },
          "description": "Share of what this flow moves that is each component, a number or an expression. Omit a component to carry the SOURCE level's own blend."
        },
        "leak": {
          "type": "object",
          "description": "A conveyor's leakage outflow; set \"rate\": \"\" and \"from\" the conveyor.",
          "properties": {
            "fraction": {
              "type": [
                "string",
                "number"
              ],
              "description": "Linear: share of a batch lost over the zone. Exponential: rate per time unit. Read every DT."
            },
            "zone": {
              "type": "array",
              "items": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "minItems": 2,
              "maxItems": 2,
              "default": [
                0,
                1
              ],
              "description": "[start, end] fractions of the belt from the inflowing side."
            }
          },
          "required": [
            "fraction"
          ],
          "additionalProperties": false
        },
        "thresholds": {
          "type": "array",
          "description": "Realised-rate values that fire discrete logic when crossed : a signal, a variable, and a lump cost per crossing -- a generator's start cost. Rising crossings are counted as the flow's Starts.",
          "items": {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "direction": {
                "type": "string",
                "enum": [
                  "falling",
                  "rising",
                  "both"
                ],
                "default": "falling"
              },
              "signal": {
                "type": "string"
              },
              "variable": {
                "type": "string"
              },
              "cost": {
                "type": "number",
                "default": 0,
                "description": "Lump charged once per crossing."
              },
              "cost_item": {
                "type": "string",
                "description": "Cost item it accrues into; defaults to the flow's own name."
              },
              "category": {
                "type": "string"
              }
            },
            "required": [
              "value"
            ],
            "additionalProperties": false
          },
          "x-quantity": "rate",
          "x-unit-key": "rate_time_unit"
        },
        "locals": {
          "type": "object",
          "description": "Submodel parameter bindings, written by flattening; not authored by hand."
        }
      },
      "required": [
        "name",
        "rate"
      ],
      "additionalProperties": false
    },
    "conversion": {
      "type": "object",
      "description": "A delayed conversion with a yield curve: feed in, product released over the following hours or days, per substrate. Feed is grouped into cohorts closed at a fixed interval and each cohort releases at a rate constant within each step of its curve, so the product rate stays piecewise constant. Read by CONV(name) and FRACTION(name, component); attach it to a level with an ordinary flow whose rate is CONV(name).",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The conversion's name."
        },
        "description": {
          "type": "string",
          "description": "What the conversion stands for; the run does not read it."
        },
        "unit": {
          "type": "string",
          "description": "Label for the product, e.g. Nm3."
        },
        "cohort_interval": {
          "description": "Feed accumulated over this interval closes into one cohort and releases from its CLOSE, so the mean delay is longer by up to half an interval. Curve knots round onto the same grid.",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "type": "number",
          "exclusiveMinimum": 0,
          "default": 1.0
        },
        "time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit the cohort interval and the curve ages are in."
        },
        "substrates": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "feed": {
                "type": [
                  "string",
                  "number"
                ],
                "description": "Feed rate of this substrate: an expression, usually FLOW of its feeder.",
                "x-quantity": "rate",
                "x-unit-key": "feed_time_unit",
                "default": "0"
              },
              "feed_time_unit": {
                "type": "string",
                "enum": [
                  "base",
                  "milliseconds",
                  "seconds",
                  "minutes",
                  "hours",
                  "days",
                  "weeks",
                  "months",
                  "years"
                ],
                "default": "base",
                "description": "Unit the feed rate is per."
              },
              "yield": {
                "type": "number",
                "minimum": 0,
                "description": "Product per unit of feed, e.g. 200 Nm3 of biogas per tonne."
              },
              "curve": {
                "type": "array",
                "description": "Release curve as [age, CUMULATIVE share] knots, ending at 1.0.",
                "items": {
                  "type": "array",
                  "minItems": 2,
                  "maxItems": 2,
                  "items": {
                    "type": "number"
                  }
                }
              },
              "half_life": {
                "type": "number",
                "exclusiveMinimum": 0,
                "description": "First-order release shortcut, discretised into equal-width steps instead of an explicit curve."
              },
              "steps": {
                "type": "integer",
                "minimum": 1,
                "default": 12,
                "description": "Steps the half-life curve is cut into."
              },
              "tail": {
                "type": "number",
                "exclusiveMinimum": 0,
                "default": 6.0,
                "description": "Half-lives the discretisation spans; the remainder is renormalised in, so the yield is conserved exactly."
              },
              "components": {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "string",
                    "number"
                  ]
                },
                "description": "Share of this substrate's product that is each component (a feedstock's methane content). Evaluated once at run start."
              },
              "initial_inventory": {
                "type": "number",
                "minimum": 0,
                "description": "Feed already inside at t=0, released as one cohort."
              },
              "initial_feed_rate": {
                "type": "number",
                "minimum": 0,
                "description": "Start in the STEADY STATE for this feed rate: the output is feed x yield from t=0, so a year-long study needs no start-up transient."
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "description": "The feeds that go in, each with its own rate and yield curve."
        },
        "locals": {
          "type": "object",
          "description": "Submodel parameter bindings, written by flattening; not authored by hand."
        }
      },
      "required": [
        "name",
        "substrates"
      ],
      "additionalProperties": false
    },
    "fixed_cost": {
      "type": "object",
      "description": "A cost of the SCENARIO rather than of the run: capex, or an annuity over a sized parameter. The amount is evaluated once at run start, joins Total Cost and is itemised in the cost_summary frame. It is never prorated to the observed window -- write the share you want into the expression.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The cost's name, as the cost summary lists it."
        },
        "description": {
          "type": "string",
          "description": "What the cost pays for; the run does not read it."
        },
        "amount": {
          "type": [
            "string",
            "number"
          ],
          "description": "A number, or an expression over the model's variables and data evaluated once at run start.",
          "x-quantity": "money",
          "default": "0"
        },
        "category": {
          "type": "string",
          "description": "Grouping shown in the cost_summary frame."
        },
        "capex": {
          "type": "boolean",
          "default": false,
          "description": "An upfront investment: the investment case keeps it out of operating cost. Read by `nagasim.investment` only; Total Cost and every frame of a run are unchanged."
        },
        "locals": {
          "type": "object",
          "description": "Submodel parameter bindings, written by flattening; not authored by hand."
        }
      },
      "required": [
        "name",
        "amount"
      ],
      "additionalProperties": false
    },
    "investment": {
      "type": "object",
      "description": "OPTIONAL investment case: `naga invest` and the Studies window report payback, NPV and ROI of every scenario against the baseline. Per replication the run's Total Cost less its capex fixed costs, and the throughput, are scaled from the observed window to operating_hours_per_year.",
      "properties": {
        "baseline": {
          "type": "string",
          "default": "",
          "description": "A scenario name; empty is the model as saved."
        },
        "horizon_years": {
          "description": "Years the saving is counted over; a fraction counts its last year pro rata.",
          "type": "number",
          "exclusiveMinimum": 0,
          "default": 5
        },
        "discount_rate": {
          "description": "Per year, for the NPV.",
          "x-quantity": "ratio",
          "type": "number",
          "minimum": 0,
          "default": 0.08
        },
        "operating_hours_per_year": {
          "description": "The observed window is scaled to this.",
          "type": "number",
          "exclusiveMinimum": 0,
          "default": 4000
        },
        "margin_per_part": {
          "description": "Money per extra good part; 0 is a pure cost case.",
          "x-quantity": "money",
          "type": "number",
          "default": 0.0
        },
        "throughput": {
          "type": "string",
          "default": "",
          "description": "A KPI key counting good parts (a `flatten_kpis` key such as \"user/Good parts\"); empty is the system's completed entities."
        }
      },
      "additionalProperties": false
    },
    "dispatch": {
      "type": "object",
      "description": "OPTIONAL storage dispatch plan: a rolling-horizon LP over the bus that sets every `levels[].storage` with optimal true at the cheapest cost of the `flows[].grid` flows, replanned from the measured state. Absent, nothing of it runs.",
      "properties": {
        "name": {
          "type": "string",
          "default": "site",
          "description": "The dispatch_summary row and KPI key part."
        },
        "supply_tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "Bus tags forecast as supply, e.g. [\"generation\", \"dispatchable\"]."
        },
        "demand_tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "Bus tags forecast as demand, e.g. [\"demand\"]."
        },
        "horizon": {
          "description": "How far each plan looks ahead; clipped at the run's end.",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "type": "number",
          "exclusiveMinimum": 0,
          "default": 24.0
        },
        "step": {
          "description": "The plan's grid: setpoints are constant per step.",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "type": "number",
          "exclusiveMinimum": 0,
          "default": 0.25
        },
        "replan_every": {
          "description": "How often the plan is solved again from the measured state; a multiple of step.",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "type": "number",
          "exclusiveMinimum": 0,
          "default": 1.0
        },
        "time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "hours",
          "description": "Unit of horizon, step and replan_every."
        },
        "terminal": {
          "enum": [
            "hold",
            "free"
          ],
          "default": "hold",
          "description": "hold: each plan ends with every storage at least at its starting level; free: it may end empty."
        },
        "forecast": {
          "enum": [
            "model",
            "persistence"
          ],
          "default": "model",
          "description": "model: the rates and prices evaluated ahead (perfect foresight of the profiles); persistence: their values at the replan instant, held over the horizon."
        },
        "voll": {
          "description": "Cost per unit of unserved demand in the plan; default 100 x the dearest import price.",
          "x-quantity": "money",
          "type": "number",
          "minimum": 0
        },
        "status_variable": {
          "type": "string",
          "default": "dispatch_ok",
          "description": "A declared variable the plan sets to 1 while it holds and to 0 when a solve fails."
        }
      },
      "required": [
        "supply_tags",
        "demand_tags"
      ],
      "additionalProperties": false
    },
    "stockpiles": {
      "type": "object",
      "description": "OPTIONAL piles for store blocks, drawn in playback only: each area's block shows its entities as slabs on a few piles instead of a queue row. Ignored by the engine.",
      "properties": {
        "source": {
          "type": "string",
          "description": "The block whose created entities `keys` lists, in creation order."
        },
        "keys": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Each entity's pile key, by creation order at source."
        },
        "max_layers": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 8,
          "description": "Slabs drawn per pile; past it only the label counts."
        },
        "areas": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "block": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "description": "Drawn with the area's total, e.g. 'Area A' -> 'Area A . 47'."
              },
              "label_at": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "minItems": 2,
                "maxItems": 2
              },
              "colour": {
                "type": "string",
                "pattern": "^#[0-9A-Fa-f]{6}$"
              },
              "keys": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "This area's own pile keys, by creation order at its source (D1146); without them the section's keys apply."
              },
              "source": {
                "type": "string",
                "description": "The block whose created entities this area's keys list; default the section's source."
              },
              "piles": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "rect": {
                      "type": "array",
                      "items": {
                        "type": "number"
                      },
                      "minItems": 4,
                      "maxItems": 4
                    }
                  },
                  "required": [
                    "rect"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "block",
              "piles"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "areas"
      ],
      "additionalProperties": false
    },
    "crane": {
      "type": "object",
      "description": "An overhead or gantry crane, drawn in playback only: a traced move with a duration between two blocks it serves is a lift (the hook travels empty, lowers, carries the load and sets it down, inside the move's own time). Ignored by the engine.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "runway": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "minItems": 4,
          "maxItems": 4,
          "description": "[x0, y0, x1, y1] in metres: the area the bridge travels over."
        },
        "serves": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 2,
          "description": "The blocks whose moves between each other this crane makes."
        },
        "axis": {
          "enum": [
            "x",
            "y"
          ],
          "description": "The plan axis the bridge travels along; default the runway's long side."
        },
        "home": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "minItems": 2,
          "maxItems": 2,
          "description": "Where the hook waits before the first lift and between lifts far apart; default the runway's centre."
        },
        "colour": {
          "type": "string",
          "pattern": "^#[0-9A-Fa-f]{6}$",
          "description": "Bridge and hook colour; default safety yellow."
        },
        "trail": {
          "type": "boolean",
          "description": "Draw a faint dashed line from the last lift's pick to its drop; default off."
        },
        "park_after": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "const": false
            }
          ],
          "description": "An idle gap of at least this many minutes sends the hook home until its next lift; default 1, false never."
        },
        "speed": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "How fast the idle hook goes home, plan metres a minute; default 30."
        }
      },
      "required": [
        "name",
        "runway",
        "serves"
      ],
      "additionalProperties": false
    },
    "building": {
      "type": "object",
      "description": "OPTIONAL building in metres (the network's frame, y down): rooms filled in order, walls derived from the outlines of rooms with walls true plus the free-standing wall_lines, openings cut into them, labels and plan-only fixtures. A path segment through a wall with no opening is a W_WALL_CROSSING warning. Ignored by the engine; the editor draws it and `product building` writes the floor plan, the 3D walls and the floor texture from it.",
      "properties": {
        "extent": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "minItems": 4,
          "maxItems": 4,
          "description": "The plan's canvas [x0, y0, x1, y1], metres."
        },
        "ground": {
          "type": "string",
          "default": "#DCDCD6",
          "description": "The plan outside the rooms: a colour or palette name."
        },
        "palette": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Fill names -> \"#RRGGBB\", used by rooms' fill."
        },
        "walls": {
          "type": "object",
          "properties": {
            "thickness": {
              "type": "number",
              "exclusiveMinimum": 0,
              "default": 0.2
            },
            "height": {
              "type": "number",
              "exclusiveMinimum": 0,
              "default": 2.7,
              "description": "Full height of the 3D walls, metres."
            },
            "color": {
              "type": "string",
              "default": "#4A4F57",
              "description": "The plan's wall line and the 3D wall tops."
            },
            "face_color": {
              "type": "string",
              "default": "#E9E7E2",
              "description": "The 3D wall sides."
            },
            "opening_fill": {
              "type": "string",
              "default": "#ECE9E3",
              "description": "A door's threshold on plan and texture."
            },
            "ground_3d": {
              "type": "string",
              "default": "#B9BDB6",
              "description": "The 3D ground around the floor."
            },
            "finish": {
              "$ref": "#/$defs/wall_finish"
            }
          },
          "additionalProperties": false
        },
        "floor_tile": {
          "type": [
            "number",
            "null"
          ],
          "exclusiveMinimum": 0,
          "default": 0.6,
          "description": "Tile joints on the floor texture, metres; null for none."
        },
        "rooms": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "rect": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "minItems": 4,
                "maxItems": 4
              },
              "polygon": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/point"
                },
                "minItems": 3
              },
              "fill": {
                "type": "string",
                "description": "A colour or palette name; absent = no fill."
              },
              "walls": {
                "type": "boolean",
                "default": true
              },
              "label": {
                "anyOf": [
                  {
                    "const": false
                  },
                  {
                    "$ref": "#/$defs/building_label"
                  }
                ],
                "description": "false hides it; the text defaults to the name, the place to the centroid."
              },
              "height": {
                "type": "number",
                "exclusiveMinimum": 0,
                "description": "This room's wall height, metres; absent = walls.height."
              },
              "thickness": {
                "type": "number",
                "exclusiveMinimum": 0,
                "description": "This room's wall thickness, metres; absent = walls.thickness."
              },
              "finish": {
                "$ref": "#/$defs/wall_finish"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          }
        },
        "wall_lines": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "A free-standing wall: a polyline through its points, cut by the openings on it like a room's walls.",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "points": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/point"
                },
                "minItems": 2,
                "description": "[[x, y], ...] metres, at least two."
              },
              "height": {
                "type": "number",
                "exclusiveMinimum": 0,
                "description": "Wall height, metres; absent = walls.height."
              },
              "thickness": {
                "type": "number",
                "exclusiveMinimum": 0,
                "description": "Wall thickness, metres; absent = walls.thickness."
              },
              "finish": {
                "$ref": "#/$defs/wall_finish"
              }
            },
            "required": [
              "points"
            ],
            "additionalProperties": false
          }
        },
        "openings": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "A door or curtain cut into a wall: attached (wall, at, width; it follows the wall when the wall moves) or free (a and b, two points on a wall line). One that cuts no wall is a W_OPENING_OFF_WALL warning.",
            "properties": {
              "wall": {
                "type": "object",
                "description": "{\"room\": name, \"edge\": k} or {\"line\": index, \"edge\": k}: edge k runs from point k to k + 1 (a rect's from its top-left, clockwise; a room's last edge closes it).",
                "properties": {
                  "room": {
                    "type": "string",
                    "minLength": 1
                  },
                  "line": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "edge": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "edge"
                ],
                "additionalProperties": false
              },
              "at": {
                "type": "number",
                "minimum": 0,
                "maximum": 1,
                "description": "The centre's place along the edge, 0..1."
              },
              "width": {
                "type": "number",
                "exclusiveMinimum": 0,
                "description": "Metres."
              },
              "a": {
                "$ref": "#/$defs/point"
              },
              "b": {
                "$ref": "#/$defs/point"
              },
              "kind": {
                "enum": [
                  "door",
                  "curtain"
                ],
                "default": "door"
              },
              "plan": {
                "type": "boolean",
                "default": true,
                "description": "false cuts the 3D walls only; the plan keeps the wall."
              }
            },
            "anyOf": [
              {
                "required": [
                  "wall",
                  "at",
                  "width"
                ]
              },
              {
                "required": [
                  "a",
                  "b"
                ]
              }
            ],
            "additionalProperties": false
          }
        },
        "markings": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "A floor marking (an aisle line, a parking box, a hatched no-go area): painted on the floor of the plan, the floor texture and the 3D view, with no height.",
            "properties": {
              "points": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/point"
                },
                "minItems": 2,
                "description": "[[x, y], ...] metres; three or more when closed."
              },
              "closed": {
                "type": "boolean",
                "default": false,
                "description": "true joins the last point to the first: an area."
              },
              "color": {
                "type": "string",
                "default": "yellow",
                "description": "yellow, white, red, orange, green, blue, black (the RAL signal colours) or \"#RRGGBB\"."
              },
              "style": {
                "enum": [
                  "solid",
                  "dashed",
                  "hatch"
                ],
                "default": "solid",
                "description": "hatch fills a closed marking with stripes (a no-go area)."
              },
              "width": {
                "type": "number",
                "exclusiveMinimum": 0,
                "default": 0.1,
                "description": "The line's width, metres."
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "description": "Text painted at its middle."
              }
            },
            "required": [
              "points"
            ],
            "additionalProperties": false
          }
        },
        "labels": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/building_label"
          }
        },
        "fixtures": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "Plan-only furniture: a rect or a line.",
            "properties": {
              "rect": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "minItems": 4,
                "maxItems": 4
              },
              "line": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/point"
                },
                "minItems": 2,
                "maxItems": 2
              },
              "fill": {
                "type": "string"
              },
              "stroke": {
                "type": "string"
              },
              "stroke_width": {
                "type": "number",
                "minimum": 0
              },
              "radius": {
                "type": "number",
                "minimum": 0
              },
              "dash": {
                "$ref": "#/$defs/point"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "required": [
        "extent"
      ],
      "additionalProperties": false
    },
    "wall_finish": {
      "type": "string",
      "description": "A wall's surface: a texture (plaster, brick, concrete, tile, wood) or a \"#RRGGBB\" flat colour; absent = walls.face_color.",
      "anyOf": [
        {
          "enum": [
            "plaster",
            "brick",
            "concrete",
            "tile",
            "wood"
          ]
        },
        {
          "pattern": "^#[0-9A-Fa-f]{6}$"
        }
      ]
    },
    "building_label": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "minLength": 1,
          "description": "\\n starts a second line."
        },
        "at": {
          "$ref": "#/$defs/point"
        },
        "size": {
          "type": "number",
          "exclusiveMinimum": 0,
          "default": 0.55,
          "description": "Font size, metres."
        },
        "weight": {
          "type": "integer",
          "minimum": 100,
          "maximum": 900,
          "default": 600
        },
        "color": {
          "type": "string"
        },
        "anchor": {
          "enum": [
            "start",
            "middle",
            "end"
          ],
          "default": "middle"
        }
      },
      "additionalProperties": false
    },
    "subscript": {
      "type": "object",
      "description": "A dimension: a record with \"dims\": [name] is flattened into one record per element when the model is built.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "An identifier, written as \"[name]\" in a lookup."
        },
        "description": {
          "type": "string",
          "description": "What the dimension stands for; the run does not read it."
        },
        "elements": {
          "type": "array",
          "minItems": 1,
          "uniqueItems": true,
          "items": {
            "type": [
              "string",
              "integer"
            ]
          },
          "description": "Element names, in output order."
        },
        "parent": {
          "type": "string",
          "description": "Makes this a subrange of that dimension: its elements are a subset of the parent's. \"x[North]\" reads the owner's element inside an owner over North or its parent; SUM(x[North*]) sums the subset."
        },
        "map_to": {
          "type": "object",
          "description": "Maps this dimension element-wise onto another : inside an owner over this one, \"x[dim]\" reads the corresponding element (and the reverse when it is one-to-one).",
          "properties": {
            "dim": {
              "type": "string",
              "minLength": 1
            },
            "elements": {
              "type": "array",
              "items": {
                "type": [
                  "string",
                  "integer"
                ]
              },
              "description": "The target element of each element, in order; absent maps by position (same size)."
            }
          },
          "required": [
            "dim"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "name",
        "elements"
      ],
      "additionalProperties": false
    },
    "auxiliary": {
      "type": "object",
      "description": "A named expression read as AUX(\"name\"): evaluated on read, memoised per pass of the level engine. A flow reading an auxiliary that reads LEVEL() or TNOW is re-integrated on the SD grid.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The auxiliary's name, the argument of AUX(\"name\")."
        },
        "dims": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true,
          "description": "Subscripts this record runs over: it is flattened into one record per element, named \"Name[north]\" (\"Name[north,young]\" for two). Inside, \"x[dim]\" in a LEVEL/FLOW/AUX/DELAY name reads the same element, and SUM(x)/MEAN(x) aggregate over \"x[*]\"."
        },
        "elements": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "number"
            ]
          },
          "description": "Per-element equations: {\"north\": \"2\", \"a,x\": \"3\"} replaces the record's first expression (a level's initial, a flow's rate, an auxiliary's expr, a delay's input) for those elements; the shared one covers the rest. Keys join one element per dim with a comma."
        },
        "description": {
          "type": "string",
          "description": "What the auxiliary computes; the run does not read it."
        },
        "expr": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string",
              "minLength": 1
            }
          ],
          "description": "A number, or any flow-rate expression; may call AUX() of another auxiliary (no cycles) and the inline delays.",
          "default": "0"
        },
        "unit": {
          "type": "string",
          "description": "Label only."
        },
        "diagram": {
          "type": "object",
          "description": "Position in the stock-and-flow view; ignored by the engine."
        },
        "locals": {
          "type": "object",
          "description": "Submodel parameter bindings, written by flattening; not authored by hand."
        }
      },
      "required": [
        "name",
        "expr"
      ],
      "additionalProperties": false
    },
    "delay": {
      "type": "object",
      "description": "A delay read as DELAY(\"name\"). material: n stages each drained at S/(tau/n), the output is the outflow; information (SMOOTH): n stages chasing the input, the output is the last; both need simulation.sd. pipeline (DELAYP): the input exactly tau later, no grid needed. sample (SAMPLE_IF_TRUE): holds the last input read while condition was true, initial before the first true reading -- \"input\"/\"delay_time\" do not apply, use \"condition\"/\"input\". noise (NOISE_NORMAL): a normal draw clipped to [lo, hi], redrawn once per re-evaluation from a stream fixed by this delay's own name (CRN) -- use \"mean\"/\"sd\"/\"lo\"/\"hi\" instead of \"input\"/\"delay_time\"; refused under RK4. Inline SMOOTH/SMOOTH3/DELAY1/DELAY3/DELAYN/DELAYP/INITIAL/ACTIVE_INITIAL/SAMPLE_IF_TRUE/TREND/FORECAST/NPV/NOISE_NORMAL calls in a level's initial value, a flow rate, an auxiliary or a delay field are shorthand for these records (INITIAL becomes a hidden level, not a delay).",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The delay's name, the argument of DELAY(\"name\")."
        },
        "dims": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "uniqueItems": true,
          "description": "Subscripts this record runs over: it is flattened into one record per element, named \"Name[north]\" (\"Name[north,young]\" for two). Inside, \"x[dim]\" in a LEVEL/FLOW/AUX/DELAY name reads the same element, and SUM(x)/MEAN(x) aggregate over \"x[*]\"."
        },
        "elements": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "number"
            ]
          },
          "description": "Per-element equations: {\"north\": \"2\", \"a,x\": \"3\"} replaces the record's first expression (a level's initial, a flow's rate, an auxiliary's expr, a delay's input) for those elements; the shared one covers the rest. Keys join one element per dim with a comma."
        },
        "description": {
          "type": "string",
          "description": "What the delay stands for; the run does not read it."
        },
        "input": {
          "type": [
            "string",
            "number"
          ],
          "description": "What is delayed: a rate for a material delay, a value otherwise; the sampled value for \"sample\" (required for every kind but \"noise\").",
          "default": "0"
        },
        "delay_time": {
          "type": [
            "string",
            "number"
          ],
          "description": "tau, in the model's base time unit (> 0); a pipeline reads it once at run start. Required for material/information/pipeline only.",
          "x-quantity": "time",
          "x-unit-key": "delay_time_unit",
          "default": "1"
        },
        "delay_time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit `delay_time` is in."
        },
        "kind": {
          "type": "string",
          "enum": [
            "material",
            "information",
            "pipeline",
            "sample",
            "noise"
          ],
          "default": "material",
          "description": "The kind of delay; the section's description says what each one does."
        },
        "order": {
          "description": "Number of stages (material/information).",
          "x-quantity": "count",
          "type": "integer",
          "minimum": 1,
          "default": 1
        },
        "initial": {
          "type": [
            "string",
            "number"
          ],
          "default": 0,
          "description": "The output at t=0 (not \"noise\", which has none)."
        },
        "condition": {
          "type": [
            "string",
            "number"
          ],
          "description": "\"sample\" only: sampled again whenever true."
        },
        "mean": {
          "type": [
            "string",
            "number"
          ],
          "description": "\"noise\" only."
        },
        "sd": {
          "type": [
            "string",
            "number"
          ],
          "description": "\"noise\" only."
        },
        "lo": {
          "type": [
            "string",
            "number"
          ],
          "description": "\"noise\" only: clip floor."
        },
        "hi": {
          "type": [
            "string",
            "number"
          ],
          "description": "\"noise\" only: clip ceiling."
        },
        "unit": {
          "type": "string",
          "description": "Label only."
        },
        "diagram": {
          "type": "object",
          "description": "Position in the stock-and-flow view; ignored by the engine."
        },
        "locals": {
          "type": "object",
          "description": "Submodel parameter bindings, written by flattening; not authored by hand."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "agent_action": {
      "oneOf": [
        {
          "type": "object",
          "title": "set",
          "description": "Set self.<attribute> or a model variable to an expression's value.",
          "properties": {
            "target": {
              "type": "string",
              "minLength": 1
            },
            "expr": {
              "type": [
                "string",
                "number"
              ]
            }
          },
          "required": [
            "target",
            "expr"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "send",
          "description": "Send a message, delivered at the same instant (FIFO); the receiving transition reads `payload`.",
          "properties": {
            "send": {
              "type": "string",
              "minLength": 1
            },
            "to": {
              "$ref": "#/$defs/agent_target"
            },
            "payload": {
              "type": [
                "string",
                "number"
              ]
            }
          },
          "required": [
            "send",
            "to"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "enter",
          "description": "Create an entity at a block; entity.agent is this agent.",
          "properties": {
            "enter": {
              "type": "string",
              "minLength": 1
            },
            "e_type": {
              "type": "string"
            }
          },
          "required": [
            "enter"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "transfer",
          "description": "Move an amount into or out of a level (the TRANSFER block's instant move).",
          "properties": {
            "transfer": {
              "type": "string",
              "minLength": 1
            },
            "amount": {
              "type": [
                "string",
                "number"
              ]
            },
            "mode": {
              "type": "string",
              "enum": [
                "remove",
                "add"
              ]
            }
          },
          "required": [
            "transfer",
            "amount"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "signal",
          "description": "Raise a signal, releasing every HOLD (mode Signal) waiting on it.",
          "properties": {
            "signal": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "signal"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "move_to",
          "description": "Move at the type's `speed` to a point, a network node or another agent; arrival delivers an \"arrived\" message. A literal [x, y] point, or an expression: a string constant (\"'dock'\") for a node, [x, y] for a computed point, AGENT(\"Pop\", i) for another agent.",
          "properties": {
            "move_to": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "minItems": 2,
                  "maxItems": 2
                },
                {
                  "type": "string",
                  "minLength": 1
                }
              ]
            }
          },
          "required": [
            "move_to"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "spawn",
          "description": "Add agents to a population: count (default 1) and the init expressions are evaluated in the spawner's scope; a newborn starts in state (default its type's initial state), its own attribute inits run first. More than the population's max_count alive at once stops the run (E_POPULATION_FULL).",
          "properties": {
            "spawn": {
              "type": "string",
              "minLength": 1
            },
            "count": {
              "type": [
                "string",
                "integer"
              ]
            },
            "state": {
              "type": "string"
            },
            "init": {
              "type": "object",
              "additionalProperties": {
                "type": [
                  "string",
                  "number"
                ]
              }
            }
          },
          "required": [
            "spawn"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "remove",
          "description": "Remove agents: \"self\" ends the firing there; any send target works. A ref kept to a removed agent raises when used; ALIVE(ref) tests it.",
          "properties": {
            "remove": {
              "$ref": "#/$defs/agent_target"
            }
          },
          "required": [
            "remove"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "step",
          "description": "Grid only: move by [dx, dy] whole cells, instantly; off the edge of a non-torus grid the agent stays.",
          "properties": {
            "step": {
              "type": "array",
              "minItems": 2,
              "maxItems": 2,
              "items": {
                "type": [
                  "integer",
                  "string"
                ]
              }
            }
          },
          "required": [
            "step"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "move_random",
          "description": "Grid only: to a neighbourhood cell drawn uniformly from the agent's own stream; \"free\": only cells holding no agent of its population (none: it stays).",
          "properties": {
            "move_random": {
              "type": "string",
              "enum": [
                "any",
                "free"
              ]
            }
          },
          "required": [
            "move_random"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "link",
          "description": "Link self to each target (agents of its own population; self is skipped).",
          "properties": {
            "link": {
              "$ref": "#/$defs/agent_target"
            }
          },
          "required": [
            "link"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "unlink",
          "description": "Drop self's links to each target (\"links\": all).",
          "properties": {
            "unlink": {
              "$ref": "#/$defs/agent_target"
            }
          },
          "required": [
            "unlink"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "python",
          "description": "Call fn(agent, api), a top-level def in the type's `python`. Runs only with the caller's consent (NAGASIM_ALLOW_AGENT_PYTHON=1); a model file cannot grant it.",
          "properties": {
            "python": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "python"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "forward",
          "description": "Move `self.heading` degrees' worth forward by an expression's distance; a continuous space only.",
          "properties": {
            "forward": {
              "type": [
                "string",
                "number"
              ]
            }
          },
          "required": [
            "forward"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "turn",
          "description": "Add an expression's degrees to `self.heading`; a continuous space only.",
          "properties": {
            "turn": {
              "type": [
                "string",
                "number"
              ]
            }
          },
          "required": [
            "turn"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "face",
          "description": "Set `self.heading` toward a point, a network node or another agent -- the same target shapes as move_to.",
          "properties": {
            "face": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "minItems": 2,
                  "maxItems": 2
                },
                {
                  "type": "string",
                  "minLength": 1
                }
              ]
            }
          },
          "required": [
            "face"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "title": "random_walk",
          "description": "Move forward by \"step\", after turning by NORM(0, turn_sd) degrees (default 0, a straight walk).",
          "properties": {
            "random_walk": {
              "type": "object",
              "properties": {
                "step": {
                  "type": [
                    "string",
                    "number"
                  ]
                },
                "turn_sd": {
                  "type": [
                    "string",
                    "number"
                  ]
                }
              },
              "required": [
                "step"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "random_walk"
          ],
          "additionalProperties": false
        }
      ]
    },
    "agent_target": {
      "description": "\"self\", an index in the sender's population, an expression giving an agent (AGENT(\"Pop\", i), entity.agent), or a population with an optional condition on the recipient and a random pick; \"links\" or {\"links\": true, ...}, self's linked neighbours instead of a population.",
      "anyOf": [
        {
          "type": [
            "string",
            "integer"
          ]
        },
        {
          "type": "object",
          "properties": {
            "population": {
              "type": "string",
              "minLength": 1
            },
            "where": {
              "type": "string"
            },
            "random": {
              "type": "boolean"
            }
          },
          "required": [
            "population"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "links": {
              "const": true
            },
            "where": {
              "type": "string"
            },
            "random": {
              "type": "boolean"
            }
          },
          "required": [
            "links"
          ],
          "additionalProperties": false
        }
      ]
    },
    "agent_tick": {
      "type": "object",
      "description": "A fixed-step schedule, ticks at phase + k * dt (k an integer, strictly after the run start). synchronous: every agent reads the tick-start state (on_tick for all, then tick transitions for all); random: a fresh permutation per tick; sequential: index order. A population's keys override its type's.",
      "properties": {
        "dt": {
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "type": "number",
          "exclusiveMinimum": 0
        },
        "activation": {
          "type": "string",
          "enum": [
            "synchronous",
            "random",
            "sequential"
          ],
          "default": "synchronous"
        },
        "phase": {
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "type": "number",
          "default": 0.0,
          "minimum": 0
        },
        "time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit `dt` and `phase` are in."
        }
      },
      "additionalProperties": false
    },
    "agent_state": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "entry": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/agent_action"
          }
        },
        "exit": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/agent_action"
          }
        },
        "parent": {
          "type": "string",
          "minLength": 1,
          "description": "The composite state this one nests in; a state is composite iff another names it here."
        },
        "initial": {
          "type": "string",
          "minLength": 1,
          "description": "Composite only: the child entered first (default: its first child in declaration order)."
        },
        "color": {
          "type": "string"
        },
        "diagram": {
          "type": "object",
          "description": "Editor position; ignored by the engine."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "agent_transition": {
      "type": "object",
      "description": "Exactly one trigger: timeout (a duration from entry), rate (per agent per time unit: shared, own or own * shared), condition (re-checked after each agent event), message (a name, \"\" for any; guard and actions read `payload`) or tick (a condition checked at each of the population's ticks, \"\" for every tick).",
      "properties": {
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "timeout": {
          "type": [
            "string",
            "number"
          ],
          "x-quantity": "time",
          "x-unit-key": "timeout_unit",
          "minimum": 0
        },
        "timeout_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit `timeout` is in."
        },
        "rate": {
          "type": [
            "string",
            "number"
          ],
          "x-quantity": "rate",
          "x-unit-key": "rate_unit",
          "minimum": 0
        },
        "rate_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Time unit `rate` is per."
        },
        "condition": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "tick": {
          "type": "string"
        },
        "guard": {
          "type": "string"
        },
        "scan": {
          "description": "Re-check a rate or condition every scan time units (for inputs that move outside the agents).",
          "x-quantity": "time",
          "x-unit-key": "scan_unit",
          "type": "number",
          "exclusiveMinimum": 0
        },
        "scan_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit `scan` is in."
        },
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/agent_action"
          }
        },
        "history": {
          "type": "string",
          "enum": [
            "shallow",
            "deep"
          ],
          "description": "Composite target only: re-enter at the child (shallow) or leaf (deep) it was left in."
        },
        "diagram": {
          "type": "object"
        }
      },
      "required": [
        "from",
        "to"
      ],
      "additionalProperties": false
    },
    "agent_type": {
      "type": "object",
      "description": "A statechart run for every agent of a population; parameters are names in its expressions, self.<attribute> reads the agent's own columns (plus self.state, self.id).",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The agent type's name, the `type` of a population."
        },
        "description": {
          "type": "string",
          "description": "What the agents of this type are; the run does not read it."
        },
        "parameters": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          },
          "description": "Named numbers every agent of the type reads in its expressions."
        },
        "attributes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "init": {
                "default": "0",
                "anyOf": [
                  {
                    "type": [
                      "string",
                      "number"
                    ]
                  },
                  {
                    "type": "object",
                    "description": "Row i of the population's own table for agent i.",
                    "properties": {
                      "column": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "column"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "kind": {
                "type": "string",
                "enum": [
                  "number",
                  "category"
                ],
                "default": "number",
                "description": "\"category\" stores init/set as one of \"categories\" (a closed set); self.<attr> reads back the category name."
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 2,
                "uniqueItems": true,
                "description": "Required when kind is \"category\"."
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "description": "The columns each agent carries, with their starting values."
        },
        "states": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/agent_state"
          },
          "description": "The statechart's states, with the actions they run on entry and exit."
        },
        "transitions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/agent_transition"
          },
          "description": "The moves between states and what triggers each."
        },
        "initial_state": {
          "type": "string",
          "description": "The state every agent starts in."
        },
        "space": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "object",
              "description": "Continuous 2D bounds, or the model's own \"network\" section; A grid of cells with patches.",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "continuous",
                    "network",
                    "grid"
                  ]
                },
                "bounds": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  },
                  "minItems": 4,
                  "maxItems": 4,
                  "description": "[x0, y0, x1, y1], continuous only."
                },
                "edge": {
                  "type": "string",
                  "enum": [
                    "none",
                    "clamp",
                    "wrap",
                    "bounce"
                  ],
                  "default": "none",
                  "description": "Continuous only: what a move_to/forward/random_walk step does at the bounds -- pass through, clamp inside, wrap to the opposite edge, or bounce the heading."
                },
                "size": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "minItems": 2,
                  "maxItems": 2,
                  "description": "Grid only: [w, h] cells."
                },
                "cell": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "default": 1,
                  "description": "Grid only: a cell's side; agents sit at cell centres ((cx + 0.5) * cell, ...)."
                },
                "torus": {
                  "type": "boolean",
                  "default": false,
                  "description": "Grid only: the edges wrap."
                },
                "neighbourhood": {
                  "type": "string",
                  "enum": [
                    "moore",
                    "von_neumann"
                  ],
                  "default": "moore",
                  "description": "Grid only: the 8 or 4 cells NEIGHBOURS, move_random and diffuse use."
                },
                "patches": {
                  "type": "array",
                  "description": "Grid only: per-cell values read by PATCH(\"name\"[, dx, dy]) and written by a set of \"patch.<name>\".",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "init": {
                        "type": [
                          "number",
                          "string"
                        ],
                        "default": 0,
                        "description": "A number, or an expression of cx, cy (e.g. TABLE(...))."
                      },
                      "diffuse": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1,
                        "default": 0
                      },
                      "evaporate": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1,
                        "default": 0
                      },
                      "grow": {
                        "type": "object",
                        "description": "Each patch tick a cell below max gains rate, clipped at max (default: its initial value).",
                        "properties": {
                          "rate": {
                            "type": "number",
                            "minimum": 0
                          },
                          "max": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "rate"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "additionalProperties": false
                  }
                },
                "patch_tick": {
                  "description": "Grid only: every patch diffuses, evaporates, then grows at k * patch_tick.",
                  "x-quantity": "time",
                  "x-unit-key": "time_unit",
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "time_unit": {
                  "type": "string",
                  "enum": [
                    "base",
                    "milliseconds",
                    "seconds",
                    "minutes",
                    "hours",
                    "days",
                    "weeks",
                    "months",
                    "years"
                  ],
                  "default": "base",
                  "description": "Unit `patch_tick` is in."
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false
            }
          ],
          "description": "Where the agents live: nowhere, a continuous plane, a grid or the model's network."
        },
        "speed": {
          "type": [
            "string",
            "number"
          ],
          "description": "An expression (self, parameters, constants) a move_to evaluates once, in the space's own units per time unit.",
          "x-quantity": "speed",
          "x-unit-key": "speed_unit",
          "default": "1"
        },
        "speed_unit": {
          "type": "string",
          "pattern": "^(base|(mm|cm|m|km)/(ms|s|min|h|day|week|month|year))$",
          "default": "base",
          "description": "Unit `speed` is in."
        },
        "tick": {
          "$ref": "#/$defs/agent_tick"
        },
        "let": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "number"
            ]
          },
          "description": "Tick-local values, {name: expression}, evaluated in order once per agent per tick before on_tick; read as a bare name by on_tick and the tick transitions."
        },
        "on_tick": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/agent_action"
          },
          "description": "Actions every agent runs at each tick, before its tick transitions."
        },
        "python": {
          "type": "string",
          "description": "Def statements only; {python: <fn>} actions call fn(agent, api). Parsed at validation, never run there; a run needs the caller's consent (NAGASIM_ALLOW_AGENT_PYTHON=1)."
        }
      },
      "required": [
        "name",
        "states"
      ],
      "additionalProperties": false
    },
    "population": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The population's name."
        },
        "description": {
          "type": "string",
          "description": "What the population stands for; the run does not read it."
        },
        "type": {
          "type": "string",
          "minLength": 1,
          "description": "The agent type its agents follow."
        },
        "count": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "object",
              "description": "The number of rows of a model table (one agent per row), or the sum of one of its columns (a group table).",
              "properties": {
                "table": {
                  "type": "string",
                  "minLength": 1
                },
                "column": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "table"
              ],
              "additionalProperties": false
            }
          ],
          "x-quantity": "count",
          "default": 0,
          "description": "How many agents start: a number, or the rows of a table."
        },
        "max_count": {
          "description": "The most agents alive at once when spawn actions add some (>= count); default count.",
          "x-quantity": "count",
          "type": "integer",
          "minimum": 0
        },
        "tick": {
          "$ref": "#/$defs/agent_tick"
        },
        "network": {
          "type": "object",
          "description": "The initial links between this population's agents, drawn at run start from its own network stream. random: G(n, p) (p, or mean_degree = p (n - 1)); small_world: Watts-Strogatz ring of k neighbours, each link rewired with probability beta; scale_free: Barabasi-Albert, m links per new agent; table: a model table's \"from\"/\"to\" columns (agent indices); none: no initial links.",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "none",
                "random",
                "small_world",
                "scale_free",
                "table"
              ]
            },
            "directed": {
              "type": "boolean",
              "default": false,
              "description": "random and table only."
            },
            "link_on_spawn": {
              "type": "boolean",
              "default": false,
              "description": "A newborn starts linked to the agent of this population that spawned it."
            },
            "p": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "mean_degree": {
              "type": "number",
              "minimum": 0
            },
            "k": {
              "type": "integer",
              "minimum": 2
            },
            "beta": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 0
            },
            "m": {
              "type": "integer",
              "minimum": 1
            },
            "table": {
              "type": "string",
              "minLength": 1
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        "color_by": {
          "type": "string",
          "minLength": 1,
          "description": "A declared categorical attribute; playback colours the population's tokens by its current category instead of by state (2D and 3D)."
        },
        "colors": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "{category: colour name}, the palette color_by draws from -- the same names a statechart state's own \"color\" uses. Presentational only, like that field."
        },
        "initial": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string"
              },
              "count": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "state",
              "count"
            ],
            "additionalProperties": false
          },
          "description": "The first agents by index start in these states, the rest in the type's initial state."
        },
        "placement": {
          "type": "object",
          "description": "Only meaningful when the type has a space: default {\"kind\": \"random\"} (uniform over the space's own bounds, or a uniform random network node, both from the agent's own stream).",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "random",
                "table"
              ]
            },
            "bounds": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 4,
              "maxItems": 4,
              "description": "Overrides the space's own bounds (continuous, kind random)."
            },
            "points": {
              "type": "array",
              "description": "[[x, y], ...], one per agent by index, cycled (continuous, kind table); on a grid, cells [cx, cy].",
              "items": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "minItems": 2,
                "maxItems": 2
              }
            },
            "nodes": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Network node names, one per agent by index, cycled (network, kind table)."
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "name",
        "type",
        "count"
      ],
      "additionalProperties": false
    },
    "sequence": {
      "type": "object",
      "description": "A routing: an ordered list of operations a product follows through STATION blocks. A ROUTE block sends an entity whose `sequence` attribute names this one to each step's station in turn, assigning that step's \"values\" as entity attributes on the way.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The routing's name, the value of an entity's `sequence` attribute."
        },
        "description": {
          "type": "string",
          "description": "What the routing is for; the run does not read it."
        },
        "steps": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "properties": {
              "station": {
                "type": "string",
                "minLength": 1,
                "description": "Name of a STATION block; inside a submodel instance that is the flattened \"instance/station\" path."
              },
              "values": {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "number",
                    "string",
                    "boolean"
                  ]
                },
                "description": "Attributes assigned to the entity when it is sent to this step, e.g. {\"process_time\": 3}."
              }
            },
            "required": [
              "station"
            ],
            "additionalProperties": false
          },
          "description": "The operations in order: each names a station and the attributes to assign there."
        }
      },
      "required": [
        "name",
        "steps"
      ],
      "additionalProperties": false
    },
    "network": {
      "type": "object",
      "description": "The path network: nodes at real layout coordinates and the segments joining them. Travel between two places is the shortest path along the segments, so a distance is geometry, not a guess.",
      "properties": {
        "length_factor": {
          "description": "Multiplies the straight-line distance when a segment declares no explicit length. 1.0 is straight aisles.",
          "x-quantity": "ratio",
          "type": "number",
          "exclusiveMinimum": 0,
          "default": 1.0
        },
        "nodes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              },
              "capacity": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "description": "Recorded, not enforced in this build."
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          }
        },
        "segments": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "minLength": 1
              },
              "to": {
                "type": "string",
                "minLength": 1
              },
              "length": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Null takes the straight-line distance x length_factor.",
                "x-quantity": "length",
                "x-unit-key": "length_unit",
                "exclusiveMinimum": 0
              },
              "length_unit": {
                "type": "string",
                "enum": [
                  "base",
                  "millimeters",
                  "centimeters",
                  "meters",
                  "kilometers"
                ],
                "default": "base",
                "description": "Unit `length` is in."
              },
              "two_way": {
                "type": "boolean",
                "default": true
              },
              "speed": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Speed LIMIT on this segment; it changes travel time, never the route chosen.",
                "x-quantity": "speed",
                "x-unit-key": "speed_unit",
                "exclusiveMinimum": 0
              },
              "speed_unit": {
                "type": "string",
                "pattern": "^(base|(mm|cm|m|km)/(ms|s|min|h|day|week|month|year))$",
                "default": "base",
                "description": "Unit `speed` is in."
              },
              "capacity": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Vehicles allowed on it at once (zone control, both directions of a two-way segment together); null is unlimited .",
                "x-quantity": "count",
                "minimum": 1
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "motion_profile": {
      "type": "object",
      "description": "How something moves (automation sub-project 1): a robot, a person or a mechanism, named by a MOTION block's `profile`. The rules are the same for every kind.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The profile's name, the `profile` of a MOTION block."
        },
        "description": {
          "type": "string",
          "description": "What the profile stands for; the run does not read it."
        },
        "kind": {
          "type": "string",
          "enum": [
            "robot",
            "human",
            "mechanism"
          ],
          "default": "robot",
          "description": "What moves: a \"robot\", a \"human\" or a \"mechanism\"."
        },
        "speed": {
          "description": "m/s.",
          "x-quantity": "speed",
          "x-unit-key": "speed_unit",
          "type": "number",
          "exclusiveMinimum": 0,
          "default": 1.0
        },
        "speed_unit": {
          "type": "string",
          "pattern": "^(base|(mm|cm|m|km)/(ms|s|min|h|day|week|month|year))$",
          "default": "m/s",
          "description": "Unit `speed` and `collaborative_speed` are in."
        },
        "accel": {
          "description": "m/s^2.",
          "type": "number",
          "exclusiveMinimum": 0,
          "default": 1.0
        },
        "payload_max": {
          "type": [
            "number",
            "null"
          ],
          "description": "kg; null or absent = no payload derating.",
          "x-quantity": "mass",
          "x-unit-key": "payload_unit",
          "exclusiveMinimum": 0
        },
        "payload_unit": {
          "type": "string",
          "enum": [
            "base",
            "g",
            "kg",
            "t"
          ],
          "default": "kg",
          "description": "Unit `payload_max` is in."
        },
        "payload_derate": {
          "type": [
            "number",
            "null"
          ],
          "default": 1.0,
          "description": "Speed fraction at payload_max, linear from 1.0 at 0 kg.",
          "x-quantity": "ratio",
          "exclusiveMinimum": 0,
          "maximum": 1
        },
        "collaborative_speed": {
          "type": [
            "number",
            "null"
          ],
          "description": "m/s; required when a block uses hrc \"collaborative\" or \"separation\".",
          "x-quantity": "speed",
          "x-unit-key": "speed_unit",
          "exclusiveMinimum": 0
        }
      },
      "required": [
        "name",
        "speed",
        "accel"
      ],
      "additionalProperties": false
    },
    "robot": {
      "type": "object",
      "description": "A robot type: a structure with its dimensions, or a joint chain, with each actuated axis's range, speed and acceleration, and the tool frame. A MOTION block names it by `robot`. Frame: Z up, X forward; degrees, metres and seconds throughout.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The robot's name, the `robot` of a MOTION block."
        },
        "description": {
          "type": "string",
          "description": "What the robot is; the run does not read it."
        },
        "structure": {
          "type": "string",
          "enum": [
            "serial6",
            "palletizer4",
            "scara4",
            "delta",
            "gantry",
            "serial7",
            "chain"
          ],
          "description": "The structure template, or \"chain\" for a robot given by its joints."
        },
        "params": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          },
          "description": "The template's dimensions in metres (a template names the ones it needs)."
        },
        "joints": {
          "type": "array",
          "description": "With structure \"chain\" only: the serial joints at the zero pose, each {name, type: revolute|prismatic, origin [m], axis, parent?, coupled?: {axis: factor}, passive?}.",
          "items": {
            "type": "object"
          }
        },
        "axes": {
          "type": "array",
          "description": "One per actuated axis, in the template's order.",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "range": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "minItems": 2,
                "maxItems": 2,
                "description": "[lo, hi]: degrees, or metres for a prismatic axis."
              },
              "speed": {
                "type": "number",
                "exclusiveMinimum": 0,
                "description": "deg/s, or m/s for a prismatic axis."
              },
              "accel": {
                "type": "number",
                "exclusiveMinimum": 0,
                "description": "deg/s^2, or m/s^2 for a prismatic axis."
              }
            },
            "required": [
              "range",
              "speed",
              "accel"
            ],
            "additionalProperties": false
          }
        },
        "tool": {
          "type": "object",
          "description": "The tool frame (TCP) from the flange.",
          "properties": {
            "xyz": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Metres."
            },
            "rpy_deg": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 3,
              "maxItems": 3,
              "description": "Roll, pitch, yaw in degrees."
            }
          },
          "additionalProperties": false
        },
        "home": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "The rest pose, one value per axis; all zeros clipped into range when absent."
        },
        "reach_m": {
          "type": [
            "number",
            "null"
          ],
          "description": "The datasheet reach in metres, for comparison.",
          "x-quantity": "length",
          "exclusiveMinimum": 0
        },
        "payload_max": {
          "type": [
            "number",
            "null"
          ],
          "description": "The rated payload; null or absent = no payload derating.",
          "x-quantity": "mass",
          "x-unit-key": "payload_unit",
          "exclusiveMinimum": 0
        },
        "payload_unit": {
          "type": "string",
          "enum": [
            "base",
            "g",
            "kg",
            "t"
          ],
          "default": "kg",
          "description": "Unit `payload_max` is in."
        },
        "payload_derate": {
          "type": [
            "number",
            "null"
          ],
          "default": 1.0,
          "description": "Axis speed fraction at payload_max, linear from 1.0 at 0 kg.",
          "x-quantity": "ratio",
          "exclusiveMinimum": 0,
          "maximum": 1
        },
        "tcp_speed": {
          "type": [
            "number",
            "null"
          ],
          "description": "Top tool speed along a straight-line move.",
          "x-quantity": "speed",
          "x-unit-key": "speed_unit",
          "exclusiveMinimum": 0
        },
        "speed_unit": {
          "type": "string",
          "pattern": "^(base|(mm|cm|m|km)/(ms|s|min|h|day|week|month|year))$",
          "default": "m/s",
          "description": "Unit `tcp_speed` is in."
        },
        "tcp_accel": {
          "type": [
            "number",
            "null"
          ],
          "description": "Top tool acceleration along a straight-line move, m/s^2.",
          "exclusiveMinimum": 0
        },
        "approximate": {
          "type": "boolean",
          "description": "True when the values are read from a public datasheet rather than the maker's model."
        },
        "source": {
          "type": "string",
          "description": "Where the values come from."
        }
      },
      "required": [
        "name",
        "structure",
        "axes"
      ],
      "additionalProperties": false
    },
    "pallet_pattern": {
      "type": "object",
      "description": "Where each item of a pallet goes: the pallet, the nominal item, named layer layouts, the order they repeat up the stack and the limits that close a pallet. A carrier BATCH names it by `pattern`. Lengths are in the model's length unit, weights in kg; a slot's x and y are the item's centre from the pallet's centre, x along the pallet's length, and its rotation is in degrees, clockwise from above, with the item's length along x at 0.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The pattern's name, the `pattern` of a carrier BATCH."
        },
        "description": {
          "type": "string",
          "description": "What the pattern is; the run does not read it."
        },
        "pallet": {
          "type": "object",
          "description": "The pallet's footprint, deck height and tare.",
          "properties": {
            "length": {
              "type": "number",
              "description": "Along x.",
              "x-quantity": "length"
            },
            "width": {
              "type": "number",
              "description": "Along y.",
              "x-quantity": "length"
            },
            "deck_height": {
              "type": "number",
              "default": 0,
              "description": "Height of the deck the first layer stands on.",
              "x-quantity": "length"
            },
            "tare_kg": {
              "type": "number",
              "default": 0.0,
              "description": "The empty pallet's weight.",
              "x-quantity": "mass"
            }
          },
          "required": [
            "length",
            "width"
          ],
          "additionalProperties": false
        },
        "item": {
          "type": "object",
          "description": "The nominal item, used by the checks and the generator.",
          "properties": {
            "length": {
              "type": "number",
              "description": "Along x at rotation 0.",
              "x-quantity": "length"
            },
            "width": {
              "type": "number",
              "description": "Along y at rotation 0.",
              "x-quantity": "length"
            },
            "height": {
              "type": "number",
              "description": "One layer's height.",
              "x-quantity": "length"
            },
            "weight_kg": {
              "type": [
                "number",
                "null"
              ],
              "description": "Used when an item has no `weight` attribute.",
              "x-quantity": "mass"
            }
          },
          "required": [
            "length",
            "width",
            "height"
          ],
          "additionalProperties": false
        },
        "overhang": {
          "type": [
            "number",
            "null"
          ],
          "default": 0.0,
          "description": "How far an item may pass the pallet's edge.",
          "x-quantity": "length"
        },
        "layers": {
          "type": "object",
          "description": "Layer layouts by name, each a list of slots in load order.",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "rotation": {
                  "type": "number",
                  "default": 0
                }
              },
              "required": [
                "x",
                "y"
              ],
              "additionalProperties": false
            }
          }
        },
        "stack": {
          "type": "array",
          "description": "The layers from the deck up, repeated until a limit is reached.",
          "items": {
            "type": "object",
            "properties": {
              "layer": {
                "type": "string"
              },
              "transform": {
                "type": "string",
                "enum": [
                  "rotate180",
                  "mirror_x",
                  "mirror_y"
                ]
              }
            },
            "required": [
              "layer"
            ],
            "additionalProperties": false
          }
        },
        "sheet": {
          "type": [
            "object",
            "null"
          ],
          "description": "A sheet between layers: its thickness and the time to place it (in the model's time unit), added before each layer after the first.",
          "properties": {
            "thickness": {
              "type": "number",
              "default": 0.0,
              "x-quantity": "length"
            },
            "time": {
              "type": "number",
              "default": 0.0,
              "x-quantity": "time"
            }
          },
          "additionalProperties": false
        },
        "limits": {
          "type": "object",
          "description": "The first reached closes the pallet; null = no limit. One of layers, items or height must be set.",
          "properties": {
            "layers": {
              "type": [
                "integer",
                "null"
              ],
              "x-quantity": "count"
            },
            "items": {
              "type": [
                "integer",
                "null"
              ],
              "x-quantity": "count"
            },
            "weight_kg": {
              "type": [
                "number",
                "null"
              ],
              "description": "Tare plus the items.",
              "x-quantity": "mass"
            },
            "height": {
              "type": [
                "number",
                "null"
              ],
              "description": "From the floor to the top of the stack.",
              "x-quantity": "length"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "name",
        "pallet",
        "item",
        "layers",
        "stack",
        "limits"
      ],
      "additionalProperties": false
    },
    "zone": {
      "type": "object",
      "description": "A safety zone: a network node and a radius that a MOTION block's or a tending group's `zone.name` binds to, so blocks sharing a zone share its radius. With hrc \"separation\", a worker within the radius slows the robot to its collaborative speed.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The zone's name, the `zone.name` of a MOTION block."
        },
        "description": {
          "type": "string",
          "description": "What the zone protects; the run does not read it."
        },
        "node": {
          "type": "string",
          "description": "The network node the zone is around."
        },
        "radius_m": {
          "description": "Metres, > 0; a worker this close or closer is inside.",
          "x-quantity": "length",
          "type": "number",
          "exclusiveMinimum": 0
        },
        "measure": {
          "type": "string",
          "enum": [
            "path",
            "straight"
          ],
          "default": "path",
          "description": "\"path\": the walk along the network; \"straight\": the straight line between the worker's floor point and the node, as a safety laser scanner measures it."
        }
      },
      "required": [
        "name",
        "node",
        "radius_m"
      ],
      "additionalProperties": false
    },
    "fleet": {
      "type": "object",
      "description": "A pool of vehicles that carry entities on the network. A fleet IS a resource under its own name, so schedules, failures, utilization and costs all work on it unchanged.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The fleet's name; it is also the name of the resource its vehicles form."
        },
        "description": {
          "type": "string",
          "description": "What the fleet carries; the run does not read it."
        },
        "count": {
          "x-quantity": "count",
          "type": "integer",
          "minimum": 1,
          "default": 1,
          "description": "How many vehicles the fleet has."
        },
        "kind": {
          "type": "string",
          "enum": [
            "vehicle",
            "worker"
          ],
          "default": "vehicle",
          "description": "\"worker\" lets a SEIZE/PROCESS summon a unit with `worker_fleet`; the pool is unchanged."
        },
        "motion": {
          "type": "string",
          "enum": [
            "network",
            "gantry"
          ],
          "default": "network",
          "description": "\"gantry\" travels directly between two nodes' coordinates (`speed_x`/`speed_y`/`hoist_time`), ignoring the path network and segment capacity; cannot be kind \"worker\"."
        },
        "speed_x": {
          "description": "Gantry only: speed along x, distance per model time unit.",
          "x-quantity": "speed",
          "x-unit-key": "speed_unit",
          "type": "number",
          "exclusiveMinimum": 0
        },
        "speed_y": {
          "description": "Gantry only: speed along y, distance per model time unit.",
          "x-quantity": "speed",
          "x-unit-key": "speed_unit",
          "type": "number",
          "exclusiveMinimum": 0
        },
        "hoist_time": {
          "description": "Gantry only: fixed time added to every hop (raising and lowering the load), in `time_unit`.",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "type": "number",
          "minimum": 0,
          "default": 0.0
        },
        "units": {
          "type": "array",
          "minItems": 1,
          "description": "Named units, replacing `count` when given.",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "skills": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "What `worker_skill` may ask for."
              },
              "home": {
                "type": "string",
                "description": "Node this unit starts at and parks at; defaults to the fleet's `home`."
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          }
        },
        "loads": {
          "description": "Entities one vehicle may carry on a tour: up to loads - 1 waiting TRANSPORTs ride with the one granted the vehicle. 1 on a worker fleet.",
          "x-quantity": "count",
          "type": "integer",
          "minimum": 1,
          "default": 1
        },
        "arm": {
          "type": "string",
          "description": "Name of a `motion_profiles` record: the fleet is a mobile cobot, which loads and unloads a STATION that declares `tending` with its arm. Empty or absent: an ordinary fleet. Needs kind \"vehicle\", motion \"network\" and loads 1."
        },
        "exchange": {
          "type": "boolean",
          "default": false,
          "description": "Arm fleets only: a second holding place, so a cobot arriving loaded at a machine that holds a finished part picks it, places its own and carries the finished one on."
        },
        "speed": {
          "description": "Loaded speed, distance per model time unit.",
          "x-quantity": "speed",
          "x-unit-key": "speed_unit",
          "type": "number",
          "exclusiveMinimum": 0
        },
        "speed_unit": {
          "type": "string",
          "pattern": "^(base|(mm|cm|m|km)/(ms|s|min|h|day|week|month|year))$",
          "default": "base",
          "description": "Unit of every speed of the fleet."
        },
        "speed_empty": {
          "description": "Speed when driving to a pick-up; defaults to `speed`.",
          "x-quantity": "speed",
          "x-unit-key": "speed_unit",
          "type": "number",
          "exclusiveMinimum": 0
        },
        "load_time": {
          "type": [
            "number",
            "string"
          ],
          "description": "Number or expression, in `time_unit`.",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "default": "0"
        },
        "unload_time": {
          "type": [
            "number",
            "string"
          ],
          "description": "Number or expression, in `time_unit`.",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "default": "0"
        },
        "time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit the load and unload times are in."
        },
        "home": {
          "type": "string",
          "description": "Node the vehicles start at, and return to under `park: \"home\"`."
        },
        "park": {
          "type": "string",
          "enum": [
            "stay",
            "home"
          ],
          "default": "stay",
          "description": "Where an idle vehicle waits: \"stay\" where it is, \"home\" back at its home node."
        },
        "capacity_schedule": {
          "type": "string",
          "description": "A \"capacity\"-kind schedule: how many vehicles are on shift."
        },
        "dispatch": {
          "type": "string",
          "enum": [
            "fifo",
            "nearest"
          ],
          "default": "fifo",
          "description": "Whose request is served when a vehicle frees. Priority is the primary key under both."
        },
        "select": {
          "type": "string",
          "enum": [
            "nearest",
            "longest_idle",
            "cyclic"
          ],
          "default": "nearest",
          "description": "Which idle vehicle serves a granted request."
        },
        "cost_busy": {
          "x-quantity": "rate",
          "x-unit-key": "cost_time_unit",
          "type": "number",
          "minimum": 0,
          "default": 0.0,
          "description": "Cost per time unit (see `cost_time_unit`) for a vehicle that is carrying."
        },
        "cost_idle": {
          "x-quantity": "rate",
          "x-unit-key": "cost_time_unit",
          "type": "number",
          "minimum": 0,
          "default": 0.0,
          "description": "Cost per time unit (see `cost_time_unit`) for a vehicle that is waiting."
        },
        "cost_per_use": {
          "x-quantity": "money",
          "type": "number",
          "minimum": 0,
          "default": 0.0,
          "description": "Cost added each time a vehicle is seized for a trip."
        },
        "cost_time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "hours",
          "description": "The time unit `cost_busy` and `cost_idle` are per."
        },
        "power": {
          "type": "object",
          "description": "kW per vehicle while busy/idle/blocked/down/off_shift; absent keys are 0, \"blocked\" defaults to \"busy\" (a blocked vehicle is seized).",
          "properties": {
            "busy": {
              "type": "number",
              "minimum": 0
            },
            "idle": {
              "type": "number",
              "minimum": 0
            },
            "blocked": {
              "type": "number",
              "minimum": 0
            },
            "down": {
              "type": "number",
              "minimum": 0
            },
            "off_shift": {
              "type": "number",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        "graphic": {
          "type": "string",
          "description": "Inline SVG vehicle picture (24 x 24 artboard, facing east) drawn for each unit on the floor plan; the editor's generic vehicle when absent."
        },
        "length_m": {
          "description": "Vehicle length in metres for the floor-plan marker (default 2.4).",
          "x-quantity": "length",
          "type": "number",
          "minimum": 0
        },
        "battery": {
          "type": "object",
          "description": "Each unit (vehicle, worker or gantry crane) carries a battery: it drains at the fleet's `power` kW per state and recharges at a charger once its job is done. State of charge (SoC) values are fractions, 0 to 1.",
          "properties": {
            "capacity_kwh": {
              "type": "number",
              "minimum": 0,
              "description": "Usable kWh per vehicle; 0 means no battery."
            },
            "initial": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 1.0,
              "description": "SoC at the start of the run."
            },
            "low": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "description": "A vehicle freed below this SoC goes to charge."
            },
            "target": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "default": 1.0,
              "description": "SoC charged to; above `low`."
            },
            "strategy": {
              "type": "string",
              "enum": [
                "threshold",
                "opportunity",
                "swap",
                "scheduled"
              ],
              "default": "threshold"
            },
            "opportunity_below": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 1,
              "description": "Opportunity only: an idle vehicle below it charges when a point is free, and stays dispatchable."
            },
            "schedule": {
              "type": [
                "string",
                "null"
              ],
              "description": "Scheduled only: a `schedules` record; vehicles freed while its value is > 0 charge until `target` or the window's end."
            },
            "chargers": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Chargers the fleet may use; default every charger of the kind its strategy needs."
            }
          },
          "required": [
            "capacity_kwh",
            "low"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "name",
        "speed"
      ],
      "additionalProperties": false
    },
    "charger": {
      "type": "object",
      "description": "A charger or a battery-swap station at a network node (automation sub-project 2), used by fleets that declare a `battery`.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The charger's name."
        },
        "description": {
          "type": "string",
          "description": "What the charger stands for; the run does not read it."
        },
        "node": {
          "type": "string",
          "description": "The network node it stands at."
        },
        "kind": {
          "type": "string",
          "enum": [
            "charge",
            "swap"
          ],
          "default": "charge",
          "description": "\"charge\" refills the battery in place, \"swap\" exchanges it for a full one."
        },
        "points": {
          "description": "Vehicles served at once.",
          "x-quantity": "count",
          "type": "integer",
          "minimum": 1,
          "default": 1
        },
        "power_kw": {
          "description": "kW per point; for \"swap\", the rate a removed pack recharges at.",
          "x-quantity": "power",
          "type": "number",
          "exclusiveMinimum": 0
        },
        "knee": {
          "description": "Above this SoC the power falls linearly.",
          "x-quantity": "ratio",
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "default": 0.8
        },
        "taper_floor": {
          "description": "Share of `power_kw` left at 100 %.",
          "x-quantity": "ratio",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1,
          "default": 0.1
        },
        "efficiency": {
          "description": "Grid kWh = battery kWh / efficiency.",
          "x-quantity": "ratio",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1,
          "default": 1.0
        },
        "swap_time": {
          "type": [
            "string",
            "number"
          ],
          "description": "Swap only: expression, in `swap_time_unit`.",
          "x-quantity": "time",
          "x-unit-key": "swap_time_unit",
          "minimum": 0
        },
        "swap_time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit `swap_time` is in."
        },
        "spare_packs": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Swap only: charged packs in stock at the start; a swap waits for one. Absent = unlimited.",
          "x-quantity": "count",
          "minimum": 1
        }
      },
      "required": [
        "name",
        "node",
        "power_kw"
      ],
      "additionalProperties": false
    },
    "failure": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The failure's name, shown in the resource log."
        },
        "resources": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "The resources that fail; each one fails and recovers on its own, drawing its own times."
        },
        "uptime": {
          "$ref": "#/$defs/duration",
          "x-quantity": "time",
          "x-unit-key": "uptime.time_unit"
        },
        "downtime": {
          "$ref": "#/$defs/duration",
          "x-quantity": "time",
          "x-unit-key": "downtime.time_unit"
        },
        "meta": {
          "$ref": "#/$defs/meta",
          "description": "Where the values come from: status (data, uncertain, assumed), source and note, extra text keys kept. The run ignores it."
        }
      },
      "required": [
        "name",
        "resources",
        "uptime",
        "downtime"
      ],
      "additionalProperties": false
    },
    "scenario": {
      "type": "object",
      "description": "A named set of parameter overrides applied to the base model.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The scenario's name, as the comparison table lists it."
        },
        "description": {
          "type": "string",
          "description": "What the scenario changes and why; shown beside it in the editor."
        },
        "goal": {
          "type": "string",
          "maxLength": 500,
          "description": "Optional: the question this scenario answers, in a sentence. Shown in Present mode and the editor."
        },
        "overrides": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string",
                "description": "Dotted override path, e.g. \"resources.Server.capacity\" or \"blocks.process_1.params.dist_params.rate\"."
              },
              "value": {}
            },
            "required": [
              "path",
              "value"
            ],
            "additionalProperties": false
          },
          "description": "The changes this scenario makes to the base model, applied in order."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false
    },
    "reality_check": {
      "type": "object",
      "description": "A Vensim-style reality check: a test input imposed on the model (a scenario-style override map), then a constraint the model is expected to keep. Run by `nagasim.modelcheck`, one deterministic replication per check.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The check's name, as its result lists it."
        },
        "description": {
          "type": "string",
          "description": "What the check tests; the run does not read it."
        },
        "inputs": {
          "type": "object",
          "additionalProperties": {},
          "description": "Override path -> value, the same grammar a scenario override's \"path\" uses (e.g. \"auxiliaries.Workforce.expr\": \"0\")."
        },
        "constraint": {
          "type": "string",
          "minLength": 1,
          "description": "A boolean expression over LEVEL()/AUX()/FLOW() and TNOW, checked at every sampled instant the \"when\" below selects."
        },
        "when": {
          "type": "string",
          "default": "always",
          "description": "\"always\" (every sample), \"final\" (the last sample only), or a window of sampled times, ends included: \"after <t>\", \"before <t>\" or \"between <t1> and <t2>\" (the constraint holds at every sample in it). \"eventually\", alone or followed by a window, asks that it hold at least once in it."
        }
      },
      "required": [
        "name",
        "inputs",
        "constraint"
      ],
      "additionalProperties": false
    },
    "assertion": {
      "type": "object",
      "description": "A model assertion: pins one KPI (an `experiments.flatten_kpis` key) against a comparison operator and value, checked over its own replications by a Student-t confidence interval. Run by `nagasim.modelcheck.check`, `naga check`.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The assertion's name, as the check lists it."
        },
        "description": {
          "type": "string",
          "description": "What the assertion guards; the run does not read it."
        },
        "kpi": {
          "type": "string",
          "minLength": 1,
          "description": "A KPI key from `experiments.flatten_kpis`, e.g. \"system/Throughput (per time unit)\" or \"resource/Server/Usage % (snapshot)\"."
        },
        "op": {
          "type": "string",
          "enum": [
            "<",
            "<=",
            ">",
            ">=",
            "=="
          ],
          "description": "Passes when the WHOLE confidence interval clears the bound (\"==\" means inside value +/- tolerance)."
        },
        "value": {
          "type": "number",
          "description": "The number the KPI is compared with."
        },
        "replications": {
          "type": "integer",
          "minimum": 1,
          "default": 5,
          "description": "Assertions sharing a replication count are run in one batch."
        },
        "confidence": {
          "type": "number",
          "exclusiveMinimum": 0,
          "exclusiveMaximum": 1,
          "default": 0.95,
          "description": "The confidence level of the interval the comparison uses."
        },
        "tolerance": {
          "type": "number",
          "default": 0,
          "description": "Half-width of the \"==\" band around value; ignored by the other operators."
        }
      },
      "required": [
        "name",
        "kpi",
        "op",
        "value"
      ],
      "additionalProperties": false
    },
    "path_check": {
      "type": "object",
      "description": "A rule on the blocks each entity visits, where a visit is an arrival at a block (created there, or moved there by a link or a route). Checked by `naga check` on one traced replication, so a pass rests on one seed.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The rule's name, as the check lists it."
        },
        "description": {
          "type": "string",
          "description": "What the rule guards; the run does not read it."
        },
        "rule": {
          "type": "string",
          "enum": [
            "order",
            "never",
            "at_most",
            "always"
          ],
          "description": "\"order\": an entity that visits both blocks reaches \"first\" before \"then\" (first visits). \"never\": no entity visits \"block\". \"at_most\": none visits it more than \"count\" times. \"always\": every entity that left through a DISPOSE visited it; one still in the system at the end is not judged by this rule."
        },
        "block": {
          "type": "string",
          "minLength": 1,
          "description": "The block of a never, at_most or always rule."
        },
        "first": {
          "type": "string",
          "minLength": 1,
          "description": "An order rule's earlier block."
        },
        "then": {
          "type": "string",
          "minLength": 1,
          "description": "An order rule's later block."
        },
        "count": {
          "type": "integer",
          "minimum": 0,
          "description": "An at_most rule's most visits per entity."
        },
        "e_type": {
          "type": "string",
          "description": "Judge entities of this type only: the type an entity had when last seen."
        }
      },
      "required": [
        "name",
        "rule"
      ],
      "allOf": [
        {
          "if": {
            "properties": {
              "rule": {
                "const": "order"
              }
            }
          },
          "then": {
            "required": [
              "first",
              "then"
            ]
          },
          "else": {
            "required": [
              "block"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "rule": {
                "const": "at_most"
              }
            }
          },
          "then": {
            "required": [
              "count"
            ]
          }
        }
      ],
      "additionalProperties": false
    },
    "dashboard_widget": {
      "type": "object",
      "description": "A dashboard widget: kpi/gauge read one expression, line/bar read 1-4/1-8 labelled series, sampled at the same instants as the timeseries sampler (`core/timeseries.py`). \"row\"/\"col\"/\"span\" are layout hints for the editor's dashboard panel only.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string",
          "enum": [
            "kpi",
            "gauge",
            "line",
            "bar"
          ]
        },
        "title": {
          "type": "string",
          "description": "Defaults to \"name\"."
        },
        "unit": {
          "type": "string"
        },
        "expr": {
          "type": "string",
          "description": "kpi/gauge only: the expression sampled."
        },
        "series": {
          "type": "array",
          "description": "line/bar only: 1-4 series for a line widget, 1-8 for a bar.",
          "items": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1
              },
              "expr": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "label",
              "expr"
            ],
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 8
        },
        "min": {
          "type": "number",
          "description": "gauge only; default 0."
        },
        "max": {
          "type": "number",
          "description": "gauge only; required."
        },
        "thresholds": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "gauge only: ascending values within [min, max]."
        },
        "row": {
          "type": "integer",
          "minimum": 0
        },
        "col": {
          "type": "integer",
          "minimum": 0
        },
        "span": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "dashboard_control": {
      "type": "object",
      "description": "A game-mode control: a slider sets a resource's capacity (within 0..its declared capacity), a variable or an SD auxiliary over [min, max]; a decision answers the pending decision of a Policy-mode DECIDE, one option label per outgoing link.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string",
          "enum": [
            "slider",
            "decision"
          ]
        },
        "title": {
          "type": "string",
          "description": "Defaults to \"name\"."
        },
        "target": {
          "type": "object",
          "description": "slider only: exactly one of capacity (a resource), variable, constant (an SD auxiliary).",
          "properties": {
            "capacity": {
              "type": "string"
            },
            "variable": {
              "type": "string"
            },
            "constant": {
              "type": "string"
            }
          },
          "minProperties": 1,
          "maxProperties": 1,
          "additionalProperties": false
        },
        "min": {
          "type": "number",
          "description": "slider only."
        },
        "max": {
          "type": "number",
          "description": "slider only; greater than min."
        },
        "step": {
          "type": "number",
          "exclusiveMinimum": 0,
          "default": 1,
          "description": "slider only."
        },
        "policy": {
          "type": "string",
          "description": "decision only: a Policy-mode DECIDE's policy."
        },
        "options": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "decision only: one label per outgoing link."
        }
      },
      "required": [
        "name",
        "kind"
      ],
      "additionalProperties": false
    },
    "dashboard_input": {
      "type": "object",
      "description": "Present mode: one value a viewer may change before a run, as an override of \"path\" checked by `nagasim.dashboard.input_overrides`: a number within [min, max], a switch (true/false) or one of the listed choices; never text. Not `simulation.seed` or `simulation.replications`. Whether the path addresses something of this kind in the model is reported when the dashboard is used (`nagasim.dashboard.check_inputs`, `E_DASHBOARD_INPUT`), not by `naga validate`.",
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description": "An override path, e.g. resources.Server.capacity."
        },
        "label": {
          "type": "string",
          "maxLength": 80
        },
        "kind": {
          "type": "string",
          "enum": [
            "number",
            "switch",
            "choice"
          ]
        },
        "min": {
          "type": "number",
          "minimum": -1000000000000.0,
          "maximum": 1000000000000.0,
          "description": "number only."
        },
        "max": {
          "type": "number",
          "minimum": -1000000000000.0,
          "maximum": 1000000000000.0,
          "description": "number only; greater than min, at most 10000 steps away."
        },
        "step": {
          "type": "number",
          "exclusiveMinimum": 0,
          "default": 1,
          "description": "number only; a hint for the control."
        },
        "unit": {
          "type": "string",
          "maxLength": 80
        },
        "note": {
          "type": "string",
          "maxLength": 60,
          "description": "A short note shown under the lever in the viewer, e.g. \"+48 k EUR each\"."
        },
        "choices": {
          "type": "array",
          "minItems": 2,
          "maxItems": 20,
          "description": "choice only.",
          "items": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              },
              "value": {
                "type": [
                  "number",
                  "boolean",
                  "string"
                ]
              }
            },
            "required": [
              "label",
              "value"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "path",
        "kind"
      ],
      "additionalProperties": false
    },
    "dashboard_result": {
      "type": "object",
      "description": "Present mode: a KPI to report first, by its `experiments.flatten_kpis` key. The keys depend on the run, so only the shape is checked.",
      "properties": {
        "kpi": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "label": {
          "type": "string",
          "maxLength": 80
        },
        "unit": {
          "type": "string",
          "maxLength": 80
        },
        "better": {
          "type": "string",
          "enum": [
            "lower",
            "higher"
          ],
          "description": "The direction that is better; default: the KPI's known direction, else no better/worse verdict."
        },
        "target": {
          "type": "number",
          "minimum": -1000000000000.0,
          "maximum": 1000000000000.0,
          "description": "The value the study aims for: the viewer's answer says whether your version reaches it."
        }
      },
      "required": [
        "kpi"
      ],
      "additionalProperties": false
    },
    "dashboard_page": {
      "type": "object",
      "description": "Present mode: one page of the Presenter. The item kinds a page takes depend on its activity: what_if: input, result, widget, table, view; scenarios: scenarios, result, widget, table, view; play: view, decisions, control, widget, result, table; live: status, view, forecast, recommendations. Positions are hints.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "activity": {
          "type": "string",
          "enum": [
            "what_if",
            "scenarios",
            "play",
            "live"
          ]
        },
        "items": {
          "type": "array",
          "maxItems": 40,
          "items": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "control",
                  "decisions",
                  "forecast",
                  "input",
                  "recommendations",
                  "result",
                  "scenarios",
                  "status",
                  "table",
                  "view",
                  "widget"
                ]
              },
              "ref": {
                "type": "string",
                "description": "input: its path; result: its kpi; widget and control: its name."
              },
              "row": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "col": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "span": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              },
              "mode": {
                "type": "string",
                "enum": [
                  "schematic",
                  "layout",
                  "3d"
                ],
                "description": "view only."
              },
              "names": {
                "type": "array",
                "maxItems": 64,
                "items": {
                  "type": "string"
                },
                "description": "scenarios only: the ones offered."
              }
            },
            "required": [
              "kind"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "name",
        "activity"
      ],
      "additionalProperties": false
    },
    "dashboard": {
      "type": "object",
      "description": "The dashboard: KPI tiles, gauges, time charts and bars over the model's own expression language, shown during playback and in the results. Since v29 also what Present mode shows a person who did not build the model: \"inputs\", \"results\", \"limits\" and \"pages\"; with no \"pages\" the definition is generated (`nagasim.dashboard.default_dashboard`). Absent for a model that declares none.",
      "properties": {
        "question": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description": "The question the study answers, shown at the top of the viewer (default: the model's title)."
        },
        "widgets": {
          "type": "array",
          "maxItems": 64,
          "items": {
            "$ref": "#/$defs/dashboard_widget"
          },
          "description": "The tiles, gauges and charts, each over an expression."
        },
        "controls": {
          "type": "array",
          "maxItems": 64,
          "items": {
            "$ref": "#/$defs/dashboard_control"
          },
          "description": "Game-mode controls."
        },
        "inputs": {
          "type": "array",
          "maxItems": 32,
          "items": {
            "$ref": "#/$defs/dashboard_input"
          },
          "description": "The values a viewer may change in Present mode before a run."
        },
        "results": {
          "type": "array",
          "maxItems": 32,
          "items": {
            "$ref": "#/$defs/dashboard_result"
          },
          "description": "The KPIs Present mode reports first."
        },
        "limits": {
          "type": "object",
          "description": "What a run on a viewer's behalf may cost.",
          "properties": {
            "replications": {
              "type": "integer",
              "minimum": 2
            },
            "max_replications": {
              "type": "integer",
              "minimum": 2,
              "maximum": 1000,
              "default": 30
            }
          },
          "additionalProperties": false
        },
        "pages": {
          "type": "array",
          "maxItems": 8,
          "items": {
            "$ref": "#/$defs/dashboard_page"
          },
          "description": "The pages of the Presenter, each with an activity and its items."
        },
        "hidden": {
          "type": "array",
          "maxItems": 200,
          "items": {
            "type": "string",
            "maxLength": 200
          },
          "description": "Generated entries the author removed (\"input:<path>\", \"result:<kpi>\", \"page:<name>\"): regenerating never adds them back."
        }
      },
      "required": [
        "widgets"
      ],
      "additionalProperties": false
    },
    "annotation": {
      "type": "object",
      "description": "A graphic item on the canvas or in the 3D view (a note, frame, counter, image, arrow or zone); the engine ignores this section.",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "The item's identifier, unique among the annotations."
        },
        "kind": {
          "type": "string",
          "enum": [
            "text",
            "frame",
            "counter",
            "image",
            "arrow",
            "zone"
          ],
          "description": "\"text\" is a note, \"frame\" a titled box, \"counter\" a live value, \"image\" an embedded picture, \"arrow\" a pointer, \"zone\" a shaded area."
        },
        "position": {
          "$ref": "#/$defs/point",
          "description": "The canvas point of a text note or a counter."
        },
        "rect": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "minItems": 4,
          "maxItems": 4,
          "description": "The [x, y, width, height] on the canvas of a frame, image or zone."
        },
        "points": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/point"
          },
          "minItems": 2,
          "maxItems": 2,
          "description": "An arrow's tail and head on the canvas, [[x1, y1], [x2, y2]]."
        },
        "text": {
          "type": "string",
          "description": "The note's text."
        },
        "title": {
          "type": "string",
          "description": "The frame's title."
        },
        "color": {
          "type": "string",
          "description": "The item's colour, as a hex string."
        },
        "font_size": {
          "type": "number",
          "description": "The text size, in canvas units."
        },
        "opacity": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "How opaque the item is, from 0 (clear) to 1 (solid)."
        },
        "label": {
          "type": "string",
          "description": "The words before a counter's value."
        },
        "unit": {
          "type": "string",
          "description": "The words after a counter's value."
        },
        "decimals": {
          "type": "integer",
          "minimum": 0,
          "maximum": 4,
          "description": "The decimals a counter shows, 0 to 4 (default 0)."
        },
        "source": {
          "type": "object",
          "properties": {
            "of": {
              "type": "string",
              "enum": [
                "count",
                "queue",
                "busy",
                "util",
                "wip",
                "created",
                "completed",
                "expr"
              ],
              "description": "What the counter shows: entities in a block (count), waiting at it (queue), a resource's units in use (busy), utilisation in percent of a resource or a block (util), the run's wip, created or completed, or an expression (expr)."
            },
            "block": {
              "type": "string",
              "description": "The block counted."
            },
            "resource": {
              "type": "string",
              "description": "The resource counted."
            },
            "expr": {
              "type": "string",
              "description": "The expression an expr counter shows."
            }
          },
          "required": [
            "of"
          ],
          "additionalProperties": false,
          "description": "What a counter shows."
        },
        "image": {
          "type": "object",
          "properties": {
            "svg": {
              "type": "string",
              "maxLength": 512000,
              "description": "SVG text, checked like an asset graphic."
            },
            "png": {
              "type": "string",
              "maxLength": 512000,
              "pattern": "^data:image/png;base64,",
              "description": "A PNG as a data URI, at most 4096 px a side."
            }
          },
          "minProperties": 1,
          "maxProperties": 1,
          "additionalProperties": false,
          "description": "The picture of an image item, embedded: svg text or a png data URI."
        },
        "place_3d": {
          "type": "object",
          "properties": {
            "at": {
              "$ref": "#/$defs/point",
              "description": "Where it stands, in the units of a block's layout_position."
            },
            "elevation": {
              "type": "number",
              "description": "Height above the floor, in m (default 0)."
            },
            "size": {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 2,
              "maxItems": 2,
              "description": "Width and depth in m (width and height when upright), each above 0 and at most 1000."
            },
            "yaw": {
              "type": "number",
              "description": "Clockwise turn seen from above, in degrees, like layout_rotation (default 0)."
            },
            "upright": {
              "type": "boolean",
              "description": "Stands up like a sign instead of lying on the floor (default false)."
            }
          },
          "required": [
            "at",
            "size"
          ],
          "additionalProperties": false,
          "description": "Its place in the 3D view; an item without one shows only on the canvas."
        }
      },
      "required": [
        "id",
        "kind"
      ],
      "additionalProperties": false
    },
    "submodel": {
      "type": "object",
      "description": "A reusable definition, instantiated by a SUBMODEL block and flattened away before the engine sees the model.",
      "properties": {
        "info": {
          "type": "object",
          "description": "The definition's own details, such as its title and description."
        },
        "parameters": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "default": {},
              "description": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "description": "What the argument is. A string value is an EXPRESSION unless the type is a literal one (name/choice/string), where the word itself is the value."
              },
              "refers_to": {
                "type": "string",
                "description": "For type \"name\": the kind of record the argument names (resource, resource_set, schedule, table, sequence, entity)."
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "description": "The arguments an instance sets; blocks inside read them by name."
        },
        "scoped": {
          "type": "object",
          "description": "Per-instance field overrides on `$`-scoped records."
        },
        "repeat": {
          "type": "array",
          "description": "Repeat groups (Phase 15 M7): per instance, the named blocks and every link touching them are stamped `count` times, `{i}` = 1..count in every string inside them. A group with no `{i}` in its names is optional (count 0 or 1). In a list param, an item {\"$repeat\": <count>, \"item\": <value>} is spliced in as count copies the same way.",
          "items": {
            "type": "object",
            "properties": {
              "count": {
                "description": "An int 0..500, a {\"$arg\": <parameter>} or an expression of the definition's parameters.",
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 500
                  },
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "object"
                  }
                ]
              },
              "blocks": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "required": [
              "count",
              "blocks"
            ],
            "additionalProperties": false
          }
        },
        "extends": {
          "type": "string",
          "minLength": 1,
          "description": "Inherit another definition: this one is the parent's with its own blocks and parameters merged in by name (child wins), links by source/target/ports, `scoped` per record. Chains allowed; a cycle is E_EXTENDS_CYCLE."
        },
        "remove": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "With `extends`: parent blocks to drop, with every parent link touching one; a `src->tgt` entry drops the parent links between those two blocks."
        },
        "blocks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/block"
          },
          "description": "The blocks of the definition."
        },
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/link"
          },
          "description": "The links between the blocks of the definition."
        },
        "annotations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/annotation"
          },
          "description": "The canvas notes of the definition; the engine ignores them."
        },
        "code": {
          "type": "object",
          "description": "The item's own Python logic: a class with event hooks (on_entry, on_exit, on_timer, on_state, on_signal) that reads the instance's parameters. It runs only after a person has trusted this exact code on their computer.",
          "properties": {
            "class": {
              "type": "string",
              "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
              "description": "The class in `source` whose hooks run."
            },
            "source": {
              "type": "string",
              "maxLength": 200000,
              "description": "The Python source of the class."
            },
            "timer": {
              "anyOf": [
                {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "How often on_timer runs, in the model's time unit; null for no timer."
            },
            "watch": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "description": "Model variables whose writes call on_state."
            },
            "signals": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "description": "Signals that call on_signal; a `$name` is per instance."
            },
            "placed": {
              "type": "object",
              "description": "Written by library placing: who the library names as author, and the code's fingerprint when placed, to tell a later edit. Never read for trust.",
              "properties": {
                "author": {
                  "type": "string"
                },
                "fingerprint": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "required": [
            "class",
            "source"
          ],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "data_source": {
      "type": "object",
      "description": "Where a data binding reads from. A relative `location` resolves against the MODEL FILE's folder; `sql`/`json_url` are refused unless the caller explicitly allows network access, and a literal password in a URL is a validation error (use \"${NAGASIM_DATA_<NAME>}\").",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The source's name, the `source` of a binding."
        },
        "kind": {
          "type": "string",
          "enum": [
            "csv",
            "xlsx",
            "sqlite",
            "sql",
            "json_url",
            "rest",
            "mqtt",
            "opcua",
            "modbus"
          ],
          "description": "The kind of source, which decides how its `location` is read."
        },
        "location": {
          "type": "string",
          "minLength": 1,
          "description": "Path relative to the model file, or a URL. For a live kind: what to read over the connection (a path), never a host."
        },
        "connection": {
          "type": "string",
          "description": "Live kinds only: the NAME of a connection the person running the model defined in their own connections file. A model never holds an address or a credential."
        },
        "query": {
          "type": "string",
          "description": "SELECT, for the sqlite/sql kinds."
        },
        "sheet": {
          "type": "string",
          "description": "Worksheet name, for the xlsx kind."
        },
        "options": {
          "type": "object",
          "description": "Extra keyword arguments for the pandas reader; for a live kind, that reader's own options."
        },
        "description": {
          "type": "string",
          "description": "What the source holds; the run does not read it."
        }
      },
      "required": [
        "name",
        "kind",
        "location"
      ],
      "additionalProperties": false
    },
    "data_binding": {
      "type": "object",
      "description": "One model parameter read from a data source.",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The binding's name."
        },
        "source": {
          "type": "string",
          "minLength": 1,
          "description": "The name of the data source to read."
        },
        "column": {
          "type": "string",
          "description": "The column (or field) to read from the source."
        },
        "filter": {
          "type": "object",
          "description": "{\"column\": value} or {\"column >=\": value}; comparisons only, never code."
        },
        "transform": {
          "type": "string",
          "description": "One of mean, median, last, sum, count, value, fit, empirical, orders, or quantile:<argument>, rate_per:<argument>, arrival_schedule:<argument>, table:<argument>, series:<argument>."
        },
        "target": {
          "type": "string",
          "minLength": 1,
          "description": "An override path, e.g. \"resources.Nurse.capacity\"."
        },
        "map": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "\"orders\" transform only: {order field: source column} for any field whose column is not already named after it."
        },
        "enabled": {
          "type": "boolean",
          "default": true,
          "description": "When false the binding is skipped and the parameter keeps its file value."
        },
        "description": {
          "type": "string",
          "description": "What the binding sets; the run does not read it."
        }
      },
      "required": [
        "name",
        "source",
        "transform",
        "target"
      ],
      "additionalProperties": false
    },
    "order": {
      "type": "object",
      "description": "A released job: what a CREATE block in \"Orders\" arrival mode emits at `release`, carrying a due date the run reports lateness and tardiness against. Times are in the model's BASE unit.",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "Unique; the KPI frames report the order under it."
        },
        "description": {
          "type": "string",
          "description": "A note on the job; the run does not read it."
        },
        "release": {
          "type": [
            "number",
            "string"
          ],
          "description": "When the order is released into the model. An ISO timestamp instead of a number needs a calendar.",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "minimum": 0,
          "default": 0.0
        },
        "due": {
          "type": [
            "number",
            "string",
            "null"
          ],
          "description": "Absolute due time, not a lead time; null = no due date. May be an ISO timestamp.",
          "x-quantity": "time",
          "x-unit-key": "time_unit"
        },
        "time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit `release` and `due` are in (a dated value ignores it)."
        },
        "quantity": {
          "type": "integer",
          "minimum": 0,
          "default": 1,
          "description": "Entities this order releases."
        },
        "entity_type": {
          "type": "string",
          "description": "Overrides the CREATE block's own e_type."
        },
        "sequence": {
          "type": "string",
          "description": "Name of a declared routing the entities follow."
        },
        "priority": {
          "type": "number",
          "description": "Carried as entity.priority."
        },
        "source": {
          "type": "string",
          "description": "CREATE block that releases it; omit for the first CREATE in \"Orders\" mode."
        },
        "attributes": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "number",
              "string",
              "boolean"
            ]
          },
          "description": "Further attributes assigned onto every entity of this order."
        },
        "plan": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          },
          "description": "{station: planned start}, carried as entity.plan and read by the \"Plan\" queue discipline (cpsat.propose writes it)."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false
    },
    "initial_state": {
      "type": "object",
      "description": "Warm start: what is already in the system at t=0.",
      "properties": {
        "time": {
          "description": "Timestamp of the snapshot this state came from; recorded for the report, never shifts the clock.",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "type": "number"
        },
        "time_unit": {
          "type": "string",
          "enum": [
            "base",
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "base",
          "description": "Unit `time` is in."
        },
        "clock": {
          "type": "number",
          "minimum": 0,
          "description": "The model time the run's clock starts at (default 0): the time a state was taken at. Statistics cover the run from there, as after a warm-up of that length."
        },
        "schedule_offset": {
          "type": "number",
          "minimum": 0,
          "description": "How far into its own cycle the calendar already is at model time 0, in base time units. Every schedule and every repeating time-series input is read at t + this, so a mid-shift warm start resumes the shift instead of restarting it."
        },
        "arrivals": {
          "type": "object",
          "description": "Per CREATE block: the arrivals already made and the absolute time of the next one.",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "minimum": 0
              },
              "next": {
                "type": "number"
              },
              "scheduled": {
                "type": "number",
                "minimum": 0,
                "description": "When the next arrival was drawn."
              },
              "rank": {
                "type": "integer",
                "minimum": 0,
                "description": "Its place among arrivals drawn at one instant for one instant."
              },
              "times": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "description": "A jittered FixedSchedule's times still to come after the next one."
              }
            },
            "additionalProperties": false
          }
        },
        "orders": {
          "type": "object",
          "description": "Per declared order released before the clock: the entities it released and completed, and when the last one completed.",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "created": {
                "type": "integer",
                "minimum": 0
              },
              "completed": {
                "type": "integer",
                "minimum": 0
              },
              "completed_at": {
                "type": "number",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        },
        "resource_sets": {
          "type": "object",
          "description": "Per resource set: the index of the member a Cyclical set picked last (-1: none yet).",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "cursor": {
                "type": "integer",
                "minimum": -1
              }
            },
            "additionalProperties": false
          }
        },
        "blocks": {
          "type": "object",
          "description": "Per block, what it carries: a changeover's setup key its last job left; a BATCH's running maximum wait, the time it falls due; a CONVEYOR's next free entry slot and when the last part left each of its points and its end (occ: on a typed belt, the length each of those parts took); for a slot row that frees at move_end, when each load still moving out of it frees its slot.",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "setup": {
                "type": [
                  "string",
                  "number"
                ]
              },
              "due": {
                "type": "number"
              },
              "next_entry": {
                "type": "number"
              },
              "left": {
                "type": "array",
                "items": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              },
              "sections": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                }
              },
              "occ": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              },
              "frees": {
                "type": "array",
                "items": {
                  "type": "number"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "variables": {
          "type": "object",
          "description": "Model variable values to start from."
        },
        "fleets": {
          "type": "object",
          "description": "Where each vehicle of a fleet is: one record per unit, in unit order. Times are absolute.",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "cursor": {
                "type": "integer",
                "minimum": -1,
                "description": "The unit a fleet with select \"cyclic\" picked last, -1 for none."
              },
              "vehicles": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "node": {
                      "type": "string",
                      "description": "The network node it stands at, or left from when it drives."
                    },
                    "idle_since": {
                      "type": "number"
                    },
                    "soc": {
                      "type": "number",
                      "maximum": 1,
                      "description": "Its battery's state of charge."
                    },
                    "until": {
                      "type": "number",
                      "description": "When its loading or unloading ends."
                    },
                    "drive": {
                      "type": "object",
                      "properties": {
                        "to": {
                          "type": "string"
                        },
                        "started": {
                          "type": "number"
                        },
                        "loaded": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "to",
                        "started"
                      ],
                      "additionalProperties": false
                    },
                    "charge": {
                      "type": "object",
                      "properties": {
                        "charger": {
                          "type": "string"
                        },
                        "held": {
                          "type": "boolean"
                        },
                        "stage": {
                          "enum": [
                            "drive",
                            "wait",
                            "charge"
                          ]
                        },
                        "until": {
                          "type": "number"
                        },
                        "wait": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "charger"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "node"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "vehicles"
            ],
            "additionalProperties": false
          }
        },
        "levels": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          },
          "description": "Level values to start from: the state of charge of a battery, the stock on hand in a warehouse."
        },
        "used": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The resources, sets and stores something happened to before the clock: they keep their report row."
        },
        "entities": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "block": {
                "type": "string",
                "minLength": 1,
                "description": "The block to inject into; a block inside a submodel is \"<instance>/<inner>\"."
              },
              "count": {
                "type": "integer",
                "minimum": 0
              },
              "e_type": {
                "type": "string"
              },
              "attributes": {
                "type": "object"
              },
              "age": {
                "description": "Time already spent in the system before t=0.",
                "x-quantity": "time",
                "x-unit-key": "age_unit",
                "type": "number",
                "minimum": 0,
                "default": 0.0
              },
              "age_unit": {
                "type": "string",
                "enum": [
                  "base",
                  "milliseconds",
                  "seconds",
                  "minutes",
                  "hours",
                  "days",
                  "weeks",
                  "months",
                  "years"
                ],
                "default": "base",
                "description": "Unit `age` is in."
              },
              "in_service": {
                "type": "integer",
                "minimum": 0
              },
              "remaining": {
                "type": "array",
                "items": {
                  "type": "number",
                  "minimum": 0
                }
              },
              "ends": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "description": "Instead of `remaining`: the absolute time each service in progress ends."
              },
              "auto_cost": {
                "type": "number",
                "description": "The part of the entity's `cost` attribute the engine charged itself."
              },
              "holding_cost": {
                "type": "number",
                "description": "The holding cost within it."
              },
              "member": {
                "type": "string",
                "description": "The member of the block's resource set serving the entry's jobs in service."
              },
              "deadline": {
                "type": "number",
                "description": "The absolute time the entry's waiting entities give up (a block with renege_after)."
              },
              "since": {
                "type": "number",
                "description": "The absolute time the entry's waiting entities joined the queue (at or before the clock): their wait counts from it."
              },
              "arrives": {
                "type": "number",
                "description": "The absolute time an entity on a link reaches the block (count 1)."
              },
              "held_by": {
                "type": "string",
                "description": "The block that still holds a waiting entity: the BUFFER whose place it has, or the station blocked after service that keeps its unit until the entity is accepted, or the CONVEYOR whose end keeps it until the next belt takes it (count 1)."
              },
              "held_at": {
                "type": "object",
                "description": "Of a part a CONVEYOR's divert hands over (held_by that belt): the divert's point and since when the part waits.",
                "properties": {
                  "point": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "since": {
                    "type": "number"
                  }
                },
                "required": [
                  "point",
                  "since"
                ],
                "additionalProperties": false
              },
              "held_since": {
                "type": "number",
                "description": "The absolute time the station in held_by seized its unit, or the entity entered the belt in held_by."
              },
              "holds": {
                "type": "object",
                "description": "Resources the entity holds from an earlier block, seized again for it before anything else: per resource or set, since when, how many units (default 1) and of a set which member.",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "since": {
                      "type": "number"
                    },
                    "units": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "member": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "belt": {
                "type": "object",
                "description": "An entity on an accumulating CONVEYOR: its stage (cell: waits for a cell; slot: boards at until; ride: at the end at until; packed: behind the part ahead; move: moving up, there at until; stop: waits for the end stop), until, and when it entered the belt. On a belt with stops, diverts or merges, point is the one it rides to or stands at (entry to end), with the stages of that point's kind.",
                "properties": {
                  "stage": {
                    "enum": [
                      "cell",
                      "entry",
                      "slot",
                      "ride",
                      "packed",
                      "move",
                      "stop",
                      "due",
                      "gap",
                      "claim",
                      "wait",
                      "dwell",
                      "push",
                      "blocked",
                      "door",
                      "join"
                    ]
                  },
                  "until": {
                    "type": "number"
                  },
                  "entered": {
                    "type": "number"
                  },
                  "point": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "stage"
                ],
                "additionalProperties": false
              },
              "place": {
                "type": "boolean",
                "description": "false: the entity waits for a place of the block (a BUFFER, a queue_capacity) and has none yet."
              },
              "trip": {
                "type": "object",
                "description": "A load's trip, at its TRANSPORT block: the origin and destination nodes, the target STATION block and, once a vehicle has it, its unit, the stage (pickup, load, carry, unload) and the unload time already drawn.",
                "properties": {
                  "origin": {
                    "type": "string"
                  },
                  "destination": {
                    "type": "string"
                  },
                  "target": {
                    "type": "string"
                  },
                  "unit": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "stage": {
                    "enum": [
                      "pickup",
                      "load",
                      "carry",
                      "unload"
                    ]
                  },
                  "unload": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "origin",
                  "destination",
                  "target"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "block",
              "count"
            ],
            "additionalProperties": false
          },
          "description": "The entities already in the system at time 0, with the block each one starts in."
        },
        "resources": {
          "type": "object",
          "additionalProperties": {
            "type": "object",
            "properties": {
              "down_until": {
                "type": [
                  "number",
                  "string"
                ],
                "description": "Absolute time, or an ISO timestamp with a calendar."
              },
              "busy": {
                "type": "integer",
                "minimum": 0,
                "description": "An observation: the units reported busy. It must match the entities in service."
              },
              "failures": {
                "type": "object",
                "description": "Per failure name: {\"next\": t}, the absolute time it fails, or {\"down_until\": t or null}, down by it now and repaired at t.",
                "additionalProperties": {
                  "type": "object"
                }
              }
            },
            "additionalProperties": false
          },
          "description": "The state of resources at time 0, by resource name."
        },
        "order_book": {
          "type": "array",
          "description": "The orders the run releases instead of the model's \"orders\" section: the plant's book, by id. A state from a plant writes it.",
          "items": {
            "type": "object",
            "description": "A released job: what a CREATE block in \"Orders\" arrival mode emits at `release`, carrying a due date the run reports lateness and tardiness against. Times are in the model's BASE unit.",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "description": "Unique; the KPI frames report the order under it."
              },
              "description": {
                "type": "string",
                "description": "A note on the job; the run does not read it."
              },
              "release": {
                "type": [
                  "number",
                  "string"
                ],
                "description": "When the order is released into the model. An ISO timestamp instead of a number needs a calendar.",
                "x-quantity": "time",
                "x-unit-key": "time_unit",
                "minimum": 0,
                "default": 0.0
              },
              "due": {
                "type": [
                  "number",
                  "string",
                  "null"
                ],
                "description": "Absolute due time, not a lead time; null = no due date. May be an ISO timestamp.",
                "x-quantity": "time",
                "x-unit-key": "time_unit"
              },
              "time_unit": {
                "type": "string",
                "enum": [
                  "base",
                  "milliseconds",
                  "seconds",
                  "minutes",
                  "hours",
                  "days",
                  "weeks",
                  "months",
                  "years"
                ],
                "default": "base",
                "description": "Unit `release` and `due` are in (a dated value ignores it)."
              },
              "quantity": {
                "type": "integer",
                "minimum": 0,
                "default": 1,
                "description": "Entities this order releases."
              },
              "entity_type": {
                "type": "string",
                "description": "Overrides the CREATE block's own e_type."
              },
              "sequence": {
                "type": "string",
                "description": "Name of a declared routing the entities follow."
              },
              "priority": {
                "type": "number",
                "description": "Carried as entity.priority."
              },
              "source": {
                "type": "string",
                "description": "CREATE block that releases it; omit for the first CREATE in \"Orders\" mode."
              },
              "attributes": {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "number",
                    "string",
                    "boolean"
                  ]
                },
                "description": "Further attributes assigned onto every entity of this order."
              },
              "plan": {
                "type": "object",
                "additionalProperties": {
                  "type": "number"
                },
                "description": "{station: planned start}, carried as entity.plan and read by the \"Plan\" queue discipline (cpsat.propose writes it)."
              },
              "held": {
                "type": "boolean",
                "default": false,
                "description": "Not released until a person releases it."
              }
            },
            "required": [
              "id"
            ],
            "additionalProperties": false
          }
        },
        "tended": {
          "type": "array",
          "description": "The tending stations at the take: [station, fleet] pairs. A taken state writes it.",
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 2,
            "maxItems": 2
          }
        }
      },
      "additionalProperties": false
    },
    "simulation": {
      "type": "object",
      "description": "Run settings; every one can be overridden per run.",
      "properties": {
        "time_limit": {
          "type": [
            "number",
            "null"
          ],
          "description": "Run length in base time units; null/0 means \"run until the model drains\", which only works for a model that can drain.",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "minimum": 0
        },
        "warmup": {
          "description": "Statistics are reset at this time.",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "type": "number",
          "minimum": 0,
          "default": 0.0
        },
        "replications": {
          "x-quantity": "count",
          "type": "integer",
          "minimum": 1,
          "default": 1,
          "description": "How many independent runs to make, each with its own seed."
        },
        "deterministic": {
          "type": "boolean",
          "default": false,
          "description": "Deterministic run mode: every distribution samples its mean, DECIDE-by-chance uses largest-remainder allocation, a failure's TTF/TTR use their mean, and replications are forced to 1. A mean-value model, not a fluid limit; agent-based and system-dynamics parts are unaffected."
        },
        "time_unit": {
          "type": "string",
          "enum": [
            "milliseconds",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "years"
          ],
          "default": "minutes",
          "description": "The model's BASE unit; every duration without its own unit is already in it."
        },
        "length_unit": {
          "type": "string",
          "enum": [
            "millimeters",
            "centimeters",
            "meters",
            "kilometers"
          ],
          "default": "meters",
          "description": "The model's length unit: default unit of new length fields and of reported lengths."
        },
        "currency": {
          "type": "string",
          "default": "EUR",
          "description": "Cost label only; never enters the arithmetic."
        },
        "energy_price": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            }
          ],
          "description": "Money per kWh, a number or an expression, evaluated once at run start. Prices every resource/fleet's \"power\".",
          "x-quantity": "money",
          "default": 0
        },
        "entity_log_limit": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Cap on retained entity-log rows.",
          "x-quantity": "count",
          "minimum": 0
        },
        "log_level": {
          "type": "string",
          "enum": [
            "kpi",
            "series",
            "full",
            "study",
            "explore",
            "replay"
          ],
          "description": "What a run records (D1395): kpi (summaries only), series (plus the time series and dashboard), full (plus the entity, resource and store logs), or a profile: study (kpi), explore and replay (full). Beats record_logs and timeseries_points; a caller's level beats it. Absent: those two settings decide."
        },
        "record_logs": {
          "type": "boolean",
          "default": true,
          "description": "Record the per-EVENT entity/resource/store logs . False returns the three flat log frames empty and leaves every summary statistic exact -- what a big study wants."
        },
        "strict_checks": {
          "type": "boolean",
          "default": false,
          "description": "Stop the run on a conveyor check: an open port, overlapping or unsnapped pieces, a part handed to nothing or routed against its rule become errors with the same code. Off: they are warnings."
        },
        "queue_limit": {
          "type": "object",
          "description": "Stop a run when one queue holds more than length entities: it saves run time on a model whose queue grows without bound. Absent or on false: no limit; a bad value warns, reads as off.",
          "properties": {
            "on": {
              "type": "boolean",
              "default": false
            },
            "length": {
              "type": "integer",
              "minimum": 1,
              "default": 100000
            }
          },
          "additionalProperties": false
        },
        "entity_waits": {
          "type": "boolean",
          "default": false,
          "description": "Sum each entity's queue time over every seize into a \"Total Wait\" column of the entity log (what a tail goal on Total Wait reads). Off: no column."
        },
        "timeseries_points": {
          "type": [
            "integer",
            "null"
          ],
          "description": "How many samples the time-series OUTPUT sampler takes over a time-limited run (default 200).",
          "x-quantity": "count",
          "minimum": 0,
          "default": 200
        },
        "timeseries_interval": {
          "type": [
            "number",
            "null"
          ],
          "description": "Fixed sampling interval for a draining run, which has no horizon to divide.",
          "x-quantity": "time",
          "x-unit-key": "time_unit",
          "minimum": 0
        },
        "timeseries_counts": {
          "type": "array",
          "maxItems": 1000,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1
          },
          "description": "Blocks whose departures the sampler counts, as the series block/<name>/out (flattened names). What a twin compares a plant counter with; none by default."
        },
        "sd": {
          "type": "object",
          "description": "OPTIONAL system-dynamics step grid. Absent, rates change only at events. Present, every rate reading LEVEL(), FRACTION() or TNOW is re-integrated at each multiple of \"dt\"; static rates and events inside a step stay exact.",
          "properties": {
            "dt": {
              "description": "Step, in \"time_unit\".",
              "x-quantity": "time",
              "x-unit-key": "time_unit",
              "type": "number",
              "exclusiveMinimum": 0
            },
            "method": {
              "type": "string",
              "enum": [
                "euler",
                "rk4"
              ],
              "default": "euler",
              "description": "euler, or rk4 as an effective rate over each step (no random draws in a dynamic rate)."
            },
            "time_unit": {
              "type": "string",
              "enum": [
                "base",
                "milliseconds",
                "seconds",
                "minutes",
                "hours",
                "days",
                "weeks",
                "months",
                "years"
              ],
              "default": "base",
              "description": "Unit dt is in."
            }
          },
          "required": [
            "dt"
          ],
          "additionalProperties": false
        },
        "calendar": {
          "type": "object",
          "description": "OPTIONAL real dates. Absent, the clock is a plain number and nothing changes. Present, model time 0 is \"start\" and weekday schedules, dated series and dated orders resolve against it.",
          "properties": {
            "start": {
              "type": "string",
              "description": "ISO 8601 instant model time 0 stands for. With no offset it is read in \"timezone\", never in the machine's local time."
            },
            "timezone": {
              "type": "string",
              "default": "UTC",
              "description": "IANA name (Europe/Rome). The wall clock weekday schedules and date labels use."
            },
            "end": {
              "type": "string",
              "description": "Run until this instant, instead of a \"time_limit\" length."
            }
          },
          "required": [
            "start"
          ],
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "meta": {
      "type": "object",
      "description": "Where this part's values come from, for a person or an agent reading the model; the run never reads it and the editor shows it on hover. Extra keys are kept; every value is text, at most 2,000 characters in all (compact JSON). A bad one is a W_META warning, never an error.",
      "properties": {
        "status": {
          "enum": [
            "data",
            "uncertain",
            "assumed"
          ],
          "description": "data: measured; uncertain: measured but doubtful; assumed: no data behind it."
        },
        "source": {
          "type": "string",
          "description": "Where the values come from, such as \"plant log, Nov 2026\"."
        },
        "note": {
          "type": "string",
          "description": "Anything else worth knowing, such as \"n=12\"."
        }
      },
      "additionalProperties": {
        "type": "string"
      }
    }
  }
}
