{
for (int i = 0; i < arg0.size(); i++)
{
if (Math.random() > c.getBaseMutationRate()/c.getChromosomeLength())
continue;
IChromosome chromosome = arg0.getChromosome(i);
Gene[] beforeArray = chromosome.getGenes();
Gene[] afterArray = new Gene[beforeArray.length + 1];
for (int j = 0; j < beforeArray.length; j++)
afterArray[j] = beforeArray[j];
afterArray[afterArray.length - 1] = afterArray[0].newGene();
try
{
chromosome.setGenes(afterArray);
}
catch (InvalidConfigurationException e)
{
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
logger.severe(sw.toString());
}
}
IChromosome chromosome = arg0.getConfiguration().getSampleChromosome();
Gene[] beforeArray = chromosome.getGenes();
Gene[] afterArray = new Gene[beforeArray.length + 1];
for (int j = 0; j < beforeArray.length; j++)
afterArray[j] = beforeArray[j];
afterArray[afterArray.length - 1] = afterArray[0].newGene();
try
{
chromosome.setGenes(afterArray);
}
catch (InvalidConfigurationException e)
{
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));