Antares Simulator
Power System Simulator
|
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. | |
![]() | |
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 | |
| |
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. | |
![]() | |
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. | |
![]() | |
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. | |
Area * | areaAdd (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::Sets > | scenarioRules |
Rules for building scenarios (can be null) | |
TimeSeries::TS | scenarioInitialHydroLevels |
TimeSeries::TS | scenarioFinalHydroLevels |
StudyRuntimeInfos | runtime |
Runtime informations. | |
UIRuntimeInfo * | uiinfo = 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. | |
Antares::Data::Study::Study | ( | bool | forTheSolver = false | ) |
Default Constructor.
forTheSolver | True to indicate that the study will be used for a simulation Consequently some preparations / shortcuts should be done |
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
name | The name of the new area |
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
area | The area. The pointer will no longer be valid after the call to this routine |
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
s | The study |
area | The area. The pointer will no longer be valid after the call to this routine |
bool Antares::Data::Study::areaRename | ( | Area * | area, |
AreaName | newName ) |
Rename an area.
area | The area. The pointer will no longer be valid after the call to this routine |
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.
output | True for checking output filenames, false for input |
chfolder | The study folder to take into consideration |
bool Antares::Data::Study::clusterRename | ( | Cluster * | cluster, |
ClusterName | newName ) |
Rename a renewable/thermal cluster.
cluster | The cluster |
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
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.
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.
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").
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.
|
protectedvirtual |
Load all binding constraints.
Reimplemented in PublicStudy, and PublicStudy.
|
static |
Check if a path is within a study folder.
path | The path to check | |
[out] | location | The location of the study folder (if any) |
[out] | title | The title of the study folder (if any) |
|
static |
Get if a folder if a study.
folder | A study folder |
|
static |
Get if a folder if a study.
folder | A study folder |
buffer | A buffer to reuse for temporary operations |
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
lnk | The link. The pointer will no longer be valid after the call to this routine |
bool Antares::Data::Study::loadFromFolder | ( | const std::string & | path, |
const StudyLoadOptions & | options ) |
Load a study from a folder.
path | The path where data are located |
bool Antares::Data::Study::modifyAreaNameIfAlreadyTaken | ( | AreaName & | out, |
const AreaName & | basename ) |
Try to find a name for a new area.
out | The new name |
basename | The root base name |
void Antares::Data::Study::performTransformationsBeforeLaunchingSimulation | ( | ) |
Perform several modifications required when launching a simulation (like computing the DSM values)
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
, ...).
bool Antares::Data::Study::resetFolderIcon | ( | ) | const |
Reset the folder icon (Windows only)
void Antares::Data::Study::resizeAllTimeseriesNumbers | ( | uint | n | ) |
Resize all matrices dedicated to the sampled timeseries numbers.
n | A number of years |
bool Antares::Data::Study::saveToFolder | ( | const AnyString & | newfolder | ) |
Save the study into a folder.
folder | The folder where to write data |
|
inline |
Store the timeseries numbers.
TimeSeriesT | The time-series set to store |
|
static |
Extract the title of a study.
folder | A study folder | |
[out] | out | The variable where the title will be written |
warnings | False to prevent warnings/errors when loading |
void* Antares::Data::Study::cacheTSGenerator[timeSeriesCount] |
Time-series generators used by the solver.
Date::Calendar Antares::Data::Study::calendar |
Calendar.
When launched from the solver, this calendar does not take into consideration the leap year
Date::Calendar Antares::Data::Study::calendarOutput |
Calendar output.
With leap year mode (if any), for the output results
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)
StudyRuntimeInfos Antares::Data::Study::runtime |
Runtime informations.
These informations are only needed when a study is processed.
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.