Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Nov 21, 2024
1 parent 8b301ba commit 099bc57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/cpp/benders/factories/BendersFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ BENDERSMETHOD DeduceBendersMethod(size_t coupling_map_size, size_t batch_size,
}
}

void BendersMainFactory::PrepareForExecution(bool external_loop) {
void BendersMainFactory::PrepareForExecution(bool outer_loop) {
BendersBaseOptions benders_options(options_.get_benders_options());
benders_options.EXTERNAL_LOOP_OPTIONS.DO_OUTER_LOOP = external_loop;
benders_options.EXTERNAL_LOOP_OPTIONS.DO_OUTER_LOOP = outer_loop;

SetupLoggerAndOutputWriter(benders_options);

const auto coupling_map = CouplingMapGenerator::BuildInput(
benders_options.STRUCTURE_FILE,
std::make_shared<BendersLoggerBase>(benders_loggers_), "Benders");

method_ = DeduceBendersMethod(coupling_map.size(), options_.BATCH_SIZE,
external_loop);
method_ =
DeduceBendersMethod(coupling_map.size(), options_.BATCH_SIZE, outer_loop);
context_ = bendersmethod_to_string(method_);

criterion_input_holder_ = ProcessCriterionInput();
Expand Down Expand Up @@ -262,7 +262,6 @@ int BendersMainFactory::RunExternalLoop() {
try {
PrepareForExecution(true);
double tau = 0.5;

const auto& outer_loop_inputs =
std::get<Benders::Criterion::OuterLoopCriterionInputData>(
criterion_input_holder_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ class BendersMainFactory {
[[nodiscard]] int RunBenders();
[[nodiscard]] std::shared_ptr<MathLoggerDriver> BuildMathLogger(
bool benders_log_console) const;
void PrepareForExecution(bool external_loop);
void PrepareForExecution(bool outer_loop);
[[nodiscard]] std::variant<Benders::Criterion::CriterionInputData,
Benders::Criterion::OuterLoopCriterionInputData>
ProcessCriterionInput();

Benders::Criterion::CriterionInputData BuildPatternsUsingAreaFile();
std::set<std::string> ReadAreaFile();
void StartMessage();
void EndMessage(const double execution_time);
void AddCriterionOutputs();
bool isCriterionListEmpty() const;
Expand All @@ -57,6 +58,5 @@ class BendersMainFactory {
const SOLVER& solver);
int Run();
std::filesystem::path LogReportsName() const;
void StartMessage();
};
#endif // ANTARES_XPANSION_SRC_CPP_BENDERS_FACTORIES_INCLUDE_BENDERSFACTORY_H

0 comments on commit 099bc57

Please sign in to comment.