Skip to content
New issue

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

Notice:when code runing occur error,readers can change the code refer to the README.md #3

Open
LeonLi717 opened this issue Nov 12, 2021 · 4 comments

Comments

@LeonLi717
Copy link

LeonLi717 commented Nov 12, 2021

No description provided.

@LeonLi717 LeonLi717 reopened this Nov 15, 2021
@LeonLi717 LeonLi717 changed the title Could you please help me solve the code running problem? Notice:when code runing occur error,readers can change the code refer to the README.md Nov 15, 2021
@LeonLi717
Copy link
Author

change:
population = np.concatenate((elites, offsprings), axis = 0)
fitness_list = elite_fitness_list + offspring_fitness_list
into:
population = np.concatenate((elites,mutants, offsprings), axis = 0)
fitness_list = self.cal_fitness(population)
and change the return of the partition() :
return population[sorted_indexs[:self.num_elites]], population[sorted_indexs[self.num_elites:]]#,np.array(fitness_list)[sorted_indexs[:self.num_elites]]

@Motherlesssss
Copy link

hi when i run the BRKGA.ipynb it shows
Traceback (most recent call last): File "d:\三创\算法\3D-Bin-Packing-Problem-with-BRKGA-main\3D-Bin-Packing-Problem-with-BRKGA-main\code\test.py", line 19, in <module> model.fit(patient = 15,verbose = True) File "d:\三创\算法\3D-Bin-Packing-Problem-with-BRKGA-main\3D-Bin-Packing-Problem-with-BRKGA-main\code\model.py", line 384, in fit elites, non_elites, elite_fitness_list = self.partition(population, fitness_list) File "d:\三创\算法\3D-Bin-Packing-Problem-with-BRKGA-main\3D-Bin-Packing-Problem-with-BRKGA-main\code\model.py", line 338, in partition return population[sorted_indexs[:self.num_elites]], population[sorted_indexs[self.num_elites:]], fitness_list[sorted_indexs[:self.num_elites]] TypeError: only integer scalar arrays can be converted to a scalar index
how can i deal with it ?

@mich1342
Copy link

Hi @Motherlesssss and all who might need it, I create a fork from this repo that fix all errors and could run using the latest python libraries

https://github.com/mich1342/3D-Bin-Packing-Problem-with-BRKGA

@hytan96
Copy link

hytan96 commented Jul 11, 2024

@mich1342 Thanks for sorting out most of the problem. There is another problem that you can fix which is the np.product() issue. You can replace all the method with np.prod().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants