From f7a27497dd184da6259ea8bd87c3c704df519923 Mon Sep 17 00:00:00 2001 From: krishnaa96 Date: Sat, 15 Aug 2020 22:29:23 +0530 Subject: Add support to generic optimization structure Add a new template version to support the new optmization model Issue-ID: OPTFRA-730 Signed-off-by: krishnaa96 Change-Id: I286f7ae1bad0af1fac0da7e96f7274eb9518e031 --- conductor/etc/conductor/opt_schema.json | 138 ++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 conductor/etc/conductor/opt_schema.json (limited to 'conductor/etc') diff --git a/conductor/etc/conductor/opt_schema.json b/conductor/etc/conductor/opt_schema.json new file mode 100644 index 0000000..cdf04de --- /dev/null +++ b/conductor/etc/conductor/opt_schema.json @@ -0,0 +1,138 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "The root schema comprises the entire JSON document.", + "required": [ + "goal", + "operation_function" + ], + "title": "The root schema", + "properties": { + "goal": { + "description": "Goal of the optimization.", + "enum": [ + "minimize", + "maximize" + ], + "title": "The goal schema", + "type": "string" + }, + "operation_function": { + "$id": "#operation_function", + "description": "The operation function that has to be optimized.", + "required": [ + "operator", + "operands" + ], + "title": "The operation_function schema", + "properties": { + "operator": { + "description": "The operation which will be a part of the objective function.", + "enum": [ + "sum", + "min", + "max" + ], + "title": "The operator schema", + "type": "string" + }, + "operands": { + "description": "The operand on which the operation is to be performed.", + "title": "The operands schema", + "type": "array", + "additionalItems": true, + "items": { + "anyOf": [ + { + "default": {}, + "description": "An explanation about the purpose of this instance.", + "required": [ + "function", + "params" + ], + "title": "function operand schema", + "properties": { + "function": { + "default": "", + "description": "Function to be performed on the parameters", + "enum": [ + "distance_between", + "latency_between", + "attribute" + ], + "title": "The function schema", + "type": "string" + }, + "weight": { + "default": 1.0, + "description": "Weight for the operand.", + "title": "The weight schema", + "type": "number" + }, + "params": { + "description": "key-value pair which will be passed as kwargs to the function.", + "title": "The params schema", + "type": "object", + "additionalProperties": true + }, + "normalization": { + "description": "Set of values used to normalize the operand.", + "$id": "#normalization", + "required": [ + "start", + "end" + ], + "title": "The normalization schema", + "properties": { + "start": { + "description": "Start of the range.", + "title": "The start schema", + "type": "number" + }, + "end": { + "description": "End of the range.", + "title": "The end schema", + "type": "number" + } + }, + "additionalProperties": true + } + }, + "additionalProperties": true + }, + { + "description": "operation function operand.", + "required": [ + "operation_function" + ], + "title": "The operation function operand schema", + "properties": { + "operation_function": { + "description": "The operation function which same as the top level object.", + "title": "The operation_function schema", + "$ref": "#/properties/operation_function", + "additionalProperties": true + }, + "normalization": { + "description": "Set of values used to normalize the operand.", + "title": "The normalization schema", + "$ref": "#/properties/operation_function/properties/operands/items/anyOf/0/properties/normalization", + "additionalProperties": true + }, + "weight": { + "default": 1.0, + "description": "An explanation about the purpose of this instance.", + "title": "The weight schema", + "type": "number" + } + }, + "additionalProperties": true + } + ] + } + } + }, + "additionalProperties": true + } + }, + "additionalProperties": true +} -- cgit 1.2.3-korg