|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectexamples.supergene.AbstractSupergeneTest
examples.supergene.SupergeneSample
public class SupergeneSample
To test the Supergene, we created the "make change" version with additional condition: the number of nickels and pennies must be both even or both odd. The supergene encloses two genes (nickels and pennies) and is valid if the condition above is satisfied.
| Field Summary |
|---|
| Fields inherited from class examples.supergene.AbstractSupergeneTest |
|---|
DIMES, EXISTING_SOLUTIONS_ONLY, MAX_ALLOWED_EVOLUTIONS, NICKELS, PENNIES, POPULATION_SIZE, QUARTERS, REPORT_ENABLED |
| Constructor Summary | |
|---|---|
SupergeneSample()
|
|
| Method Summary | |
|---|---|
static void |
main(java.lang.String[] args)
|
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. |
| Methods inherited from class examples.supergene.AbstractSupergeneTest |
|---|
amountOfChange, getDimesGene, getNickelsGene, getPenniesGene, getQuartersGene, report, solve, test |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SupergeneSample()
| Method Detail |
|---|
public int makeChangeForAmount(int a_targetChangeAmount)
throws java.lang.Exception
makeChangeForAmount in class AbstractSupergeneTesta_targetChangeAmount - the target amount of change for which this
method is attempting to produce the minimum number of coins
java.lang.Exceptionpublic static void main(java.lang.String[] args)
|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||