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

Method initialize

pymoo/util/display/single.py:53–69  ·  view source on GitHub ↗

Initialize output columns based on the problem. Args: algorithm: The optimization algorithm instance.

(self, algorithm: Any)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 2

pareto_front_if_possibleFunction · 0.90
has_constraintsMethod · 0.45

Tested by

no test coverage detected