Example #1
0
 def post_evaluate(self, population, species, best):
     fit_mean = mean([c.fitness for c in population])
     fit_std = stdev([c.fitness for c in population])
     print('Population\'s average fitness: {0:3.5f} stdev: {1:3.5f}'.format(fit_mean, fit_std))
     print('Best fitness: {0:3.5f} - size: {1!r} - species {2} - id {3}'.format(best.fitness, best.size(),
                                                                                best.species_id, best.ID))
     print('Species length: {0:d} totaling {1:d} individuals'.format(len(species), sum(
         [len(s.members) for s in species])))
     print('Species ID       : {0!s}'.format([s.ID for s in species]))
     print('Species size     : {0!s}'.format([len(s.members) for s in species]))
     print('Species age      : {0}'.format([s.age for s in species]))
def report():
    print "\nNumber of runs: {0!s}\n".format(sys.argv[2])
    print "\t Gen. \t Nodes \t Conn. \t Evals. \t Score \n"
    print "average  {0:3.2f} \t {1:2.2f} \t {2:2.2f} \t {3:2.2f} \t {4:2.2f}".format(mean(total_gens), mean(total_nodes), mean(total_conns), mean(total_evals), mean(total_score))
    print "stdev    {0:3.2f} \t {1:2.2f} \t {2:2.2f} \t {3:2.2f} \t {4:2.2f}".format(stdev(total_gens), stdev(total_nodes), stdev(total_conns), stdev(total_evals), stdev(total_score))