Update JSON schema

This commit is contained in:
2023-02-22 15:00:42 -06:00
parent b1d49e1313
commit e4ed05fb98
2 changed files with 188 additions and 193 deletions

View File

@@ -18,6 +18,9 @@ const schema = {
"time horizon (years)": { "time horizon (years)": {
type: "number", type: "number",
}, },
"distance metric": {
type: "string",
},
}, },
required: ["time horizon (years)"], required: ["time horizon (years)"],
}, },
@@ -159,6 +162,15 @@ const schema = {
"initial amounts": { "initial amounts": {
$ref: "#/definitions/InitialAmount", $ref: "#/definitions/InitialAmount",
}, },
"disposal limit (tonne)": {
$ref: "#/definitions/TimeSeries",
},
"disposal cost ($/tonne)": {
$ref: "#/definitions/TimeSeries",
},
"acquisition cost ($/tonne)": {
$ref: "#/definitions/TimeSeries",
},
}, },
required: ["transportation cost ($/km/tonne)"], required: ["transportation cost ($/km/tonne)"],
}, },

View File

@@ -1,206 +1,189 @@
{ {
"$schema": "http://json-schema.org/draft-07/schema#", "$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://anl-ceeesa.github.io/RELOG/input", "$id": "https://anl-ceeesa.github.io/RELOG/input",
"title": "Schema for RELOG Input File", "title": "Schema for RELOG Input File",
"definitions": { "definitions": {
"TimeSeries": { "TimeSeries": {
"type": "array", "type": "array",
"items": { "items": {
"type": "number" "type": "number"
} }
},
"Parameters": {
"type": "object",
"properties": {
"time horizon (years)": {
"type": "number"
}, },
"Parameters": { "distance metric": {
"type": "string"
}
},
"required": ["time horizon (years)"]
},
"Plant": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"input": {
"type": "string"
},
"outputs (tonne/tonne)": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"energy (GJ/tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"emissions (tonne/tonne)": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/TimeSeries"
}
},
"locations": {
"$ref": "#/definitions/PlantLocation"
}
},
"required": ["input", "locations"]
}
},
"PlantLocation": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"location": {
"type": "string"
},
"latitude (deg)": {
"type": "number"
},
"longitude (deg)": {
"type": "number"
},
"disposal": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"cost ($/tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"limit (tonne)": {
"$ref": "#/definitions/TimeSeries"
}
},
"required": ["cost ($/tonne)"]
}
},
"storage": {
"type": "object", "type": "object",
"properties": { "properties": {
"time horizon (years)": { "cost ($/tonne)": {
"type": "number" "$ref": "#/definitions/TimeSeries"
}, },
"distance metric": { "limit (tonne)": {
"type": "string" "type": "number"
} }
}, },
"required": [ "required": ["cost ($/tonne)", "limit (tonne)"]
"time horizon (years)" },
] "capacities (tonne)": {
},
"Plant": {
"type": "object", "type": "object",
"additionalProperties": { "additionalProperties": {
"type": "object", "type": "object",
"properties": { "properties": {
"input": { "variable operating cost ($/tonne)": {
"type": "string" "$ref": "#/definitions/TimeSeries"
},
"outputs (tonne/tonne)": {
"type": "object",
"additionalProperties": {
"type": "number"
}
},
"energy (GJ/tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"emissions (tonne/tonne)": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/TimeSeries"
}
},
"locations": {
"$ref": "#/definitions/PlantLocation"
}
}, },
"required": [ "fixed operating cost ($)": {
"input", "$ref": "#/definitions/TimeSeries"
"locations" },
] "opening cost ($)": {
"$ref": "#/definitions/TimeSeries"
}
},
"required": [
"variable operating cost ($/tonne)",
"fixed operating cost ($)",
"opening cost ($)"
]
} }
}
}, },
"PlantLocation": { "required": ["capacities (tonne)"]
"type": "object", }
"additionalProperties": {
"type": "object",
"properties": {
"location": {
"type": "string"
},
"latitude (deg)": {
"type": "number"
},
"longitude (deg)": {
"type": "number"
},
"disposal": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"cost ($/tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"limit (tonne)": {
"$ref": "#/definitions/TimeSeries"
}
},
"required": [
"cost ($/tonne)"
]
}
},
"storage": {
"type": "object",
"properties": {
"cost ($/tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"limit (tonne)": {
"type": "number"
}
},
"required": [
"cost ($/tonne)",
"limit (tonne)"
]
},
"capacities (tonne)": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"variable operating cost ($/tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"fixed operating cost ($)": {
"$ref": "#/definitions/TimeSeries"
},
"opening cost ($)": {
"$ref": "#/definitions/TimeSeries"
}
},
"required": [
"variable operating cost ($/tonne)",
"fixed operating cost ($)",
"opening cost ($)"
]
}
}
},
"required": [
"capacities (tonne)"
]
}
},
"InitialAmount": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"location": {
"type": "string"
},
"latitude (deg)": {
"type": "number"
},
"longitude (deg)": {
"type": "number"
},
"amount (tonne)": {
"$ref": "#/definitions/TimeSeries"
}
},
"required": [
"amount (tonne)"
]
}
},
"Product": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"transportation cost ($/km/tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"transportation energy (J/km/tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"transportation emissions (tonne/km/tonne)": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/TimeSeries"
}
},
"initial amounts": {
"$ref": "#/definitions/InitialAmount"
},
"disposal limit (tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"disposal cost ($/tonne)": {
"$ref": "#/definitions/TimeSeries"
}
},
"required": [
"transportation cost ($/km/tonne)"
]
}
}
}, },
"type": "object", "InitialAmount": {
"properties": { "type": "object",
"parameters": { "additionalProperties": {
"$ref": "#/definitions/Parameters" "type": "object",
"properties": {
"location": {
"type": "string"
},
"latitude (deg)": {
"type": "number"
},
"longitude (deg)": {
"type": "number"
},
"amount (tonne)": {
"$ref": "#/definitions/TimeSeries"
}
}, },
"plants": { "required": ["amount (tonne)"]
"$ref": "#/definitions/Plant" }
},
"products": {
"$ref": "#/definitions/Product"
}
}, },
"required": [ "Product": {
"parameters", "type": "object",
"plants", "additionalProperties": {
"products" "type": "object",
] "properties": {
} "transportation cost ($/km/tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"transportation energy (J/km/tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"transportation emissions (tonne/km/tonne)": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/TimeSeries"
}
},
"initial amounts": {
"$ref": "#/definitions/InitialAmount"
},
"disposal limit (tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"disposal cost ($/tonne)": {
"$ref": "#/definitions/TimeSeries"
},
"acquisition cost ($/tonne)": {
"$ref": "#/definitions/TimeSeries"
}
},
"required": ["transportation cost ($/km/tonne)"]
}
}
},
"type": "object",
"properties": {
"parameters": {
"$ref": "#/definitions/Parameters"
},
"plants": {
"$ref": "#/definitions/Plant"
},
"products": {
"$ref": "#/definitions/Product"
}
},
"required": ["parameters", "plants", "products"]
}