Beispiel #1
0
 /**
  * Writes a subpopulation in binary form, in a format readable by
  * readSubpopulation(EvolutionState, DataInput).
  */
 public void writeSubpopulation(final EvolutionState state, final DataOutput dataOutput)
     throws IOException {
   dataOutput.writeInt(individuals.length);
   for (int i = 0; i < individuals.length; i++) individuals[i].writeIndividual(state, dataOutput);
 }
 public void writeGenotype(final EvolutionState state, final DataOutput dataOutput)
     throws IOException {
   dataOutput.writeInt(genome.length);
   for (int x = 0; x < genome.length; x++)
     dataOutput.writeBoolean(genome[x]); // inefficient: booleans are written out as bytes
 }