Skip to content

Commit

Permalink
remove number_of_scenarios (#866)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir authored Jul 8, 2024
1 parent e866666 commit bc5360c
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 14 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
# build
_build
_install
include/google
vcpkg_installed

# Cmake generated files
CMakeCache.txt
Expand Down
2 changes: 0 additions & 2 deletions src/cpp/benders/benders_core/BendersBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1032,8 +1032,6 @@ std::vector<double> BendersBase::ComputeOuterLoopCriterion(
auto subproblem_weight = SubproblemWeight(_data.nsubproblem, subproblem_name);
double criterion_count_threshold =
outer_loop_input_data_.CriterionCountThreshold();
auto number_of_scenarios =
_options.EXTERNAL_LOOP_OPTIONS.OUTER_LOOP_NUMBER_OF_SCENARIOS;

for (int pattern_index(0); pattern_index < outer_loop_input_size;
++pattern_index) {
Expand Down
3 changes: 1 addition & 2 deletions src/cpp/benders/benders_core/SimulationOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,5 @@ SimulationOptions::InvalidOptionFileException::InvalidOptionFileException(


ExternalLoopOptions SimulationOptions::GetExternalLoopOptions() const {
return {DO_OUTER_LOOP, OUTER_LOOP_OPTION_FILE,
OUTER_LOOP_NUMBER_OF_SCENARIOS};
return {DO_OUTER_LOOP, OUTER_LOOP_OPTION_FILE};
}
2 changes: 0 additions & 2 deletions src/cpp/benders/benders_core/include/SimulationOptions.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,3 @@ BENDERS_OPTIONS_MACRO(DO_OUTER_LOOP, bool, false, asBool())
BENDERS_OPTIONS_MACRO(OUTER_LOOP_OPTION_FILE, std::string,
"outer_loop_options.json", asString())

// Outer Loop number of scenarios (mc years)
BENDERS_OPTIONS_MACRO(OUTER_LOOP_NUMBER_OF_SCENARIOS, unsigned int, 1, asUInt())
1 change: 0 additions & 1 deletion src/cpp/benders/benders_core/include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ typedef BaseOptions MergeMPSOptions;
struct ExternalLoopOptions {
bool DO_OUTER_LOOP = false;
std::string OUTER_LOOP_OPTION_FILE;
unsigned int OUTER_LOOP_NUMBER_OF_SCENARIOS = 1;
};

struct BendersBaseOptions : public BaseOptions {
Expand Down
5 changes: 3 additions & 2 deletions src/python/antares_xpansion/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,9 @@ def _set_options_for_benders_solver(self):
options_values[OptimisationKeys.last_master_basis_key()] = self._config.LAST_MASTER_BASIS
options_values[OptimisationKeys.batch_size_key()] = self.get_batch_size()
options_values[OptimisationKeys.do_outer_loop_key()] = self._config.method == "outer_loop"
options_values[OptimisationKeys.outer_loop_option_file_key()] = self.outer_loop_options_path()
options_values[OptimisationKeys.outer_loop_number_of_scenarios_key()] = len(self.active_years)
options_values[OptimisationKeys.outer_loop_option_file_key()] = (
self.outer_loop_options_path()
)
# generate options file for the solver
with open(self.options_file_path(), "w") as options_file:
json.dump(options_values, options_file, indent=4)
Expand Down
3 changes: 0 additions & 3 deletions src/python/antares_xpansion/optimisation_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,3 @@ def do_outer_loop_key():
def outer_loop_option_file_key():
return "OUTER_LOOP_OPTION_FILE"

@staticmethod
def outer_loop_number_of_scenarios_key():
return "OUTER_LOOP_NUMBER_OF_SCENARIOS"

0 comments on commit bc5360c

Please sign in to comment.