|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectexamples.supergene.AbstractSupergeneTest
public abstract class AbstractSupergeneTest
Abstract class for testing Supergene performance.
| Field Summary | |
|---|---|
static int |
DIMES
Gene index for the dimes gene |
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. |
static int |
MAX_ALLOWED_EVOLUTIONS
The total number of times we'll let the population evolve. |
static int |
NICKELS
Gene index for the nickels gene Only used in the alternative presentation |
static int |
PENNIES
Gene index for the pennies gene. |
static int |
POPULATION_SIZE
Chromosome size. |
static int |
QUARTERS
Gene index for the quarters gene. |
static boolean |
REPORT_ENABLED
|
| Constructor Summary | |
|---|---|
AbstractSupergeneTest()
|
|
| Method Summary | |
|---|---|
static int |
amountOfChange(int a_numQuarters,
int a_numDimes,
int a_numNickels,
int a_numPennies)
Compute the money value from the coin information. |
protected Gene |
getDimesGene(Configuration a_conf)
|
protected Gene |
getNickelsGene(Configuration a_conf)
|
protected Gene |
getPenniesGene(Configuration a_conf)
|
protected Gene |
getQuartersGene(Configuration a_conf)
|
abstract int |
makeChangeForAmount(int a_targetChangeAmount)
Executes the genetic algorithm to determine the minimum number of coins necessary to make up the given target amount of change. |
IChromosome |
report(SupergeneChangeFitnessFunction a_fitnessFunction,
Genotype a_population)
Write report on eveluation to the given stream. |
protected int |
solve(Configuration a_conf,
int a_targetChangeAmount,
SupergeneChangeFitnessFunction a_fitnessFunction,
Gene[] a_sampleGenes)
Find and print the solution, return the solution error. |
int |
test()
Test the method, returns the sum of all differences between the required and obtained excange amount. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DIMES
public static final int QUARTERS
public static final int NICKELS
public static final int PENNIES
public static int MAX_ALLOWED_EVOLUTIONS
public static int POPULATION_SIZE
public static boolean REPORT_ENABLED
public static boolean EXISTING_SOLUTIONS_ONLY
| Constructor Detail |
|---|
public AbstractSupergeneTest()
| Method Detail |
|---|
protected Gene getDimesGene(Configuration a_conf)
a_conf - the configuration to use
protected Gene getNickelsGene(Configuration a_conf)
a_conf - the configuration to use
protected Gene getPenniesGene(Configuration a_conf)
a_conf - the configuration to use
protected Gene getQuartersGene(Configuration a_conf)
a_conf - the configuration to use
public static int amountOfChange(int a_numQuarters,
int a_numDimes,
int a_numNickels,
int a_numPennies)
public abstract int makeChangeForAmount(int a_targetChangeAmount)
throws java.lang.Exception
a_targetChangeAmount - the target amount of change for which this
method is attempting to produce the minimum number of coins
java.lang.Exception
public IChromosome report(SupergeneChangeFitnessFunction a_fitnessFunction,
Genotype a_population)
a_fitnessFunction - p_SupergeneChangeFitnessFunctiona_population - Genotype
public int test()
protected int solve(Configuration a_conf,
int a_targetChangeAmount,
SupergeneChangeFitnessFunction a_fitnessFunction,
Gene[] a_sampleGenes)
throws InvalidConfigurationException
a_conf - the configuration to use
InvalidConfigurationException
|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||