diff --git a/packages/client/hmi-client/src/types/Types.ts b/packages/client/hmi-client/src/types/Types.ts index 39ac34181f..594fd5bf17 100644 --- a/packages/client/hmi-client/src/types/Types.ts +++ b/packages/client/hmi-client/src/types/Types.ts @@ -224,12 +224,12 @@ export interface InitialSemantic extends Semantic { } export interface ModelConfiguration extends TerariumAsset { - calibrationRunId?: string; modelId: string; simulationId?: string; observableSemanticList: ObservableSemantic[]; parameterSemanticList: ParameterSemantic[]; initialSemanticList: InitialSemantic[]; + inferredParameterList?: ParameterSemantic[]; } export interface ObservableSemantic extends Semantic { diff --git a/packages/server/src/main/java/software/uncharted/terarium/hmiserver/models/dataservice/model/configurations/ModelConfiguration.java b/packages/server/src/main/java/software/uncharted/terarium/hmiserver/models/dataservice/model/configurations/ModelConfiguration.java index b2e4abef38..c943669e90 100644 --- a/packages/server/src/main/java/software/uncharted/terarium/hmiserver/models/dataservice/model/configurations/ModelConfiguration.java +++ b/packages/server/src/main/java/software/uncharted/terarium/hmiserver/models/dataservice/model/configurations/ModelConfiguration.java @@ -22,9 +22,6 @@ @Entity public class ModelConfiguration extends TerariumAsset { - @TSOptional - private UUID calibrationRunId; - private UUID modelId; /** This is "simulation" in the sense of our POJO. It actually corresponds to a pyciemss calibration */ @@ -43,6 +40,26 @@ public class ModelConfiguration extends TerariumAsset { @JsonManagedReference private List initialSemanticList = new ArrayList<>(); + /** + * This field is only populated if simulationId is not null, it is meant as a sampling of the + * configured space, but not necessarily the true distributions. It will set once and should + * be readonly afterward. + * + * We will designated a dummy distribution type + * { + * type: 'inferred', + * parameters: { + * mean: + * stddev: + * } + * } + * + **/ + @TSOptional + @OneToMany(mappedBy = "modelConfiguration", fetch = FetchType.EAGER, cascade = CascadeType.ALL) + @JsonManagedReference + private List inferredParameterList = new ArrayList<>(); + @Override public ModelConfiguration clone() { final ModelConfiguration clone = new ModelConfiguration(); @@ -64,6 +81,13 @@ public ModelConfiguration clone() { } } + if (this.inferredParameterList != null) { + clone.setInferredParameterList(new ArrayList<>()); + for (final ParameterSemantic semantic : inferredParameterList) { + clone.getInferredParameterList().add(semantic.clone()); + } + } + if (this.initialSemanticList != null) { clone.setInitialSemanticList(new ArrayList<>()); for (final InitialSemantic semantic : initialSemanticList) {