public static void main(String[] args) {
		
		// Initialize the population
		PacManGeneticAlgorithm population = new PacManGeneticAlgorithm(POPULATION_SIZE);
		int generationCount = 0;
		
		float bestFitnessEver = 0;
		
		// we'll break out of this loop with a break statement from within it
		// when the worst and best fitness values of genes are close enough 
		//  TODO: define "enough"
		while( true ) {
			
			population.evaluateGeneration();
			
			// print information on the current state of the population
			float avgFitness = 0.f;
            float minFitness = Float.POSITIVE_INFINITY;
            float maxFitness = Float.NEGATIVE_INFINITY;
            
            for( int i = 0; i < population.size(); i++ ) {
            	float currentFitness = population.getGene(i).getFitness();
            	avgFitness += currentFitness;
            	if( currentFitness < minFitness ) {
            		minFitness = currentFitness;
            	}
            	if( currentFitness > maxFitness ) {
            		maxFitness = currentFitness;
            	}
            }
            if( population.size() > 0 ) {
            	avgFitness = avgFitness / population.size();
            }
            
            String output = "Generation: " + generationCount
            		+ "\t AvgFitness: " + avgFitness
            		+ "\t MinFitness: " + minFitness
            		+ "\t MaxFitness: " + maxFitness;
            System.out.println( output );
            
        	System.out.println( "\tWorst performing gene so far: " + population.getGene(0).toString() );
        	System.out.println( "\tBest performing gene so far: " + population.getGene(population.size()-1).toString() );
            
        	if( bestFitnessEver < maxFitness ) {
        		bestFitnessEver = maxFitness;
        	}
        	
            if( (maxFitness - minFitness) <= MIN_MAX_FITNESS_DELTA_GOAL &&
            		(bestFitnessEver - maxFitness) <= MIN_MAX_FITNESS_DELTA_GOAL ) {
            	
            	// we have reached our goal, let's print the best gene
            	System.out.println( "Best performing gene:" );
            	System.out.println( population.getGene(0).toString() );
            	
            	break;
            }
            
            population.produceNextGeneration();
            generationCount++;
		}
	}