{
  "$defs": {
    "ComponentOverride": {
      "additionalProperties": false,
      "properties": {
        "capacity": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Capacity"
        },
        "interarrival": {
          "anyOf": [
            {
              "discriminator": {
                "mapping": {
                  "constant": "#/$defs/Constant",
                  "exponential": "#/$defs/Exponential",
                  "normal": "#/$defs/Normal",
                  "uniform": "#/$defs/Uniform"
                },
                "propertyName": "kind"
              },
              "oneOf": [
                {
                  "$ref": "#/$defs/Constant"
                },
                {
                  "$ref": "#/$defs/Exponential"
                },
                {
                  "$ref": "#/$defs/Normal"
                },
                {
                  "$ref": "#/$defs/Uniform"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Interarrival"
        },
        "processing": {
          "anyOf": [
            {
              "discriminator": {
                "mapping": {
                  "constant": "#/$defs/Constant",
                  "exponential": "#/$defs/Exponential",
                  "normal": "#/$defs/Normal",
                  "uniform": "#/$defs/Uniform"
                },
                "propertyName": "kind"
              },
              "oneOf": [
                {
                  "$ref": "#/$defs/Constant"
                },
                {
                  "$ref": "#/$defs/Exponential"
                },
                {
                  "$ref": "#/$defs/Normal"
                },
                {
                  "$ref": "#/$defs/Uniform"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Processing"
        }
      },
      "title": "ComponentOverride",
      "type": "object"
    },
    "Constant": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "constant",
          "title": "Kind",
          "type": "string"
        },
        "value": {
          "minimum": 0,
          "title": "Value",
          "type": "number"
        }
      },
      "required": [
        "kind",
        "value"
      ],
      "title": "Constant",
      "type": "object"
    },
    "Expectation": {
      "additionalProperties": false,
      "description": "A conclusion the analysis must confirm: a hazard is, or is not, reachable.",
      "properties": {
        "hazard": {
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$",
          "title": "Hazard",
          "type": "string"
        },
        "reachable": {
          "title": "Reachable",
          "type": "boolean"
        }
      },
      "required": [
        "hazard",
        "reachable"
      ],
      "title": "Expectation",
      "type": "object"
    },
    "Exponential": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "exponential",
          "title": "Kind",
          "type": "string"
        },
        "mean": {
          "exclusiveMinimum": 0,
          "title": "Mean",
          "type": "number"
        }
      },
      "required": [
        "kind",
        "mean"
      ],
      "title": "Exponential",
      "type": "object"
    },
    "Limits": {
      "additionalProperties": false,
      "properties": {
        "max_wall_seconds": {
          "default": 60.0,
          "exclusiveMinimum": 0,
          "title": "Max Wall Seconds",
          "type": "number"
        }
      },
      "title": "Limits",
      "type": "object"
    },
    "Normal": {
      "additionalProperties": false,
      "description": "Normal distribution; a negative draw is truncated to zero.",
      "properties": {
        "kind": {
          "const": "normal",
          "title": "Kind",
          "type": "string"
        },
        "mean": {
          "title": "Mean",
          "type": "number"
        },
        "std": {
          "exclusiveMinimum": 0,
          "title": "Std",
          "type": "number"
        }
      },
      "required": [
        "kind",
        "mean",
        "std"
      ],
      "title": "Normal",
      "type": "object"
    },
    "SignalFault": {
      "additionalProperties": false,
      "description": "A fault on a signal between two components: what the receiving\ncomponent reads instead of the true value.",
      "properties": {
        "at": {
          "description": "When it starts",
          "minimum": 0,
          "title": "At",
          "type": "number"
        },
        "kind": {
          "enum": [
            "stuck",
            "offset",
            "drift",
            "noise",
            "delay",
            "dropout"
          ],
          "title": "Kind",
          "type": "string"
        },
        "name": {
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$",
          "title": "Name",
          "type": "string"
        },
        "signal": {
          "description": "The input it corrupts: component.input",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]*\\.\\S+$",
          "title": "Signal",
          "type": "string"
        },
        "steps": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "delay: communication steps",
          "title": "Steps"
        },
        "until": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "When it ends; never if absent",
          "title": "Until"
        },
        "value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "stuck: the value read (absent: the last true value); offset: added; drift: added per time unit; noise: standard deviation; dropout: the value read (absent: 0)",
          "title": "Value"
        }
      },
      "required": [
        "name",
        "signal",
        "kind",
        "at"
      ],
      "title": "SignalFault",
      "type": "object"
    },
    "Uniform": {
      "additionalProperties": false,
      "properties": {
        "high": {
          "title": "High",
          "type": "number"
        },
        "kind": {
          "const": "uniform",
          "title": "Kind",
          "type": "string"
        },
        "low": {
          "minimum": 0,
          "title": "Low",
          "type": "number"
        }
      },
      "required": [
        "kind",
        "low",
        "high"
      ],
      "title": "Uniform",
      "type": "object"
    }
  },
  "$id": "mokili.scenario/1",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "One experiment input, fixed: which model, what changes, for how long,\nwith which seed, and which outputs to keep.",
  "properties": {
    "assumptions": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Assumptions",
      "type": "array"
    },
    "engine": {
      "enum": [
        "discrete-event",
        "fmi",
        "netlogo",
        "qualitative",
        "co-simulation",
        "protocol",
        "equations"
      ],
      "title": "Engine",
      "type": "string"
    },
    "expectations": {
      "default": [],
      "items": {
        "$ref": "#/$defs/Expectation"
      },
      "title": "Expectations",
      "type": "array"
    },
    "faults": {
      "default": [],
      "description": "Qualitative models: faults that may occur",
      "items": {
        "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$",
        "type": "string"
      },
      "title": "Faults",
      "type": "array"
    },
    "horizon": {
      "exclusiveMinimum": 0,
      "title": "Horizon",
      "type": "number"
    },
    "initial": {
      "default": {},
      "description": "Qualitative models: starting value of each quantity and mode",
      "patternProperties": {
        "^[A-Za-z][A-Za-z0-9_-]{0,63}$": {
          "type": "string"
        }
      },
      "title": "Initial",
      "type": "object"
    },
    "intervals": {
      "additionalProperties": {
        "maxItems": 2,
        "minItems": 2,
        "prefixItems": [
          {
            "type": "number"
          },
          {
            "type": "number"
          }
        ],
        "type": "array"
      },
      "default": {},
      "description": "Equations models: quantities known only within [low, high] \u2014 parameters, inputs, initial states; the run computes guaranteed bounds that hold for every value at once",
      "title": "Intervals",
      "type": "object"
    },
    "limits": {
      "$ref": "#/$defs/Limits",
      "default": {
        "max_wall_seconds": 60.0
      }
    },
    "model": {
      "pattern": "^sha256:[0-9a-f]{64}$",
      "title": "Model",
      "type": "string"
    },
    "name": {
      "minLength": 1,
      "title": "Name",
      "type": "string"
    },
    "observed_measurement": {
      "anyOf": [
        {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Qualitative models: a measurement of the real system to check against the analysis",
      "title": "Observed Measurement"
    },
    "observed_run": {
      "anyOf": [
        {
          "pattern": "^sha256:[0-9a-f]{64}$",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Qualitative models: a run of the counterpart to check against the analysis",
      "title": "Observed Run"
    },
    "output_step": {
      "anyOf": [
        {
          "exclusiveMinimum": 0,
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Output Step"
    },
    "outputs": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Outputs",
      "type": "array"
    },
    "overrides": {
      "default": {},
      "patternProperties": {
        "^[A-Za-z][A-Za-z0-9_-]{0,63}$": {
          "$ref": "#/$defs/ComponentOverride"
        }
      },
      "title": "Overrides",
      "type": "object"
    },
    "parameters": {
      "additionalProperties": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "integer"
          },
          {
            "type": "boolean"
          },
          {
            "type": "string"
          }
        ]
      },
      "default": {},
      "title": "Parameters",
      "type": "object"
    },
    "replications": {
      "default": 1,
      "description": "Random engines: independent runs with seeds seed, seed + 1, ...",
      "maximum": 1000,
      "minimum": 1,
      "title": "Replications",
      "type": "integer"
    },
    "requirements": {
      "default": [],
      "description": "Requirements every run is checked against",
      "items": {
        "pattern": "^sha256:[0-9a-f]{64}$",
        "type": "string"
      },
      "title": "Requirements",
      "type": "array"
    },
    "schema": {
      "const": "mokili.scenario/1",
      "title": "Schema",
      "type": "string"
    },
    "seed": {
      "anyOf": [
        {
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Seed"
    },
    "signal_faults": {
      "default": [],
      "description": "Coupled models: faults on signals between components",
      "items": {
        "$ref": "#/$defs/SignalFault"
      },
      "title": "Signal Faults",
      "type": "array"
    },
    "warmup": {
      "default": 0.0,
      "minimum": 0,
      "title": "Warmup",
      "type": "number"
    }
  },
  "required": [
    "schema",
    "name",
    "model",
    "engine",
    "horizon"
  ],
  "title": "Scenario",
  "type": "object"
}
