From 0bfd94c63e9bb81841261e3fbc5ef747c4232f1a Mon Sep 17 00:00:00 2001 From: Guillaume PIERRE Date: Wed, 11 Dec 2024 16:43:04 +0100 Subject: [PATCH] Clang formatting --- src/libs/antares/exception/LoadingError.cpp | 4 +- .../adq_patch_curtailment_sharing.cpp | 3 +- .../adequacy_patch_csr/solve_problem.h | 5 +- .../adequacy_patch_csr/hourly_csr_problem.h | 3 +- .../optimisation/post_process_commands.h | 4 +- .../opt_appel_solveur_lineaire.cpp | 2 +- .../antares/solver/variable/economy/all.h | 53 ++++++++++--------- .../antares/solver/variable/economy/loldCsr.h | 3 +- .../antares/solver/variable/economy/lolpCsr.h | 3 +- .../solver/variable/economy/max-mrg-csr.h | 3 +- .../solver/variable/economy/max-mrg-utils.h | 3 +- .../solver/variable/economy/overallCostCsr.h | 3 +- .../variable/economy/unsupliedEnergyCsr.h | 3 +- src/solver/variable/max-mrg-utils.cpp | 9 ++-- .../adequacy_patch/adequacy_patch.cpp | 1 - 15 files changed, 48 insertions(+), 54 deletions(-) diff --git a/src/libs/antares/exception/LoadingError.cpp b/src/libs/antares/exception/LoadingError.cpp index 08f5799fd7..32f4b3b1c1 100644 --- a/src/libs/antares/exception/LoadingError.cpp +++ b/src/libs/antares/exception/LoadingError.cpp @@ -96,8 +96,8 @@ InvalidSolverSpecificParameters::InvalidSolverSpecificParameters(const std::stri { } -InvalidStudy::InvalidStudy(const std::string& study) : - LoadingError(std::string("The folder `") + study + "` does not seem to be a valid study") +InvalidStudy::InvalidStudy(const std::string& study): + LoadingError(std::string("The folder `") + study + "` does not seem to be a valid study") { } diff --git a/src/solver/optimisation/adequacy_patch_csr/adq_patch_curtailment_sharing.cpp b/src/solver/optimisation/adequacy_patch_csr/adq_patch_curtailment_sharing.cpp index c5c2f2c124..731aaac79c 100644 --- a/src/solver/optimisation/adequacy_patch_csr/adq_patch_curtailment_sharing.cpp +++ b/src/solver/optimisation/adequacy_patch_csr/adq_patch_curtailment_sharing.cpp @@ -25,9 +25,10 @@ #include "antares/solver/optimisation/adequacy_patch_csr/count_constraints_variables.h" #include "antares/solver/optimisation/adequacy_patch_csr/csr_quadratic_problem.h" -#include "solve_problem.h" #include "antares/solver/simulation/adequacy_patch_runtime_data.h" +#include "solve_problem.h" + using namespace Yuni; namespace Antares::Data::AdequacyPatch diff --git a/src/solver/optimisation/adequacy_patch_csr/solve_problem.h b/src/solver/optimisation/adequacy_patch_csr/solve_problem.h index 772253ef3a..59b0619ca2 100644 --- a/src/solver/optimisation/adequacy_patch_csr/solve_problem.h +++ b/src/solver/optimisation/adequacy_patch_csr/solve_problem.h @@ -1,10 +1,9 @@ #pragma once -#include "antares/study/parameters/adq-patch-params.h" - -#include "antares/solver/optimisation/opt_structure_probleme_a_resoudre.h" #include "antares/solver/optimisation/adequacy_patch_csr/hourly_csr_problem.h" +#include "antares/solver/optimisation/opt_structure_probleme_a_resoudre.h" +#include "antares/study/parameters/adq-patch-params.h" using namespace Antares::Data::AdequacyPatch; diff --git a/src/solver/optimisation/include/antares/solver/optimisation/adequacy_patch_csr/hourly_csr_problem.h b/src/solver/optimisation/include/antares/solver/optimisation/adequacy_patch_csr/hourly_csr_problem.h index 25af5b1b2a..6ebb9734e4 100644 --- a/src/solver/optimisation/include/antares/solver/optimisation/adequacy_patch_csr/hourly_csr_problem.h +++ b/src/solver/optimisation/include/antares/solver/optimisation/adequacy_patch_csr/hourly_csr_problem.h @@ -87,7 +87,6 @@ class HourlyCSRProblem HourlyCSRProblem(const HourlyCSRProblem&) = delete; HourlyCSRProblem& operator=(const HourlyCSRProblem&) = delete; - inline void setHour(int hour) { triggeredHour = hour; @@ -124,6 +123,7 @@ class HourlyCSRProblem // Costs void setQuadraticCost(); void setLinearCost(); + public: // TODO [gp] : try to make these members private double belowThisThresholdSetToZero; @@ -145,7 +145,6 @@ class HourlyCSRProblem std::map rhsAreaBalanceValues; - // links between two areas inside the adq-patch domain std::map linkInsideAdqPatch; }; diff --git a/src/solver/optimisation/include/antares/solver/optimisation/post_process_commands.h b/src/solver/optimisation/include/antares/solver/optimisation/post_process_commands.h index 04c464fb39..b7e125ad03 100644 --- a/src/solver/optimisation/include/antares/solver/optimisation/post_process_commands.h +++ b/src/solver/optimisation/include/antares/solver/optimisation/post_process_commands.h @@ -85,9 +85,7 @@ class UpdateMrgPriceAfterCSRcmd: public basePostProcessCommand class DTGnettingAfterCSRcmd: public basePostProcessCommand { public: - DTGnettingAfterCSRcmd(PROBLEME_HEBDO* problemeHebdo, - AreaList& areas, - unsigned int numSpace); + DTGnettingAfterCSRcmd(PROBLEME_HEBDO* problemeHebdo, AreaList& areas, unsigned int numSpace); void execute(const optRuntimeData&) override; private: diff --git a/src/solver/optimisation/opt_appel_solveur_lineaire.cpp b/src/solver/optimisation/opt_appel_solveur_lineaire.cpp index 78853c5e4c..304aab13df 100644 --- a/src/solver/optimisation/opt_appel_solveur_lineaire.cpp +++ b/src/solver/optimisation/opt_appel_solveur_lineaire.cpp @@ -218,7 +218,7 @@ static SimplexResult OPT_TryToCallSimplex(const OptimizationOptions& options, solver = ORTOOLS_Simplexe(&Probleme, solver, keepBasis, options); if (solver != nullptr) { - ProblemeAResoudre->ProblemesSpx[NumIntervalle] = (void*)solver; + ProblemeAResoudre->ProblemesSpx[NumIntervalle] = (void*)solver; } measure.tick(); diff --git a/src/solver/variable/include/antares/solver/variable/economy/all.h b/src/solver/variable/include/antares/solver/variable/economy/all.h index 1a4c046e6d..17207c22db 100644 --- a/src/solver/variable/include/antares/solver/variable/economy/all.h +++ b/src/solver/variable/include/antares/solver/variable/economy/all.h @@ -63,11 +63,11 @@ #include "pumping.h" #include "renewableGeneration.h" #include "reservoirlevel.h" +#include "spilledEnergy.h" #include "thermalAirPollutantEmissions.h" #include "unsupliedEnergy.h" #include "unsupliedEnergyCsr.h" #include "waterValue.h" -#include "spilledEnergy.h" // By thermal plant #include "nbOfDispatchedUnitsByPlant.h" @@ -125,31 +125,32 @@ typedef // Prices >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> VariablesPerArea; /*! diff --git a/src/solver/variable/include/antares/solver/variable/economy/loldCsr.h b/src/solver/variable/include/antares/solver/variable/economy/loldCsr.h index d7a057787b..299e83b94f 100644 --- a/src/solver/variable/include/antares/solver/variable/economy/loldCsr.h +++ b/src/solver/variable/include/antares/solver/variable/economy/loldCsr.h @@ -59,8 +59,7 @@ struct VCardLOLD_CSR >>>>> ResultsType; - static constexpr uint8_t categoryDataLevel - = Category::DataLevel::area; + static constexpr uint8_t categoryDataLevel = Category::DataLevel::area; //! File level (provided by the type of the results) static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile & (Category::FileLevel::id diff --git a/src/solver/variable/include/antares/solver/variable/economy/lolpCsr.h b/src/solver/variable/include/antares/solver/variable/economy/lolpCsr.h index 29c113c120..45d9ed61ac 100644 --- a/src/solver/variable/include/antares/solver/variable/economy/lolpCsr.h +++ b/src/solver/variable/include/antares/solver/variable/economy/lolpCsr.h @@ -58,8 +58,7 @@ struct VCardLOLP_CSR //! The VCard to look for for calculating spatial aggregates typedef VCardLOLP_CSR VCardForSpatialAggregate; - static constexpr uint8_t categoryDataLevel - = Category::DataLevel::area; + static constexpr uint8_t categoryDataLevel = Category::DataLevel::area; //! File level (provided by the type of the results) static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile & (Category::FileLevel::id diff --git a/src/solver/variable/include/antares/solver/variable/economy/max-mrg-csr.h b/src/solver/variable/include/antares/solver/variable/economy/max-mrg-csr.h index 191aa265ed..2ff8edc89d 100644 --- a/src/solver/variable/include/antares/solver/variable/economy/max-mrg-csr.h +++ b/src/solver/variable/include/antares/solver/variable/economy/max-mrg-csr.h @@ -62,8 +62,7 @@ struct VCardMAX_MRG_CSR //! The VCard to look for for calculating spatial aggregates typedef VCardMAX_MRG_CSR VCardForSpatialAggregate; - static constexpr uint8_t categoryDataLevel - = Category::DataLevel::area; + static constexpr uint8_t categoryDataLevel = Category::DataLevel::area; //! File level (provided by the type of the results) static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile & (Category::FileLevel::id diff --git a/src/solver/variable/include/antares/solver/variable/economy/max-mrg-utils.h b/src/solver/variable/include/antares/solver/variable/economy/max-mrg-utils.h index 2386836074..2a5de71b74 100644 --- a/src/solver/variable/include/antares/solver/variable/economy/max-mrg-utils.h +++ b/src/solver/variable/include/antares/solver/variable/economy/max-mrg-utils.h @@ -1,8 +1,9 @@ #pragma once -#include "../state.h" #include +#include "../state.h" + namespace Antares::Solver::Variable::Economy { diff --git a/src/solver/variable/include/antares/solver/variable/economy/overallCostCsr.h b/src/solver/variable/include/antares/solver/variable/economy/overallCostCsr.h index 6888175ff6..63739b686b 100644 --- a/src/solver/variable/include/antares/solver/variable/economy/overallCostCsr.h +++ b/src/solver/variable/include/antares/solver/variable/economy/overallCostCsr.h @@ -60,8 +60,7 @@ struct VCardOverallCostCsr //! The VCard to look for for calculating spatial aggregates typedef VCardOverallCostCsr VCardForSpatialAggregate; - static constexpr uint8_t categoryDataLevel - = Category::DataLevel::area; + static constexpr uint8_t categoryDataLevel = Category::DataLevel::area; //! File level (provided by the type of the results) static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile & (Category::FileLevel::id diff --git a/src/solver/variable/include/antares/solver/variable/economy/unsupliedEnergyCsr.h b/src/solver/variable/include/antares/solver/variable/economy/unsupliedEnergyCsr.h index 64163b7746..a83ccb2e03 100644 --- a/src/solver/variable/include/antares/solver/variable/economy/unsupliedEnergyCsr.h +++ b/src/solver/variable/include/antares/solver/variable/economy/unsupliedEnergyCsr.h @@ -60,8 +60,7 @@ struct VCardUnsupliedEnergyCSR //! The VCard to look for for calculating spatial aggregates typedef VCardUnsupliedEnergyCSR VCardForSpatialAggregate; - static constexpr uint8_t categoryDataLevel - = Category::DataLevel::area; + static constexpr uint8_t categoryDataLevel = Category::DataLevel::area; //! File level (provided by the type of the results) static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile & (Category::FileLevel::id diff --git a/src/solver/variable/max-mrg-utils.cpp b/src/solver/variable/max-mrg-utils.cpp index 5b43f99cea..bfa93c1567 100644 --- a/src/solver/variable/max-mrg-utils.cpp +++ b/src/solver/variable/max-mrg-utils.cpp @@ -135,10 +135,11 @@ void computeMaxMRG(double* maxMrgOut, const MaxMRGinput& in) assert(h < HOURS_PER_YEAR && "calendar overflow"); if (niveau > OI[h]) { - maxMrgOut[h] = Math::Min( - niveau, - OI[h] + in.maxHourlyGenPower->getCoefficient(in.year, h + in.hourInYear) - - in.hydroGeneration[h]); + maxMrgOut[h] = Math::Min(niveau, + OI[h] + + in.maxHourlyGenPower->getCoefficient(in.year, + h + in.hourInYear) + - in.hydroGeneration[h]); SM += maxMrgOut[h] - OI[h]; } else diff --git a/src/tests/src/solver/optimisation/adequacy_patch/adequacy_patch.cpp b/src/tests/src/solver/optimisation/adequacy_patch/adequacy_patch.cpp index ea22f4a2ec..9f716ecb77 100644 --- a/src/tests/src/solver/optimisation/adequacy_patch/adequacy_patch.cpp +++ b/src/tests/src/solver/optimisation/adequacy_patch/adequacy_patch.cpp @@ -401,4 +401,3 @@ BOOST_AUTO_TEST_CASE(check_adq_param_wrong_hurdle_cost) auto p = createParams(); BOOST_CHECK_THROW(p.checkAdqPatchIncludeHurdleCost(false), Error::IncompatibleHurdleCostCSR); } -