-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IllegalArgumentException: Too many seed candidates for specified population size. #27
Comments
Hi, |
Sure. It's just class wrapping list of Doubles. AbstractGenotype contains nothing at all. public class FloatGenotype extends AbstractGenotype {
private List<Double> genes;
public FloatGenotype(final List<Double> genes) {
super();
this.genes = genes;
}
public FloatGenotype(final FloatGenotype genotype) {
super();
this.genes = genotype.getGenes();
}
public List<Double> getGenes() {
return genes;
}
public void setGenes(final List<Double> genes) {
this.genes = genes;
}
@Override
public String toString() {
String result = "[";
for(Double f : getGenes()) {
result += f + " ";
}
return result + "] ";
}
} |
Hi, |
My mistake. public class FloatGenotypeFactory extends AbstractGenotypeFactory<FloatGenotype> {
private static final Double UPPERBOUND = 1.0d;
private static final Double LOWERBOUND = 0.0d;
private static final Integer DIM = 3;
private Integer dim;
public FloatGenotypeFactory() {
super(LOWERBOUND, UPPERBOUND);
this.dim = DIM;
}
public FloatGenotypeFactory(final Double lowerbound, final Double upperbound, final Integer dim) {
super(lowerbound, upperbound);
this.dim = dim;
}
@Override
public FloatGenotype generateRandomCandidate(final Random rng) {
List<Double> genes = new ArrayList<>();
for(int i=0; i<dim; i++) {
genes.add(uniform(rng));
}
return new FloatGenotype(genes);
}
}
public abstract class AbstractGenotypeFactory<T extends AbstractGenotype> extends AbstractCandidateFactory<T> {
private Double lowerbound;
private Double upperbound;
public AbstractGenotypeFactory(final Double lowerbound, final Double upperbound) {
this.lowerbound = lowerbound;
this.upperbound = upperbound;
}
protected Double uniform(final Random rng) {
return rng.nextDouble() * (this.upperbound - this.lowerbound) + this.lowerbound ;
}
} |
Hi, |
Hey,
I'm working on simple example using multiple islands.
I have code as follows:
Everything works fine when I'm setting populationSize on 120 or above. But if i try to use lower value i get following error on the end of first epoch, around 50th generation.
I'm not setting seed candidates count or seeds candidates themselves so I guess error is not on my side. To be sure if it not dependent on elitism and migrations number I have lowered them to 5 and 3 respectively (as in user manual) but it has changed nothing. Still needed at least 120 objects in population to work.
The text was updated successfully, but these errors were encountered: