Skip to content

Commit

Permalink
update model-config for housing calibration result (#4308)
Browse files Browse the repository at this point in the history
Co-authored-by: Derek Vince <dvince@uncharted.software>
  • Loading branch information
mwdchang and dvince2 authored Jul 30, 2024
1 parent 86abfc4 commit 0b14471
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/client/hmi-client/src/types/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -43,6 +40,26 @@ public class ModelConfiguration extends TerariumAsset {
@JsonManagedReference
private List<InitialSemantic> 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: <number>
* stddev: <number>
* }
* }
*
**/
@TSOptional
@OneToMany(mappedBy = "modelConfiguration", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JsonManagedReference
private List<ParameterSemantic> inferredParameterList = new ArrayList<>();

@Override
public ModelConfiguration clone() {
final ModelConfiguration clone = new ModelConfiguration();
Expand All @@ -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) {
Expand Down

0 comments on commit 0b14471

Please sign in to comment.