Skip to content

Commit

Permalink
Rename to OutputType.FSV to FINAL_STATE
Browse files Browse the repository at this point in the history
Signed-off-by: lisrte <[email protected]>
  • Loading branch information
Lisrte committed Sep 26, 2024
1 parent 4237477 commit 4c6ec60
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ class DynawoOutputVariableGroovyExtension implements OutputVariableGroovyExtensi
variablesBuilder.add(consumer)
}
binding.curve = c -> closure(c, OutputVariable.OutputType.CURVE)
binding.fsv = c -> closure(c, OutputVariable.OutputType.FSV)
binding.fsv = c -> closure(c, OutputVariable.OutputType.FINAL_STATE)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private void validateOutputVariable(OutputVariable outputVariable) {
assertEquals(OutputVariable.OutputType.CURVE, outputVariable.getOutputType());
assertTrue(Arrays.asList("NGEN_Upu_value", "NHV1_Upu_value", "NHV2_Upu_value", "NLOAD_Upu_value").contains(outputVariable.getVariableName()));
} else if (network.getIdentifiable(outputVariable.getModelId()) instanceof Generator) {
assertEquals(OutputVariable.OutputType.FSV, outputVariable.getOutputType());
assertEquals(OutputVariable.OutputType.FINAL_STATE, outputVariable.getOutputType());
assertTrue(Arrays.asList("generator_omegaPu", "generator_PGen", "generator_UStatorPU", "voltageRegulator_UcEfdP", "voltageRegulator_EfdPu").contains(outputVariable.getVariableName()));
} else if (network.getIdentifiable(outputVariable.getModelId()) instanceof Load) {
assertEquals(OutputVariable.OutputType.CURVE, outputVariable.getOutputType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public boolean withCurveVariables() {
}

public boolean withFsvVariables() {
return outputVariables.containsKey(OutputVariable.OutputType.FSV);
return outputVariables.containsKey(OutputVariable.OutputType.FINAL_STATE);
}

public List<ParametersSet> getDynamicModelsParameters() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public List<OutputVariable> deserialize(JsonParser parser, DeserializationContex
JsonUtil.parseObjectArray(parser, modelConfigList::add, p -> parseOutputVariablesBuilder(p, OutputVariable.OutputType.CURVE));
return true;
} else if (name.equals("fsv")) {
JsonUtil.parseObjectArray(parser, modelConfigList::add, p -> parseOutputVariablesBuilder(p, OutputVariable.OutputType.FSV));
JsonUtil.parseObjectArray(parser, modelConfigList::add, p -> parseOutputVariablesBuilder(p, OutputVariable.OutputType.FINAL_STATE));
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static void writeCurve(Path workingDir, DynawoSimulationContext context)
}

public static void writeFsv(Path workingDir, DynawoSimulationContext context) throws IOException {
new OutputVariablesXml(FSV_FILENAME, "finalStateValuesInput", "finalStateValue", OutputVariable.OutputType.FSV)
new OutputVariablesXml(FSV_FILENAME, "finalStateValuesInput", "finalStateValue", OutputVariable.OutputType.FINAL_STATE)
.createXmlFileFromContext(workingDir, context);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ private static List<OutputVariable> getExpectedOutputVariables() {
new DynawoOutputVariablesBuilder().staticId("BUS").variables("Upu_value").add(variables::add);
new DynawoOutputVariablesBuilder().dynamicModelId("BBM_GEN2").variables("generator_omegaPu", "generator_PGen", "generator_UStatorPU").add(variables::add);
new DynawoOutputVariablesBuilder().staticId("LOAD").variables("load_PPu", "load_QPu").outputType(OutputVariable.OutputType.CURVE).add(variables::add);
new DynawoOutputVariablesBuilder().dynamicModelId("BBM_GEN").variables("generator_PGen").outputType(OutputVariable.OutputType.FSV).add(variables::add);
new DynawoOutputVariablesBuilder().staticId("LOAD").variables("load_QPu").outputType(OutputVariable.OutputType.FSV).add(variables::add);
new DynawoOutputVariablesBuilder().dynamicModelId("BBM_GEN").variables("generator_PGen").outputType(OutputVariable.OutputType.FINAL_STATE).add(variables::add);
new DynawoOutputVariablesBuilder().staticId("LOAD").variables("load_QPu").outputType(OutputVariable.OutputType.FINAL_STATE).add(variables::add);
return variables;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void setup() {
network.getLoadStream().forEach(b -> new DynawoOutputVariablesBuilder()
.staticId(b.getId())
.variables("load_PPu", "load_QPu")
.outputType(OutputVariable.OutputType.FSV)
.outputType(OutputVariable.OutputType.FINAL_STATE)
.add(outputVariables::add));

network.getBusBreakerView().getBusStream().forEach(b -> new DynawoOutputVariablesBuilder()
Expand Down

0 comments on commit 4c6ec60

Please sign in to comment.