Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
blankjul committed Apr 5, 2023
2 parents be917d7 + c6c7fac commit 0f13cac
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/source/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ @article{das_dennis
}

@book{multi_objective_book,
author = {Deb, Kalyanmoy and Kalyanmoy, Deb},
author = {Kalyanmoy, Deb},
title = {Multi-Objective Optimization Using Evolutionary Algorithms},
year = {2001},
isbn = {047187339X},
Expand Down Expand Up @@ -753,4 +753,4 @@ @article{mosade
pages={193--209},
year={2010},
publisher={Springer}
}
}
17 changes: 17 additions & 0 deletions pymoo/core/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ def __getstate__(self):
return state


class JoblibParallelization:

def __init__(self, aJoblibParallel, aJoblibDelayed, *args, **kwargs) -> None:
super().__init__()
self.parallel = aJoblibParallel
self.delayed = aJoblibDelayed

def __call__(self, f, X):
return self.parallel(self.delayed(f)(x) for x in X)

def __getstate__(self):
state = self.__dict__.copy()
state.pop("parallel", None)
state.pop("delayed", None)
return state


class Problem:
def __init__(self,
n_var=-1,
Expand Down
2 changes: 1 addition & 1 deletion pymoo/gradient/grad_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def calc_complex_gradient(problem, return_values_of, x, eps, *args, **kwargs):
xp = x + np.eye(len(x)) * np.complex(0, eps)
xp = x + np.eye(len(x)) * complex(0, eps)
out = problem.do(xp, return_values_of, *args, **kwargs)

grad = {}
Expand Down

0 comments on commit 0f13cac

Please sign in to comment.