public void doGeneration() {
			for (Solution solution : population) {
				solution.evaluate();
			}

			Comparator comparator = Collections.reverseOrder();
			Collections.sort(population, comparator);

			ArrayList<Solution> newPopulation = new ArrayList();

			// Elitism
			for (int i = 0; i < ELITE_SIZE; i++) {
				newPopulation.add(population.get(i));
			}

			int[] weights = new int[population.size()];
			for (int i = 0; i < population.size(); i++) {
				weights[i] = population.get(i).getFitness();
			}

			crossover: while (!haveSolution()) {
				Solution parent1 = population.get(getWeightedRandom(weights));
				Solution parent2 = population.get(getWeightedRandom(weights));

				Solution[] offspring = parent1.crossover(parent2,
						random.nextFloat());

				for (int i = 0; i < 2; i++) {
					offspring[i].mutate();
					newPopulation.add(offspring[i]);

					if (newPopulation.size() == POP_SIZE - ELITE_SIZE) {
						break crossover;
					}
				}
			}

			population = newPopulation;
		}