Antares Simulator
Power System Simulator
timeseries_base.h File Reference

Base classes and traits for time series variables in Antares Simulator. More...

#include <algorithm>
#include <memory>
#include <string>
#include <string_view>
#include <vector>
#include <antares/study/area/area.h>
#include "antares/solver/variable/variable.h"

Go to the source code of this file.

Classes

struct  Antares::Solver::Variable::Economy::TimeSeriesTraits< Derived >
 Base traits template providing common properties for all time series variables. More...
 
struct  Antares::Solver::Variable::Economy::VCardTimeSeriesBase< TraitsType >
 VCard template providing variable metadata and configuration. More...
 
class  Antares::Solver::Variable::Economy::TimeSeriesValuesBase< Derived, NextT, VCardType >
 Base implementation for time series variables using CRTP pattern. More...
 
struct  Antares::Solver::Variable::Economy::TimeSeriesValuesBase< Derived, NextT, VCardType >::Statistics< CDataLevel, CFile >
 Compile-time statistics calculation. More...
 

Namespaces

 Antares::Solver::Variable::Economy::detail
 Internal helpers for template metaprogramming.
 

Variables

template<class VCard , class Next , int CDataLevel, int CFile>
constexpr int Antares::Solver::Variable::Economy::detail::StatisticsCount
 Compile-time calculation of statistics count. More...
 

Detailed Description

Base classes and traits for time series variables in Antares Simulator.

  • This file provides a modern C++20 foundation for implementing time series variables in the Antares Simulator solver. It eliminates code duplication by providing common functionality through templates and traits.

Architecture Overview

TimeSeriesTraits<T> ← Common properties and types
VCardTimeSeriesBase<T> ← VCard implementation
TimeSeriesValuesBase<D,N,V> ← Base behavior implementation
Derived Classes ← Specific implementations (Load, Solar, etc.)

Usage Example

// 1. Define traits for your time series type
struct MyTimeSeriesTraits {
static constexpr std::string_view kCaption = "MY_TYPE";
static constexpr std::string_view kDescription = "My custom time series";
};
// 2. Create VCard using the base template
using VCardMyTimeSeries = VCardTimeSeriesBase<MyTimeSeriesTraits>;
// 3. Implement your time series class
template<class NextT = Container::EndOfList>
class MyTimeSeries : public TimeSeriesValuesBase<MyTimeSeries<NextT>, NextT, VCardMyTimeSeries> {
public:
void initializeDerivedFromStudy(Data::Study& study) { ... }
void yearBeginImpl(unsigned int year, unsigned int space) { ... }
void hourForEachAreaImpl(State& state, unsigned int space) { ... }
};
See also
generation.h for concrete examples
load.h, hydro.h for other implementations