Project-Platypus / Platypus

A Free and Open Source Python Library for Multiobjective Optimization
GNU General Public License v3.0
563 stars 153 forks source link

ZeroDivisionError in tql2 #135

Closed Martin1887 closed 1 year ago

Martin1887 commented 4 years ago

Hello.

The following error has happened:

tools.py", line 364, in tql2
    p = (d[l+1] - g) / (2.0*e[l])
ZeroDivisionError: float division by zero

It can be fixed adding an epsilon.

Regards.

Martin1887 commented 4 years ago

The same in line 405.

Regards.

zahraghh commented 3 years ago

Hello,

I have the same problem while using CMAES algorithm. The program works well for other algorithms such as NSGA-II. I've added the epsilon but still get this error: an eigenvalue has become negative Traceback (most recent call last): File "F:\Zahra\Research\Aim 2\Operation Planning\Two_Stage_SP-IMECE\Two_Stage_SP\Case_1_Code\main_two_stage_SP.py", line 162, in algorithm.run(5000) File "c:\users\zahra\platypus\platypus\core.py", line 408, in run self.step() File "c:\users\zahra\platypus\platypus\algorithms.py", line 1077, in step self.iterate() File "c:\users\zahra\platypus\platypus\algorithms.py", line 1307, in iterate self.update_distribution() File "c:\users\zahra\platypus\platypus\algorithms.py", line 1273, in update_distribution artmp[i] = sum([self.B[j][i]*BDz[j] for j in range(self.problem.nvars)]) / self.diag_D[i] ZeroDivisionError: float division by zero

github-actions[bot] commented 1 year ago

This issue is stale and will be closed soon. If you feel this issue is still relevant, please comment to keep it active. Please also consider working on a fix and submitting a PR.