reset password
Author Message
rabbott
Posts: 1649
Posted 05:40 Apr 17, 2020 |

All the GA examples have been moved to a new Examples/ga_examples directory.

Two of the files, ga_knapsack and ga_parentheses, are purely text output.

In the knapsack problem, an individual is printed as fitness<-x_vector. For example, the successful solution is 15<-1001000.

After each generation, the entire population is printed. This is feasible because the population size is set to 10 elements. Were it larger it wouldn't make sense to print them all.

The knapsack problem  cheats in that it sets the fitness target to be 15. Normally you don't know the value of the best packing.

Last edited by rabbott at 05:41 Apr 17, 2020.