Skip to content

Commit

Permalink
Remove global var NumeroChroniquesTireesParInterconnexion (#1715)
Browse files Browse the repository at this point in the history
* [DEV] Use tsnumbers in variable/links

* [DEV] Use tsnumbers in sim_calcul, fix condition

* [DEV] Remove useless struct, fix compile

* [DEV] Remove var NumeroChroniquesTireesParInterconnexion

* Remove obsolete struct

Signed-off-by: Sylvain Leclerc <[email protected]>

* [DEV] Remove dir src/solver/aleatoire

---------

Signed-off-by: Sylvain Leclerc <[email protected]>
Co-authored-by: Sylvain Leclerc <[email protected]>
  • Loading branch information
payetvin and sylvlecl authored Oct 25, 2023
1 parent 80a78bb commit 736e91a
Show file tree
Hide file tree
Showing 18 changed files with 3 additions and 183 deletions.
2 changes: 0 additions & 2 deletions src/solver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ add_subdirectory(variable)
add_subdirectory(hydro)
add_subdirectory(simulation)
add_subdirectory(ts-generator)
add_subdirectory(aleatoire)
add_subdirectory(utils)
add_subdirectory(optimisation)
add_subdirectory(main)
Expand Down Expand Up @@ -90,7 +89,6 @@ set(ANTARES_SOLVER_LIBS ${ANTARES_SOLVER_LIBS}
antares-solver-main-economy
antares-solver-main-adequacy
antares-solver-hydro
antares-solver-aleatoire
antares-solver-variable
antares-solver-simulation
antares-solver-ts-generator
Expand Down
17 changes: 0 additions & 17 deletions src/solver/aleatoire/CMakeLists.txt

This file was deleted.

34 changes: 0 additions & 34 deletions src/solver/aleatoire/alea_fonctions.h

This file was deleted.

40 changes: 0 additions & 40 deletions src/solver/aleatoire/alea_sys.h

This file was deleted.

56 changes: 0 additions & 56 deletions src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp

This file was deleted.

1 change: 0 additions & 1 deletion src/solver/simulation/common-eco-adq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <cassert>
#include <map>
#include "simulation.h"
#include "../aleatoire/alea_fonctions.h"

using namespace Yuni;

Expand Down
6 changes: 0 additions & 6 deletions src/solver/simulation/sim_allocation_tableaux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,5 @@ static void AllocateResultsForEconomicMode(const Data::Study& study)

void SIM_AllocationTableaux(const Data::Study& study)
{
NumeroChroniquesTireesParInterconnexion.resize(study.maxNbYearsInParallel);

const uint intercoCount = study.areas.areaLinkCount();
for (uint numSpace = 0; numSpace < study.maxNbYearsInParallel; numSpace++)
NumeroChroniquesTireesParInterconnexion[numSpace].resize(intercoCount);

AllocateResultsForEconomicMode(study);
}
3 changes: 1 addition & 2 deletions src/solver/simulation/sim_calcul_economique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,7 @@ void SIM_RenseignementProblemeHebdo(const Study& study,
for (uint k = 0; k != linkCount; ++k)
{
auto& lnk = *(studyruntime.areaLink[k]);
const int tsIndex
= NumeroChroniquesTireesParInterconnexion[numSpace][k].TransmissionCapacities;
const int tsIndex = (lnk.directCapacities.width != 1) ? lnk.timeseriesNumbers[0][year] : 0;

assert((uint)hourInYear < lnk.directCapacities.height);
assert((uint)tsIndex < lnk.directCapacities.width);
Expand Down
1 change: 0 additions & 1 deletion src/solver/simulation/sim_extern_variables_globales.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "sim_structure_probleme_economique.h"

/* Valeurs generees de maniere aleatoire */
extern std::vector<std::vector<NUMERO_CHRONIQUES_TIREES_PAR_INTERCONNEXION>> NumeroChroniquesTireesParInterconnexion;

/* Resultats */
/*-Economique-*/
Expand Down
12 changes: 0 additions & 12 deletions src/solver/simulation/sim_structure_donnees.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,11 @@
#ifndef __SOLVER_SIMULATION_DATA_STRUCTS_H__
#define __SOLVER_SIMULATION_DATA_STRUCTS_H__

#include <vector>

typedef struct
{
int TransmissionCapacities;
} NUMERO_CHRONIQUES_TIREES_PAR_INTERCONNEXION;

typedef struct
{
double* Horaire;
} PRODUCTION_THERMIQUE;

typedef struct
{
double* ParLigne;
} MATRICE_2D;

/* Old define */
#define DEFINITION_STRUCTURES_DONNEES

Expand Down
2 changes: 0 additions & 2 deletions src/solver/simulation/sim_variables_globales.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@
#include "sim_structure_donnees.h"
#include "sim_structure_probleme_economique.h"

std::vector<std::vector<NUMERO_CHRONIQUES_TIREES_PAR_INTERCONNEXION>> NumeroChroniquesTireesParInterconnexion;

std::vector<std::vector<double>> transitMoyenInterconnexionsRecalculQuadratique;
4 changes: 1 addition & 3 deletions src/solver/simulation/solver.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <antares/exception/InitializationError.hpp>
#include "../variable/print.h"
#include <yuni/io/io.h>
#include "../aleatoire/alea_fonctions.h"
#include "timeseries-numbers.h"
#include "apply-scenario.h"
#include <antares/fatal-error.h>
Expand Down Expand Up @@ -156,8 +155,7 @@ public:
randomReservoirLevel = randomForCurrentYear.pReservoirLevels;

// 2 - Preparing the Time-series numbers
// We want to draw lots of numbers for time-series
ApplyRandomTSnumbers(study, y, numSpace);
// removed

// 3 - Preparing data related to Clusters in 'must-run' mode
simulation_->prepareClustersInMustRunMode(numSpace, y);
Expand Down
1 change: 0 additions & 1 deletion src/solver/ts-generator/generator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#ifndef __ANTARES_SOLVER_timeSeries_GENERATOR_HXX__
#define __ANTARES_SOLVER_timeSeries_GENERATOR_HXX__

#include "../aleatoire/alea_fonctions.h"
#include <antares/logs/logs.h>

namespace Antares
Expand Down
1 change: 0 additions & 1 deletion src/solver/ts-generator/hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include <yuni/yuni.h>
#include "../simulation/sim_extern_variables_globales.h"
#include "../aleatoire/alea_fonctions.h"
#include <antares/benchmarking/DurationCollector.h>
#include <antares/fatal-error.h>
#include <antares/writer/i_writer.h>
Expand Down
1 change: 0 additions & 1 deletion src/solver/ts-generator/thermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "../simulation/sim_structure_donnees.h"
#include "../simulation/sim_structure_probleme_economique.h"
#include "../simulation/sim_extern_variables_globales.h"
#include "../aleatoire/alea_fonctions.h"

using namespace Yuni;

Expand Down
3 changes: 1 addition & 2 deletions src/solver/variable/economy/links/congestionProbability.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,7 @@ class CongestionProbability
assert(state.link != NULL);
const auto& linkDirectCapa = state.link->directCapacities;
const auto& linkIndirectCapa = state.link->indirectCapacities;
const int tsIndex = NumeroChroniquesTireesParInterconnexion[numSpace][state.link->index]
.TransmissionCapacities;
const int tsIndex = (linkDirectCapa.width != 1) ? state.link->timeseriesNumbers[0][state.year] : 0;
// CONG. PROB +
if (state.ntc.ValeurDuFlux[state.link->index]
> +linkDirectCapa.entry[tsIndex][state.hourInTheYear] - 10e-6)
Expand Down
1 change: 0 additions & 1 deletion src/tests/end-to-end/binding_constraints/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ target_link_libraries(tests-binding_constraints
antares-solver-simulation
antares-solver-hydro
antares-solver-ts-generator
antares-solver-aleatoire
)

target_include_directories(tests-binding_constraints
Expand Down
1 change: 0 additions & 1 deletion src/tests/end-to-end/simple_study/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ target_link_libraries(tests-simple-study
antares-solver-main-economy
antares-solver-main-adequacy
antares-solver-hydro
antares-solver-aleatoire
antares-solver-variable
antares-solver-simulation
antares-solver-ts-generator
Expand Down

0 comments on commit 736e91a

Please sign in to comment.