Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update model-config for housing calibration result #4308

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading