Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
Antares::Data::TimeSeries Class Reference

This class is used to represent the generic time series. More...

#include <series.h>

Public Types

using TS = Matrix<double>
 

Public Member Functions

 TimeSeries (TimeSeriesNumbers &tsNumbers)
 
bool loadFromFile (const std::filesystem::path &path, const bool average)
 Load series from a file.
 
int saveToFolder (const std::string &areaID, const std::string &folder, const std::string &prefix) const
 Save time series to a file.
 
int saveToFile (const std::string &filename, bool saveEvenIfAllZero) const
 
double getCoefficient (uint32_t year, uint32_t timestep) const
 
const double * getColumn (uint32_t year) const
 
uint32_t getSeriesIndex (uint32_t year) const
 
double * operator[] (uint32_t index)
 overload operator to return a column Unlike getColumn() it uses direct indexing and not timeseriesNumbers
 
void reset ()
 
void reset (uint32_t width, uint32_t height)
 
uint32_t numberOfColumns () const
 
void unloadFromMemory () const
 
void roundAllEntries ()
 
void resize (uint32_t timeSeriesCount, uint32_t timestepCount)
 
void fill (double value)
 
void averageTimeseries ()
 
bool forceReload (bool reload=false) const
 
void markAsModified () const
 

Public Attributes

TS timeSeries
 
TimeSeriesNumberstimeseriesNumbers
 

Static Public Attributes

static const std::vector< double > emptyColumn
 used in getColumn if timeSeries empty
 

Detailed Description

This class is used to represent the generic time series.

The goal is to handle indexing with the time series numbers: getCoefficient() and also providing a wrapper for all the Matrix<> functions such as resize()

Member Function Documentation

◆ loadFromFile()

bool Antares::Data::TimeSeries::loadFromFile ( const std::filesystem::path & path,
const bool average )

Load series from a file.

Parameters
pathpath of the file
averageused to average timeseries
Returns
A non-zero value if the operation succeeded, 0 otherwise

◆ saveToFolder()

int Antares::Data::TimeSeries::saveToFolder ( const std::string & areaID,
const std::string & folder,
const std::string & prefix ) const

Save time series to a file.

Parameters
areaIDThe ID of the area associated to the data series
folderThe target folder
prefixthe prefix for the filename
Returns
A non-zero value if the operation succeeded, 0 otherwise

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