Skip to content

Instantly share code, notes, and snippets.

Created December 26, 2015 13:52
Show Gist options
  • Save anonymous/ad1145a530071a621459 to your computer and use it in GitHub Desktop.
Save anonymous/ad1145a530071a621459 to your computer and use it in GitHub Desktop.
public interface Chromosome extends Comparable {
Chromosome crossover(Chromosome chromosome);
Chromosome mutate(Chromosome chromosome);
double getFitnessValue();
boolean isValid();
String toString();
@Override
default int compareTo(Object o) {
Chromosome chromosome = (Chromosome) o;
return Double.valueOf(this.getFitnessValue()).compareTo(chromosome.getFitnessValue());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment