{
  "$defs": {
    "ARSource": {
      "additionalProperties": false,
      "description": "Autoregressive process: coefficients per base step, mean and stationary standard deviation.",
      "properties": {
        "kind": {
          "const": "ar",
          "description": "`ar`",
          "title": "Kind",
          "type": "string"
        },
        "coef": {
          "description": "Coefficients φ₁…φₚ, per base step `dt`; they must give a stationary process.",
          "items": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "$ref": "#/$defs/Distribution"
              }
            ]
          },
          "minItems": 1,
          "title": "Coef",
          "type": "array"
        },
        "mean": {
          "title": "Mean",
          "description": "Mean, in the signal's unit.",
          "default": 0.0,
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ]
        },
        "std": {
          "title": "Std",
          "description": "Stationary standard deviation, in the signal's unit.",
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ]
        }
      },
      "required": [
        "kind",
        "coef",
        "std"
      ],
      "title": "ARSource",
      "type": "object"
    },
    "BurnIn": {
      "additionalProperties": false,
      "description": "Start by running with noise for a while and discarding it.",
      "properties": {
        "burn_in": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            }
          ],
          "description": "How long to run before t = 0.",
          "title": "Burn In"
        }
      },
      "required": [
        "burn_in"
      ],
      "title": "BurnIn",
      "type": "object"
    },
    "ConstantSource": {
      "additionalProperties": false,
      "description": "A constant value.",
      "properties": {
        "kind": {
          "const": "constant",
          "description": "`constant`",
          "title": "Kind",
          "type": "string"
        },
        "value": {
          "title": "Value",
          "description": "The value, in the signal's unit.",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ]
        }
      },
      "required": [
        "kind",
        "value"
      ],
      "title": "ConstantSource",
      "type": "object"
    },
    "CustomOp": {
      "additionalProperties": true,
      "description": "A core operator used directly; every other key is an operator parameter.",
      "properties": {
        "id": {
          "description": "Name of the operator; its output signal has the same name.",
          "title": "Id",
          "type": "string"
        },
        "op": {
          "description": "Operator, for example `sum`, `product`, `first_order` or `schedule` (see the operator reference).",
          "title": "Op",
          "type": "string"
        },
        "inputs": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Input port → signal name.",
          "title": "Inputs",
          "type": "object"
        },
        "unit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unit of the output signal.",
          "title": "Unit"
        },
        "period": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Update period, a multiple of `dt` (default: every step).",
          "title": "Period"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        }
      },
      "required": [
        "id",
        "op"
      ],
      "title": "CustomOp",
      "type": "object"
    },
    "Degradation": {
      "additionalProperties": true,
      "description": "A slow degradation from the domain library on one unit; every other key is a parameter.",
      "properties": {
        "target": {
          "description": "A unit id.",
          "title": "Target",
          "type": "string"
        },
        "kind": {
          "description": "A degradation of the domain library, for example `fouling`.",
          "title": "Kind",
          "type": "string"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        }
      },
      "required": [
        "target",
        "kind"
      ],
      "title": "Degradation",
      "type": "object"
    },
    "Exogenous": {
      "additionalProperties": false,
      "description": "Drive a signal (usually a template port such as TIC-101.feed_temp) from a source, or from\nan existing signal with `from`.",
      "properties": {
        "target": {
          "description": "A template port such as `TIC-101.feed_temp`, or the name of a new signal.",
          "title": "Target",
          "type": "string"
        },
        "source": {
          "anyOf": [
            {
              "discriminator": {
                "mapping": {
                  "ar": "#/$defs/ARSource",
                  "constant": "#/$defs/ConstantSource",
                  "ou": "#/$defs/OUSource"
                },
                "propertyName": "kind"
              },
              "oneOf": [
                {
                  "$ref": "#/$defs/OUSource"
                },
                {
                  "$ref": "#/$defs/ARSource"
                },
                {
                  "$ref": "#/$defs/ConstantSource"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A source that creates the signal: `ou`, `ar` or `constant`.",
          "title": "Source"
        },
        "from": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "An existing signal that feeds the port instead of a source, for example another unit's output.",
          "title": "From"
        },
        "unit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Unit of the signal, for the signal table.",
          "title": "Unit"
        },
        "measured": {
          "anyOf": [
            {
              "$ref": "#/$defs/Measurement"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Also measure the signal with an instrument."
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        }
      },
      "required": [
        "target"
      ],
      "title": "Exogenous",
      "type": "object"
    },
    "FamilySpec": {
      "additionalProperties": false,
      "description": "How many plants to draw from the config's distributions, and histories per plant.",
      "properties": {
        "plants": {
          "default": 1,
          "description": "Number of plants to draw.",
          "minimum": 1,
          "title": "Plants",
          "type": "integer"
        },
        "histories": {
          "default": 1,
          "description": "Histories per plant (the same plant, different noise).",
          "minimum": 1,
          "title": "Histories",
          "type": "integer"
        }
      },
      "title": "FamilySpec",
      "type": "object"
    },
    "Intervention": {
      "additionalProperties": false,
      "description": "A planned change (target + value) or a fault (target unit + fault name).",
      "properties": {
        "at": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            }
          ],
          "description": "When the change starts.",
          "title": "At"
        },
        "target": {
          "description": "A setpoint, mode, manual output, port or parameter path; for a fault, a unit id.",
          "title": "Target",
          "type": "string"
        },
        "value": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The value for `set`, the amount for `shift`, the factor for `scale`; a mode may be `MAN`, `AUTO` or `CAS`.",
          "title": "Value"
        },
        "action": {
          "default": "set",
          "description": "How `value` applies.",
          "enum": [
            "set",
            "shift",
            "scale"
          ],
          "title": "Action",
          "type": "string"
        },
        "fault": {
          "anyOf": [
            {
              "enum": [
                "valve_stiction",
                "valve_stuck",
                "sensor_bias",
                "sensor_drift",
                "sensor_noise",
                "fouling"
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "A fault of the domain library, instead of a planned change.",
          "title": "Fault"
        },
        "magnitude": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Size of the fault, in the fault's own terms (see the fault's description).",
          "title": "Magnitude"
        },
        "profile": {
          "anyOf": [
            {
              "enum": [
                "step",
                "ramp"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "`step`, or `ramp` over `over` (default: step; a fault's own default for faults).",
          "title": "Profile"
        },
        "over": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Duration of a ramp.",
          "title": "Over"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Id of the event in the event log (default: its position).",
          "title": "Id"
        },
        "lanes": {
          "anyOf": [
            {
              "items": {
                "type": "integer"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The lanes it applies to (default: all).",
          "title": "Lanes"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        }
      },
      "required": [
        "at",
        "target"
      ],
      "title": "Intervention",
      "type": "object"
    },
    "Measurement": {
      "additionalProperties": false,
      "description": "Measure an exogenous signal with a sensor preset over a span.",
      "properties": {
        "tag": {
          "description": "Tag of the measured signal, for example `TT-205`.",
          "title": "Tag",
          "type": "string"
        },
        "sensor": {
          "anyOf": [
            {
              "enum": [
                "thermocouple",
                "magnetic_flowmeter",
                "radar_level",
                "online_analyzer",
                "lab"
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Sensor preset of the domain library (default: the library's first preset).",
          "title": "Sensor"
        },
        "span": {
          "description": "Measurement span `[low, high]`; noise and quantization are percentages of it.",
          "maxItems": 2,
          "minItems": 2,
          "prefixItems": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            }
          ],
          "title": "Span",
          "type": "array"
        },
        "installed": {
          "default": true,
          "description": "Whether the sensor is installed at the start (a removed sensor reads NaN).",
          "title": "Installed",
          "type": "boolean"
        }
      },
      "required": [
        "tag",
        "span"
      ],
      "title": "Measurement",
      "type": "object"
    },
    "OUSource": {
      "additionalProperties": false,
      "description": "Ornstein–Uhlenbeck process: mean, stationary standard deviation and correlation time.",
      "properties": {
        "kind": {
          "const": "ou",
          "description": "`ou`",
          "title": "Kind",
          "type": "string"
        },
        "mean": {
          "title": "Mean",
          "description": "Long-run mean, in the signal's unit.",
          "default": 0.0,
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ]
        },
        "std": {
          "title": "Std",
          "description": "Stationary standard deviation, in the signal's unit (the same whatever `dt`).",
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ]
        },
        "tau": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            }
          ],
          "description": "Correlation time.",
          "title": "Tau"
        }
      },
      "required": [
        "kind",
        "std",
        "tau"
      ],
      "title": "OUSource",
      "type": "object"
    },
    "Output": {
      "additionalProperties": false,
      "description": "What is recorded.",
      "properties": {
        "every": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Recording interval, a multiple of `dt` (default: every step).",
          "title": "Every"
        },
        "start": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Calendar time of t = 0; the index becomes timestamps instead of elapsed time.",
          "title": "Start"
        }
      },
      "title": "Output",
      "type": "object"
    },
    "Plan": {
      "additionalProperties": false,
      "description": "A historical plan: the starting regime, the production changes and the maintenance.",
      "properties": {
        "start": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The regime at the start of the run; the plant settles in it.",
          "title": "Start"
        },
        "production": {
          "description": "Production transitions between regimes (or a generator; see Self-running plans).",
          "anyOf": [
            {
              "description": "Production transitions between regimes (or a generator; see Self-running plans).",
              "items": {
                "$ref": "#/$defs/Transition"
              },
              "title": "Production",
              "type": "array"
            },
            {
              "$ref": "#/$defs/Generator"
            }
          ]
        },
        "maintenance": {
          "description": "Maintenance tasks (entries may be recurring generators).",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/Task"
              },
              {
                "$ref": "#/$defs/Generator"
              }
            ]
          },
          "title": "Maintenance",
          "type": "array"
        }
      },
      "title": "Plan",
      "type": "object"
    },
    "Task": {
      "additionalProperties": false,
      "description": "A maintenance task from the domain library, on one unit or several.",
      "properties": {
        "at": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            }
          ],
          "description": "When the task starts.",
          "title": "At"
        },
        "task": {
          "description": "A maintenance task of the domain library, for example `clean` or `calibrate`.",
          "title": "Task",
          "enum": [
            "clean",
            "replace_catalyst",
            "calibrate",
            "replace_sensor",
            "replace_valve",
            "stop",
            "remove_sensor",
            "install_sensor"
          ]
        },
        "target": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          ],
          "description": "A unit id, or several.",
          "title": "Target"
        },
        "duration": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "How long the task takes, for tasks that need one (for example `stop`).",
          "title": "Duration"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Id of the task in the event log.",
          "title": "Id"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        }
      },
      "required": [
        "at",
        "task",
        "target"
      ],
      "title": "Task",
      "type": "object"
    },
    "Transition": {
      "additionalProperties": false,
      "description": "Move to a regime at `at`, ramping its numeric values over `over` (modes switch at once).",
      "properties": {
        "at": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            }
          ],
          "description": "When the transition starts.",
          "title": "At"
        },
        "to": {
          "description": "The regime to move to.",
          "title": "To",
          "type": "string"
        },
        "over": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            }
          ],
          "default": 0.0,
          "description": "Duration of the ramp (0: a step).",
          "title": "Over"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Id of the transition in the event log.",
          "title": "Id"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        }
      },
      "required": [
        "at",
        "to"
      ],
      "title": "Transition",
      "type": "object"
    },
    "UnitSpec": {
      "additionalProperties": true,
      "description": "A template instance; every other key is a template parameter.",
      "properties": {
        "id": {
          "description": "Unit id, for example `TIC-101`; its ISA tags derive from it (`TT-101`, `TV-101`).",
          "title": "Id",
          "type": "string"
        },
        "template": {
          "description": "Template of the domain library, for example `temperature_loop`.",
          "title": "Template",
          "type": "string"
        },
        "period": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Update period of every operator of the unit, a multiple of `dt` (default: every step).",
          "title": "Period"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        }
      },
      "required": [
        "id",
        "template"
      ],
      "title": "UnitSpec",
      "type": "object"
    },
    "Distribution": {
      "type": "object",
      "minProperties": 1,
      "maxProperties": 1,
      "propertyNames": {
        "enum": [
          "normal",
          "lognormal",
          "uniform",
          "loguniform",
          "choice"
        ]
      },
      "description": "A distribution, drawn once per plant: `{normal: {mean, sd}}`, `{lognormal: {median, sigma}}`, `{uniform: [low, high]}`, `{loguniform: [low, high]}`, `{choice: {value: weight}}` or `{choice: [values]}`."
    },
    "Generator": {
      "type": "object",
      "description": "A generator of plan entries or faults, expanded when a plant is drawn (see the guide `guides/self-running-plans`)."
    },
    "StatCheck": {
      "additionalProperties": false,
      "description": "A statistic of a signal over a window stays within bounds: the mean, standard deviation, minimum, maximum, or the number of recorded values.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the expectation in the report (default: `expect[<position>]`).",
          "title": "Id"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why it should hold, in words: the intent the scenario is meant to show.",
          "title": "Note"
        },
        "lane": {
          "default": 0,
          "description": "The lane it applies to (default: lane 0).",
          "minimum": 0,
          "title": "Lane",
          "type": "integer"
        },
        "kind": {
          "const": "stat",
          "description": "`stat`",
          "title": "Kind",
          "type": "string"
        },
        "signal": {
          "description": "Any signal of the run (a measured tag such as `TT-101`, or a true value such as `TIC-101.cv`).",
          "title": "Signal",
          "type": "string"
        },
        "stat": {
          "description": "Which statistic. `count` is the number of recorded values that are not NaN: `at_most: 0` says a signal is missing (a removed transmitter).",
          "enum": [
            "mean",
            "std",
            "min",
            "max",
            "count"
          ],
          "title": "Stat",
          "type": "string"
        },
        "at_least": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The statistic is at least this.",
          "title": "At Least"
        },
        "at_most": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The statistic is at most this.",
          "title": "At Most"
        },
        "window": {
          "anyOf": [
            {
              "description": "A span of time `[from, to]`, in time since the start of the run.",
              "maxItems": 2,
              "minItems": 2,
              "prefixItems": [
                {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "pattern": "^-?\\s*[0-9.]",
                      "type": "string"
                    }
                  ]
                },
                {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "pattern": "^-?\\s*[0-9.]",
                      "type": "string"
                    }
                  ]
                }
              ],
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Where to measure it (default: the whole run).",
          "title": "Window"
        }
      },
      "required": [
        "kind",
        "signal",
        "stat"
      ],
      "title": "StatCheck",
      "type": "object"
    },
    "ShiftCheck": {
      "additionalProperties": false,
      "description": "A signal's mean moves between two windows: after minus before. Use it to show that a change reaches (or does not reach) a signal.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the expectation in the report (default: `expect[<position>]`).",
          "title": "Id"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why it should hold, in words: the intent the scenario is meant to show.",
          "title": "Note"
        },
        "lane": {
          "default": 0,
          "description": "The lane it applies to (default: lane 0).",
          "minimum": 0,
          "title": "Lane",
          "type": "integer"
        },
        "kind": {
          "const": "shift",
          "description": "`shift`",
          "title": "Kind",
          "type": "string"
        },
        "signal": {
          "description": "Any signal of the run.",
          "title": "Signal",
          "type": "string"
        },
        "before": {
          "description": "The reference window.",
          "maxItems": 2,
          "minItems": 2,
          "prefixItems": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "pattern": "^-?\\s*[0-9.]",
                  "type": "string"
                }
              ]
            },
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "pattern": "^-?\\s*[0-9.]",
                  "type": "string"
                }
              ]
            }
          ],
          "title": "Before",
          "type": "array"
        },
        "after": {
          "description": "The window to compare with it.",
          "maxItems": 2,
          "minItems": 2,
          "prefixItems": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "pattern": "^-?\\s*[0-9.]",
                  "type": "string"
                }
              ]
            },
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "pattern": "^-?\\s*[0-9.]",
                  "type": "string"
                }
              ]
            }
          ],
          "title": "After",
          "type": "array"
        },
        "at_least": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The shift (after minus before) is at least this.",
          "title": "At Least"
        },
        "at_most": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The shift is at most this.",
          "title": "At Most"
        },
        "absolute": {
          "default": false,
          "description": "Judge the size of the shift, ignoring its sign (for example `at_most: 0.3` with `absolute: true` means the signal did not move).",
          "title": "Absolute",
          "type": "boolean"
        }
      },
      "required": [
        "kind",
        "signal",
        "before",
        "after"
      ],
      "title": "ShiftCheck",
      "type": "object"
    },
    "SaturationCheck": {
      "additionalProperties": false,
      "description": "A controller output spends little time at its limits: a controller that saturates cannot control.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the expectation in the report (default: `expect[<position>]`).",
          "title": "Id"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why it should hold, in words: the intent the scenario is meant to show.",
          "title": "Note"
        },
        "lane": {
          "default": 0,
          "description": "The lane it applies to (default: lane 0).",
          "minimum": 0,
          "title": "Lane",
          "type": "integer"
        },
        "kind": {
          "const": "saturation",
          "description": "`saturation`",
          "title": "Kind",
          "type": "string"
        },
        "loop": {
          "description": "The loop, named after its controller's unit (for example `TIC-101`).",
          "title": "Loop",
          "type": "string"
        },
        "at_most": {
          "description": "The largest fraction of recorded samples at a limit (0.05 is 5 %).",
          "maximum": 1,
          "minimum": 0,
          "title": "At Most",
          "type": "number"
        },
        "window": {
          "anyOf": [
            {
              "description": "A span of time `[from, to]`, in time since the start of the run.",
              "maxItems": 2,
              "minItems": 2,
              "prefixItems": [
                {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "pattern": "^-?\\s*[0-9.]",
                      "type": "string"
                    }
                  ]
                },
                {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "pattern": "^-?\\s*[0-9.]",
                      "type": "string"
                    }
                  ]
                }
              ],
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Where to measure it (default: the whole run).",
          "title": "Window"
        }
      },
      "required": [
        "kind",
        "loop",
        "at_most"
      ],
      "title": "SaturationCheck",
      "type": "object"
    },
    "SettlesCheck": {
      "additionalProperties": false,
      "description": "Loops settle on their new setpoint within a time after a production transition (see the `settle_times` labeler).",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the expectation in the report (default: `expect[<position>]`).",
          "title": "Id"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why it should hold, in words: the intent the scenario is meant to show.",
          "title": "Note"
        },
        "lane": {
          "default": 0,
          "description": "The lane it applies to (default: lane 0).",
          "minimum": 0,
          "title": "Lane",
          "type": "integer"
        },
        "kind": {
          "const": "settles",
          "description": "`settles`",
          "title": "Kind",
          "type": "string"
        },
        "within": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            }
          ],
          "description": "The longest settle time, counted from the start of the transition.",
          "title": "Within"
        },
        "transition": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Only this transition, for example `grade_A->grade_B` (default: every transition).",
          "title": "Transition"
        },
        "loop": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Only this loop (default: every loop).",
          "title": "Loop"
        },
        "band": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "How close counts as settled, in the regulated variable's unit (default: 1 % of the new setpoint).",
          "title": "Band"
        },
        "hold": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            }
          ],
          "default": 600.0,
          "description": "How long it must stay within the band.",
          "title": "Hold"
        }
      },
      "required": [
        "kind",
        "within"
      ],
      "title": "SettlesCheck",
      "type": "object"
    },
    "VisibleCheck": {
      "additionalProperties": false,
      "description": "A fault becomes detectable on a signal within a time, or, with `visible: false`, never does (the loop hides it). Runs one twin lane per fault, so the scenario must have one lane; see the `visibility` labeler.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the expectation in the report (default: `expect[<position>]`).",
          "title": "Id"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why it should hold, in words: the intent the scenario is meant to show.",
          "title": "Note"
        },
        "kind": {
          "const": "visible",
          "description": "`visible`",
          "title": "Kind",
          "type": "string"
        },
        "fault": {
          "description": "A fault of the domain library, for example `valve_stiction`.",
          "title": "Fault",
          "enum": [
            "valve_stiction",
            "valve_stuck",
            "sensor_bias",
            "sensor_drift",
            "sensor_noise",
            "fouling"
          ]
        },
        "signal": {
          "description": "The observed signal to look at, for example `FT-101` or `FIC-101.out`.",
          "title": "Signal",
          "type": "string"
        },
        "target": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Only the fault on this unit (default: every fault of that kind). Every matching fault must satisfy the expectation.",
          "title": "Target"
        },
        "visible": {
          "default": true,
          "description": "`true`: it becomes visible; `false`: it stays hidden on this signal.",
          "title": "Visible",
          "type": "boolean"
        },
        "within": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "With `visible: true`, the longest delay from the fault's onset to its detection.",
          "title": "Within"
        }
      },
      "required": [
        "kind",
        "fault",
        "signal"
      ],
      "title": "VisibleCheck",
      "type": "object"
    },
    "FeasibleCheck": {
      "additionalProperties": false,
      "description": "Every loop starts at its setpoint with its output strictly inside its limits (see the `feasibility` labeler).",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Name of the expectation in the report (default: `expect[<position>]`).",
          "title": "Id"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why it should hold, in words: the intent the scenario is meant to show.",
          "title": "Note"
        },
        "lane": {
          "default": 0,
          "description": "The lane it applies to (default: lane 0).",
          "minimum": 0,
          "title": "Lane",
          "type": "integer"
        },
        "kind": {
          "const": "feasible",
          "description": "`feasible`",
          "title": "Kind",
          "type": "string"
        }
      },
      "required": [
        "kind"
      ],
      "title": "FeasibleCheck",
      "type": "object"
    },
    "Unit_flow_loop": {
      "type": "object",
      "title": "flow_loop",
      "description": "Flow control loop: a fast first-order-plus-dead-time flow response to the valve, upstream pressure as the disturbance, and a noisy flowmeter.",
      "properties": {
        "id": {
          "description": "Unit id, for example `TIC-101`; its ISA tags derive from it (`TT-101`, `TV-101`).",
          "title": "Id",
          "type": "string"
        },
        "template": {
          "const": "flow_loop"
        },
        "period": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Update period of every operator of the unit, a multiple of `dt` (default: every step).",
          "title": "Period"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        },
        "sp": {
          "description": "initial setpoint [m3/h]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 50.0
        },
        "mode": {
          "description": "initial controller mode",
          "anyOf": [
            {
              "enum": [
                "MAN",
                "AUTO",
                "CAS"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "AUTO"
        },
        "Kc": {
          "description": "controller gain (tuning: manual) [%/(m3/h)]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.8
        },
        "Ti": {
          "description": "integral time (tuning: manual) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 5.0
        },
        "tuning": {
          "description": "manual (use Kc and Ti) or simc (compute them from the plant model)",
          "anyOf": [
            {
              "enum": [
                "manual",
                "simc"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "manual"
        },
        "detune": {
          "description": "simc: multiplies the closed-loop time constant (above 1 is slower and more robust)",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.0
        },
        "Td": {
          "description": "derivative time [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "fs": {
          "description": "valve static friction band (stiction) [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "fd": {
          "description": "valve dynamic friction band [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "scan": {
          "description": "controller scan period, a multiple of dt (0 = every step) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "sensor": {
          "description": "sensor preset",
          "anyOf": [
            {
              "enum": [
                "thermocouple",
                "magnetic_flowmeter",
                "radar_level",
                "online_analyzer",
                "lab"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "magnetic_flowmeter"
        },
        "span": {
          "description": "measurement span [low, high] [m3/h]",
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 2,
              "maxItems": 2
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": [
            0.0,
            100.0
          ]
        },
        "cv": {
          "description": "name of the true regulated signal (default <id>.cv)",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": ""
        },
        "K": {
          "description": "flow per % of valve opening [(m3/h)/%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.0
        },
        "tau": {
          "description": "flow time constant [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 5.0
        },
        "theta": {
          "description": "flow dead time [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.0
        },
        "Kp": {
          "description": "flow change per bar of upstream pressure deviation [(m3/h)/bar]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 5.0
        }
      },
      "required": [
        "id",
        "template"
      ],
      "additionalProperties": false
    },
    "Unit_level_loop": {
      "type": "object",
      "title": "level_loop",
      "description": "Level control loop: the level integrates inflow minus outflow; the controller opens the outlet valve when the level rises (direct acting).",
      "properties": {
        "id": {
          "description": "Unit id, for example `TIC-101`; its ISA tags derive from it (`TT-101`, `TV-101`).",
          "title": "Id",
          "type": "string"
        },
        "template": {
          "const": "level_loop"
        },
        "period": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Update period of every operator of the unit, a multiple of `dt` (default: every step).",
          "title": "Period"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        },
        "sp": {
          "description": "initial setpoint [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 50.0
        },
        "mode": {
          "description": "initial controller mode",
          "anyOf": [
            {
              "enum": [
                "MAN",
                "AUTO",
                "CAS"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "AUTO"
        },
        "Kc": {
          "description": "controller gain (tuning: manual) [%/(%)]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.4
        },
        "Ti": {
          "description": "integral time (tuning: manual) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1200.0
        },
        "tuning": {
          "description": "manual (use Kc and Ti) or simc (compute them from the plant model)",
          "anyOf": [
            {
              "enum": [
                "manual",
                "simc"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "manual"
        },
        "detune": {
          "description": "simc: multiplies the closed-loop time constant (above 1 is slower and more robust)",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.0
        },
        "Td": {
          "description": "derivative time [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "fs": {
          "description": "valve static friction band (stiction) [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "fd": {
          "description": "valve dynamic friction band [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "scan": {
          "description": "controller scan period, a multiple of dt (0 = every step) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "sensor": {
          "description": "sensor preset",
          "anyOf": [
            {
              "enum": [
                "thermocouple",
                "magnetic_flowmeter",
                "radar_level",
                "online_analyzer",
                "lab"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "radar_level"
        },
        "span": {
          "description": "measurement span [low, high] [%]",
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 2,
              "maxItems": 2
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": [
            0.0,
            100.0
          ]
        },
        "cv": {
          "description": "name of the true regulated signal (default <id>.cv)",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": ""
        },
        "Kv": {
          "description": "outflow per % of outlet valve opening [(m3/h)/%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.5
        },
        "tau_v": {
          "description": "outflow time constant [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 2.0
        },
        "area": {
          "description": "tank cross-section [m2]",
          "anyOf": [
            {
              "type": "number",
              "exclusiveMinimum": 0
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 2.0
        },
        "height": {
          "description": "tank height (100 % level) [m]",
          "anyOf": [
            {
              "type": "number",
              "exclusiveMinimum": 0
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 3.0
        }
      },
      "required": [
        "id",
        "template"
      ],
      "additionalProperties": false
    },
    "Unit_temperature_loop": {
      "type": "object",
      "title": "temperature_loop",
      "description": "Temperature control loop: a slow first-order-plus-dead-time response to the heating valve, the feed temperature as the disturbance, and a lagged thermocouple.",
      "properties": {
        "id": {
          "description": "Unit id, for example `TIC-101`; its ISA tags derive from it (`TT-101`, `TV-101`).",
          "title": "Id",
          "type": "string"
        },
        "template": {
          "const": "temperature_loop"
        },
        "period": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Update period of every operator of the unit, a multiple of `dt` (default: every step).",
          "title": "Period"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        },
        "sp": {
          "description": "initial setpoint [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 80.0
        },
        "mode": {
          "description": "initial controller mode",
          "anyOf": [
            {
              "enum": [
                "MAN",
                "AUTO",
                "CAS"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "AUTO"
        },
        "Kc": {
          "description": "controller gain (tuning: manual) [%/(degC)]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 4.0
        },
        "Ti": {
          "description": "integral time (tuning: manual) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 600.0
        },
        "tuning": {
          "description": "manual (use Kc and Ti) or simc (compute them from the plant model)",
          "anyOf": [
            {
              "enum": [
                "manual",
                "simc"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "manual"
        },
        "detune": {
          "description": "simc: multiplies the closed-loop time constant (above 1 is slower and more robust)",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.0
        },
        "Td": {
          "description": "derivative time [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "fs": {
          "description": "valve static friction band (stiction) [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "fd": {
          "description": "valve dynamic friction band [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "scan": {
          "description": "controller scan period, a multiple of dt (0 = every step) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "sensor": {
          "description": "sensor preset",
          "anyOf": [
            {
              "enum": [
                "thermocouple",
                "magnetic_flowmeter",
                "radar_level",
                "online_analyzer",
                "lab"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "thermocouple"
        },
        "span": {
          "description": "measurement span [low, high] [degC]",
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 2,
              "maxItems": 2
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": [
            0.0,
            200.0
          ]
        },
        "cv": {
          "description": "name of the true regulated signal (default <id>.cv)",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": ""
        },
        "K": {
          "description": "temperature rise per % of heating valve opening [degC/%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.8
        },
        "tau": {
          "description": "process time constant [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 600.0
        },
        "theta": {
          "description": "process dead time [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 60.0
        },
        "Kd": {
          "description": "effect of the feed temperature",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.5
        },
        "tau_d": {
          "description": "feed temperature time constant [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 900.0
        },
        "base": {
          "description": "temperature with the valve closed and a 0 degC feed [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 10.0
        }
      },
      "required": [
        "id",
        "template"
      ],
      "additionalProperties": false
    },
    "Unit_mixer": {
      "type": "object",
      "title": "mixer",
      "description": "Two feeds mixed in proportion to their flows, then plug flow through the outlet pipe (transit time = volume / total flow), with an online analyzer.",
      "properties": {
        "id": {
          "description": "Unit id, for example `TIC-101`; its ISA tags derive from it (`TT-101`, `TV-101`).",
          "title": "Id",
          "type": "string"
        },
        "template": {
          "const": "mixer"
        },
        "period": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Update period of every operator of the unit, a multiple of `dt` (default: every step).",
          "title": "Period"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        },
        "volume": {
          "description": "volume of the outlet pipe (plug flow) [m3]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 2.0
        },
        "max_transit": {
          "description": "longest transit time to support (at low flows) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 21600.0
        },
        "analyzer": {
          "description": "measure the outlet property with an online analyzer",
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": true
        },
        "span": {
          "description": "analyzer span [low, high]",
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 2,
              "maxItems": 2
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": [
            0.0,
            10.0
          ]
        }
      },
      "required": [
        "id",
        "template"
      ],
      "additionalProperties": false
    },
    "Unit_heat_exchanger": {
      "type": "object",
      "title": "heat_exchanger",
      "description": "A heating valve controls the process outlet temperature; the temperature rise per % of valve falls as the process flow rises.",
      "properties": {
        "id": {
          "description": "Unit id, for example `TIC-101`; its ISA tags derive from it (`TT-101`, `TV-101`).",
          "title": "Id",
          "type": "string"
        },
        "template": {
          "const": "heat_exchanger"
        },
        "period": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Update period of every operator of the unit, a multiple of `dt` (default: every step).",
          "title": "Period"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        },
        "sp": {
          "description": "initial setpoint [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 70.0
        },
        "mode": {
          "description": "initial controller mode",
          "anyOf": [
            {
              "enum": [
                "MAN",
                "AUTO",
                "CAS"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "AUTO"
        },
        "Kc": {
          "description": "controller gain (tuning: manual) [%/(degC)]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 4.0
        },
        "Ti": {
          "description": "integral time (tuning: manual) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 300.0
        },
        "tuning": {
          "description": "manual (use Kc and Ti) or simc (compute them from the plant model)",
          "anyOf": [
            {
              "enum": [
                "manual",
                "simc"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "manual"
        },
        "detune": {
          "description": "simc: multiplies the closed-loop time constant (above 1 is slower and more robust)",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.0
        },
        "Td": {
          "description": "derivative time [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "fs": {
          "description": "valve static friction band (stiction) [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "fd": {
          "description": "valve dynamic friction band [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "scan": {
          "description": "controller scan period, a multiple of dt (0 = every step) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "sensor": {
          "description": "sensor preset",
          "anyOf": [
            {
              "enum": [
                "thermocouple",
                "magnetic_flowmeter",
                "radar_level",
                "online_analyzer",
                "lab"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "thermocouple"
        },
        "span": {
          "description": "measurement span [low, high] [degC]",
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 2,
              "maxItems": 2
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": [
            0.0,
            200.0
          ]
        },
        "cv": {
          "description": "name of the true regulated signal (default <id>.cv)",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": ""
        },
        "K": {
          "description": "temperature rise per % of heating valve at the nominal flow [degC/%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.6
        },
        "tau": {
          "description": "exchanger time constant [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 300.0
        },
        "theta": {
          "description": "exchanger dead time [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 30.0
        },
        "F_nom": {
          "description": "nominal process flow [m3/h]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 20.0
        },
        "tau_in": {
          "description": "time constant of the inlet temperature's effect [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 300.0
        }
      },
      "required": [
        "id",
        "template"
      ],
      "additionalProperties": false
    },
    "Unit_reactor": {
      "type": "object",
      "title": "reactor",
      "description": "A reactor temperature loop plus the product property: an Arrhenius- and feed-ratio-dependent law, plug flow and back-mixing through the reactor, and a lab analysis, by default every 4 h and reported 1 h later.",
      "properties": {
        "id": {
          "description": "Unit id, for example `TIC-101`; its ISA tags derive from it (`TT-101`, `TV-101`).",
          "title": "Id",
          "type": "string"
        },
        "template": {
          "const": "reactor"
        },
        "period": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Update period of every operator of the unit, a multiple of `dt` (default: every step).",
          "title": "Period"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        },
        "sp": {
          "description": "initial setpoint [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 80.0
        },
        "mode": {
          "description": "initial controller mode",
          "anyOf": [
            {
              "enum": [
                "MAN",
                "AUTO",
                "CAS"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "AUTO"
        },
        "Kc": {
          "description": "controller gain (tuning: manual) [%/(degC)]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 4.0
        },
        "Ti": {
          "description": "integral time (tuning: manual) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 600.0
        },
        "tuning": {
          "description": "manual (use Kc and Ti) or simc (compute them from the plant model)",
          "anyOf": [
            {
              "enum": [
                "manual",
                "simc"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "manual"
        },
        "detune": {
          "description": "simc: multiplies the closed-loop time constant (above 1 is slower and more robust)",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.0
        },
        "Td": {
          "description": "derivative time [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "fs": {
          "description": "valve static friction band (stiction) [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "fd": {
          "description": "valve dynamic friction band [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "scan": {
          "description": "controller scan period, a multiple of dt (0 = every step) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "sensor": {
          "description": "sensor preset",
          "anyOf": [
            {
              "enum": [
                "thermocouple",
                "magnetic_flowmeter",
                "radar_level",
                "online_analyzer",
                "lab"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "thermocouple"
        },
        "span": {
          "description": "measurement span [low, high] [degC]",
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 2,
              "maxItems": 2
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": [
            0.0,
            200.0
          ]
        },
        "cv": {
          "description": "name of the true regulated signal (default <id>.cv)",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": ""
        },
        "K": {
          "description": "temperature rise per % of heating valve opening [degC/%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.8
        },
        "tau": {
          "description": "process time constant [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 600.0
        },
        "theta": {
          "description": "process dead time [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 60.0
        },
        "Kd": {
          "description": "effect of the feed temperature",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.5
        },
        "tau_d": {
          "description": "feed temperature time constant [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 900.0
        },
        "base": {
          "description": "temperature with the valve closed and a 0 degC feed [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 10.0
        },
        "q_ref": {
          "description": "product property at the reference temperature, feed ratio 1 and full catalyst activity",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 2.0
        },
        "t_ref": {
          "description": "reference temperature [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 80.0
        },
        "E_R": {
          "description": "activation temperature E/R of the property's temperature dependence [K]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 5000.0
        },
        "b": {
          "description": "exponent of the feed ratio",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.0
        },
        "volume": {
          "description": "reactor volume, crossed in plug flow [m3]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 5.0
        },
        "tau_mix": {
          "description": "back-mixing time constant at the nominal flow [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 600.0
        },
        "F_nom": {
          "description": "nominal feed flow [m3/h]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 10.0
        },
        "max_residence": {
          "description": "longest residence time to support (at low flows) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 21600.0
        },
        "lab_span": {
          "description": "span of the lab analysis [low, high]",
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 2,
              "maxItems": 2
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": [
            0.0,
            10.0
          ]
        },
        "lab_period": {
          "description": "time between lab samples [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 14400.0
        },
        "lab_delay": {
          "description": "time from taking a lab sample to reporting its result [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 3600.0
        },
        "lab_noise": {
          "description": "standard deviation of the lab's error, in % of the lab's span [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 2.0
        }
      },
      "required": [
        "id",
        "template"
      ],
      "additionalProperties": false
    },
    "Unit_cstr": {
      "type": "object",
      "title": "cstr",
      "description": "A stirred reactor with two feeds and a reaction on a catalyst: the fraction of B left in the reactor, the reaction heat and the catalyst's poisoning by a feed impurity are latent states that shift the product property; a lab analysis, by default every 4 h and reported 1 h later.",
      "properties": {
        "id": {
          "description": "Unit id, for example `TIC-101`; its ISA tags derive from it (`TT-101`, `TV-101`).",
          "title": "Id",
          "type": "string"
        },
        "template": {
          "const": "cstr"
        },
        "period": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "pattern": "^-?\\s*[0-9.]",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Update period of every operator of the unit, a multiple of `dt` (default: every step).",
          "title": "Period"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        },
        "sp": {
          "description": "initial setpoint [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 80.0
        },
        "mode": {
          "description": "initial controller mode",
          "anyOf": [
            {
              "enum": [
                "MAN",
                "AUTO",
                "CAS"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "AUTO"
        },
        "Kc": {
          "description": "controller gain (tuning: manual) [%/(degC)]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 4.0
        },
        "Ti": {
          "description": "integral time (tuning: manual) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 600.0
        },
        "tuning": {
          "description": "manual (use Kc and Ti) or simc (compute them from the plant model)",
          "anyOf": [
            {
              "enum": [
                "manual",
                "simc"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "manual"
        },
        "detune": {
          "description": "simc: multiplies the closed-loop time constant (above 1 is slower and more robust)",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.0
        },
        "Td": {
          "description": "derivative time [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "fs": {
          "description": "valve static friction band (stiction) [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "fd": {
          "description": "valve dynamic friction band [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "scan": {
          "description": "controller scan period, a multiple of dt (0 = every step) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "sensor": {
          "description": "sensor preset",
          "anyOf": [
            {
              "enum": [
                "thermocouple",
                "magnetic_flowmeter",
                "radar_level",
                "online_analyzer",
                "lab"
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": "thermocouple"
        },
        "span": {
          "description": "measurement span [low, high] [degC]",
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 2,
              "maxItems": 2
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": [
            0.0,
            200.0
          ]
        },
        "cv": {
          "description": "name of the true regulated signal (default <id>.cv)",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": ""
        },
        "K": {
          "description": "temperature rise per % of heating valve opening [degC/%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.8
        },
        "tau": {
          "description": "process time constant [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 600.0
        },
        "theta": {
          "description": "process dead time [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 60.0
        },
        "Kd": {
          "description": "effect of the feed temperature",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.5
        },
        "tau_d": {
          "description": "feed temperature time constant [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 900.0
        },
        "base": {
          "description": "temperature with the valve closed and a 0 degC feed [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 10.0
        },
        "volume": {
          "description": "reactor volume (well mixed) [m3]",
          "anyOf": [
            {
              "type": "number",
              "exclusiveMinimum": 0
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 5.0
        },
        "k_ref": {
          "description": "rate constant at t_ref with fresh catalyst and no impurity [1/h]",
          "anyOf": [
            {
              "type": "number",
              "exclusiveMinimum": 0
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 4.0
        },
        "E_k": {
          "description": "activation temperature E/R of the reaction rate [K]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 8000.0
        },
        "poison": {
          "description": "activity lost to the impurity in the reactor: factor exp(−poison · impurity) [1/ppm]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.3
        },
        "dT_rxn": {
          "description": "temperature rise per unit fraction of feed converted (heat of reaction) [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 50.0
        },
        "Kf": {
          "description": "cooling by the feed per m3/h above F_nom [degC/(m3/h)]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.5
        },
        "F_nom": {
          "description": "nominal total feed [m3/h]",
          "anyOf": [
            {
              "type": "number",
              "exclusiveMinimum": 0
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 10.0
        },
        "q_ref": {
          "description": "product property at t_ref and x_ref, with fresh catalyst and no impurity",
          "anyOf": [
            {
              "type": "number",
              "exclusiveMinimum": 0
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.0
        },
        "x_ref": {
          "description": "reference fraction of B in the reactor",
          "anyOf": [
            {
              "type": "number",
              "exclusiveMinimum": 0
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.08
        },
        "b": {
          "description": "exponent of the fraction of B in the reactor",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.8
        },
        "E_q": {
          "description": "activation temperature of the property's own temperature dependence [K]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 3000.0
        },
        "gamma": {
          "description": "direct effect of the impurity on the property: factor exp(gamma · impurity) [1/ppm]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.15
        },
        "c": {
          "description": "exponent of the catalyst activity (an ageing catalyst makes a different product)",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 1.5
        },
        "t_ref": {
          "description": "reference temperature [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 80.0
        },
        "cooling": {
          "description": "the valve removes heat instead of adding it (a cooled reactor, for a strongly exothermic reaction); the controller is then direct acting",
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": false
        },
        "side_effect": {
          "description": "effect of the side product on the property: factor exp(−side_effect · side product); positive lowers the property, negative raises it (a contaminant content, say); 0 leaves it out",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "E_side": {
          "description": "activation temperature of the side reaction (steeper than the main one, so excursions count) [K]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 40000.0
        },
        "t_side": {
          "description": "temperature at which the side product reaches 1 at the nominal feed [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 84.0
        },
        "q_noise": {
          "description": "unexplained variation of the property: standard deviation of a slow random factor exp(ε) (0.02 = 2 %); 0 leaves it out",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        },
        "q_noise_tau": {
          "description": "correlation time of the unexplained variation [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 14400.0
        },
        "pipe_volume": {
          "description": "volume of the outlet line (plug flow) [m3]",
          "anyOf": [
            {
              "type": "number",
              "exclusiveMinimum": 0
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.5
        },
        "max_residence": {
          "description": "longest transit through the outlet line to support (at low flows) [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 21600.0
        },
        "lab_span": {
          "description": "span of the lab analysis [low, high]",
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "number"
              },
              "minItems": 2,
              "maxItems": 2
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": [
            0.0,
            2.0
          ]
        },
        "lab_period": {
          "description": "time between lab samples [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 14400.0
        },
        "lab_delay": {
          "description": "time from taking a lab sample to reporting its result [s]",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "string",
                  "pattern": "^-?\\s*[0-9.]"
                }
              ]
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 3600.0
        },
        "lab_noise": {
          "description": "standard deviation of the lab's error, in % of the lab's span [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 2.0
        }
      },
      "required": [
        "id",
        "template"
      ],
      "additionalProperties": false
    },
    "Degradation_fouling": {
      "type": "object",
      "title": "fouling",
      "description": "Heat-transfer fouling that cuts the heating gain: the lost fraction F grows linearly with time, dF/dt = rate x T / t_ref (rate per day, so a steady temperature gives a straight line), up to max, and the gain is K x (1 - F); hotter plants foul faster; cleaning resets it.",
      "properties": {
        "target": {
          "description": "A unit id.",
          "title": "Target",
          "type": "string"
        },
        "kind": {
          "const": "fouling"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        },
        "rate": {
          "description": "fraction of the heating gain lost per day at the reference temperature [1/day]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.01
        },
        "t_ref": {
          "description": "reference temperature [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 80.0
        },
        "max": {
          "description": "largest fraction that can be lost",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.8
        }
      },
      "required": [
        "target",
        "kind"
      ],
      "additionalProperties": false
    },
    "Degradation_sensor_drift": {
      "type": "object",
      "title": "sensor_drift",
      "description": "The transmitter drifts at a steady rate; calibration resets it.",
      "properties": {
        "target": {
          "description": "A unit id.",
          "title": "Target",
          "type": "string"
        },
        "kind": {
          "const": "sensor_drift"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        },
        "rate": {
          "description": "drift per day, in % of the measurement span [%/day]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.1
        }
      },
      "required": [
        "target",
        "kind"
      ],
      "additionalProperties": false
    },
    "Degradation_valve_wear": {
      "type": "object",
      "title": "valve_wear",
      "description": "Packing wear widens the valve's stick-slip friction bands; replacing the valve resets it.",
      "properties": {
        "target": {
          "description": "A unit id.",
          "title": "Target",
          "type": "string"
        },
        "kind": {
          "const": "valve_wear"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        },
        "rate": {
          "description": "growth of the static friction band per day, in % of travel [%/day]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.05
        },
        "max": {
          "description": "largest growth [%]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 10.0
        }
      },
      "required": [
        "target",
        "kind"
      ],
      "additionalProperties": false
    },
    "Degradation_catalyst_decay": {
      "type": "object",
      "title": "catalyst_decay",
      "description": "The catalyst loses activity, faster at higher temperatures, lowering the product property; replacing the catalyst resets it.",
      "properties": {
        "target": {
          "description": "A unit id.",
          "title": "Target",
          "type": "string"
        },
        "kind": {
          "const": "catalyst_decay"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Why, in words: kept with the scenario and shown by `homeostat explain`.",
          "title": "Note"
        },
        "rate": {
          "description": "fraction of the activity lost per day at the reference temperature [1/day]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.02
        },
        "t_ref": {
          "description": "reference temperature [degC]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 80.0
        },
        "max": {
          "description": "largest fraction that can be lost",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.9
        },
        "E": {
          "description": "activation temperature of the decay; 0 makes it proportional to the temperature in degC [K]",
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ],
          "default": 0.0
        }
      },
      "required": [
        "target",
        "kind"
      ],
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "description": "A plant and its timeline.",
  "properties": {
    "seed": {
      "default": 0,
      "description": "Seed of every random stream.",
      "title": "Seed",
      "type": "integer"
    },
    "duration": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ]
        },
        {
          "pattern": "^-?\\s*[0-9.]",
          "type": "string"
        }
      ],
      "description": "Length of the run, a whole multiple of `dt`.",
      "title": "Duration"
    },
    "dt": {
      "anyOf": [
        {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "$ref": "#/$defs/Distribution"
            }
          ]
        },
        {
          "pattern": "^-?\\s*[0-9.]",
          "type": "string"
        }
      ],
      "default": 1.0,
      "description": "Base step; parameters are given in physical units and discretized exactly.",
      "title": "Dt"
    },
    "lanes": {
      "default": 1,
      "description": "Number of lanes run side by side as one batch.",
      "minimum": 1,
      "title": "Lanes",
      "type": "integer"
    },
    "noise_keys": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "One noise key per lane; lanes with the same key share their noise (twin runs).",
      "title": "Noise Keys"
    },
    "init": {
      "anyOf": [
        {
          "enum": [
            "steady",
            "none"
          ],
          "type": "string"
        },
        {
          "$ref": "#/$defs/BurnIn"
        }
      ],
      "default": "steady",
      "description": "`steady` (settle noise-free first), `none`, or `{burn_in: <duration>}`.",
      "title": "Init"
    },
    "library": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Domain library, optionally pinned to a major version: `process` or `process@1`.",
      "title": "Library"
    },
    "units": {
      "description": "Template instances.",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/Unit_flow_loop"
          },
          {
            "$ref": "#/$defs/Unit_level_loop"
          },
          {
            "$ref": "#/$defs/Unit_temperature_loop"
          },
          {
            "$ref": "#/$defs/Unit_mixer"
          },
          {
            "$ref": "#/$defs/Unit_heat_exchanger"
          },
          {
            "$ref": "#/$defs/Unit_reactor"
          },
          {
            "$ref": "#/$defs/Unit_cstr"
          }
        ]
      },
      "title": "Units",
      "type": "array"
    },
    "exogenous": {
      "description": "Sources and wiring of template ports and new signals.",
      "items": {
        "$ref": "#/$defs/Exogenous"
      },
      "title": "Exogenous",
      "type": "array"
    },
    "interventions": {
      "description": "Planned changes and faults at given times.",
      "items": {
        "$ref": "#/$defs/Intervention"
      },
      "title": "Interventions",
      "type": "array"
    },
    "custom": {
      "description": "Core operators used directly.",
      "items": {
        "$ref": "#/$defs/CustomOp"
      },
      "title": "Custom",
      "type": "array"
    },
    "regimes": {
      "additionalProperties": {
        "additionalProperties": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "$ref": "#/$defs/Distribution"
                }
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "type": "object"
      },
      "description": "Named sets of values (setpoints, parameters, modes) for the plan.",
      "title": "Regimes",
      "type": "object"
    },
    "plan": {
      "$ref": "#/$defs/Plan",
      "description": "The starting regime, production transitions and maintenance."
    },
    "degradation": {
      "description": "Slow degradations of units.",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/Degradation_fouling"
          },
          {
            "$ref": "#/$defs/Degradation_sensor_drift"
          },
          {
            "$ref": "#/$defs/Degradation_valve_wear"
          },
          {
            "$ref": "#/$defs/Degradation_catalyst_decay"
          }
        ]
      },
      "title": "Degradation",
      "type": "array"
    },
    "family": {
      "anyOf": [
        {
          "$ref": "#/$defs/FamilySpec"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Plants and histories drawn by `homeostat.family()`."
    },
    "output": {
      "$ref": "#/$defs/Output"
    },
    "expect": {
      "description": "What the run should show, checked by `homeostat diagnose`; it does not change the plant.",
      "items": {
        "discriminator": {
          "mapping": {
            "feasible": "#/$defs/FeasibleCheck",
            "saturation": "#/$defs/SaturationCheck",
            "settles": "#/$defs/SettlesCheck",
            "shift": "#/$defs/ShiftCheck",
            "stat": "#/$defs/StatCheck",
            "visible": "#/$defs/VisibleCheck"
          },
          "propertyName": "kind"
        },
        "oneOf": [
          {
            "$ref": "#/$defs/StatCheck"
          },
          {
            "$ref": "#/$defs/ShiftCheck"
          },
          {
            "$ref": "#/$defs/SaturationCheck"
          },
          {
            "$ref": "#/$defs/SettlesCheck"
          },
          {
            "$ref": "#/$defs/VisibleCheck"
          },
          {
            "$ref": "#/$defs/FeasibleCheck"
          }
        ]
      },
      "title": "Expect",
      "type": "array"
    },
    "faults": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Generator"
      },
      "description": "Poisson fault processes: `target`, `every`, `kinds`, optional `magnitude` and `after`. Expanded into interventions."
    }
  },
  "required": [
    "duration"
  ],
  "title": "Homeostat scenario",
  "type": "object",
  "x-library": {
    "name": "process",
    "version": 1
  }
}
