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

Method infill

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

Source from the content-addressed store, hash-verified

181 self.opt = None
182
183 def infill(self) -> Population | None:
184 if self.problem is None:
185 raise Exception("Please call `setup(problem)` before calling next().")
186
187 # the first time next is called simply initial the algorithm - makes the interface cleaner
188 if not self.is_initialized:
189 # hook mostly used by the class to happen before even to initialize
190 self._initialize()
191
192 # execute the initialization infill of the algorithm
193 infills = self._initialize_infill()
194
195 else:
196 # request the infill solutions if the algorithm has implemented it
197 infills = self._infill()
198
199 # set the current generation to the offsprings
200 if infills is not None:
201 infills.set("n_gen", self.n_iter)
202 infills.set("n_iter", self.n_iter)
203
204 return infills
205
206 def advance(
207 self, infills: Population | None = None, **kwargs

Callers 4

nextMethod · 0.95
askMethod · 0.95
_infillMethod · 0.80

Calls 4

_initializeMethod · 0.95
_initialize_infillMethod · 0.95
_infillMethod · 0.95
setMethod · 0.45

Tested by 1