Package adams.event

Class 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
    • 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 event
        fitness - the fitness that triggered this event
        setup - the setup
        weights - 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