@@ -68,55 +68,16 @@ This architecture enables **8 different combinations** while maintaining clean s
6868
6969### Key Abstractions
7070
71- #### IBendersCore Interface
72- The main interface for Benders engine operations:
73- ``` cpp
74- class IBendersCore {
75- public:
76- virtual void launch() = 0;
77- virtual void InitializeProblems() = 0;
78- virtual void set_input_map(const CouplingMap&) = 0;
79- virtual int MasterRowIndex(const std::string&) const = 0;
80- virtual LogData GetBestIterationData() const = 0;
81- virtual WorkerMasterDataVect AllCuts() const = 0;
82- // ... other methods
83- };
84- ```
71+ #### Key Strategy Interfaces
8572
86- #### Strategy Interfaces
87-
88- **IExecutionStrategy**: Controls how subproblems are solved
89- ```cpp
90- class IExecutionStrategy {
91- public:
92- virtual void Run() = 0;
93- virtual void InitializeProblems() = 0;
94- virtual void set_input_map(const CouplingMap&) = 0;
95- virtual std::string BendersName() const = 0;
96- // ... other methods
97- };
98- ```
73+ Three focused interfaces separate concerns:
9974
100- ** IBatchingStrategy** : Controls problem batching
101- ``` cpp
102- class IBatchingStrategy {
103- public:
104- virtual void InitializeProblems() = 0;
105- virtual void UpdateStoppingCriterion() = 0;
106- virtual bool ShouldRelaxationStop() const = 0;
107- };
108- ```
75+ - ** IBendersCore** : Main interface for Benders engine operations
76+ - ** IExecutionStrategy** : Controls how subproblems are solved (Sequential vs. MPI)
77+ - ** IBatchingStrategy** : Controls problem batching
78+ - ** IOuterLoopStrategy** : Controls outer-loop optimization
10979
110- **IOuterLoopStrategy**: Controls outer-loop optimization
111- ```cpp
112- class IOuterLoopStrategy {
113- public:
114- virtual void Run(IBendersCore*) = 0;
115- virtual void init_data() = 0;
116- virtual bool UpdateMaster(WorkerMasterDataVect&) = 0;
117- // ... other methods
118- };
119- ```
80+ For detailed interface signatures and methods, see [ API Reference] ( ../../api/benders-strategy-api.md )
12081
12182## Component Details
12283
@@ -130,135 +91,43 @@ public:
13091- Delegates operations to appropriate strategy
13192- Coordinates execution flow
13293
133- ** Location** : ` src/cpp/benders/strategy/include/antares-xpansion/benders/strategy/BendersCore.h `
134-
135- ** Example** :
136- ``` cpp
137- class BendersCore : public IBendersCore {
138- public:
139- BendersCore(
140- std::unique_ptr<IExecutionStrategy > exec,
141- std::unique_ptr<IBatchingStrategy > batch,
142- std::unique_ptr<IOuterLoopStrategy > outer
143- );
144-
145- void launch() override;
146- // ... other IBendersCore methods
147-
148- private:
149- std::unique_ptr<IExecutionStrategy > execution_ ;
150- std::unique_ptr<IBatchingStrategy > batching_ ;
151- std::unique_ptr<IOuterLoopStrategy > outer_loop_ ;
152- };
153- ```
94+ For implementation details and code examples, see [ API Reference - BendersCore] ( ../../api/benders-strategy-api.md#orchestrator )
15495
15596### Execution Strategies
15697
157- #### SequentialExecutionStrategy
158- **Wraps**: BendersSequential
159- **Use Case**: Single-process execution
160- **Selection**: Automatic when `world->size() == 1`
161- **Location**: `src/cpp/benders/strategy/include/.../SequentialExecutionStrategy.h`
98+ - ** SequentialExecutionStrategy** : Single-process execution
99+ - ** ParallelMpiExecutionStrategy** : Multi-process MPI execution
162100
163- #### ParallelMpiExecutionStrategy
164- **Wraps**: BendersMPI
165- **Use Case**: Multi-process MPI execution
166- **Selection**: Automatic when `world->size() > 1`
167- **Location**: `src/cpp/benders/strategy/include/.../ParallelMpiExecutionStrategy.h`
101+ Automatically selected based on ` world->size() ` . Details in [ API Reference] ( ../../api/benders-strategy-api.md#concrete-strategies )
168102
169103### Batching Strategies
170104
171- #### NoBatchingStrategy
172- **Behavior**: Passthrough (no batching logic)
173- **Use Case**: Process all subproblems together
174- **Selection**: When BENDERSMETHOD doesn't include "BY_BATCH"
175- **Location**: `src/cpp/benders/strategy/include/.../NoBatchingStrategy.h`
105+ - ** NoBatchingStrategy** : Process all subproblems together
106+ - ** ByBatchStrategy** : Process subproblems in batches
176107
177- #### ByBatchStrategy
178- **Wraps**: BendersByBatch
179- **Use Case**: Process subproblems in batches
180- **Selection**: When BENDERSMETHOD includes "BY_BATCH"
181- **Location**: `src/cpp/benders/strategy/include/.../ByBatchStrategy.h`
108+ Selected based on BENDERSMETHOD enum. See [ Developer Guide] ( ../../developer-guide/benders-strategy-guide.md ) for usage.
182109
183110### Outer-Loop Strategies
184111
185- #### NoOuterLoopStrategy
186- **Behavior**: Passthrough (no outer-loop optimization)
187- **Use Case**: Standard Benders without outer loop
188- **Selection**: When BENDERSMETHOD doesn't include "OUTERLOOP"
189- **Location**: `src/cpp/benders/strategy/include/.../NoOuterLoopStrategy.h`
112+ - ** NoOuterLoopStrategy** : Standard Benders without outer loop
113+ - ** OuterLoopAdapter** : Benders with outer-loop optimization
190114
191- #### OuterLoopAdapter
192- **Wraps**: Outerloop::OuterLoop
193- **Use Case**: Benders with outer-loop optimization
194- **Selection**: When BENDERSMETHOD includes "OUTERLOOP"
195- **Location**: `src/cpp/benders/strategy/include/.../OuterLoopAdapter.h`
115+ Selected based on BENDERSMETHOD enum. See [ API Reference] ( ../../api/benders-strategy-api.md ) for details.
196116
197117## Execution Flow
198118
199- ### Initialization Flow
119+ ### Overview
200120
201- ```
202- BendersFactory::PrepareForExecution()
203- │
204- ├─→ Determine BENDERSMETHOD (from options)
205- │
206- ├─→ ConfigureBenders()
207- │ │
208- │ ├─→ Create ExecutionStrategy
209- │ │ └─→ world->size() == 1 ? Sequential : MPI
210- │ │
211- │ ├─→ Create BatchingStrategy
212- │ │ └─→ method has BY_BATCH ? ByBatch : NoBatch
213- │ │
214- │ ├─→ Create OuterLoopStrategy
215- │ │ └─→ method has OUTERLOOP ? OuterLoop : None
216- │ │
217- │ └─→ Create BendersCore(exec, batch, outer)
218- │
219- └─→ Return BendersEnvironment { benders: IBendersCore* }
220- ```
221-
222- ### Runtime Execution Flow
223-
224- ```
225- client->launch() // Called on IBendersCore
226- │
227- ▼
228- BendersCore::launch()
229- │
230- ├─→ 1. outer_loop_ ->init_data()
231- │
232- ├─→ 2. batching_ ->InitializeProblems()
233- │
234- ├─→ 3. execution_ ->InitializeProblems()
235- │
236- ├─→ 4. if (outer_loop_ != nullptr)
237- │ │ outer_loop_ ->Run(this) // Outer loop controls execution
238- │ │
239- │ └─→ else
240- │ execution_ ->Run() // Direct execution
241- │
242- └─→ 5. batching_ ->UpdateStoppingCriterion()
243- ```
121+ Execution follows this sequence:
122+ 1 . ** Initialize outer-loop** : Set up data structures
123+ 2 . ** Initialize batching** : Configure batch processing
124+ 3 . ** Initialize execution** : Set up solver strategies
125+ 4 . ** Run** : Execute outer-loop (if enabled) or direct execution
126+ 5 . ** Update stopping criterion** : Check convergence
244127
245- ### Delegation Examples
246-
247- **Example 1: Get master row index**
248- ```
249- Client → BendersCore::MasterRowIndex()
250- │
251- └─→ execution_ ->MasterRowIndex()
252- │
253- └─→ wrapped_benders_ ->MasterRowIndex()
254- ```
255-
256- **Example 2: Check if should stop**
257- ```
258- Client → BendersCore::ShouldRelaxationStop()
259- │
260- └─→ batching_ ->ShouldRelaxationStop()
261- ```
128+ For detailed flow diagrams and code examples, see:
129+ - [ API Reference - Orchestrator] ( ../../api/benders-strategy-api.md#orchestrator )
130+ - [ Developer Guide - Using the Strategy Pattern] ( ../../developer-guide/benders-strategy-guide.md#using-the-strategy-pattern )
262131
263132## Design Principles
264133
@@ -332,9 +201,12 @@ All **8 combinations** are supported:
332201
333202## Next Steps
334203
335- For detailed information, see:
336- - **Developer Guide**: `docs/developer-guide/benders-strategy-guide.md`
337- - **Code Navigation**: `docs/developer-guide/code-navigation.md`
338- - **Testing Guide**: `docs/developer-guide/testing-strategy-pattern.md`
339- - **API Reference**: `docs/api/benders-strategy-api.md`
340- - **ADR**: `docs/architecture/adr/0001-benders-strategy-pattern.md`
204+ ** Start here** : This is a high-level architecture overview.
205+
206+ ** For detailed API information** : See [ API Reference] ( ../../api/benders-strategy-api.md )
207+
208+ ** For practical guidance** : See [ Developer Guide] ( ../../developer-guide/benders-strategy-guide.md )
209+
210+ ** For code location and navigation** : See [ Code Navigation] ( ../../developer-guide/code-navigation.md )
211+
212+ ** For architectural decision context** : See [ ADR 0001] ( adr/0001-benders-strategy-pattern.md )
0 commit comments