Coverage Report - org.dishevelled.evolve.EvolutionaryAlgorithmListener
 
Classes in this File Line Coverage Branch Coverage Complexity
EvolutionaryAlgorithmListener
N/A
N/A
1
 
 1  
 /*
 2  
 
 3  
     dsh-evolve  Framework for evolutionary algorithms.
 4  
     Copyright (c) 2005-2013 held jointly by the individual authors.
 5  
 
 6  
     This library is free software; you can redistribute it and/or modify it
 7  
     under the terms of the GNU Lesser General Public License as published
 8  
     by the Free Software Foundation; either version 3 of the License, or (at
 9  
     your option) any later version.
 10  
 
 11  
     This library is distributed in the hope that it will be useful, but WITHOUT
 12  
     ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or
 13  
     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
 14  
     License for more details.
 15  
 
 16  
     You should have received a copy of the GNU Lesser General Public License
 17  
     along with this library;  if not, write to the Free Software Foundation,
 18  
     Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
 19  
 
 20  
     > http://www.fsf.org/licensing/licenses/lgpl.html
 21  
     > http://www.opensource.org/licenses/lgpl-license.php
 22  
 
 23  
 */
 24  
 package org.dishevelled.evolve;
 25  
 
 26  
 import java.util.EventListener;
 27  
 
 28  
 /**
 29  
  * A listener that receives notification of progress
 30  
  * in an evolutionary algorithm function.
 31  
  *
 32  
  * @param <I> individual type
 33  
  * @author  Michael Heuer
 34  
  */
 35  
 public interface EvolutionaryAlgorithmListener<I>
 36  
     extends EventListener
 37  
 {
 38  
 
 39  
     /**
 40  
      * Notify this listener of an exit failed event.
 41  
      * The specified event object will provide a reference
 42  
      * to the population, fitness scores, and the time (in number of generations).
 43  
      *
 44  
      * @see EvolutionaryAlgorithmEvent#getPopulation
 45  
      * @see EvolutionaryAlgorithmEvent#getScores
 46  
      * @see EvolutionaryAlgorithmEvent#getTime
 47  
      * @param e exit failed event
 48  
      */
 49  
     void exitFailed(EvolutionaryAlgorithmEvent<I> e);
 50  
 
 51  
     /**
 52  
      * Notify this listener of an exit succeeded event.
 53  
      * The specified event object will provide a reference
 54  
      * to the population, fitness scores, and the time (in number of generations).
 55  
      *
 56  
      * @see EvolutionaryAlgorithmEvent#getPopulation
 57  
      * @see EvolutionaryAlgorithmEvent#getScores
 58  
      * @see EvolutionaryAlgorithmEvent#getTime
 59  
      * @param e exit succeeded event
 60  
      */
 61  
     void exitSucceeded(EvolutionaryAlgorithmEvent<I> e);
 62  
 
 63  
     /**
 64  
      * Notify this listener of a recombined event.
 65  
      * The specified event object will provide a reference
 66  
      * to the population of individuals and collection of recombined
 67  
      * individuals.
 68  
      *
 69  
      * @see EvolutionaryAlgorithmEvent#getPopulation
 70  
      * @see EvolutionaryAlgorithmEvent#getRecombined
 71  
      * @param e recombined event
 72  
      */
 73  
     void recombined(EvolutionaryAlgorithmEvent<I> e);
 74  
 
 75  
     /**
 76  
      * Notify this listener of a mutated event.
 77  
      * The specified event object will provide a reference
 78  
      * to the collection recombined individuals and collection
 79  
      * of mutated individuals.
 80  
      *
 81  
      * @see EvolutionaryAlgorithmEvent#getRecombined
 82  
      * @see EvolutionaryAlgorithmEvent#getMutated
 83  
      * @param e mutated event
 84  
      */
 85  
     void mutated(EvolutionaryAlgorithmEvent<I> e);
 86  
 
 87  
     /**
 88  
      * Notify this listener of a fitness calculated event.
 89  
      * The specified event object will provide a reference
 90  
      * to the individual and its fitness score.
 91  
      *
 92  
      * @see EvolutionaryAlgorithmEvent#getIndividual
 93  
      * @see EvolutionaryAlgorithmEvent#getScore
 94  
      * @param e fitness calculated event
 95  
      */
 96  
     void fitnessCalculated(EvolutionaryAlgorithmEvent<I> e);
 97  
 
 98  
     /**
 99  
      * Notify this listener of a selected event.
 100  
      * The specified event object will provide a reference
 101  
      * to the original population of individuals, the collection of
 102  
      * selected individuals, and the fitness scores for the collection
 103  
      * of selected individuals.
 104  
      *
 105  
      * @see EvolutionaryAlgorithmEvent#getPopulation
 106  
      * @see EvolutionaryAlgorithmEvent#getSelected
 107  
      * @see EvolutionaryAlgorithmEvent#getScores
 108  
      * @param e selected event
 109  
      */
 110  
     void selected(EvolutionaryAlgorithmEvent<I> e);
 111  
 }