File tree 2 files changed +17
-5
lines changed
2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -93,13 +93,18 @@ def post_solve_loop(self):
93
93
pass
94
94
95
95
def pre_iter0 (self ):
96
- ''' Method called at the end of PH_Prep().
97
- When this method is called, all scenarios have been created, and
96
+ ''' When this method is called, all scenarios have been created, and
98
97
the dual/prox terms have been attached to the objective, but the
99
98
solvers have not yet been created.
100
99
'''
101
100
pass
102
101
102
+ def iter0_post_solver_creation (self ):
103
+ ''' When this method is called, PH iteration 0 has been initiated and
104
+ all solver objects have been created.
105
+ '''
106
+ pass
107
+
103
108
def post_iter0 (self ):
104
109
''' Method called after the first PH iteration.
105
110
When this method is called, one call to solve_loop() has been
@@ -192,6 +197,10 @@ def pre_iter0(self):
192
197
for lobject in self .extdict .values ():
193
198
lobject .pre_iter0 ()
194
199
200
+ def iter0_post_solver_creation (self ):
201
+ for lobject in self .extdict .values ():
202
+ lobject .iter0_post_solver_creation ()
203
+
195
204
def post_iter0 (self ):
196
205
for lobject in self .extdict .values ():
197
206
lobject .post_iter0 ()
Original file line number Diff line number Diff line change @@ -772,8 +772,7 @@ def PH_Prep(
772
772
773
773
Note:
774
774
This function constructs an Extension object if one was specified
775
- at the time the PH object was created. It also calls the
776
- `pre_iter0` method of the Extension object.
775
+ at the time the PH object was created.
777
776
"""
778
777
779
778
self .attach_Ws_and_prox ()
@@ -832,9 +831,10 @@ def Iter0(self):
832
831
stochastic program with the nonanticipativity constraints
833
832
removed.
834
833
"""
834
+
835
835
if (self .extensions is not None ):
836
836
self .extobject .pre_iter0 ()
837
-
837
+
838
838
verbose = self .options ["verbose" ]
839
839
dprogress = self .options ["display_progress" ]
840
840
dtiming = self .options ["display_timing" ]
@@ -853,6 +853,9 @@ def _vb(msg):
853
853
global_toc ("Creating solvers" )
854
854
self ._create_solvers ()
855
855
856
+ if (self .extensions is not None ):
857
+ self .extobject .iter0_post_solver_creation ()
858
+
856
859
teeme = ("tee-rank0-solves" in self .options
857
860
and self .options ['tee-rank0-solves' ]
858
861
and self .cylinder_rank == 0
You can’t perform that action at this time.
0 commit comments