title: get the generation number and pass it to the fitness function PyGAD
body: <p>I am trying to set up the fitness function in PyGAD but inside this I am calling and external process for each solution(individual) get the resulting data and perform the fitness. So I'll have a folder for each generation and each individual for each process execution, I can get the individual number with the solution_idx but I want the generation number so i can create the folders with each index (generation and individual).
  The format for a fitness function in PyGAD documentation is:</p>
  <pre><code>def fitness_func(solution, solution_idx):
      #perform fitness
      return fitness
  </code></pre>
  <p>For what I want it would look something like this:</p>
  <pre><code>def fitness_func(solution, solution_idx,ga_instance):
  
      generation=ga_instance.generation_completed
  
      data=function2callprocess(solution,solution_idx,generation)
  
      fitness=fitness(data)
  
      return fitness
  </code></pre>
  <p>so the function2callprocess needs the solution index and generation number to keep track of the GA so it creates the folders or each run of the process.</p>
  <p>I wonder if this is possible or anybody had any suggestions.</p>