Package adams.event
Class GeneticFitnessChangeEvent
- java.lang.Object
-
- java.util.EventObject
-
- adams.event.GeneticFitnessChangeEvent
-
- All Implemented Interfaces:
Serializable
public class GeneticFitnessChangeEvent extends EventObject
Event that gets sent whenever the fitness of a genetic algorithm changed.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GeneticFitnessChangeEvent(AbstractGeneticAlgorithm source, double fitness, Object setup, int[] weights)
Initializes the event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getFitness()
Returns the fitness that triggered this event.AbstractGeneticAlgorithm
getGeneticAlgorithm()
Returns the genetic algorithm that triggered the event.Object
getSetup()
Returns the associated setup.int[]
getWeights()
Returns the associated weights/bits.-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Field Detail
-
m_Fitness
protected double m_Fitness
the fitness that triggered this event.
-
m_Setup
protected Object m_Setup
the associated setup, if any.
-
m_Weights
protected int[] m_Weights
the associated weights.
-
-
Constructor Detail
-
GeneticFitnessChangeEvent
public GeneticFitnessChangeEvent(AbstractGeneticAlgorithm source, double fitness, Object setup, int[] weights)
Initializes the event.- Parameters:
source
- the algorithm that triggered the eventfitness
- the fitness that triggered this eventsetup
- the setupweights
- the weights/bits
-
-
Method Detail
-
getGeneticAlgorithm
public AbstractGeneticAlgorithm getGeneticAlgorithm()
Returns the genetic algorithm that triggered the event.- Returns:
- the genetic algorithm
-
getFitness
public double getFitness()
Returns the fitness that triggered this event.- Returns:
- the fitness
-
getSetup
public Object getSetup()
Returns the associated setup.- Returns:
- the setup
-
getWeights
public int[] getWeights()
Returns the associated weights/bits.- Returns:
- the weights
-
-