From b0793fab3d1cc133b74f5eaeecb404aa81a5bf14 Mon Sep 17 00:00:00 2001 From: Tom Szendrey Date: Mon, 9 Sep 2024 15:28:55 -0400 Subject: [PATCH 01/10] Using optional as Kevin suggests --- packages/client/hmi-client/src/types/Types.ts | 6 ++++-- .../simulationservice/CiemssStatusUpdate.java | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/client/hmi-client/src/types/Types.ts b/packages/client/hmi-client/src/types/Types.ts index b76588d5be..8785dc35a4 100644 --- a/packages/client/hmi-client/src/types/Types.ts +++ b/packages/client/hmi-client/src/types/Types.ts @@ -554,9 +554,11 @@ export interface CalibrationRequestCiemss { } export interface CiemssStatusUpdate { - loss: number; - progress: number; jobId: string; + progress: number; + loss?: number; + currentResults?: number[]; + totalPossibleIterations?: number; } export interface EnsembleCalibrationCiemssRequest { diff --git a/packages/server/src/main/java/software/uncharted/terarium/hmiserver/models/simulationservice/CiemssStatusUpdate.java b/packages/server/src/main/java/software/uncharted/terarium/hmiserver/models/simulationservice/CiemssStatusUpdate.java index 988f75aeda..fd35fa6545 100644 --- a/packages/server/src/main/java/software/uncharted/terarium/hmiserver/models/simulationservice/CiemssStatusUpdate.java +++ b/packages/server/src/main/java/software/uncharted/terarium/hmiserver/models/simulationservice/CiemssStatusUpdate.java @@ -4,19 +4,30 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.List; import lombok.Data; import software.uncharted.terarium.hmiserver.annotations.TSModel; +import software.uncharted.terarium.hmiserver.annotations.TSOptional; @Data @TSModel public class CiemssStatusUpdate { - private Number loss; + @JsonAlias("job_id") + private String jobId; private Number progress; - @JsonAlias("job_id") - private String jobId; + @TSOptional + private Number loss; + + @TSOptional + @JsonAlias("current_results") + private List currentResults; + + @TSOptional + @JsonAlias("total_possible_iterations") + private Number totalPossibleIterations; @JsonIgnore public JsonNode getDataToPersist() { From 61b9a63e3b44d1a6c52c569b85f2a581547529cb Mon Sep 17 00:00:00 2001 From: Tom Szendrey Date: Tue, 10 Sep 2024 09:40:58 -0400 Subject: [PATCH 02/10] adding % to node. --- .../optimize-ciemss-operation.ts | 5 +++- .../tera-optimize-ciemss-node.vue | 26 ++++++++++++++++--- 2 files changed, 27 insertions(+), 4 deletions(-) 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 09192f8243..4917dbb963 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 @@ -72,6 +72,8 @@ export interface OptimizeCiemssOperationState extends BaseState { optimizedInterventionPolicyId: string; optimizeErrorMessage: { name: string; value: string; traceback: string }; simulateErrorMessage: { name: string; value: string; traceback: string }; + // Intermediate: + currentProgress: number; } // This is used as a map between dropdown labels and the inner values used by pyciemss-service. @@ -150,7 +152,8 @@ export const OptimizeCiemssOperation: Operation = { optimizationRunId: '', optimizedInterventionPolicyId: '', optimizeErrorMessage: { name: '', value: '', traceback: '' }, - simulateErrorMessage: { name: '', value: '', traceback: '' } + simulateErrorMessage: { name: '', value: '', traceback: '' }, + currentProgress: 0 }; return init; } diff --git a/packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/tera-optimize-ciemss-node.vue b/packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/tera-optimize-ciemss-node.vue index 592ceca61d..158da7dbb0 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/tera-optimize-ciemss-node.vue +++ b/packages/client/hmi-client/src/components/workflow/ops/optimize-ciemss/tera-optimize-ciemss-node.vue @@ -4,7 +4,11 @@