We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello! Thank you for the library, it's been great working with it.
I am having issues when running ABC.
When the fitness function is negative ABC fails with the following message
File mealpy\optimizer.py:636, in Optimizer.get_index_roulette_wheel_selection(self, list_fitness) 633 final_fitness = np.max(list_fitness) - list_fitness 635 prob = final_fitness / np.sum(final_fitness) --> 636 return int(self.generator.choice(range(0, len(list_fitness)), p=prob)) File _generator.pyx:745, in numpy.random._generator.Generator.choice() ValueError: probabilities are not non-negative
I know the problem does not make so much sense but 🤷
from mealpy import IntegerVar, ABC import numpy as np lower_bound = 0 upper_bound = 500 rows = 11 columns = 3 target_matrix = np.random.randint(lower_bound, upper_bound, size=(rows, columns)) def objective_func(solution): return np.sum(solution.flatten() - target_matrix.flatten()) problem_dict = { "obj_func": objective_func, "bounds": IntegerVar( lb=[0]*11*3, ub=[500]*11*3 ), "minmax": "max", } abc_model = ABC.OriginalABC(epoch=1000, pop_size=100, n_limits=50) g_best = abc_model.solve(problem_dict)
I think I know where the prolem is. I am creating an PR so you can take a look
The text was updated successfully, but these errors were encountered:
thieu1995
Successfully merging a pull request may close this issue.
Description of the bug
Hello!
Thank you for the library, it's been great working with it.
I am having issues when running ABC.
When the fitness function is negative ABC fails with the following message
Steps To Reproduce
I know the problem does not make so much sense but 🤷
Additional Information
I think I know where the prolem is. I am creating an PR so you can take a look
The text was updated successfully, but these errors were encountered: