diff --git a/src/solver/CMakeLists.txt b/src/solver/CMakeLists.txt index 7372ff3b83..1d55b9b7df 100644 --- a/src/solver/CMakeLists.txt +++ b/src/solver/CMakeLists.txt @@ -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) @@ -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 diff --git a/src/solver/aleatoire/CMakeLists.txt b/src/solver/aleatoire/CMakeLists.txt deleted file mode 100644 index 609d979cd5..0000000000 --- a/src/solver/aleatoire/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -set(SRC_ALEATOIRE - alea_fonctions.h - alea_sys.h - alea_tirage_au_sort_chroniques.cpp) -source_group("aleatoire" FILES ${SRC_ALEATOIRE}) - - -add_library(antares-solver-aleatoire ${SRC_ALEATOIRE}) - -target_include_directories(antares-solver-aleatoire - PRIVATE - ${CMAKE_SOURCE_DIR}/solver) - -target_link_libraries(antares-solver-aleatoire - PUBLIC - Antares::study -) diff --git a/src/solver/aleatoire/alea_fonctions.h b/src/solver/aleatoire/alea_fonctions.h deleted file mode 100644 index e54d825358..0000000000 --- a/src/solver/aleatoire/alea_fonctions.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -** Copyright 2007-2023 RTE -** Authors: Antares_Simulator Team -** -** This file is part of Antares_Simulator. -** -** Antares_Simulator is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** There are special exceptions to the terms and conditions of the -** license as they are applied to this software. View the full text of -** the exceptions in file COPYING.txt in the directory of this software -** distribution -** -** Antares_Simulator is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with Antares_Simulator. If not, see . -** -** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions -*/ -#pragma once - -#include "../simulation/sim_structure_donnees.h" -#include "antares/study/study.h" - -void ApplyRandomTSnumbers(const Antares::Data::Study& study, - unsigned int year, - uint numSpace); \ No newline at end of file diff --git a/src/solver/aleatoire/alea_sys.h b/src/solver/aleatoire/alea_sys.h deleted file mode 100644 index 434e67decb..0000000000 --- a/src/solver/aleatoire/alea_sys.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -** Copyright 2007-2023 RTE -** Authors: Antares_Simulator Team -** -** This file is part of Antares_Simulator. -** -** Antares_Simulator is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** There are special exceptions to the terms and conditions of the -** license as they are applied to this software. View the full text of -** the exceptions in file COPYING.txt in the directory of this software -** distribution -** -** Antares_Simulator is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with Antares_Simulator. If not, see . -** -** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions -*/ -#ifndef __SOLVER_RANDOM_SYSHDR_H__ -#define __SOLVER_RANDOM_SYSHDR_H__ - -#include -#include -#include -#include -#include - -#include "../config.h" -#include -#include "../simulation/simulation.h" - -#endif /* __SOLVER_RANDOM_SYSHDR_H__ */ diff --git a/src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp b/src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp deleted file mode 100644 index 64c1aa43ef..0000000000 --- a/src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* -** Copyright 2007-2023 RTE -** Authors: Antares_Simulator Team -** -** This file is part of Antares_Simulator. -** -** Antares_Simulator is free software: you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation, either version 3 of the License, or -** (at your option) any later version. -** -** There are special exceptions to the terms and conditions of the -** license as they are applied to this software. View the full text of -** the exceptions in file COPYING.txt in the directory of this software -** distribution -** -** Antares_Simulator is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with Antares_Simulator. If not, see . -** -** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions -*/ - -#include "../simulation/sim_extern_variables_globales.h" -#include "alea_fonctions.h" -#include - -using namespace Yuni; -using namespace Antares; -using namespace Antares::Data; - -void ApplyRandomTSnumbers(const Study& study, - unsigned int year, - uint numSpace) -{ - // ------------------------------ - // Transmission capacities - // ------------------------------ - // each link - for (unsigned int linkIndex = 0; linkIndex < study.runtime->interconnectionsCount(); ++linkIndex) - { - AreaLink* link = study.runtime->areaLink[linkIndex]; - assert(year < link->timeseriesNumbers.height); - NUMERO_CHRONIQUES_TIREES_PAR_INTERCONNEXION& ptchro - = NumeroChroniquesTireesParInterconnexion[numSpace][linkIndex]; - const uint directWidth = link->directCapacities.width; - [[maybe_unused]] const uint indirectWidth = link->indirectCapacities.width; - assert(directWidth == indirectWidth); - ptchro.TransmissionCapacities - = (directWidth != 1) ? link->timeseriesNumbers[0][year] : 0; // zero-based - } -} diff --git a/src/solver/simulation/common-eco-adq.cpp b/src/solver/simulation/common-eco-adq.cpp index a3f2099ce9..29bcb34475 100644 --- a/src/solver/simulation/common-eco-adq.cpp +++ b/src/solver/simulation/common-eco-adq.cpp @@ -36,7 +36,6 @@ #include #include #include "simulation.h" -#include "../aleatoire/alea_fonctions.h" using namespace Yuni; diff --git a/src/solver/simulation/sim_allocation_tableaux.cpp b/src/solver/simulation/sim_allocation_tableaux.cpp index c9178da041..862d8c5898 100644 --- a/src/solver/simulation/sim_allocation_tableaux.cpp +++ b/src/solver/simulation/sim_allocation_tableaux.cpp @@ -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); } diff --git a/src/solver/simulation/sim_calcul_economique.cpp b/src/solver/simulation/sim_calcul_economique.cpp index a24e2c83e8..49241bf179 100644 --- a/src/solver/simulation/sim_calcul_economique.cpp +++ b/src/solver/simulation/sim_calcul_economique.cpp @@ -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); diff --git a/src/solver/simulation/sim_extern_variables_globales.h b/src/solver/simulation/sim_extern_variables_globales.h index 737626593f..0c79e71b1a 100644 --- a/src/solver/simulation/sim_extern_variables_globales.h +++ b/src/solver/simulation/sim_extern_variables_globales.h @@ -31,7 +31,6 @@ #include "sim_structure_probleme_economique.h" /* Valeurs generees de maniere aleatoire */ -extern std::vector> NumeroChroniquesTireesParInterconnexion; /* Resultats */ /*-Economique-*/ diff --git a/src/solver/simulation/sim_structure_donnees.h b/src/solver/simulation/sim_structure_donnees.h index 6b3431a735..35486dd592 100644 --- a/src/solver/simulation/sim_structure_donnees.h +++ b/src/solver/simulation/sim_structure_donnees.h @@ -27,23 +27,11 @@ #ifndef __SOLVER_SIMULATION_DATA_STRUCTS_H__ #define __SOLVER_SIMULATION_DATA_STRUCTS_H__ -#include - -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 diff --git a/src/solver/simulation/sim_variables_globales.cpp b/src/solver/simulation/sim_variables_globales.cpp index 78b6e6250c..7c20c0ad7f 100644 --- a/src/solver/simulation/sim_variables_globales.cpp +++ b/src/solver/simulation/sim_variables_globales.cpp @@ -28,6 +28,4 @@ #include "sim_structure_donnees.h" #include "sim_structure_probleme_economique.h" -std::vector> NumeroChroniquesTireesParInterconnexion; - std::vector> transitMoyenInterconnexionsRecalculQuadratique; diff --git a/src/solver/simulation/solver.hxx b/src/solver/simulation/solver.hxx index 9b9e268077..8a33ad50b5 100644 --- a/src/solver/simulation/solver.hxx +++ b/src/solver/simulation/solver.hxx @@ -34,7 +34,6 @@ #include #include "../variable/print.h" #include -#include "../aleatoire/alea_fonctions.h" #include "timeseries-numbers.h" #include "apply-scenario.h" #include @@ -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); diff --git a/src/solver/ts-generator/generator.hxx b/src/solver/ts-generator/generator.hxx index acf699e4b7..a143ff0d29 100644 --- a/src/solver/ts-generator/generator.hxx +++ b/src/solver/ts-generator/generator.hxx @@ -27,7 +27,6 @@ #ifndef __ANTARES_SOLVER_timeSeries_GENERATOR_HXX__ #define __ANTARES_SOLVER_timeSeries_GENERATOR_HXX__ -#include "../aleatoire/alea_fonctions.h" #include namespace Antares diff --git a/src/solver/ts-generator/hydro.cpp b/src/solver/ts-generator/hydro.cpp index c554de8852..526c71c0c8 100644 --- a/src/solver/ts-generator/hydro.cpp +++ b/src/solver/ts-generator/hydro.cpp @@ -27,7 +27,6 @@ #include #include "../simulation/sim_extern_variables_globales.h" -#include "../aleatoire/alea_fonctions.h" #include #include #include diff --git a/src/solver/ts-generator/thermal.cpp b/src/solver/ts-generator/thermal.cpp index 9196cfe489..dce0a5c4f5 100644 --- a/src/solver/ts-generator/thermal.cpp +++ b/src/solver/ts-generator/thermal.cpp @@ -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; diff --git a/src/solver/variable/economy/links/congestionProbability.h b/src/solver/variable/economy/links/congestionProbability.h index 6e81772f41..72f560d7b4 100644 --- a/src/solver/variable/economy/links/congestionProbability.h +++ b/src/solver/variable/economy/links/congestionProbability.h @@ -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) diff --git a/src/tests/end-to-end/binding_constraints/CMakeLists.txt b/src/tests/end-to-end/binding_constraints/CMakeLists.txt index c65327c73f..b01ed52509 100644 --- a/src/tests/end-to-end/binding_constraints/CMakeLists.txt +++ b/src/tests/end-to-end/binding_constraints/CMakeLists.txt @@ -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 diff --git a/src/tests/end-to-end/simple_study/CMakeLists.txt b/src/tests/end-to-end/simple_study/CMakeLists.txt index ac29766275..779588376b 100644 --- a/src/tests/end-to-end/simple_study/CMakeLists.txt +++ b/src/tests/end-to-end/simple_study/CMakeLists.txt @@ -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