MCPcopy Create free account
hub / github.com/anyoptimization/pymoo / _post_advance

Method _post_advance

pymoo/core/algorithm.py:308–331  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

306 self.opt = filter_optimum(self.pop, least_infeasible=True)
307
308 def _post_advance(self) -> None:
309
310 # update the current optimum of the algorithm
311 self._set_optimum()
312
313 # update the current termination condition of the algorithm
314 self.termination.update(self) # type: ignore
315
316 # display the output if defined by the algorithm
317 self.display(self)
318
319 if self.save_history:
320 _hist, _callback, _display = self.history, self.callback, self.display
321
322 self.history, self.callback, self.display = None, None, None # type: ignore
323 obj = copy.deepcopy(self)
324
325 self.history, self.callback, self.display = _hist, _callback, _display
326 self.history.append(obj)
327
328 # if a callback function is provided it is called after each iteration
329 self.callback(self)
330
331 self.n_iter += 1 # type: ignore
332
333 # =========================================================================================================
334 # TO BE OVERWRITTEN

Callers 1

advanceMethod · 0.95

Calls 3

_set_optimumMethod · 0.95
appendMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected