Skip to content

Commit

Permalink
#428 dump final states (IIDM file and dmp file)
Browse files Browse the repository at this point in the history
Signed-off-by: Dimitri Baron <[email protected]>
  • Loading branch information
barondim committed Nov 6, 2024
1 parent 7cf7f48 commit 2741cf3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sources/Launcher/DYNRobustnessAnalysisLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,21 @@ RobustnessAnalysisLauncher::simulate(const boost::shared_ptr<DYN::Simulation>& s
simulation->printTimeline(result.getTimelineStream());
simulation->printConstraints(result.getConstraintsStream());
simulation->printLostEquipments(result.getLostEquipementsStream());

const std::string outputIIDMpath = createAbsolutePath("outputIIDM", workingDirectory_);
if (!is_directory(outputIIDMpath)) {
create_directory(outputIIDMpath);
}
boost::filesystem::path outputIIDM(createAbsolutePath("outputIIDM_" + result.getUniqueScenarioId() + ".xml", outputIIDMpath));
simulation->dumpIIDMFile(outputIIDM);

const std::string finalStateDumpPath = createAbsolutePath("outputState", workingDirectory_);
if (!is_directory(finalStateDumpPath)) {
create_directory(finalStateDumpPath);
}
boost::filesystem::path finalStateDump(createAbsolutePath("outputState_" + result.getUniqueScenarioId() + ".dmp", finalStateDumpPath));
simulation->dumpState(finalStateDump);

return result.getStatus();
}

Expand Down

0 comments on commit 2741cf3

Please sign in to comment.