(self)
| 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 |
no test coverage detected