import Individual; import java.awt.*; public class BooleanIndividual extends Individual { protected boolean chromosome[]; protected static int LENGTH=20; public BooleanIndividual(boolean[] boolArray) { super(); chromosome=boolArray; } public BooleanIndividual() { this(getRandomChromosome()); } public BooleanIndividual(BooleanIndividual i) { this(i.getChromosome()); } public boolean[] getChromosome() { return chromosome; } //function for character representation public String toString() { String ret=""; for (int i=0;i=0.5); } return chromo; } public Individual[] getOffspringWith(Individual mom) { boolean dadsDNA[]=this.getChromosome(); boolean momsDNA[]=((BooleanIndividual)mom).getChromosome(); int len=dadsDNA.length; if (len>momsDNA.length) len=momsDNA.length; boolean temp; for (int i=AIMath.getRandomInt(len);i