calculating automatically number of generations and population size of the GA