You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Haris,
First of all thank you very much for sharing your work! I have some questions regarding the code.
In line 136, the output of non_dominated_sorted_solution2_1 will always be 0,1,2... for every i, so it seems that the code is meaningless. I think what we should do is to align crowding distance and front order, which seems not to appear in the code.
The code below is the original code which seems not to achieve the target aligning crowding distance and front order.
for i in range(0,len(non_dominated_sorted_solution2)):
non_dominated_sorted_solution2_1 = [index_of(non_dominated_sorted_solution2[i][j], non_dominated_sorted_solution2[i] ) for j in range(0,len(non_dominated_sorted_solution2[i]))]
In line 22, the definition of index_of(a,list) is not rigorous. If there are two same values which equal to a in the list, the function only outputs the first position. Thus, using the list.index(a) perhaps is a better choice.
def index_of(a,list):
for i in range(0,len(list)):
if list[i] == a:
return i
return -1
The operations of mutation and crossover are strange, because it seems the parent is not correlated with children at all. From the code, we can see no matter which the selected individuals a, b are, the crossover will give a new random solution.
The crowding distance was also miscalculated and should have been calculated for each target and then added up, which has mentioned by other many times.
The text was updated successfully, but these errors were encountered:
Hello Haris,
First of all thank you very much for sharing your work! I have some questions regarding the code.
The code below is the original code which seems not to achieve the target aligning crowding distance and front order.
The text was updated successfully, but these errors were encountered: