Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
BendersPlugin.h
1#pragma once
2
3#include <memory>
4#include <string>
5
6#include "antares-xpansion/benders/benders_core/SubproblemConstraintsManager.h"
7#include "antares-xpansion/benders/benders_core/common.h"
8#include "antares-xpansion/multisolver_interface/SolverAbstract.h"
9
10/*
11 This interface will be implemented each time we need to add call backs.
12*/
14{
15public:
16 virtual ~BendersPlugin() = default;
17
18 /*
19 This method will be called on the start of the benders method
20 @inputs :
21 - subproblem_map : map of subproblem workers
22 - logger : benders logger
23 - options : study configurations
24 - solver_log_manager : solver log manager
25 */
26 virtual void OnBendersStart(const SubproblemsMapPtr& subproblem_map,
27 const Logger& logger,
28 const BendersBaseOptions& options,
29 const SolverLogManager& solver_log_manager)
30 = 0;
31
32 /*
33 This method will be called on the end of the benders method
34 @inputs :
35
36 */
37 virtual void OnBendersEnd() = 0;
38
39 virtual void OnBendersIterationStart() = 0;
40
41 virtual void OnBendersIterationEnd() = 0;
42
43 virtual void OnBendersSubResolutionStart() = 0;
44 virtual void OnBendersSubResolutionEnd(std::string sub_name, int num_micro_iter) = 0;
45 /*
46 This method will be called at the start of the master iteration after solving subprolems
47 @inputs :
48
49*/
50 virtual void OnBendersMasterResolutionStart() = 0;
51
52 /*
53 This method will be called at the end of the master iteration after solving the master
54 @inputs :
55 - master_out : solution of the master problem
56 - num_iter : master iteration number
57
58 */
59 virtual void OnBendersMasterResolutionEnd(std::map<std::string, double>& master_out,
60 int& num_iter)
61 = 0;
62
63 /*
64 This method will be called before solving a subproblem (for each subproblem)
65 */
66 virtual void OnBendersMicroIterationStart() = 0;
67
68 /*
69 This method will be called after solving a subproblem (for each subproblem)
70 @inputs :
71 - sub_name : subproblem name
72 - added_rows : if any rows we have to add to the subproblem worker
73 - solve_time : elapsed time to solve the subproblem
74 - num_master_iter : master iteration number
75 - num_micro_iter : micro iteration number within the current master iteration
76 */
77 virtual void OnBendersMicroIterationEnd(std::string sub_name,
78 bool& added_rows,
79 std::string solve_time,
80 int num_master_iter,
81 int num_micro_iter)
82 = 0;
83};
Definition BendersPlugin.h:14
Definition SolverAbstract.h:20
Definition common.h:207