{
  "$id": "https://github.com/klimPaskov/hoi4-agent-tools/blob/v3.6.0/schemas/probability-scenario-set.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "default": "1.0",
      "type": "string",
      "const": "1.0"
    },
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "workspaceId": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_-]{0,63}$"
    },
    "description": {
      "type": "string",
      "maxLength": 8192
    },
    "surfaceHint": {
      "type": "string",
      "enum": [
        "event_mean_time_to_happen",
        "event_option_ai_chance",
        "decision_ai_will_do",
        "mission_ai_will_do",
        "national_focus_ai_will_do",
        "technology_ai_will_do",
        "doctrine_ai_will_do",
        "direct_random",
        "random_list",
        "ai_strategy_factor",
        "custom_weighted_pool"
      ]
    },
    "scenarios": {
      "minItems": 1,
      "maxItems": 10000,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema0"
      }
    }
  },
  "required": [
    "id",
    "scenarios"
  ],
  "additionalProperties": false,
  "$defs": {
    "__schema0": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/__schema1"
        },
        "label": {
          "$ref": "#/$defs/__schema2"
        },
        "prevalence": {
          "$ref": "#/$defs/__schema3"
        },
        "actor": {
          "$ref": "#/$defs/__schema4"
        },
        "date": {
          "$ref": "#/$defs/__schema5"
        },
        "controls": {
          "$ref": "#/$defs/__schema6"
        },
        "state": {
          "$ref": "#/$defs/__schema9"
        },
        "flags": {
          "$ref": "#/$defs/__schema12"
        },
        "eventTargets": {
          "$ref": "#/$defs/__schema14"
        },
        "scopes": {
          "$ref": "#/$defs/__schema15"
        },
        "scopePools": {
          "$ref": "#/$defs/__schema18"
        },
        "candidateOverrides": {
          "$ref": "#/$defs/__schema28"
        },
        "uncertainInputs": {
          "$ref": "#/$defs/__schema29"
        },
        "correlations": {
          "$ref": "#/$defs/__schema45"
        },
        "schedule": {
          "$ref": "#/$defs/__schema47"
        }
      },
      "required": [
        "id",
        "state"
      ],
      "additionalProperties": false
    },
    "__schema1": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "__schema2": {
      "type": "string",
      "maxLength": 4096
    },
    "__schema3": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "__schema4": {
      "type": "string",
      "maxLength": 256
    },
    "__schema5": {
      "type": "string",
      "maxLength": 64
    },
    "__schema6": {
      "type": "object",
      "propertyNames": {
        "$ref": "#/$defs/__schema7"
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema8"
      }
    },
    "__schema7": {
      "type": "string",
      "pattern": "^[1-9][0-9]{0,8}$"
    },
    "__schema8": {
      "type": "string",
      "pattern": "^[A-Z0-9]{3}$"
    },
    "__schema9": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "minLength": 1,
        "maxLength": 1024
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema10"
      }
    },
    "__schema10": {
      "anyOf": [
        {
          "$ref": "#/$defs/__schema11"
        },
        {
          "maxItems": 100000,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema11"
          }
        }
      ]
    },
    "__schema11": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 4096
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "__schema12": {
      "maxItems": 100000,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema13"
      }
    },
    "__schema13": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "__schema14": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "maxLength": 512
      },
      "additionalProperties": {
        "type": "string",
        "maxLength": 512
      }
    },
    "__schema15": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "minLength": 1,
        "maxLength": 512
      },
      "additionalProperties": {
        "$ref": "#/$defs/__schema16"
      }
    },
    "__schema16": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "type": {
          "type": "string",
          "enum": [
            "country",
            "state",
            "character",
            "unit_leader",
            "operative",
            "strategic_region",
            "province",
            "unknown"
          ]
        },
        "actor": {
          "type": "string",
          "maxLength": 256
        },
        "state": {
          "default": {},
          "type": "object",
          "propertyNames": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema10"
          }
        },
        "flags": {
          "maxItems": 100000,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema17"
          }
        },
        "eventTargets": {
          "type": "object",
          "propertyNames": {
            "type": "string",
            "maxLength": 512
          },
          "additionalProperties": {
            "type": "string",
            "maxLength": 512
          }
        },
        "weight": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          ]
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false
    },
    "__schema17": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "__schema18": {
      "maxItems": 100000,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema19"
      }
    },
    "__schema19": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/__schema20"
        },
        "bindAs": {
          "$ref": "#/$defs/__schema21"
        },
        "selection": {
          "$ref": "#/$defs/__schema22"
        },
        "complete": {
          "$ref": "#/$defs/__schema23"
        },
        "filter": {
          "$ref": "#/$defs/__schema24"
        },
        "candidates": {
          "$ref": "#/$defs/__schema27"
        }
      },
      "required": [
        "id",
        "candidates"
      ],
      "additionalProperties": false
    },
    "__schema20": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "__schema21": {
      "default": "THIS",
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "__schema22": {
      "default": "enumeration",
      "type": "string",
      "enum": [
        "enumeration",
        "uniform",
        "proportional_categorical"
      ]
    },
    "__schema23": {
      "default": false,
      "type": "boolean"
    },
    "__schema24": {
      "type": "object",
      "properties": {
        "inlineClausewitz": {
          "$ref": "#/$defs/__schema25"
        },
        "scriptedTrigger": {
          "$ref": "#/$defs/__schema26"
        }
      },
      "additionalProperties": false
    },
    "__schema25": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1048576
    },
    "__schema26": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "__schema27": {
      "minItems": 1,
      "maxItems": 100000,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema16"
      }
    },
    "__schema28": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "maxLength": 512
      },
      "additionalProperties": {
        "type": "boolean"
      }
    },
    "__schema29": {
      "maxItems": 10000,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema30"
      }
    },
    "__schema30": {
      "type": "object",
      "properties": {
        "path": {
          "$ref": "#/$defs/__schema31"
        },
        "range": {
          "$ref": "#/$defs/__schema32"
        },
        "alternatives": {
          "$ref": "#/$defs/__schema33"
        },
        "distribution": {
          "$ref": "#/$defs/__schema34"
        },
        "unresolved": {
          "$ref": "#/$defs/__schema44"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false
    },
    "__schema31": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "__schema32": {
      "type": "object",
      "properties": {
        "min": {
          "type": "number"
        },
        "max": {
          "type": "number"
        }
      },
      "required": [
        "min",
        "max"
      ],
      "additionalProperties": false
    },
    "__schema33": {
      "minItems": 1,
      "maxItems": 100000,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema11"
      }
    },
    "__schema34": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/$defs/__schema35"
        },
        "min": {
          "$ref": "#/$defs/__schema36"
        },
        "max": {
          "$ref": "#/$defs/__schema37"
        },
        "mode": {
          "$ref": "#/$defs/__schema38"
        },
        "mean": {
          "$ref": "#/$defs/__schema39"
        },
        "stddev": {
          "$ref": "#/$defs/__schema40"
        },
        "values": {
          "$ref": "#/$defs/__schema41"
        },
        "probabilities": {
          "$ref": "#/$defs/__schema42"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false
    },
    "__schema35": {
      "type": "string",
      "enum": [
        "uniform",
        "triangular",
        "normal",
        "lognormal",
        "categorical",
        "empirical"
      ]
    },
    "__schema36": {
      "type": "number"
    },
    "__schema37": {
      "type": "number"
    },
    "__schema38": {
      "type": "number"
    },
    "__schema39": {
      "type": "number"
    },
    "__schema40": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "__schema41": {
      "minItems": 1,
      "maxItems": 100000,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema11"
      }
    },
    "__schema42": {
      "minItems": 1,
      "maxItems": 100000,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema43"
      }
    },
    "__schema43": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "__schema44": {
      "type": "boolean",
      "const": true
    },
    "__schema45": {
      "maxItems": 10000,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema46"
      }
    },
    "__schema46": {
      "type": "object",
      "properties": {
        "left": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "right": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "coefficient": {
          "type": "number",
          "minimum": -1,
          "maximum": 1
        }
      },
      "required": [
        "left",
        "right",
        "coefficient"
      ],
      "additionalProperties": false
    },
    "__schema47": {
      "maxItems": 100000,
      "type": "array",
      "items": {
        "$ref": "#/$defs/__schema48"
      }
    },
    "__schema48": {
      "type": "object",
      "properties": {
        "atDay": {
          "type": "number",
          "minimum": 0
        },
        "set": {
          "type": "object",
          "propertyNames": {
            "type": "string",
            "maxLength": 1024
          },
          "additionalProperties": {
            "$ref": "#/$defs/__schema10"
          }
        },
        "clearFlags": {
          "maxItems": 100000,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema49"
          }
        },
        "addFlags": {
          "maxItems": 100000,
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema50"
          }
        }
      },
      "required": [
        "atDay",
        "set"
      ],
      "additionalProperties": false
    },
    "__schema49": {
      "type": "string",
      "maxLength": 512
    },
    "__schema50": {
      "type": "string",
      "maxLength": 512
    }
  }
}
