i am using Jenetics
in order to get the best individual that maximizes the problem. How does the population size affects the individuals ?
Imagine that i have this initial population read from file put into a list
while( (line = bf.readLine())!=null){
String[] tokens = line.split(",");
chromossomes.add(IntegerChromosome.of(
IntegerGene.of(Integer.parseInt(tokens[0]),0,100),
IntegerGene.of(Integer.parseInt(tokens[1]),0,100),
IntegerGene.of(Integer.parseInt(tokens[2]),0,100));
}
If the file contains i.e. 10 chromossomes, and then i set population to 100, are the remaining 90 individuals created randomly?
I would like to know also if this fitness function is correct
private static int eval(Genotype<IntegerGene> gt) {
int best=0,fitness=0;
for(int i=0;i<gt.length();i++) {
fitness = getFitness(gt.getChromosome(i));
if (fitness > best){
best = fitness;
}
}
return best;
}