Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
blankjul committed Feb 27, 2023
2 parents 6795ac3 + 5af46f3 commit 4549b0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/problems/definition.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"metadata": {},
"source": [
"The majority of optimization algorithms implemented in *pymoo* are population-based, which means that more than one solution is evaluated in each generation. This is ideal for implementing a parallelization of function evaluations. Thus, the default definition of a problem retrieves a **set** of solutions to be evaluated. The actual function evaluation takes place in the `_evaluate` method, which aims to fill the `out` dictionary with the corresponding data. \n",
"The function values are supposed to be written into `out[\"F\"]` and the constraints into `out[\"G\"]` if `n_constr` is greater than zero. "
"The function values are supposed to be written into `out[\"F\"]` and the constraints into `out[\"G\"]` if `n_constr` is greater than zero. If another approach is used to compute the function values or the constraints, they must be appropriately converted into a two-dimensional `numpy` array (one dimension for the function values, the other dimension for each element of the population evaluated in the current round). For example, if the function values are written in a regular python list like `F_list = [[<func values for individual 1>], [<func values for individual 2>], ...]`, before returning from the `_evaluate` method, the list must be converted to numpy array with `out[\"F\"] = np.row_stack(F_list_of_lists)`. "
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion pymoo/core/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def evaluate(self,
try:
out[k] = v.astype(np.float64)
except:
pass
out[k] = v

if self.callback is not None:
self.callback(X, out)
Expand Down

0 comments on commit 4549b0c

Please sign in to comment.