Closed wellinton-capixaba closed 3 years ago
Hello @wellinton-capixaba Please refer to the original paper of MFO here Most of the answers to your inquiries about the structure and convergence can be found in that paper. The other questions are related to metaheuristics in general. Please read more about the details of the topic. You can refer to this excellent book . If you still have inquires after referring to these resources I would be happy to help. Please be patient we are extremely busy.
Hi some doubts (many actually) about the code:
What "lb = [lb] dim" and "ub = [ub] dim" does precisely? I know they are determine a maximum and minimum value that the moths can take (I assume that to make the algorith to find a answer faster), but what the "[]" means and way are the dim variable involved?
Some reason line n°28: "numpy.random.uniform(0, 1, N)" is generating values between 0 and 1?
What means "inf" on line 29 "Moth_fitness=numpy.full(N,float("inf"))". What is that necessary as the initial values?
"Convergence_curve" (declared on line 32) is just a container for the best flame scores in each iteartion, so one can identify how the algorith is converging to a answer?
What "objf" (on line n°73) does. Is it the function to be appoached? It is applied to an entire line of the moth matrix?
On line 79: "fitness_sorted=numpy.sort(Moth_fitness)", does "Moth_fitness" remains sorted or only "fitness_sorted" ?
What "argsort on" line n°80 "I=numpy.argsort(Moth_fitness)" and on line n°95 "I2 =numpy.argsort(double_fitness)" does?
The line n°82 "sorted_population=Moth_pos[I,:]" copy all the rows from Moth_pos's line n° I to sorted_population?
What this line (n°90 and also the 91) "double_population=numpy.concatenate((previous_population,best_flames),axis=0)" does? I mean it creates something with size 2N x dim?. And what the "axis" means?
What this line does: "double_sorted_population[newindex,:]=numpy.array(double_population[I2[newindex],:])" It simple copies the content of "double_population" to "double_sorted_population" ?
On line 111: "Best_flame_pos=sorted_population[0,:]" Is being copied an entire line os the positions of a certain moth?
-Can you give me an overall explanation why there are so many structures, like "previous_population", "sorted_population", "double_population", "double_sorted_population"? Plus the "Moth" structure. Can't they al be replaced by "Moth" alone? Declare it with 2x the number of moths and update it instead of creating so many other? Perhaps moth and previous_population at maximum?