The script aims to optimize a set of 6 parameters using GA, the required steps are the following:
in the first generation and first population, a first set of 6 parameters is generated, implement these values in an input file for a simulation software, run the simulation, get the energy from the logfile (c_inter), then calculate the error = c_inter - desired_ouptut ( the desired output value is a value defined in the script)
The objective function here is to minimize this value of error, to be less than 0.1.
During the generation 0, the script generate different set of values of the 6 parameters at each population and run the simulation and calculate the error. The issue here is that the GA should generate another set of parameters for the next generation, however, when it comes to move to the next generation, the size of the parameters changes to 1 (instead of 6) and thus I got the error : Index exceeds the number of array elements. Index must not exceed 1.