-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8.8 solver parameters [ANT-2280] (#2466)
This pull request introduces several significant changes to the Antares project, focusing on adding support for solver-specific parameters and restructuring the optimization options. The key changes include the creation of a new `optimization-options` module, refactoring of existing code to use this module, and enhancements to error handling related to solver parameters. ### New Module Addition: * Added a new `optimization-options` module to encapsulate all options related to optimization (`src/libs/antares/optimization-options/*`). [[1]](diffhunk://#diff-ee6e20916ee5ef993486966e3faae50cf9f576a4a95b4509862b938ca2e6c727R1-R10) [[2]](diffhunk://#diff-84ba1e006bb46acefe8a9cb151fdba2b9d88f78f95df8968720cd3c6c5a3b8b7R1-R37) ### Code Refactoring: * Refactored `StudyLoadOptions` and `Parameters` classes to use the new `OptimizationOptions` structure for managing solver-related options (`src/libs/antares/study/load-options.h`, `src/libs/antares/study/load-options.cpp`, `src/libs/antares/study/parameters.h`, `src/libs/antares/study/parameters.cpp`). [[1]](diffhunk://#diff-62b049183af469564bc00c9d29667b0852c87a3276df305c2c654d127aaedc46L74-L75) [[2]](diffhunk://#diff-62b049183af469564bc00c9d29667b0852c87a3276df305c2c654d127aaedc46L91-R93) [[3]](diffhunk://#diff-b9d1a34fd795c63bd57de61deda1730a26298ee0145cebecbf3922fcfb764fa3R1075-R1085) [[4]](diffhunk://#diff-b9d1a34fd795c63bd57de61deda1730a26298ee0145cebecbf3922fcfb764fa3L1460-R1470) ### Error Handling Enhancements: * Introduced a new `InvalidSolverSpecificParameters` exception to handle invalid solver-specific parameters (`src/libs/antares/exception/LoadingError.hpp`, `src/libs/antares/exception/LoadingError.cpp`). [[1]](diffhunk://#diff-096cb984780cf8e90c60d8548064f714791bb090d76e26cc7403ff698ad36f20R138-R147) [[2]](diffhunk://#diff-6e38f1694c7d675e3f9163ec7fcee449f43692023903446c96877e36c0d4a434L60-R82) ### Documentation Updates: * Updated the command line reference guide to include the new `--solver-parameters` option (`docs/reference-guide/10-command_line.md`). ### Miscellaneous: * Moved the `add_subdirectory(writer)` command in `CMakeLists.txt` to ensure proper build order (`src/libs/antares/CMakeLists.txt`). [[1]](diffhunk://#diff-9e299f60c14464c86511d6c9a4e7c081765abb4840b57ea4dc25238311006ce9L5) [[2]](diffhunk://#diff-9e299f60c14464c86511d6c9a4e7c081765abb4840b57ea4dc25238311006ce9R21-R23) --------- Co-authored-by: Florian Omnès <[email protected]>
- Loading branch information
Showing
35 changed files
with
324 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set(PROJ optimization-options) | ||
|
||
add_library(${PROJ} INTERFACE) | ||
|
||
target_include_directories(${PROJ} | ||
INTERFACE | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
) | ||
|
||
add_library(Antares::${PROJ} ALIAS ${PROJ}) |
37 changes: 37 additions & 0 deletions
37
src/libs/antares/optimization-options/include/antares/optimization-options/options.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
** Copyright 2007-2024, RTE (https://www.rte-france.com) | ||
** See AUTHORS.txt | ||
** SPDX-License-Identifier: MPL-2.0 | ||
** This file is part of Antares-Simulator, | ||
** Adequacy and Performance assessment for interconnected energy networks. | ||
** | ||
** Antares_Simulator is free software: you can redistribute it and/or modify | ||
** it under the terms of the Mozilla Public Licence 2.0 as published by | ||
** the Mozilla Foundation, either version 2 of the License, or | ||
** (at your option) any later version. | ||
** | ||
** 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 | ||
** Mozilla Public Licence 2.0 for more details. | ||
** | ||
** You should have received a copy of the Mozilla Public Licence 2.0 | ||
** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>. | ||
*/ | ||
|
||
#pragma once | ||
#include <antares/logs/logs.h> | ||
|
||
namespace Antares::Solver::Optimization | ||
{ | ||
|
||
struct OptimizationOptions | ||
{ | ||
//! Force ortools use | ||
bool ortoolsUsed = false; | ||
//! The solver name, sirius is the default | ||
std::string ortoolsSolver = "sirius"; | ||
bool solverLogs = false; | ||
std::string solverParameters; | ||
}; | ||
} // namespace Antares::Solver::Optimization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.