Antares Simulator
Power System Simulator
state.hxx
1 /*
2  * Copyright 2007-2025, RTE (https://www.rte-france.com)
3  * See AUTHORS.txt
4  * SPDX-License-Identifier: MPL-2.0
5  * This file is part of Antares-Simulator,
6  * Adequacy and Performance assessment for interconnected energy networks.
7  *
8  * Antares_Simulator is free software: you can redistribute it and/or modify
9  * it under the terms of the Mozilla Public Licence 2.0 as published by
10  * the Mozilla Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * Antares_Simulator is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * Mozilla Public Licence 2.0 for more details.
17  *
18  * You should have received a copy of the Mozilla Public Licence 2.0
19  * along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20  */
21 #ifndef __SOLVER_VARIABLE_STATE_HXX__
22 #define __SOLVER_VARIABLE_STATE_HXX__
23 
24 namespace Antares::Solver::Variable
25 {
26 inline void State::startANewYear()
27 {
29 
33  0,
37  0,
39 
40  // Re-initializing annual costs (to be printed in output into separate files)
41  annualSystemCost = 0.;
46  averageUpdateTime = 0.;
47 }
48 
50 {
54  0,
58  0,
60 }
61 
62 inline void State::initFromAreaIndex(const unsigned int areaIndex, uint numSpace)
63 {
64  area = study.areas[areaIndex];
66  thermalCluster = nullptr;
67 
68  switch (simulationMode)
69  {
70  case Data::SimulationMode::Adequacy:
71  case Data::SimulationMode::Economy:
72  case Data::SimulationMode::Expansion:
73  {
74  hourlyResults = &problemeHebdo->ResultatsHoraires[areaIndex];
75  break;
76  }
77 
78  case Data::SimulationMode::Unknown:
79  break;
80  }
81 }
82 
83 } // namespace Antares::Solver::Variable
84 
85 #endif // __SOLVER_VARIABLE_STATE_HXX__
std::vector< AreaScratchpad > scratchpad
Scratchpad used temporary calculations (solver only)
Definition: area.h:311
AreaList areas
All available areas.
Definition: study.h:524
Data::Area * area
The current area.
Definition: state.h:155
double optimalSolutionCost1
Sum of the weekly optimal costs over the year (first optimisation step)
Definition: state.h:227
double thermalClusterPMinOfTheClusterForYear[HOURS_PER_YEAR]
Minimum power of the cluster for the whole year.
Definition: state.h:192
double averageOptimizationTime2
Average time spent in second optimization over the year (ms)
Definition: state.h:233
double thermalClusterOperatingCostForYear[HOURS_PER_YEAR]
Thermal operating cost for the current thermal cluster for the whole year.
Definition: state.h:188
void initFromAreaIndex(const unsigned int areaIndex, uint numSpace)
Initialize some variables according an area index.
Definition: state.hxx:62
void startANewYear()
Reset internal data.
Definition: state.hxx:26
double averageUpdateTime
Average time spent updating the problem over the year (ms)
Definition: state.h:235
PROBLEME_HEBDO * problemeHebdo
Probleme Hebdo.
Definition: state.h:201
double thermalClusterProductionForYear[HOURS_PER_YEAR]
Thermal production for the current thermal cluster for the whole year.
Definition: state.h:182
Data::Study & study
Reference to the original study.
Definition: state.h:208
Data::ThermalCluster * thermalCluster
The current thermal cluster (used in yearEndBuildForEachThermalCluster functions)
Definition: state.h:158
void yearEndResetThermal()
Reset thermal internal data for end of year calculations.
Definition: state.hxx:49
unsigned int hourInTheSimulation
Current hour from the begining of the simulation.
Definition: state.h:152
uint thermalClusterDispatchedUnitsCountForYear[HOURS_PER_YEAR]
Definition: state.h:185
double optimalSolutionCost2
Sum of the weekly optimal costs over the year (second optimisation step)
Definition: state.h:229
double thermalClusterNonProportionalCostForYear[HOURS_PER_YEAR]
Thermal NP Cost for the current thermal cluster for the whole year.
Definition: state.h:190
Data::SimulationMode simulationMode
Simulation mode: economy / adequacy / expansion.
Definition: state.h:204
unsigned int numSpace
Index of the state in the state vector.
Definition: state.h:212
double averageOptimizationTime1
Average time spent in first optimization over the year (ms)
Definition: state.h:231
Data::AreaScratchpad * scratchpad
The Scratchpad for the current area.
Definition: state.h:163