package Chromosomes; import GAutilities.*; abstract class BitChromosome extends Chromosome { // genes are 0/1 (boolean) protected boolean[] bits = null; protected BitChromosome() { // construction only by subclasses super(); bits = new boolean[chromosomeLength]; } public void copyChromosome(Chromosome c) { // copy this to c BitChromosome bc = (BitChromosome) c; bc.fitness = this.fitness; // these three ='s bc.rfitness = this.rfitness; // really belong bc.cfitness = this.cfitness; // in the superclass for (int i = 0; i < chromosomeLength; i++) { bc.bits[i] = this.bits[i]; } } public Chromosome cloneChromosome() { MyChromosome theClone = new MyChromosome(); copyChromosome((Chromosome) theClone); return (Chromosome) theClone; } public void initializeChromosomeRandom() { for (int i = 0; i