FarInHeight / Computational-Intelligence

Repository for the labs, homeworks and activities for the Computational Intelligence course 23/24 - Politecnico di Torino
MIT License
0 stars 0 forks source link

Lab 9 peer review - Laura Amoroso #1

Closed AmorosoLaura closed 1 week ago

AmorosoLaura commented 11 months ago

Hi Davide,

I appreciated your code, since it is very clear and full of comments and the output is well formatted. I agree with your strategies to solve the problem, and it was interesting to me your implementation of the extinction mechanism based on the genotype.

However, I have some suggestions to you.

Unfortunately, I don't have great advices for the problems 5 and 10, since I wasn't able to reach the 1.0 fitness either and I struggled to get better results. However, I hope that you can find these little tips useful, and if you try something let me know the results.

Good luck for the next works!

FarInHeight commented 11 months ago

Hi Laura, thanks for the review and the tips you gave me!

I have tried the changes to improve problem instances 1 and 2 and the results are really impressive. Looking more closely at the one_cut_crossover function you suggested, I noticed that you create the second child in a way that is quite innovative to me.

Typically, to create the second child, the first part of the second parent's genotype is concatenated with the second part of the first parent's genotype, in this order. Here it is coded:

offspring1=Individual(fitness_function, n_loci, tuple(ind1.genotype[:index]) + tuple(ind2.genotype[index:]))
offspring2=Individual(fitness_function, n_loci, tuple(ind2.genotype[:index]) + tuple(ind1.genotype[index:]))

What you do to create the second child instead is to concatenate the second part of the first parent's genotype with the first part of the second parent's genotype, in this order.

I have tried these two options and your alternative is incredibly powerful. I searched the internet and couldn't find anything related to this... really great work 💪🏻!

As for the other improvements you suggested, I will let you know what the results are when I implement them.

Good luck for the next labs to you too!