Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
Antares::Data::Study Class Reference
Inheritance diagram for Antares::Data::Study:
Antares::Data::LayerData PublicStudy PublicStudy

Public Types

using Ptr = std::shared_ptr<Study>
 
using Set = std::set<Ptr>
 Set of studies.
 
using List = std::list<Ptr>
 List of studies.
 
using SetsOfAreas = Antares::Data::Sets
 Multiple sets of areas.
 
using FileExtension = std::string
 Extension filename.
 

Public Member Functions

Constructor & Destructor
 Study (bool forTheSolver=false)
 Default Constructor.
 
virtual ~Study ()
 Destructor.
 
Loading/Saving
void createAsNew ()
 Create a clean study.
 
void relocate (const std::filesystem::path &newFolder)
 Relocate the study into a new folder.
 
bool loadFromFolder (const std::string &path, const StudyLoadOptions &options)
 Load a study from a folder.
 
void clear ()
 Clear all ressources held by the study.
 
void reloadCorrelation ()
 Reload all correlation.
 
bool reloadXCastData ()
 Reload all XCast Data.
 
bool saveToFolder (const AnyString &newfolder)
 Save the study into a folder.
 
bool resetFolderIcon () const
 Reset the folder icon (Windows only)
 
Invalidate
bool forceReload (bool reload=false) const
 Invalidate the whole study.
 
void markAsModified () const
 Mark the whole study as modified.
 
Links
bool linkDelete (AreaLink *lnk)
 Delete a connection and all its dependencies.
 
Renewable/thermal clusters
bool clusterRename (Cluster *cluster, ClusterName newName)
 Rename a renewable/thermal cluster.
 
Read-only
bool readonly () const
 Get if the study is in readonly mode.
 
Time-series
void resizeAllTimeseriesNumbers (uint n)
 Resize all matrices dedicated to the sampled timeseries numbers.
 
template<unsigned int TimeSeriesT>
void storeTimeSeriesNumbers (Solver::IResultWriter &resultWriter) const
 Store the timeseries numbers.
 
Time-series Generators
template<enum TimeSeriesType TS>
void destroyTSGeneratorData ()
 Destroy all data of the TS generator '@TS'.
 
void destroyAllLoadTSGeneratorData ()
 Destroy all data of the load TS generator.
 
void destroyAllSolarTSGeneratorData ()
 Destroy all data of the solar TS generator.
 
void destroyAllWindTSGeneratorData ()
 Destroy all data of the wind TS generator.
 
void destroyAllHydroTSGeneratorData ()
 Destroy all data of the hydro TS generator.
 
bool importTimeseriesIntoInput ()
 Import all time-series into the input folder.
 
Internal Data TS-Generators / Series
unsigned getNumberOfCoresPerMode (unsigned nbLogicalCores, int ncMode)
 Computes a raw number of cores table.
 
void getNumberOfCores (const bool forceParallel, const uint nbYearsParallelForced)
 Computes number of cores.
 
void removeTimeseriesIfTSGeneratorEnabled ()
 Remove timeseries if ts-generator is enabled.
 
bool checkForFilenameLimits (bool output, const YString &chfolder=nullptr) const
 Check for filename limits restriction on some platforms.
 
Memory management
void ensureDataAreLoadedForAllBindingConstraints ()
 Load all matrices within the binding constraints if not already done.
 
Logs
void importLogsToOutputFolder (Solver::IResultWriter &resultWriter) const
 Copy the log file from the 'logs' folder to the current output folder.
 
- Public Member Functions inherited from Antares::Data::LayerData
 LayerData (size_t activeLayer, bool showLayer)
 

Static Public Member Functions

static bool TitleFromStudyFolder (const AnyString &folder, YString &out, bool warnings=false)
 Extract the title of a study.
 
static bool IsRootStudy (const AnyString &folder)
 Get if a folder if a study.
 
static bool IsRootStudy (const AnyString &folder, YString &buffer)
 Get if a folder if a study.
 
static bool IsInsideStudyFolder (const AnyString &path, YString &location, YString &title)
 Check if a path is within a study folder.
 

Public Attributes

Paths
std::filesystem::path folder
 The source folder of the study.
 
std::filesystem::path folderInput
 The input folder.
 
std::filesystem::path folderOutput
 The output folder.
 
std::filesystem::path folderSettings
 The settings folder.
 
Binding constraints
BindingConstraintsRepository bindingConstraints
 Binding constraints.
 
BindingConstraintGroupRepository bindingConstraintsGroups
 
Correlation matrices used by the prepro
Correlation preproLoadCorrelation
 Correlation matrix for the load time series generated by the prepro.
 
Correlation preproSolarCorrelation
 Correlation matrix for the solar time series generated by the prepro.
 
Correlation preproWindCorrelation
 Correlation matrix for the wind time series generated by the prepro.
 
Correlation preproHydroCorrelation
 Correlation matrix for the hydro time series generated by the prepro.
 
Groups
SetsOfAreas setsOfAreas
 Sets of areas.
 
Cache
Warning
Those variables must not be used outside of a study.
YString buffer
 A buffer for temporary operations on filename.
 
Matrix ::BufferType dataBuffer
 A buffer for temporary operations on large amount of data.
 
YString bufferLoadingTS
 A buffer used when loading time-series for dealing with filenames (prepro/series only)
 
std::shared_ptr< Yuni::Job::QueueService > pQueueService
 The queue service that runs every set of parallel years.
 
TS Generators
void * cacheTSGenerator [timeSeriesCount]
 Time-series generators used by the solver.
 
const bool usedByTheSolver
 A non-zero value when the study will be used by the solver.
 
- Public Attributes inherited from Antares::Data::LayerData
std::map< size_t, std::string > layers
 All available layers.
 
size_t activeLayerID
 
bool showAllLayer
 

Protected Member Functions

Loading
bool internalLoadFromFolder (const std::filesystem::path &path, const StudyLoadOptions &options)
 Load a study from a folder.
 
bool internalLoadHeader (const std::filesystem::path &folder)
 Load the study header.
 
bool internalLoadCorrelationMatrices (const StudyLoadOptions &options)
 Load all correlation matrices.
 
virtual bool internalLoadBindingConstraints (const StudyLoadOptions &options)
 Load all binding constraints.
 
bool internalLoadSets ()
 Load all set of areas and links.
 
bool internalLoadIni (const std::filesystem::path &path, const StudyLoadOptions &options)
 
void parameterFiller (const StudyLoadOptions &options)
 
Misc
void reduceMemoryUsage ()
 Release all unnecessary buffers.
 
- Protected Member Functions inherited from Antares::Data::LayerData
bool saveLayers (const AnyString &filename)
 
void loadLayers (const std::filesystem::path &filename)
 

Check validity of Min Stable Power of Thermal Clusters

StudyHeader header
 Header (general information about the study)
 
void computePThetaInfForThermalClusters () const
 Check validity between Min Stable Power and capacity modulation for each thermal cluster in the all area in the study. Should be call then all inforation is suplied in to the thermal clusters.
 

Simulation

SimulationComments simulationComments
 The current Simulation.
 
int64_t pStartTime
 
uint maxNbYearsInParallel = 1
 
uint maxNbYearsInParallel_save = 0
 
uint nbYearsParallelRaw = 1
 
uint minNbYearsInParallel = 0
 
uint minNbYearsInParallel_save = 0
 
Parameters parameters
 Parameters.
 
Date::Calendar calendar
 Calendar.
 
Date::Calendar calendarOutput
 Calendar output.
 
void performTransformationsBeforeLaunchingSimulation ()
 Perform several modifications required when launching a simulation (like computing the DSM values)
 
bool initializeRuntimeInfos ()
 Initialize runtime informations required by the solver.
 
void prepareOutput ()
 Prepare the output where the results of the simulation will be written.
 
void saveAboutTheStudy (Solver::IResultWriter &resultWriter)
 
void initializeProgressMeter (bool tsGeneratorOnly)
 Initialize the progress meter.
 

Areas

AreaList areas
 All available areas.
 
bool modifyAreaNameIfAlreadyTaken (AreaName &out, const AreaName &basename)
 Try to find a name for a new area.
 
AreaareaAdd (const AreaName &name, bool update=false)
 Add an area and make all required initialization.
 
bool areaRename (Area *area, AreaName newName)
 Rename an area.
 
bool areaDelete (Area *area)
 Delete an area and all its dependancies.
 
void areaDelete (Area::Vector &area)
 Delete an area and all its dependencies.
 

Scenario Builder

std::unique_ptr< ScenarioBuilder::SetsscenarioRules
 Rules for building scenarios (can be null)
 
TimeSeries::TS scenarioInitialHydroLevels
 
TimeSeries::TS scenarioFinalHydroLevels
 
StudyRuntimeInfos runtime
 Runtime informations.
 
UIRuntimeInfouiinfo = nullptr
 Specific data related to the User Interface.
 
FileExtension inputExtension = "txt"
 The file extension for file within the input ('txt' or 'csv')
 
Solver::Progression progression
 Progression about the current action performed on the study.
 
void scenarioRulesLoadIfNotAvailable ()
 Load the data related to the scenario builder if not available.
 
void scenarioRulesCreate ()
 Re-Initialize/Re-Load the scenario builder data.
 
void scenarioRulesDestroy ()
 Release the scenario builder.
 

Constructor & Destructor Documentation

◆ Study()

Antares::Data::Study::Study ( bool forTheSolver = false)

Default Constructor.

Parameters
forTheSolverTrue to indicate that the study will be used for a simulation Consequently some preparations / shortcuts should be done

Member Function Documentation

◆ areaAdd()

Area * Antares::Data::Study::areaAdd ( const AreaName & name,
bool update = false )

Add an area and make all required initialization.

It is the safe way to add an area and it is mainly used by the GUI

Parameters
nameThe name of the new area
Returns
A pointer to a new area, or NULL if the operation failed

◆ areaDelete() [1/2]

bool Antares::Data::Study::areaDelete ( Area * area)

Delete an area and all its dependancies.

It is the safe way to delete an area and it is mainly used by the GUI

Parameters
areaThe area. The pointer will no longer be valid after the call to this routine
Returns
True if the operation succeeded, false otherwise

◆ areaDelete() [2/2]

void Antares::Data::Study::areaDelete ( Area::Vector & area)

Delete an area and all its dependencies.

It is the safe way to delete an area and it is mainly used by the GUI

Parameters
sThe study
areaThe area. The pointer will no longer be valid after the call to this routine
Returns
True if the operation succeeded, false otherwise

◆ areaRename()

bool Antares::Data::Study::areaRename ( Area * area,
AreaName newName )

Rename an area.

Parameters
areaThe area. The pointer will no longer be valid after the call to this routine
Returns
True if the operation succeeded, false otherwise
See also
BeautifyName()

◆ checkForFilenameLimits()

bool Antares::Data::Study::checkForFilenameLimits ( bool output,
const YString & chfolder = nullptr ) const

Check for filename limits restriction on some platforms.

On Windows, we can use filename with more than 256 characters. theoretically possible, but non working.

Parameters
outputTrue for checking output filenames, false for input
chfolderThe study folder to take into consideration

◆ clusterRename()

bool Antares::Data::Study::clusterRename ( Cluster * cluster,
ClusterName newName )

Rename a renewable/thermal cluster.

Parameters
clusterThe cluster
Returns
True if the operation succeeded, false otherwise

◆ ensureDataAreLoadedForAllBindingConstraints()

void Antares::Data::Study::ensureDataAreLoadedForAllBindingConstraints ( )

Load all matrices within the binding constraints if not already done.

This method is required by the interface when a saveAs is performed

◆ forceReload()

bool Antares::Data::Study::forceReload ( bool reload = false) const

Invalidate the whole study.

Mark all JIT structures as invalidated. This will force the loading of missing data in memory and it will force the rewritten of any matrix.

◆ getNumberOfCores()

void Antares::Data::Study::getNumberOfCores ( const bool forceParallel,
const uint nbYearsParallelForced )

Computes number of cores.

From the "Number of Cores" level (in GUI --> Advanced parameters), computes the real numbers of logical cores to be involved in the MC years parallelisation.

◆ getNumberOfCoresPerMode()

unsigned Antares::Data::Study::getNumberOfCoresPerMode ( unsigned nbLogicalCores,
int ncMode )

Computes a raw number of cores table.

The table associetes a raw number of cores to each level ("min", "low", "med", "high", "max").

◆ importTimeseriesIntoInput()

bool Antares::Data::Study::importTimeseriesIntoInput ( )

Import all time-series into the input folder.

This method should be used when the solver has finished its simulation and the data generated by the preprocessors must be imported in the input folder. The selection of time-series is controlled by the general data (timeSeriesToImport). When calling this routine, and if timeSeriesToImport is not equals to 0, the input folder will be modified.

Returns
True if the operation suceeded, false otherwise

◆ internalLoadBindingConstraints()

bool Antares::Data::Study::internalLoadBindingConstraints ( const StudyLoadOptions & options)
protectedvirtual

Load all binding constraints.

Reimplemented in PublicStudy, and PublicStudy.

◆ IsInsideStudyFolder()

bool Antares::Data::Study::IsInsideStudyFolder ( const AnyString & path,
YString & location,
YString & title )
static

Check if a path is within a study folder.

Warning
This method assumes that the given path is properly formatted according to the OS parameters
Parameters
pathThe path to check
[out]locationThe location of the study folder (if any)
[out]titleThe title of the study folder (if any)
Returns
True if the path is within a study folder. In this case the parameters 'location' and 'title' are set.

◆ IsRootStudy() [1/2]

bool Antares::Data::Study::IsRootStudy ( const AnyString & folder)
static

Get if a folder if a study.

Parameters
folderA study folder
Returns
True if the folder is a study, false otherwise

◆ IsRootStudy() [2/2]

static bool Antares::Data::Study::IsRootStudy ( const AnyString & folder,
YString & buffer )
static

Get if a folder if a study.

Parameters
folderA study folder
bufferA buffer to reuse for temporary operations
Returns
True if the folder is a study, false otherwise

◆ linkDelete()

bool Antares::Data::Study::linkDelete ( AreaLink * lnk)

Delete a connection and all its dependencies.

It is the safe way to delete a link and it is mainly used by the GUI

Parameters
lnkThe link. The pointer will no longer be valid after the call to this routine
Returns
True if the operation succeeded, false otherwise

◆ loadFromFolder()

bool Antares::Data::Study::loadFromFolder ( const std::string & path,
const StudyLoadOptions & options )

Load a study from a folder.

Parameters
pathThe path where data are located
Returns
True if succeeded, false otherwise

◆ modifyAreaNameIfAlreadyTaken()

bool Antares::Data::Study::modifyAreaNameIfAlreadyTaken ( AreaName & out,
const AreaName & basename )

Try to find a name for a new area.

Parameters
outThe new name
basenameThe root base name
Returns
True if a new name has been found, false otherwise

◆ performTransformationsBeforeLaunchingSimulation()

void Antares::Data::Study::performTransformationsBeforeLaunchingSimulation ( )

Perform several modifications required when launching a simulation (like computing the DSM values)

Returns
True if the operation succeeded, false otherwise

◆ relocate()

void Antares::Data::Study::relocate ( const std::filesystem::path & newFolder)

Relocate the study into a new folder.

This method does not have any effect except modifying internal variables (folder, folderInput, ...).

◆ resetFolderIcon()

bool Antares::Data::Study::resetFolderIcon ( ) const

Reset the folder icon (Windows only)

Returns
True if the operation succeeded

◆ resizeAllTimeseriesNumbers()

void Antares::Data::Study::resizeAllTimeseriesNumbers ( uint n)

Resize all matrices dedicated to the sampled timeseries numbers.

Parameters
nA number of years

◆ saveToFolder()

bool Antares::Data::Study::saveToFolder ( const AnyString & newfolder)

Save the study into a folder.

Parameters
folderThe folder where to write data
Returns
True if succeeded, false otherwise

◆ storeTimeSeriesNumbers()

template<unsigned int TimeSeriesT>
void Antares::Data::Study::storeTimeSeriesNumbers ( Solver::IResultWriter & resultWriter) const
inline

Store the timeseries numbers.

Template Parameters
TimeSeriesTThe time-series set to store
Returns
True if the operation succeeded (the file have been written), false otherwise

◆ TitleFromStudyFolder()

bool Antares::Data::Study::TitleFromStudyFolder ( const AnyString & folder,
YString & out,
bool warnings = false )
static

Extract the title of a study.

Parameters
folderA study folder
[out]outThe variable where the title will be written
warningsFalse to prevent warnings/errors when loading
Returns
True if the operation succeeded, false otherwise

Member Data Documentation

◆ cacheTSGenerator

void* Antares::Data::Study::cacheTSGenerator[timeSeriesCount]

Time-series generators used by the solver.

Warning
These variables should not be used directly

◆ calendar

Date::Calendar Antares::Data::Study::calendar

Calendar.

When launched from the solver, this calendar does not take into consideration the leap year

◆ calendarOutput

Date::Calendar Antares::Data::Study::calendarOutput

Calendar output.

With leap year mode (if any), for the output results

◆ inputExtension

FileExtension Antares::Data::Study::inputExtension = "txt"

The file extension for file within the input ('txt' or 'csv')

Since the v3.1, the file extensions in the input have been renamed into .txt, (instead of .csv)

◆ runtime

StudyRuntimeInfos Antares::Data::Study::runtime

Runtime informations.

These informations are only needed when a study is processed.

◆ usedByTheSolver

const bool Antares::Data::Study::usedByTheSolver

A non-zero value when the study will be used by the solver.

If it is the case, some data may not be kept in memory, and some calculations must be done.


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