From 900777deedb540efba26839ae703249940a1335c Mon Sep 17 00:00:00 2001 From: Tom Szendrey Date: Mon, 17 Jun 2024 10:32:35 -0400 Subject: [PATCH 01/20] START moving constraints over --- .../optimize-ciemss-operation.ts | 33 ++++-- .../optimize-ciemss/tera-optimize-ciemss.vue | 108 +++++++----------- .../tera-optimize-constraint-group-form.vue | 79 +++++++++++++ 3 files changed, 144 insertions(+), 76 deletions(-) create mode 100644 packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/tera-optimize-constraint-group-form.vue diff --git a/packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/optimize-ciemss-operation.ts b/packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/optimize-ciemss-operation.ts index 314bf05118..e7b0680193 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/optimize-ciemss-operation.ts +++ b/packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/optimize-ciemss-operation.ts @@ -27,6 +27,15 @@ export interface InterventionPolicyGroup { paramValue: number; } +export interface ConstraintGroup { + name: string; // Title of the group + targetVariable: string; + qoiMethod: ContextMethods; + riskTolerance: number; + threshold: number; + isMinimized: boolean; +} + export interface OptimizeCiemssOperationState extends BaseState { // Settings endTime: number; @@ -37,12 +46,9 @@ export interface OptimizeCiemssOperationState extends BaseState { // Intervention policies interventionType: InterventionTypes; interventionPolicyGroups: InterventionPolicyGroup[]; - // Constraints - qoiMethod: ContextMethods; - targetVariables: string[]; - riskTolerance: number; - threshold: number; - isMinimized: boolean; + // Constraints: + constraintGroups: ConstraintGroup[]; + // Charts + Outputs: chartConfigs: string[][]; inProgressOptimizeId: string; inProgressForecastId: string; @@ -64,6 +70,15 @@ export const blankInterventionPolicyGroup: InterventionPolicyGroup = { paramValue: 0 }; +export const defaultConstraintGroup: ConstraintGroup = { + name: 'Constraint', + qoiMethod: ContextMethods.max, + targetVariable: '', + riskTolerance: 5, + threshold: 1, + isMinimized: true +}; + export const OptimizeCiemssOperation: Operation = { name: WorkflowOperationTypes.OPTIMIZE_CIEMSS, displayName: 'Optimize with PyCIEMSS', @@ -85,11 +100,7 @@ export const OptimizeCiemssOperation: Operation = { maxfeval: 25, interventionType: InterventionTypes.paramValue, interventionPolicyGroups: [blankInterventionPolicyGroup], - qoiMethod: ContextMethods.max, - targetVariables: [], - riskTolerance: 5, - threshold: 1, - isMinimized: true, + constraintGroups: [defaultConstraintGroup], chartConfigs: [], inProgressOptimizeId: '', inProgressForecastId: '', diff --git a/packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/tera-optimize-ciemss.vue b/packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/tera-optimize-ciemss.vue index 8fd510e112..6ed5ce5a32 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/tera-optimize-ciemss.vue +++ b/packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/tera-optimize-ciemss.vue @@ -12,6 +12,22 @@