{
  "$defs": {
    "ComputedParameter": {
      "description": "A quantity computed from hydro data for the plant `hydro_id`.",
      "oneOf": [
        {
          "description": "Equivalent productivity coefficient (`ρ_eq`).",
          "properties": {
            "hydro_id": {
              "$ref": "#/$defs/EntityId",
              "description": "Hydro plant identifier."
            },
            "tag": {
              "const": "equivalent_productivity",
              "type": "string"
            }
          },
          "required": [
            "tag",
            "hydro_id"
          ],
          "type": "object"
        },
        {
          "description": "Accumulated productivity coefficient (`ρ_acum`).",
          "properties": {
            "hydro_id": {
              "$ref": "#/$defs/EntityId",
              "description": "Hydro plant identifier."
            },
            "tag": {
              "const": "accumulated_productivity",
              "type": "string"
            }
          },
          "required": [
            "tag",
            "hydro_id"
          ],
          "type": "object"
        },
        {
          "description": "Reference reservoir volume (`V_ref`).",
          "properties": {
            "hydro_id": {
              "$ref": "#/$defs/EntityId",
              "description": "Hydro plant identifier."
            },
            "tag": {
              "const": "reference_volume",
              "type": "string"
            }
          },
          "required": [
            "tag",
            "hydro_id"
          ],
          "type": "object"
        },
        {
          "description": "Reference turbine flow (`q_ref`).",
          "properties": {
            "hydro_id": {
              "$ref": "#/$defs/EntityId",
              "description": "Hydro plant identifier."
            },
            "tag": {
              "const": "reference_turbine",
              "type": "string"
            }
          },
          "required": [
            "tag",
            "hydro_id"
          ],
          "type": "object"
        },
        {
          "description": "Minimum operational storage (`V_min`).",
          "properties": {
            "hydro_id": {
              "$ref": "#/$defs/EntityId",
              "description": "Hydro plant identifier."
            },
            "tag": {
              "const": "min_storage",
              "type": "string"
            }
          },
          "required": [
            "tag",
            "hydro_id"
          ],
          "type": "object"
        },
        {
          "description": "Maximum operational storage (`V_max`).",
          "properties": {
            "hydro_id": {
              "$ref": "#/$defs/EntityId",
              "description": "Hydro plant identifier."
            },
            "tag": {
              "const": "max_storage",
              "type": "string"
            }
          },
          "required": [
            "tag",
            "hydro_id"
          ],
          "type": "object"
        },
        {
          "description": "Specific productivity (`ρ_esp`).",
          "properties": {
            "hydro_id": {
              "$ref": "#/$defs/EntityId",
              "description": "Hydro plant identifier."
            },
            "tag": {
              "const": "specific_productivity",
              "type": "string"
            }
          },
          "required": [
            "tag",
            "hydro_id"
          ],
          "type": "object"
        },
        {
          "description": "Equivalent productivity evaluated as the mean over the plant's storage\nrange rather than at the reference volume (own scope).",
          "properties": {
            "hydro_id": {
              "$ref": "#/$defs/EntityId",
              "description": "Hydro plant identifier."
            },
            "tag": {
              "const": "integrated_equivalent_productivity",
              "type": "string"
            }
          },
          "required": [
            "tag",
            "hydro_id"
          ],
          "type": "object"
        },
        {
          "description": "Accumulated productivity evaluated as the mean over the plant's storage\nrange rather than at the reference volume (cascade scope).",
          "properties": {
            "hydro_id": {
              "$ref": "#/$defs/EntityId",
              "description": "Hydro plant identifier."
            },
            "tag": {
              "const": "integrated_accumulated_productivity",
              "type": "string"
            }
          },
          "required": [
            "tag",
            "hydro_id"
          ],
          "type": "object"
        },
        {
          "description": "Maximum stored energy: `integrated_accumulated_productivity * (V_hi -\nV_lo)` over the hydro plant's physical storage range (stage-invariant).\nUnit is productivity `[MW/(m3/s)]` times volume `[hm3]` — the same unit\nas a productivity-times-storage-volume constraint term, not `MWh`.",
          "properties": {
            "hydro_id": {
              "$ref": "#/$defs/EntityId",
              "description": "Hydro plant identifier."
            },
            "tag": {
              "const": "max_stored_energy",
              "type": "string"
            }
          },
          "required": [
            "tag",
            "hydro_id"
          ],
          "type": "object"
        }
      ]
    },
    "EntityId": {
      "description": "Entity identifier: the integer `id` of the entity it refers to.",
      "format": "int32",
      "type": "integer"
    },
    "RawParameterKind": {
      "description": "`kind` discriminator of a `generic_parameters.json` entry.",
      "oneOf": [
        {
          "const": "constant",
          "description": "One value for every stage, in `value`.",
          "type": "string"
        },
        {
          "const": "per_stage",
          "description": "One value per stage, in `values` keyed by stage id.",
          "type": "string"
        },
        {
          "const": "seasonal",
          "description": "One value per season, in `values` keyed by season id.",
          "type": "string"
        },
        {
          "const": "computed",
          "description": "A quantity derived from hydro data, in `computed_spec`.",
          "type": "string"
        },
        {
          "const": "per_stage_block",
          "description": "One value per stage and block, in `block_values`.",
          "type": "string"
        }
      ]
    },
    "ScalarParameterJsonEntry": {
      "additionalProperties": false,
      "description": "One parameter entry.\n\nAn unknown key, such as the retired `values_source`, is a parse error that\nnames the key.",
      "properties": {
        "block_values": {
          "description": "`[[stage_id, block_id, value], ...]` triples. Required when\n`kind == \"per_stage_block\"` (each `(stage_id, block_id)` pair unique);\nmust be absent for all other kinds.",
          "items": {
            "maxItems": 3,
            "minItems": 3,
            "prefixItems": [
              {
                "format": "int32",
                "type": "integer"
              },
              {
                "format": "int32",
                "type": "integer"
              },
              {
                "format": "double",
                "type": "number"
              }
            ],
            "type": "array"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "computed_spec": {
          "anyOf": [
            {
              "$ref": "#/$defs/ComputedParameter"
            },
            {
              "type": "null"
            }
          ],
          "description": "Computed-parameter specification. Required when `kind == \"computed\"`;\nmust be absent for all other kinds."
        },
        "id": {
          "description": "Stable numeric identifier; unique within the file.",
          "format": "int32",
          "type": "integer"
        },
        "kind": {
          "$ref": "#/$defs/RawParameterKind",
          "description": "Selects which payload field (`value`, `values`, `computed_spec` or\n`block_values`) the entry carries."
        },
        "name": {
          "description": "Human-readable name; unique within the file. Used as the `@name` reference\nfrom `generic_constraints.json`.",
          "type": "string"
        },
        "value": {
          "description": "Scalar value. Required when `kind == \"constant\"`; must be absent for all\nother kinds.",
          "format": "double",
          "type": [
            "number",
            "null"
          ]
        },
        "values": {
          "description": "`[[key, value], ...]` pairs. Required when `kind == \"per_stage\"` (keys are\nstage ids, must be a contiguous range starting at 0) or\n`kind == \"seasonal\"` (keys are season ids, must be unique). Must be absent\nfor `\"constant\"` and `\"computed\"`.",
          "items": {
            "maxItems": 2,
            "minItems": 2,
            "prefixItems": [
              {
                "format": "int32",
                "type": "integer"
              },
              {
                "format": "double",
                "type": "number"
              }
            ],
            "type": "array"
          },
          "type": [
            "array",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "kind"
      ],
      "type": "object"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Root object of `generic_parameters.json`.\n\nTop-level keys other than `scalar_parameters`, such as `$schema`, are\nignored; an unknown key inside an entry is an error.",
  "properties": {
    "$schema": {
      "default": null,
      "description": "`$schema` field — informational, not validated.",
      "type": [
        "string",
        "null"
      ]
    },
    "scalar_parameters": {
      "description": "Array of scalar parameter entries.",
      "items": {
        "$ref": "#/$defs/ScalarParameterJsonEntry"
      },
      "type": "array"
    }
  },
  "required": [
    "scalar_parameters"
  ],
  "title": "ScalarParametersFile",
  "type": "object"
}