public List<Chromosome> select(List<Chromosome> population,
			int targetPopulationSize) {

		
		List<Chromosome> survivors = new LinkedList<Chromosome>();
		
		List<Double> absoluteFitnesess = new LinkedList<Double>();
		double totalFitness=0;
		for(Chromosome c : population) {
			double valor = Math.abs(f.calculate(d.decode(c)));
			absoluteFitnesess.add(valor);
			totalFitness+=valor;
		}
		
		List<Double> proportionalFitnesses = new LinkedList<Double>();
		
		for(int i=0;i<absoluteFitnesess.size();i++) {
			//Como eh minimizacao, pega o valor total e divide por valor,
			//para obter a proporcao
			double valor = absoluteFitnesess.get(i);
			double calc = totalFitness / valor;
			if(!proportionalFitnesses.isEmpty()) {
				// se nao estiver vazia, soma com o anterior
				proportionalFitnesses.add(calc+proportionalFitnesses.get(i-1));
			} else {
				// se estiver vazia
				proportionalFitnesses.add(calc);
			}
		}
		
		
		while(survivors.size() < targetPopulationSize) {
			
//			PrintArray.print(proportionalFitnesses);
			double max = proportionalFitnesses.get(proportionalFitnesses.size()-1);
			double random = Math.random() * max;
//			System.out.println();
//			System.out.println(random);
//			System.out.println();
			for(int i=0;i<proportionalFitnesses.size();i++) {
				double proporcao = proportionalFitnesses.get(i);
				if(random <= proporcao) {
					survivors.add(findCromosome(absoluteFitnesess.get(i), population));
					break;
				}
			}
			
			
			
			
			
		}
		
		
		
		return survivors;
	}