| java.lang.Object examples.supergene.AbstractSupergeneTest
All known Subclasses: examples.supergene.SupergeneSample,
AbstractSupergeneTest | abstract public class AbstractSupergeneTest (Code) | | Abstract class for testing Supergene performance.
author: Neil Rotstan author: Klaus Meffert author: Audrius Meskauskas since: 2.0 |
Field Summary | |
final public static int | DIMES | public static boolean | EXISTING_SOLUTIONS_ONLY If set to true (required for strict tests), only tasks with existing
solutions will be submitted as a test tasks. | public static int | MAX_ALLOWED_EVOLUTIONS The total number of times we'll let the population evolve. | final public static int | NICKELS | final public static int | PENNIES Gene index for the pennies gene. | public static int | POPULATION_SIZE Chromosome size. | final public static int | QUARTERS Gene index for the quarters gene. | public static boolean | REPORT_ENABLED |
DIMES | final public static int DIMES(Code) | | Gene index for the dimes gene
|
EXISTING_SOLUTIONS_ONLY | public static boolean EXISTING_SOLUTIONS_ONLY(Code) | | If set to true (required for strict tests), only tasks with existing
solutions will be submitted as a test tasks.
|
MAX_ALLOWED_EVOLUTIONS | public static int MAX_ALLOWED_EVOLUTIONS(Code) | | The total number of times we'll let the population evolve.
|
NICKELS | final public static int NICKELS(Code) | | Gene index for the nickels gene
Only used in the alternative presentation
|
PENNIES | final public static int PENNIES(Code) | | Gene index for the pennies gene.
Only used in the alternative presentation
|
POPULATION_SIZE | public static int POPULATION_SIZE(Code) | | Chromosome size.
|
QUARTERS | final public static int QUARTERS(Code) | | Gene index for the quarters gene.
|
REPORT_ENABLED | public static boolean REPORT_ENABLED(Code) | | |
amountOfChange | public static int amountOfChange(int a_numQuarters, int a_numDimes, int a_numNickels, int a_numPennies)(Code) | | Compute the money value from the coin information.
|
getDimesGene | protected Gene getDimesGene(Configuration a_conf)(Code) | | Parameters: a_conf - the configuration to use created Dimes gene instance |
getNickelsGene | protected Gene getNickelsGene(Configuration a_conf)(Code) | | Parameters: a_conf - the configuration to use created Nickels gene instance |
getPenniesGene | protected Gene getPenniesGene(Configuration a_conf)(Code) | | Parameters: a_conf - the configuration to use created Pennies (1) gene instance |
getQuartersGene | protected Gene getQuartersGene(Configuration a_conf)(Code) | | Parameters: a_conf - the configuration to use created Quarters gene instance |
makeChangeForAmount | abstract public int makeChangeForAmount(int a_targetChangeAmount) throws Exception(Code) | | Executes the genetic algorithm to determine the minimum number of
coins necessary to make up the given target amount of change. The
solution will then be written to System.out.
Parameters: a_targetChangeAmount - the target amount of change for which thismethod is attempting to produce the minimum number of coins absolute difference between the required and computed changeamount throws: Exception - |
test | public int test()(Code) | | Test the method, returns the sum of all differences between
the required and obtained excange amount. One exception counts
as 1000 on the error score.
|
|
|