From 0c15d140d205c4ede412e70ad91025a571f24663 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Tue, 24 Oct 2023 16:29:04 +0200 Subject: [PATCH 1/6] [DEV] Use tsnumbers in variable/links --- src/solver/variable/economy/links/congestionProbability.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/solver/variable/economy/links/congestionProbability.h b/src/solver/variable/economy/links/congestionProbability.h index 6e81772f41..aa761eab0a 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) From 7f92440d83cb2145ef60113db2aa665490a6974b Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Tue, 24 Oct 2023 16:40:54 +0200 Subject: [PATCH 2/6] [DEV] Use tsnumbers in sim_calcul, fix condition --- src/solver/simulation/sim_calcul_economique.cpp | 3 ++- src/solver/variable/economy/links/congestionProbability.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/solver/simulation/sim_calcul_economique.cpp b/src/solver/simulation/sim_calcul_economique.cpp index c9a64ab22d..92aa4b17dc 100644 --- a/src/solver/simulation/sim_calcul_economique.cpp +++ b/src/solver/simulation/sim_calcul_economique.cpp @@ -553,7 +553,8 @@ void SIM_RenseignementProblemeHebdo(const Study& study, for (uint k = 0; k != linkCount; ++k) { auto& lnk = *(studyruntime.areaLink[k]); - const int tsIndex + const int tsIndex = (link.directCapacities.width != 1) ? lnk.timeseriesNumbers[0][year] : 0; + = NumeroChroniquesTireesParInterconnexion[numSpace][k].TransmissionCapacities; assert((uint)hourInYear < lnk.directCapacities.height); diff --git a/src/solver/variable/economy/links/congestionProbability.h b/src/solver/variable/economy/links/congestionProbability.h index aa761eab0a..72f560d7b4 100644 --- a/src/solver/variable/economy/links/congestionProbability.h +++ b/src/solver/variable/economy/links/congestionProbability.h @@ -278,7 +278,7 @@ class CongestionProbability assert(state.link != NULL); const auto& linkDirectCapa = state.link->directCapacities; const auto& linkIndirectCapa = state.link->indirectCapacities; - const int tsIndex = (linkDirectCapa.width == 1) ? state.link->timeseriesNumbers[0][state.year] : 0; + 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) From f14012df5d236f95b78a8b95e9df7fe550c76950 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Tue, 24 Oct 2023 16:43:27 +0200 Subject: [PATCH 3/6] [DEV] Remove useless struct, fix compile --- src/solver/simulation/sim_calcul_economique.cpp | 4 +--- src/solver/simulation/sim_structure_donnees.h | 5 ----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/solver/simulation/sim_calcul_economique.cpp b/src/solver/simulation/sim_calcul_economique.cpp index 92aa4b17dc..858a051842 100644 --- a/src/solver/simulation/sim_calcul_economique.cpp +++ b/src/solver/simulation/sim_calcul_economique.cpp @@ -553,9 +553,7 @@ void SIM_RenseignementProblemeHebdo(const Study& study, for (uint k = 0; k != linkCount; ++k) { auto& lnk = *(studyruntime.areaLink[k]); - const int tsIndex = (link.directCapacities.width != 1) ? lnk.timeseriesNumbers[0][year] : 0; - - = 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_structure_donnees.h b/src/solver/simulation/sim_structure_donnees.h index 6b3431a735..9f31a0047e 100644 --- a/src/solver/simulation/sim_structure_donnees.h +++ b/src/solver/simulation/sim_structure_donnees.h @@ -39,11 +39,6 @@ typedef struct double* Horaire; } PRODUCTION_THERMIQUE; -typedef struct -{ - double* ParLigne; -} MATRICE_2D; - /* Old define */ #define DEFINITION_STRUCTURES_DONNEES From 983730c29abd5f50bf09da5b8adaeea2202b6a09 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Tue, 24 Oct 2023 16:49:49 +0200 Subject: [PATCH 4/6] [DEV] Remove var NumeroChroniquesTireesParInterconnexion --- .../alea_tirage_au_sort_chroniques.cpp | 17 +---------------- .../simulation/sim_allocation_tableaux.cpp | 6 ------ .../simulation/sim_extern_variables_globales.h | 1 - .../simulation/sim_variables_globales.cpp | 2 -- 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp b/src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp index 3739933de0..4560214ee4 100644 --- a/src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp +++ b/src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp @@ -37,22 +37,7 @@ 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 - } + // ------------------------------ //Binding constraints diff --git a/src/solver/simulation/sim_allocation_tableaux.cpp b/src/solver/simulation/sim_allocation_tableaux.cpp index 3967b0fbd5..df76986eee 100644 --- a/src/solver/simulation/sim_allocation_tableaux.cpp +++ b/src/solver/simulation/sim_allocation_tableaux.cpp @@ -44,12 +44,6 @@ 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); - NumeroChroniquesTireesParGroup.resize(study.maxNbYearsInParallel); AllocateResultsForEconomicMode(study); } diff --git a/src/solver/simulation/sim_extern_variables_globales.h b/src/solver/simulation/sim_extern_variables_globales.h index 421e8db76e..b8bad8d49d 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; extern std::vector> NumeroChroniquesTireesParGroup; /* Resultats */ diff --git a/src/solver/simulation/sim_variables_globales.cpp b/src/solver/simulation/sim_variables_globales.cpp index e5fe936dc6..18327ee96a 100644 --- a/src/solver/simulation/sim_variables_globales.cpp +++ b/src/solver/simulation/sim_variables_globales.cpp @@ -28,8 +28,6 @@ #include "sim_structure_donnees.h" #include "sim_structure_probleme_economique.h" -std::vector> NumeroChroniquesTireesParInterconnexion; - std::vector> transitMoyenInterconnexionsRecalculQuadratique; std::vector> NumeroChroniquesTireesParGroup; //Vector size = num_parallel_year From bbcdd905ce9b7c34d3d70a9a8f3423af3ca35ed2 Mon Sep 17 00:00:00 2001 From: Sylvain Leclerc Date: Wed, 25 Oct 2023 10:26:55 +0200 Subject: [PATCH 5/6] Remove obsolete struct Signed-off-by: Sylvain Leclerc --- src/solver/simulation/sim_structure_donnees.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/solver/simulation/sim_structure_donnees.h b/src/solver/simulation/sim_structure_donnees.h index 9f31a0047e..35486dd592 100644 --- a/src/solver/simulation/sim_structure_donnees.h +++ b/src/solver/simulation/sim_structure_donnees.h @@ -27,13 +27,6 @@ #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; From 1887bc1a09f657552460ce6fd82fcde7209ddf39 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Wed, 25 Oct 2023 10:49:23 +0200 Subject: [PATCH 6/6] [DEV] Remove dir src/solver/aleatoire --- src/solver/CMakeLists.txt | 2 - src/solver/aleatoire/CMakeLists.txt | 17 -------- src/solver/aleatoire/alea_fonctions.h | 34 --------------- src/solver/aleatoire/alea_sys.h | 40 ------------------ .../alea_tirage_au_sort_chroniques.cpp | 41 ------------------- src/solver/simulation/common-eco-adq.cpp | 1 - src/solver/simulation/solver.hxx | 4 +- src/solver/ts-generator/generator.hxx | 1 - src/solver/ts-generator/hydro.cpp | 1 - src/solver/ts-generator/thermal.cpp | 1 - .../binding_constraints/CMakeLists.txt | 1 - .../end-to-end/simple_study/CMakeLists.txt | 1 - 12 files changed, 1 insertion(+), 143 deletions(-) delete mode 100644 src/solver/aleatoire/CMakeLists.txt delete mode 100644 src/solver/aleatoire/alea_fonctions.h delete mode 100644 src/solver/aleatoire/alea_sys.h delete mode 100644 src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp 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 eabf5512e9..0000000000 --- a/src/solver/aleatoire/alea_tirage_au_sort_chroniques.cpp +++ /dev/null @@ -1,41 +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) -{ - -} 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/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/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