m-depascale / ci24

2 stars 0 forks source link

Issue on Lab02 #5

Open giuliuss opened 12 months ago

giuliuss commented 12 months ago

The code appears well-structured and consistent with the evolutionary algorithm process. The agent "ciccio" is initially trained to search for the best genotype (defined by states, moves, scores). After 10 generations in which the offspring gradually increases, new individuals are created through mutation or crossover.

The number of individuals is limited by POPULATION_SIZE, so only the best genotypes are retained in the population, based on the fitness function. This function iterates through the agent's states, taking into account the difference between the desired states (obtained through the agent's moves) and the current ones. It converts this difference into a binary representation and calculates the XOR on columns. The resulting score is used as a measure of the goodness of a state compared to the desired states.

After these steps, in which "ciccio" has learned the best moves based on the game's configuration, I'm sure he is ready to face the world champion of the nim game.