Initialize output columns based on the problem. Args: algorithm: The optimization algorithm instance.
(self, algorithm: Any)
| 51 | self.best: Any = None |
| 52 | |
| 53 | def initialize(self, algorithm: Any) -> None: |
| 54 | """Initialize output columns based on the problem. |
| 55 | |
| 56 | Args: |
| 57 | algorithm: The optimization algorithm instance. |
| 58 | """ |
| 59 | problem = algorithm.problem |
| 60 | |
| 61 | if problem.has_constraints(): |
| 62 | self.columns += [self.cv_min, self.cv_avg] |
| 63 | |
| 64 | self.columns += [self.f_avg, self.f_min] |
| 65 | |
| 66 | pf = pareto_front_if_possible(problem) |
| 67 | if pf is not None: |
| 68 | self.best = pf.flatten()[0] |
| 69 | self.columns += [self.f_gap] |
| 70 | |
| 71 | def update(self, algorithm: Any) -> None: |
| 72 | """Update output columns with current algorithm state. |
nothing calls this directly
no test coverage detected