Skip to content

Commit

Permalink
#428 Addition of unit test on outputIIDM
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitri Baron <[email protected]>
  • Loading branch information
barondim committed Nov 18, 2024
1 parent 1984bc8 commit 84df13a
Show file tree
Hide file tree
Showing 6 changed files with 680 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sources/Launcher/DYNRobustnessAnalysisLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ RobustnessAnalysisLauncher::storeOutputs(const SimulationResult& result, std::ma

if (!result.getOutputIIDMStreamStr().empty()) {
std::stringstream outputIIDMName;
outputIIDMName << "outputIIDM/outputIIDM_" << result.getUniqueScenarioId() << ".xml";
outputIIDMName << "finalState/outputIIDM_" << result.getUniqueScenarioId() << ".xml";
mapData[outputIIDMName.str()] = result.getOutputIIDMStreamStr();
}

Expand Down
3 changes: 3 additions & 0 deletions sources/Launcher/test/TestRobustnessAnalysisLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,19 @@ class MyLauncher : public RobustnessAnalysisLauncher {
ASSERT_FALSE(exists("res/constraints/constraints_MyScenario.xml"));
ASSERT_FALSE(exists("res/timeLine/timeline_MyScenario.log"));
ASSERT_FALSE(exists("res/timeLine/timeline_MyScenario.xml"));
ASSERT_FALSE(exists("res/finalState/outputIIDM_MyScenario.xml"));
ASSERT_TRUE(exists("res/logs/log_MyScenario.log"));

result_.getConstraintsStream() << "Test Constraints";
result_.getTimelineStream() << "Test Timeline";
result_.getOutputIIDMStream() << "Test final state";

writeResults();
ASSERT_TRUE(exists("res/MyOutputFile.zip"));
ASSERT_TRUE(exists("res/constraints/constraints_MyScenario.xml"));
ASSERT_TRUE(exists("res/timeLine/timeline_MyScenario.log"));
ASSERT_FALSE(exists("res/timeLine/timeline_MyScenario.xml"));
ASSERT_TRUE(exists("res/finalState/outputIIDM_MyScenario.xml"));
ASSERT_TRUE(exists("res/logs/log_MyScenario.log"));
}

Expand Down
119 changes: 119 additions & 0 deletions sources/Launcher/test/res/fic_DYD.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2024, RTE (http://www.rte-france.com)
See AUTHORS.txt
All rights reserved.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, you can obtain one at http://mozilla.org/MPL/2.0/.
SPDX-License-Identifier: MPL-2.0
This file is part of Dynawo, an hybrid C++/Modelica open source time domain
simulation tool for power systems.
-->
<dyn:dynamicModelsArchitecture xmlns:dyn="http://www.rte-france.com/dynawo">
<dyn:blackBoxModel id="_LOAD___2_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD___2_EC">
<dyn:staticRef var="load_PPu" staticVar="p"/>
<dyn:staticRef var="load_QPu" staticVar="q"/>
<dyn:staticRef var="load_state" staticVar="state"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___3_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD___3_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___4_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD___4_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___5_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD___5_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___6_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD___6_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD___9_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD___9_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD__10_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD__10_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD__11_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD__11_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD__12_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD__12_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD__13_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD__13_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="_LOAD__14_EC" lib="LoadAlphaBeta" parFile="fic_PAR.xml" parId="1" staticId="_LOAD__14_EC">
<dyn:macroStaticRef id="LOAD"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="GEN____1_SM" lib="GeneratorSynchronousFourWindingsProportionalRegulations" parFile="fic_PAR.xml" parId="2" staticId="_GEN____1_SM">
<dyn:staticRef var="generator_PGenPu" staticVar="p"/>
<dyn:staticRef var="generator_QGenPu" staticVar="q"/>
<dyn:staticRef var="generator_state" staticVar="state"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="GEN____2_SM" lib="GeneratorSynchronousFourWindingsProportionalRegulations" parFile="fic_PAR.xml" parId="3" staticId="_GEN____2_SM">
<dyn:macroStaticRef id="GEN"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="GEN____3_SM" lib="GeneratorSynchronousFourWindingsProportionalRegulations" parFile="fic_PAR.xml" parId="4" staticId="_GEN____3_SM">
<dyn:macroStaticRef id="GEN"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="GEN____6_SM" lib="GeneratorSynchronousThreeWindingsProportionalRegulations" parFile="fic_PAR.xml" parId="5" staticId="_GEN____6_SM">
<dyn:macroStaticRef id="GEN"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="GEN____8_SM" lib="GeneratorSynchronousThreeWindingsProportionalRegulations" parFile="fic_PAR.xml" parId="6" staticId="_GEN____8_SM">
<dyn:macroStaticRef id="GEN"/>
</dyn:blackBoxModel>
<dyn:blackBoxModel id="OMEGA_REF" lib="DYNModelOmegaRef" parFile="fic_PAR.xml" parId="7"/>
<dyn:connect id1="OMEGA_REF" var1="omega_grp_0" id2="GEN____1_SM" var2="generator_omegaPu"/>
<dyn:connect id1="OMEGA_REF" var1="omegaRef_grp_0" id2="GEN____1_SM" var2="generator_omegaRefPu"/>
<dyn:connect id1="OMEGA_REF" var1="numcc_node_0" id2="NETWORK" var2="@_GEN____1_SM@@NODE@_numcc"/>
<dyn:connect id1="OMEGA_REF" var1="running_grp_0" id2="GEN____1_SM" var2="generator_running"/>
<dyn:connect id1="OMEGA_REF" var1="omega_grp_1" id2="GEN____2_SM" var2="generator_omegaPu"/>
<dyn:connect id1="OMEGA_REF" var1="omegaRef_grp_1" id2="GEN____2_SM" var2="generator_omegaRefPu"/>
<dyn:connect id1="OMEGA_REF" var1="numcc_node_1" id2="NETWORK" var2="@_GEN____2_SM@@NODE@_numcc"/>
<dyn:connect id1="OMEGA_REF" var1="running_grp_1" id2="GEN____2_SM" var2="generator_running"/>
<dyn:connect id1="OMEGA_REF" var1="omega_grp_2" id2="GEN____3_SM" var2="generator_omegaPu"/>
<dyn:connect id1="OMEGA_REF" var1="omegaRef_grp_2" id2="GEN____3_SM" var2="generator_omegaRefPu"/>
<dyn:connect id1="OMEGA_REF" var1="numcc_node_2" id2="NETWORK" var2="@_GEN____3_SM@@NODE@_numcc"/>
<dyn:connect id1="OMEGA_REF" var1="running_grp_2" id2="GEN____3_SM" var2="generator_running"/>
<dyn:connect id1="OMEGA_REF" var1="omega_grp_3" id2="GEN____6_SM" var2="generator_omegaPu"/>
<dyn:connect id1="OMEGA_REF" var1="omegaRef_grp_3" id2="GEN____6_SM" var2="generator_omegaRefPu"/>
<dyn:connect id1="OMEGA_REF" var1="numcc_node_3" id2="NETWORK" var2="@_GEN____6_SM@@NODE@_numcc"/>
<dyn:connect id1="OMEGA_REF" var1="running_grp_3" id2="GEN____6_SM" var2="generator_running"/>
<dyn:connect id1="OMEGA_REF" var1="omega_grp_4" id2="GEN____8_SM" var2="generator_omegaPu"/>
<dyn:connect id1="OMEGA_REF" var1="omegaRef_grp_4" id2="GEN____8_SM" var2="generator_omegaRefPu"/>
<dyn:connect id1="OMEGA_REF" var1="numcc_node_4" id2="NETWORK" var2="@_GEN____8_SM@@NODE@_numcc"/>
<dyn:connect id1="OMEGA_REF" var1="running_grp_4" id2="GEN____8_SM" var2="generator_running"/>
<dyn:connect id1="_LOAD__10_EC" var1="load_terminal" id2="NETWORK" var2="_BUS___10_TN_ACPIN"/>
<dyn:connect id1="_LOAD__11_EC" var1="load_terminal" id2="NETWORK" var2="_BUS___11_TN_ACPIN"/>
<dyn:connect id1="_LOAD__12_EC" var1="load_terminal" id2="NETWORK" var2="_BUS___12_TN_ACPIN"/>
<dyn:connect id1="_LOAD__13_EC" var1="load_terminal" id2="NETWORK" var2="_BUS___13_TN_ACPIN"/>
<dyn:connect id1="_LOAD__14_EC" var1="load_terminal" id2="NETWORK" var2="_BUS___14_TN_ACPIN"/>
<dyn:connect id1="_LOAD___2_EC" var1="load_terminal" id2="NETWORK" var2="_BUS____2_TN_ACPIN"/>
<dyn:connect id1="_LOAD___3_EC" var1="load_terminal" id2="NETWORK" var2="_BUS____3_TN_ACPIN"/>
<dyn:connect id1="_LOAD___4_EC" var1="load_terminal" id2="NETWORK" var2="_BUS____4_TN_ACPIN"/>
<dyn:connect id1="_LOAD___5_EC" var1="load_terminal" id2="NETWORK" var2="_BUS____5_TN_ACPIN"/>
<dyn:connect id1="_LOAD___6_EC" var1="load_terminal" id2="NETWORK" var2="_BUS____6_TN_ACPIN"/>
<dyn:connect id1="_LOAD___9_EC" var1="load_terminal" id2="NETWORK" var2="_BUS____9_TN_ACPIN"/>
<dyn:connect id1="GEN____1_SM" var1="generator_terminal" id2="NETWORK" var2="@_GEN____1_SM@@NODE@_ACPIN"/>
<dyn:connect id1="GEN____1_SM" var1="generator_switchOffSignal1" id2="NETWORK" var2="@_GEN____1_SM@@NODE@_switchOff"/>
<dyn:connect id1="GEN____2_SM" var1="generator_terminal" id2="NETWORK" var2="@_GEN____2_SM@@NODE@_ACPIN"/>
<dyn:connect id1="GEN____2_SM" var1="generator_switchOffSignal1" id2="NETWORK" var2="@_GEN____2_SM@@NODE@_switchOff"/>
<dyn:connect id1="GEN____3_SM" var1="generator_terminal" id2="NETWORK" var2="@_GEN____3_SM@@NODE@_ACPIN"/>
<dyn:connect id1="GEN____3_SM" var1="generator_switchOffSignal1" id2="NETWORK" var2="@_GEN____3_SM@@NODE@_switchOff"/>
<dyn:connect id1="GEN____6_SM" var1="generator_terminal" id2="NETWORK" var2="@_GEN____6_SM@@NODE@_ACPIN"/>
<dyn:connect id1="GEN____6_SM" var1="generator_switchOffSignal1" id2="NETWORK" var2="@_GEN____6_SM@@NODE@_switchOff"/>
<dyn:connect id1="GEN____8_SM" var1="generator_terminal" id2="NETWORK" var2="@_GEN____8_SM@@NODE@_ACPIN"/>
<dyn:connect id1="GEN____8_SM" var1="generator_switchOffSignal1" id2="NETWORK" var2="@_GEN____8_SM@@NODE@_switchOff"/>
<dyn:macroStaticReference id="GEN">
<dyn:staticRef var="generator_PGenPu" staticVar="p"/>
<dyn:staticRef var="generator_QGenPu" staticVar="q"/>
<dyn:staticRef var="generator_state" staticVar="state"/>
</dyn:macroStaticReference>
<dyn:macroStaticReference id="LOAD">
<dyn:staticRef var="load_PPu" staticVar="p"/>
<dyn:staticRef var="load_QPu" staticVar="q"/>
<dyn:staticRef var="load_state" staticVar="state"/>
</dyn:macroStaticReference>
</dyn:dynamicModelsArchitecture>
Loading

0 comments on commit 84df13a

Please sign in to comment.