private void validatePopulation(Set<String> population)
{
// Require at least 1 individual in population in order
// for algorithm to work
if (population.Count < 1)
{
throw new IllegalArgumentException(
"Must start with at least a population of size 1");
}
// String lengths are assumed to be of fixed size,
// therefore ensure initial populations lengths correspond to this
foreach (String individual in population)
{
if (individual.length() != this.individualLength)
{
throw new IllegalArgumentException("Individual [" + individual
+ "] in population is not the required length of "
+ this.individualLength);
}
}
}