/** * Constructs a Chromosome separate from any specific Configuration. This can be useful for * constructing sample chromosomes that are to be used to setup a Configuration object. * Additionally, a constraint checker can be specified. It is used right here to verify the * validity of the gene types supplied. * * @param a_configuration the configuration to use * @param a_initialGenes the initial genes of this Chromosome * @param a_constraintChecker constraint checker to use * @throws InvalidConfigurationException in case the constraint checker reports a configuration * error * @author Klaus Meffert * @since 2.5 */ public Chromosome( final Configuration a_configuration, Gene[] a_initialGenes, IGeneConstraintChecker a_constraintChecker) throws InvalidConfigurationException { this(a_configuration, a_initialGenes.length); checkGenes(a_initialGenes); setGenes(a_initialGenes); setConstraintChecker(a_constraintChecker); }
/** * Constructs a Chromosome separate from any specific Configuration. This can be useful for * constructing sample chromosomes that are to be used to setup a Configuration object. * * @param a_configuration the configuration to use * @param a_initialGenes the initial genes of this Chromosome * @throws InvalidConfigurationException * @author Neil Rotstan * @since 1.0 */ public Chromosome(final Configuration a_configuration, Gene[] a_initialGenes) throws InvalidConfigurationException { this(a_configuration, a_initialGenes == null ? 0 : a_initialGenes.length); checkGenes(a_initialGenes); setGenes(a_initialGenes); }