| java.lang.Object examples.supergene.AbstractSupergeneTest examples.supergene.SupergeneSample
All known Subclasses: examples.supergene.WithoutSupergeneSample,
SupergeneSample | public class SupergeneSample extends AbstractSupergeneTest (Code) | | 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.
author: Neil Rotstan author: Klaus Meffert author: Audrius Meskauskas since: 2.0 |
Method Summary | |
public static void | main(String[] args) | public 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. |
makeChangeForAmount | 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 - |
|
|