JGAP

examples.dynamicMutation
Class DynamicMutationExample

java.lang.Object
  extended by examples.dynamicMutation.DynamicMutationExample

public class DynamicMutationExample
extends java.lang.Object

Experiment on how to dynamically adapt the mutation rate for different genes. This example works with coins (see MinimizingMakeChange for documentation). The idea is that a quarter has more impact onto the solution than a penny, so a quarter should mutate less frequently, probably.

Since:
2.6

Nested Class Summary
static class DynamicMutationExample.CoinsMutationRateCalc
          This class only is an experiment!
 
Constructor Summary
DynamicMutationExample()
           
 
Method Summary
static void main(java.lang.String[] args)
          Main method.
static void 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicMutationExample

public DynamicMutationExample()
Method Detail

makeChangeForAmount

public static void makeChangeForAmount(int a_targetChangeAmount)
                                throws java.lang.Exception
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 this method is attempting to produce the minimum number of coins
Throws:
java.lang.Exception
Since:
1.0

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Main method. A single command-line argument is expected, which is the amount of change to create (in other words, 75 would be equal to 75 cents).

Parameters:
args - amount of change in cents to create
Throws:
java.lang.Exception
Since:
1.0

JGAP