public void mate(Chromosome father, Chromosome offspring1,
			Chromosome offspring2) {
		int geneLength = getGenes().length;

		int cutpoint1 = (int) (Math.random() * (geneLength - getGeneticAlgorithm()
				.getCutLength()));
		int cutpoint2 = cutpoint1 + getGeneticAlgorithm().getCutLength();

		Set<Double> taken1 = new HashSet<Double>();
		Set<Double> taken2 = new HashSet<Double>();

		for (int i = 0; i < geneLength; i++) {
			if ((i < cutpoint1) || (i > cutpoint2)) {
			} else {
				offspring1.setGene(i, father.getGene(i));
				offspring2.setGene(i, getGene(i));
				taken1.add(offspring1.getGene(i));
				taken2.add(offspring2.getGene(i));
			}
		}

		for (int i = 0; i < geneLength; i++) {
			if ((i < cutpoint1) || (i > cutpoint2)) {
				if (getGeneticAlgorithm().isPreventRepeat()) {
					offspring1.setGene(i, getNotTaken(this, taken1));
					offspring2.setGene(i, getNotTaken(father, taken2));
				} else {
					offspring1.setGene(i, getGene(i));
					offspring2.setGene(i, father.getGene(i));
				}
			}
		}

		if (Math.random() < getGeneticAlgorithm().getMutationPercent()) {
			offspring1.mutate();
		}
		if (Math.random() < getGeneticAlgorithm().getMutationPercent()) {
			offspring2.mutate();
		}

		offspring1.calculateCost();
		offspring2.calculateCost();
	}