org.jscience.computing.ai.evolutionary.geneticalgorithms
Class InvalidFitnessValueException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.jscience.computing.ai.evolutionary.geneticalgorithms.InvalidFitnessValueException
All Implemented Interfaces:
java.io.Serializable

public class InvalidFitnessValueException
extends java.lang.Exception

Exception thrown when an invalid fitness value is tried to be used

Default implementation throws this exception when the fitness value has a negative value in these cases. You should correct your fitness function for returning positive values.

Custom implementations of genetic algorithms may use other (problem spceific) criterias to throw this exception.

If fitness function returns negative values, then selectChromosome() method may return a negative index for individual. To prevent ArrayIndexOutOfBounds runtime exception, this exception is implemented. Other solutions are welcome, if you have.

See Also:
Serialized Form

Constructor Summary
InvalidFitnessValueException(java.lang.String message)
          Constructs a new InvalidFitnessValueException instance with the given error message.
 
Method Summary
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvalidFitnessValueException

public InvalidFitnessValueException(java.lang.String message)
Constructs a new InvalidFitnessValueException instance with the given error message.

Parameters:
message - an error message describing the reason of this exception