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

#798 Update following DYN-2455 (following Part. 3) #800

Merged
merged 1 commit into from
Dec 3, 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 sources/Outputs/include/Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Network {
*
* @return the new parameter set for network
*/
boost::shared_ptr<parameters::ParametersSet> writeNetworkSet() const;
std::shared_ptr<parameters::ParametersSet> writeNetworkSet() const;

NetworkDefinition def_; ///< Network model parameters file description
};
Expand Down
5 changes: 3 additions & 2 deletions sources/Outputs/include/ParCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <DYNCommon.h>
#include <PARParameter.h>
#include <PARParameterFactory.h>
#include <PARParametersSetFactory.h>
#include <PARParametersSetCollection.h>
#include <PARParametersSetCollectionFactory.h>
#include <PARReference.h>
Expand Down Expand Up @@ -101,8 +102,8 @@ inline boost::shared_ptr<parameters::MacroParameterSet> buildMacroParameterSetVR
*
* @returns the parameter set
*/
inline boost::shared_ptr<parameters::ParametersSet> writeVRRemote(const std::string &busId, const std::string &elementId) {
auto set = boost::shared_ptr<parameters::ParametersSet>(new parameters::ParametersSet("Model_Signal_NQ_" + busId));
inline std::shared_ptr<parameters::ParametersSet> writeVRRemote(const std::string &busId, const std::string &elementId) {
auto set = parameters::ParametersSetFactory::newParametersSet("Model_Signal_NQ_" + busId);
set->addReference(buildReference("vrremote_U0Pu", "targetV_pu", "DOUBLE", elementId));
set->addReference(buildReference("vrremote_URef0Pu", "targetV_pu", "DOUBLE", elementId));
set->addMacroParSet(boost::shared_ptr<parameters::MacroParSet>(new parameters::MacroParSet(getMacroParameterSetId(constants::remoteVControlVRParId))));
Expand Down
4 changes: 2 additions & 2 deletions sources/Outputs/include/ParDynModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ParDynModel {
*
* @returns the parameter set to add
*/
boost::shared_ptr<parameters::ParametersSet>
std::shared_ptr<parameters::ParametersSet>
writeDynamicModelParameterSet(const inputs::SettingDataBase::Set &set, const inputs::DynamicDataBaseManager &dynamicDataBaseManager,
const algo::DynamicModelDefinition &automaton, const algo::ShuntCounterDefinitions &counters,
const algo::DynamicModelDefinitions &models, const algo::LinesByIdDefinitions &linesById,
Expand All @@ -96,7 +96,7 @@ class ParDynModel {
*
* @returns the parameter set to add
*/
boost::shared_ptr<parameters::ParametersSet> writeSVCParameterSet(const inputs::SettingDataBase::Set &set,
std::shared_ptr<parameters::ParametersSet> writeSVCParameterSet(const inputs::SettingDataBase::Set &set,
const inputs::DynamicDataBaseManager &dynamicDataBaseManager,
const algo::DynamicModelDefinition &automaton);

Expand Down
7 changes: 3 additions & 4 deletions sources/Outputs/include/ParEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "SlackNodeAlgorithm.h"

#include <PARParametersSet.h>
#include <boost/shared_ptr.hpp>
#include <functional>
#include <string>
#include <unordered_map>
Expand Down Expand Up @@ -89,7 +88,7 @@ class ParEvent {
*
* @returns the parameter set
*/
static boost::shared_ptr<parameters::ParametersSet> buildBranchDisconnection(const std::string &branchId, const double timeOfEvent);
static std::shared_ptr<parameters::ParametersSet> buildBranchDisconnection(const std::string &branchId, const double timeOfEvent);

/**
* @brief Build element disconnection parameter set for EventSetPointBoolean dynamic model
Expand All @@ -99,7 +98,7 @@ class ParEvent {
*
* @returns the parameter set
*/
static boost::shared_ptr<parameters::ParametersSet> buildEventSetPointBooleanDisconnection(const std::string &elementId, const double timeOfEvent);
static std::shared_ptr<parameters::ParametersSet> buildEventSetPointBooleanDisconnection(const std::string &elementId, const double timeOfEvent);

/**
* @brief Build element disconnection parameter set for EventConnectedStatus dynamic model
Expand All @@ -109,7 +108,7 @@ class ParEvent {
*
* @returns the parameter set
*/
static boost::shared_ptr<parameters::ParametersSet> buildEventConnectedStatusDisconnection(const std::string &elementId, const double timeOfEvent);
static std::shared_ptr<parameters::ParametersSet> buildEventConnectedStatusDisconnection(const std::string &elementId, const double timeOfEvent);

/**
* @brief Determines if contingency element is using a network cpp model
Expand Down
12 changes: 6 additions & 6 deletions sources/Outputs/include/ParGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class ParGenerator {
*
* @returns the parameter set
*/
boost::shared_ptr<parameters::ParametersSet> writeConstantGeneratorsSets(ActivePowerCompensation activePowerCompensation,
std::shared_ptr<parameters::ParametersSet> writeConstantGeneratorsSets(ActivePowerCompensation activePowerCompensation,
const algo::GeneratorDefinition& generator, StartingPointMode startingPointMode);

/**
Expand All @@ -104,7 +104,7 @@ class ParGenerator {
* @param targetP generator targetP value
* @param startingPointMode starting point mode
*/
void updateSignalNGenerator(boost::shared_ptr<parameters::ParametersSet> set, dfl::inputs::Configuration::ActivePowerCompensation activePowerCompensation,
void updateSignalNGenerator(std::shared_ptr<parameters::ParametersSet> set, dfl::inputs::Configuration::ActivePowerCompensation activePowerCompensation,
double targetP, StartingPointMode startingPointMode);

/**
Expand All @@ -113,7 +113,7 @@ class ParGenerator {
* @param set the parameter set to update
* @param isNuclear true if the energy source of the generator is nuclear
*/
void updateTransfoParameters(boost::shared_ptr<parameters::ParametersSet> set, bool isNuclear);
void updateTransfoParameters(std::shared_ptr<parameters::ParametersSet> set, bool isNuclear);

/**
* @brief Update parameter set with Rpcl parameters
Expand All @@ -123,7 +123,7 @@ class ParGenerator {
* @param databaseSetting the settings found in setting file
* @param Rcpl2 true if the model used is RPCL2, false otherwise
*/
void updateRpclParameters(boost::shared_ptr<parameters::ParametersSet> set, const std::string& genId, const inputs::SettingDataBase::Set& databaseSetting,
void updateRpclParameters(std::shared_ptr<parameters::ParametersSet> set, const std::string& genId, const inputs::SettingDataBase::Set& databaseSetting,
bool Rcpl2);

/**
Expand All @@ -135,7 +135,7 @@ class ParGenerator {
*
* @returns the parameter set
*/
boost::shared_ptr<parameters::ParametersSet> writeGenerator(const algo::GeneratorDefinition& def, const std::string& basename,
std::shared_ptr<parameters::ParametersSet> writeGenerator(const algo::GeneratorDefinition& def, const std::string& basename,
const boost::filesystem::path& dirname);

/**
Expand All @@ -155,7 +155,7 @@ class ParGenerator {
* @param def the generator definition to use
* @param set the parameter set to be updated
*/
void updateRemoteRegulationParameters(const algo::GeneratorDefinition& def, boost::shared_ptr<parameters::ParametersSet> set);
void updateRemoteRegulationParameters(const algo::GeneratorDefinition& def, std::shared_ptr<parameters::ParametersSet> set);

private:
const std::vector<algo::GeneratorDefinition>& generatorDefinitions_; ///< list of generators definitions
Expand Down
2 changes: 1 addition & 1 deletion sources/Outputs/include/ParHvdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ParHvdc {
*
* @returns the parameter set
*/
boost::shared_ptr<parameters::ParametersSet> writeHdvcLine(const algo::HVDCDefinition &hvdcLine, const std::string &basename,
std::shared_ptr<parameters::ParametersSet> writeHdvcLine(const algo::HVDCDefinition &hvdcLine, const std::string &basename,
const boost::filesystem::path &dirname,
dfl::inputs::Configuration::StartingPointMode startingPointMode,
const inputs::DynamicDataBaseManager &dynamicDataBaseManager);
Expand Down
2 changes: 1 addition & 1 deletion sources/Outputs/include/ParLoads.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ParLoads {
*
* @return the new parameter set for loads
*/
boost::shared_ptr<parameters::ParametersSet> writeConstantLoadsSet(dfl::inputs::Configuration::StartingPointMode startingPointMode);
std::shared_ptr<parameters::ParametersSet> writeConstantLoadsSet(dfl::inputs::Configuration::StartingPointMode startingPointMode);

private:
std::vector<algo::LoadDefinition> loadsDefinitions_; ///< list of loads definitions
Expand Down
2 changes: 1 addition & 1 deletion sources/Outputs/include/ParSVarC.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ParSVarC {
* @param svarc the static var compensator to use
* @returns the parameter set to add to the exported file
*/
boost::shared_ptr<parameters::ParametersSet> writeStaticVarCompensator(const algo::StaticVarCompensatorDefinition& svarc);
std::shared_ptr<parameters::ParametersSet> writeStaticVarCompensator(const algo::StaticVarCompensatorDefinition& svarc);

/**
* @brief Computes the susceptance value in PU unit
Expand Down
3 changes: 1 addition & 2 deletions sources/Outputs/include/Solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "Configuration.h"

#include <PARParametersSet.h>
#include <boost/shared_ptr.hpp>
#include <string>

namespace dfl {
Expand Down Expand Up @@ -63,7 +62,7 @@ class Solver {
*
* @return reference to the new created parameter set
*/
boost::shared_ptr<parameters::ParametersSet> writeSolverSet() const;
std::shared_ptr<parameters::ParametersSet> writeSolverSet() const;

SolverDefinition def_; ///< solver par definition
};
Expand Down
4 changes: 2 additions & 2 deletions sources/Outputs/src/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ Network::write() const {
exporter.exportToFile(paramSetCollection, networkFileName.generic_string(), constants::xmlEncoding);
}

boost::shared_ptr<parameters::ParametersSet>
std::shared_ptr<parameters::ParametersSet>
Network::writeNetworkSet() const {
// Network
auto set = boost::shared_ptr<parameters::ParametersSet>(new parameters::ParametersSet(constants::networkParId));
auto set = parameters::ParametersSetFactory::newParametersSet(constants::networkParId);

set->addParameter(helper::buildParameter("capacitor_no_reclosing_delay", 300.));
set->addParameter(helper::buildParameter("dangling_line_currentLimit_maxTimeOperation", 90.));
Expand Down
10 changes: 5 additions & 5 deletions sources/Outputs/src/ParDynModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void ParDynModel::write(boost::shared_ptr<parameters::ParametersSetCollection> &
const inputs::DynamicDataBaseManager &dynamicDataBaseManager, const algo::ShuntCounterDefinitions &shuntCounters,
const algo::LinesByIdDefinitions &linesByIdDefinitions, const algo::TransformersByIdDefinitions &transformersById) {
for (const auto &dynModel : dynamicModelsDefinitions_.models) {
boost::shared_ptr<parameters::ParametersSet> new_set;
std::shared_ptr<parameters::ParametersSet> new_set;

if (dynModel.second.lib == common::constants::svcModelName) {
new_set = writeSVCParameterSet(dynamicDataBaseManager.setting().getSet(dynModel.first), dynamicDataBaseManager, dynModel.second);
Expand All @@ -55,10 +55,10 @@ boost::optional<std::string> ParDynModel::getTransformerComponentId(const algo::
return boost::none;
}

boost::shared_ptr<parameters::ParametersSet> ParDynModel::writeSVCParameterSet(const inputs::SettingDataBase::Set &set,
std::shared_ptr<parameters::ParametersSet> ParDynModel::writeSVCParameterSet(const inputs::SettingDataBase::Set &set,
const inputs::DynamicDataBaseManager &dynamicDataBaseManager,
const algo::DynamicModelDefinition &automaton) {
auto new_set = boost::shared_ptr<parameters::ParametersSet>(new parameters::ParametersSet(set.id));
auto new_set = parameters::ParametersSetFactory::newParametersSet(set.id);

std::unordered_map<std::string, unsigned> regulatorIdToInitialIndex;
auto itAutomaton = dynamicDataBaseManager.assembling().dynamicAutomatons().find(automaton.id);
Expand Down Expand Up @@ -170,7 +170,7 @@ boost::shared_ptr<parameters::ParametersSet> ParDynModel::writeSVCParameterSet(c
return new_set;
}

boost::shared_ptr<parameters::ParametersSet>
std::shared_ptr<parameters::ParametersSet>
ParDynModel::writeDynamicModelParameterSet(const inputs::SettingDataBase::Set &set, const inputs::DynamicDataBaseManager &dynamicDataBaseManager,
const algo::DynamicModelDefinition &automaton, const algo::ShuntCounterDefinitions &counters,
const algo::DynamicModelDefinitions &models, const algo::LinesByIdDefinitions &linesById,
Expand All @@ -180,7 +180,7 @@ ParDynModel::writeDynamicModelParameterSet(const inputs::SettingDataBase::Set &s
return nullptr;
}

auto new_set = boost::shared_ptr<parameters::ParametersSet>(new parameters::ParametersSet(set.id));
auto new_set = parameters::ParametersSetFactory::newParametersSet(set.id);
for (const auto &count : set.counts) {
const auto &multipleAssociation = dynamicDataBaseManager.assembling().getMultipleAssociation(count.id);
if (multipleAssociation.shunt) {
Expand Down
12 changes: 6 additions & 6 deletions sources/Outputs/src/ParEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,23 @@ void ParEvent::write() {
exporter.exportToFile(parametersSets, def_.filename, constants::xmlEncoding);
}

boost::shared_ptr<parameters::ParametersSet> ParEvent::buildBranchDisconnection(const std::string &branchId, const double timeOfEvent) {
auto set = boost::shared_ptr<parameters::ParametersSet>(new parameters::ParametersSet("Disconnect_" + branchId));
std::shared_ptr<parameters::ParametersSet> ParEvent::buildBranchDisconnection(const std::string &branchId, const double timeOfEvent) {
auto set = parameters::ParametersSetFactory::newParametersSet("Disconnect_" + branchId);
set->addParameter(helper::buildParameter("event_tEvent", timeOfEvent));
set->addParameter(helper::buildParameter("event_disconnectOrigin", true));
set->addParameter(helper::buildParameter("event_disconnectExtremity", true));
return set;
}

boost::shared_ptr<parameters::ParametersSet> ParEvent::buildEventSetPointBooleanDisconnection(const std::string &elementId, const double timeOfEvent) {
auto set = boost::shared_ptr<parameters::ParametersSet>(new parameters::ParametersSet("Disconnect_" + elementId));
std::shared_ptr<parameters::ParametersSet> ParEvent::buildEventSetPointBooleanDisconnection(const std::string &elementId, const double timeOfEvent) {
auto set = parameters::ParametersSetFactory::newParametersSet("Disconnect_" + elementId);
set->addParameter(helper::buildParameter("event_tEvent", timeOfEvent));
set->addParameter(helper::buildParameter("event_stateEvent1", true));
return set;
}

boost::shared_ptr<parameters::ParametersSet> ParEvent::buildEventConnectedStatusDisconnection(const std::string &elementId, const double timeOfEvent) {
auto set = boost::shared_ptr<parameters::ParametersSet>(new parameters::ParametersSet("Disconnect_" + elementId));
std::shared_ptr<parameters::ParametersSet> ParEvent::buildEventConnectedStatusDisconnection(const std::string &elementId, const double timeOfEvent) {
auto set = parameters::ParametersSetFactory::newParametersSet("Disconnect_" + elementId);
set->addParameter(helper::buildParameter("event_tEvent", timeOfEvent));
set->addParameter(helper::buildParameter("event_open", true));
return set;
Expand Down
18 changes: 9 additions & 9 deletions sources/Outputs/src/ParGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void ParGenerator::write(boost::shared_ptr<parameters::ParametersSetCollection>
if (generator.isNetwork()) {
continue;
}
boost::shared_ptr<parameters::ParametersSet> paramSet;
std::shared_ptr<parameters::ParametersSet> paramSet;
if (helper::generatorSharesParId(generator)) {
if (!paramSetCollection->hasParametersSet(helper::getGeneratorParameterSetId(generator))) {
paramSet = writeConstantGeneratorsSets(activePowerCompensation, generator, startingPointMode);
Expand Down Expand Up @@ -187,7 +187,7 @@ boost::shared_ptr<parameters::MacroParameterSet> ParGenerator::buildGeneratorMac
return macroParameterSet;
}

void ParGenerator::updateSignalNGenerator(boost::shared_ptr<parameters::ParametersSet> set, ActivePowerCompensation activePowerCompensation, double targetP,
void ParGenerator::updateSignalNGenerator(std::shared_ptr<parameters::ParametersSet> set, ActivePowerCompensation activePowerCompensation, double targetP,
StartingPointMode startingPointMode) {
set->addParameter(helper::buildParameter("generator_KGover", getKGoverValue(targetP)));
set->addParameter(helper::buildParameter("generator_QMin", -constants::powerValueMax));
Expand Down Expand Up @@ -230,10 +230,10 @@ void ParGenerator::updateSignalNGenerator(boost::shared_ptr<parameters::Paramete
}
}

boost::shared_ptr<parameters::ParametersSet> ParGenerator::writeConstantGeneratorsSets(ActivePowerCompensation activePowerCompensation,
std::shared_ptr<parameters::ParametersSet> ParGenerator::writeConstantGeneratorsSets(ActivePowerCompensation activePowerCompensation,
const algo::GeneratorDefinition &generator,
StartingPointMode startingPointMode) {
auto set = boost::shared_ptr<parameters::ParametersSet>(new parameters::ParametersSet(helper::getGeneratorParameterSetId(generator)));
auto set = parameters::ParametersSetFactory::newParametersSet(helper::getGeneratorParameterSetId(generator));
updateSignalNGenerator(set, activePowerCompensation, generator.targetP, startingPointMode);
switch (generator.model) {
case ModelType::PROP_SIGNALN_INFINITE:
Expand All @@ -248,16 +248,16 @@ boost::shared_ptr<parameters::ParametersSet> ParGenerator::writeConstantGenerato
return set;
}

void ParGenerator::updateRemoteRegulationParameters(const algo::GeneratorDefinition &def, boost::shared_ptr<parameters::ParametersSet> set) {
void ParGenerator::updateRemoteRegulationParameters(const algo::GeneratorDefinition &def, std::shared_ptr<parameters::ParametersSet> set) {
set->addReference(helper::buildReference("generator_URegulated0", "U", "DOUBLE", def.regulatedBusId));
}

boost::shared_ptr<parameters::ParametersSet> ParGenerator::writeGenerator(const algo::GeneratorDefinition &def, const std::string &basename,
std::shared_ptr<parameters::ParametersSet> ParGenerator::writeGenerator(const algo::GeneratorDefinition &def, const std::string &basename,
const boost::filesystem::path &dirname) {
std::string uuid = constants::uuid(def.id);

// Use the hash id in exported files to prevent use of non-ascii characters
auto set = boost::shared_ptr<parameters::ParametersSet>(new parameters::ParametersSet(uuid));
auto set = parameters::ParametersSetFactory::newParametersSet(uuid);
// The macroParSet is associated to a macroParameterSet via the id
set->addMacroParSet(
boost::shared_ptr<parameters::MacroParSet>(new parameters::MacroParSet(getGeneratorMacroParameterSetId(def.model, DYN::doubleIsZero(def.targetP)))));
Expand All @@ -274,7 +274,7 @@ boost::shared_ptr<parameters::ParametersSet> ParGenerator::writeGenerator(const
return set;
}

void ParGenerator::updateTransfoParameters(boost::shared_ptr<parameters::ParametersSet> set, bool isNuclear) {
void ParGenerator::updateTransfoParameters(std::shared_ptr<parameters::ParametersSet> set, bool isNuclear) {
if (!set->hasParameter("generator_QNomAlt") && !set->hasReference("generator_QNomAlt"))
set->addReference(helper::buildReference("generator_QNomAlt", "qNom", "DOUBLE"));
if (!set->hasParameter("generator_SNom") && !set->hasReference("generator_SNom"))
Expand All @@ -286,7 +286,7 @@ void ParGenerator::updateTransfoParameters(boost::shared_ptr<parameters::Paramet
}
}

void ParGenerator::updateRpclParameters(boost::shared_ptr<parameters::ParametersSet> set, const std::string &genId,
void ParGenerator::updateRpclParameters(std::shared_ptr<parameters::ParametersSet> set, const std::string &genId,
const inputs::SettingDataBase::Set &databaseSetting, bool Rcpl2) {
std::vector<std::string> parameters = {"reactivePowerControlLoop_QrPu"};
if (Rcpl2) {
Expand Down
Loading
Loading