diff --git a/src/libs/antares/checks/checkLoadedInputData.cpp b/src/libs/antares/checks/checkLoadedInputData.cpp index b62408b050..e7ae0d1238 100644 --- a/src/libs/antares/checks/checkLoadedInputData.cpp +++ b/src/libs/antares/checks/checkLoadedInputData.cpp @@ -29,9 +29,9 @@ namespace Antares::Check { -void checkOrtoolsUsage(Antares::Data::UnitCommitmentMode ucMode, - bool ortoolsUsed, - const std::string& solverName) +void checkSolverMILPincompatibility(Antares::Data::UnitCommitmentMode ucMode, + bool ortoolsUsed, + const std::string& solverName) { using namespace Antares::Data; if (ucMode == UnitCommitmentMode::ucMILP) diff --git a/src/libs/antares/checks/include/antares/checks/checkLoadedInputData.h b/src/libs/antares/checks/include/antares/checks/checkLoadedInputData.h index 62352390bc..6a82fb4986 100644 --- a/src/libs/antares/checks/include/antares/checks/checkLoadedInputData.h +++ b/src/libs/antares/checks/include/antares/checks/checkLoadedInputData.h @@ -24,9 +24,9 @@ namespace Antares::Check { -void checkOrtoolsUsage(Antares::Data::UnitCommitmentMode ucMode, - bool ortoolsUsed, - const std::string& solverName); +void checkSolverMILPincompatibility(Antares::Data::UnitCommitmentMode ucMode, + bool ortoolsUsed, + const std::string& solverName); void checkStudyVersion(const AnyString& optStudyFolder); diff --git a/src/libs/antares/exception/CMakeLists.txt b/src/libs/antares/exception/CMakeLists.txt index 691967b267..41bf90c93f 100644 --- a/src/libs/antares/exception/CMakeLists.txt +++ b/src/libs/antares/exception/CMakeLists.txt @@ -28,4 +28,4 @@ target_include_directories(${PROJ} install(DIRECTORY include/antares DESTINATION "include" -) \ No newline at end of file +) diff --git a/src/libs/antares/exception/LoadingError.cpp b/src/libs/antares/exception/LoadingError.cpp index 4a80591bef..cea447153e 100644 --- a/src/libs/antares/exception/LoadingError.cpp +++ b/src/libs/antares/exception/LoadingError.cpp @@ -81,19 +81,18 @@ InvalidSolver::InvalidSolver(const std::string& solver, const std::string& avail { } -static std::string InvalidSolverSpecificParametersHelper(const std::string& solver, - const std::string& specificParameters) +static std::string InvalidSolverParameterMessage(const std::string& solver, + const std::string& parameters) { std::ostringstream message; - message << "Specific parameters '" << specificParameters + message << "Specific parameters '" << parameters << "' are not valid or not supported for solver " << solver; return message.str(); } -InvalidSolverSpecificParameters::InvalidSolverSpecificParameters( - const std::string& solver, - const std::string& specificParameters): - LoadingError(InvalidSolverSpecificParametersHelper(solver, specificParameters)) +InvalidSolverSpecificParameters::InvalidSolverSpecificParameters(const std::string& solver, + const std::string& parameters): + LoadingError(InvalidSolverParameterMessage(solver, parameters)) { } diff --git a/src/solver/application/application.cpp b/src/solver/application/application.cpp index 335a6a2c98..6a51546304 100644 --- a/src/solver/application/application.cpp +++ b/src/solver/application/application.cpp @@ -277,9 +277,9 @@ void Application::startSimulation(Data::StudyLoadOptions& options) void Application::postParametersChecks() const { // Some more checks require the existence of pParameters, hence of a study. // Their execution is delayed up to this point. - checkOrtoolsUsage(pParameters->unitCommitment.ucMode, - pParameters->optOptions.ortoolsUsed, - pParameters->optOptions.ortoolsSolver); + checkSolverMILPincompatibility(pParameters->unitCommitment.ucMode, + pParameters->optOptions.ortoolsUsed, + pParameters->optOptions.ortoolsSolver); checkSimplexRangeHydroPricing(pParameters->simplexOptimizationRange, pParameters->hydroPricing.hpMode); diff --git a/src/solver/misc/options.cpp b/src/solver/misc/options.cpp index 960b0dda6c..dba4f2230a 100644 --- a/src/solver/misc/options.cpp +++ b/src/solver/misc/options.cpp @@ -272,7 +272,7 @@ void checkOrtoolsSolver(const Antares::Solver::Optimization::OptimizationOptions const std::list availableSolverList = getAvailableOrtoolsSolverName(); // Check if solver is available - bool found = (std::find(availableSolverList.begin(), availableSolverList.end(), solverName) + bool found = (std::ranges::find(availableSolverList, solverName) != availableSolverList.end()); if (!found) { diff --git a/src/tools/batchrun/main.cpp b/src/tools/batchrun/main.cpp index 9a31f4ecdf..420dc060dd 100644 --- a/src/tools/batchrun/main.cpp +++ b/src/tools/batchrun/main.cpp @@ -124,14 +124,7 @@ int main(int argc, const char* argv[]) if (not finder.list.empty()) { - if (finder.list.size() > 1) - { - logs.info() << "Found " << finder.list.size() << " studies"; - } - else - { - logs.info() << "Found 1 study"; - } + logs.info() << "Number of studies found : " << finder.list.size(); logs.info() << "Starting..."; // The folder that contains the solver