From f3f4b83d4a2b0b53ee168caef5898e7e2c146fb6 Mon Sep 17 00:00:00 2001 From: Julian Blank Date: Mon, 16 Oct 2023 23:03:32 -0700 Subject: [PATCH] Error from RVEA algorithm when the problem has no feasible solutions #487 --- pymoo/algorithms/moo/rvea.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pymoo/algorithms/moo/rvea.py b/pymoo/algorithms/moo/rvea.py index 2d812329c..eee3915b0 100644 --- a/pymoo/algorithms/moo/rvea.py +++ b/pymoo/algorithms/moo/rvea.py @@ -133,8 +133,9 @@ def __init__(self, ref_dirs, alpha=2.0) -> None: self.gamma = calc_gamma(self.V) def adapt(self): - self.V = calc_V(calc_V(self.ref_dirs) * (self.nadir - self.ideal)) - self.gamma = calc_gamma(self.V) + if self.nadir is not None: + self.V = calc_V(calc_V(self.ref_dirs) * (self.nadir - self.ideal)) + self.gamma = calc_gamma(self.V) def _do(self, problem, pop, n_survive, algorithm=None, n_gen=None, n_max_gen=None, **kwargs):