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

Method _initialize_infill

pymoo/algorithms/base/bracket.py:21–48  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

19 self.a, self.b = a, b
20
21 def _initialize_infill(self):
22
23 # the boundaries of the problem for initialization
24 xl, xu = self.problem.bounds()
25
26 # take care of the lower bound - make sure it is an individual and make sure it is evaluated
27 if self.a is None:
28 assert xl is not None, (
29 "Either provide a left bound or set the xl attribute in the problem."
30 )
31 self.a = Individual(X=xl)
32
33 if self.a.F is None:
34 self.evaluator.eval(self.problem, self.a, algorithm=self)
35
36 # take care of the upper bound - make sure it is an individual and make sure it is evaluated
37 if self.b is None:
38 assert xl is not None, (
39 "Either provide a right bound or set the xu attribute in the problem."
40 )
41 self.b = Individual(X=xu)
42
43 if self.b.F is None:
44 self.evaluator.eval(self.problem, self.b, algorithm=self)
45
46 assert self.a.X[0] <= self.b.X[0], (
47 "The left bound must be smaller than the left bound!"
48 )

Callers

nothing calls this directly

Calls 3

IndividualClass · 0.90
boundsMethod · 0.80
evalMethod · 0.45

Tested by

no test coverage detected