Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
StudyUpdater Class Reference

Class that updates an antares study after an antares-xpansion execution. More...

#include <StudyUpdater.h>

Public Member Functions

 StudyUpdater (std::filesystem::path studyPath_p, const AntaresVersionProvider &antares_version_provider, ProblemGenerationLog::ProblemGenerationLoggerSharedPointer logger)
 constructor of class StudyUpdater
 
virtual ~StudyUpdater ()=default
 default destructor of calass StudyUpdater
 
int updateLinkdataFile (const ActiveLink &link_p, const std::map< std::string, double > &investments_p) const
 updates the linkdata file for a given link according to the investments of its candidates
 
int update (std::vector< ActiveLink > const &links_p, const std::map< std::string, double > &investments_p)
 updates the linkdata files for multiple candidates from a solution Point
 
int update (std::vector< ActiveLink > const &links_p, const std::filesystem::path &jsonPath_p)
 updates the linkdata files for multiple candidates from a json file
 

Detailed Description

Class that updates an antares study after an antares-xpansion execution.

Constructor & Destructor Documentation

◆ StudyUpdater()

StudyUpdater::StudyUpdater ( std::filesystem::path  studyPath_p,
const AntaresVersionProvider antares_version_provider,
ProblemGenerationLog::ProblemGenerationLoggerSharedPointer  logger 
)
explicit

constructor of class StudyUpdater

Parameters
studyPath_p: path to the antares study folder

Member Function Documentation

◆ update() [1/2]

int StudyUpdater::update ( std::vector< ActiveLink > const &  links_p,
const std::filesystem::path &  jsonPath_p 
)

updates the linkdata files for multiple candidates from a json file

Parameters
candidates_p: the candidates for which the linkdata file will be updated
jsonPath_p: path to a json file to read the investment solution from
Returns
number of candidates we failed to update

◆ update() [2/2]

int StudyUpdater::update ( std::vector< ActiveLink > const &  links_p,
const std::map< std::string, double > &  investments_p 
)

updates the linkdata files for multiple candidates from a solution Point

Parameters
candidates_p: the candidates for which the linkdata file will be updated
investments_p: a map giving investments per candidate
Returns
number of candidates we failed to update

◆ updateLinkdataFile()

int StudyUpdater::updateLinkdataFile ( const ActiveLink link_p,
const std::map< std::string, double > &  investments_p 
) const

updates the linkdata file for a given link according to the investments of its candidates

Parameters
link_p: link for which the linkdata file will be updated
investment_p: value of investment to consider for the update
Returns
1 if the update fails, 0 otherwise

The documentation for this class was generated from the following files: