JGAP

examples.energy
Class CoinsEnergy.EnergyGeneConstraintChecker

java.lang.Object
  extended by examples.energy.CoinsEnergy.EnergyGeneConstraintChecker
All Implemented Interfaces:
java.io.Serializable, IGeneConstraintChecker
Enclosing class:
CoinsEnergy

public static class CoinsEnergy.EnergyGeneConstraintChecker
extends java.lang.Object
implements IGeneConstraintChecker

Uses to set the energy when a new allele is set

Since:
2.4
See Also:
Serialized Form

Field Summary
static double[] coinWeights
           
 
Fields inherited from interface org.jgap.IGeneConstraintChecker
CVS_REVISION
 
Constructor Summary
CoinsEnergy.EnergyGeneConstraintChecker()
           
 
Method Summary
 boolean verify(Gene a_gene, java.lang.Object a_alleleValue, IChromosome a_chrom, int a_geneIndex)
          Check if a given allele value is valid for the given gene instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

coinWeights

public static final double[] coinWeights
Constructor Detail

CoinsEnergy.EnergyGeneConstraintChecker

public CoinsEnergy.EnergyGeneConstraintChecker()
Method Detail

verify

public boolean verify(Gene a_gene,
                      java.lang.Object a_alleleValue,
                      IChromosome a_chrom,
                      int a_geneIndex)
               throws java.lang.RuntimeException
Check if a given allele value is valid for the given gene instance.

Specified by:
verify in interface IGeneConstraintChecker
Parameters:
a_gene - the gene the given allele is to be validated for
a_alleleValue - the allele value to be validated
a_chrom - not used yet
a_geneIndex - not used yet
Returns:
true: allele may be set for gene; false: validity check failed
Throws:
java.lang.RuntimeException - if the checker cannot decide whether the given allele is valid or not
Since:
2.4

JGAP