| java.lang.Object examples.supergene.AbstractSupergeneTest examples.supergene.SupergeneSample examples.supergene.WithoutSupergeneSample
WithoutSupergeneSample | class WithoutSupergeneSample extends SupergeneSample (Code) | | Computes the optimal change with the same condition as
SupergeneTest, but without using supergenes. Implemented
to compare the performance.
To test the Supergene, we created the "makechange" 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: Audrius Meskauskas author: Klaus Meffert |
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 change throws: Exception - |
|
|