code: def save_checkpoint(self, config, population, species_set, generation):
          
          filename = '{0}{1}'.format(self.filename_prefix, generation)
          print("Saving checkpoint to {0}".format(filename))
  
          with gzip.open(filename, 'w', compresslevel=5) as f:
              data = (generation, config, population, species_set, random.getstate())
              pickle.dump(data, f, protocol=pickle.HIGHEST_PROTOCOL)
docs: Save the current simulation state.