| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| EvolutionaryAlgorithmListener |
|
| 1.0;1 |
| 1 | /* | |
| 2 | ||
| 3 | dsh-evolve Framework for evolutionary algorithms. | |
| 4 | Copyright (c) 2005-2012 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 | * @version $Revision: 1059 $ $Date: 2012-01-03 14:03:02 -0600 (Tue, 03 Jan 2012) $ | |
| 35 | */ | |
| 36 | public interface EvolutionaryAlgorithmListener<I> | |
| 37 | extends EventListener | |
| 38 | { | |
| 39 | ||
| 40 | /** | |
| 41 | * Notify this listener of an exit failed event. | |
| 42 | * The specified event object will provide a reference | |
| 43 | * to the population, fitness scores, and the time (in number of generations). | |
| 44 | * | |
| 45 | * @see EvolutionaryAlgorithmEvent#getPopulation | |
| 46 | * @see EvolutionaryAlgorithmEvent#getScores | |
| 47 | * @see EvolutionaryAlgorithmEvent#getTime | |
| 48 | * @param e exit failed event | |
| 49 | */ | |
| 50 | void exitFailed(EvolutionaryAlgorithmEvent<I> e); | |
| 51 | ||
| 52 | /** | |
| 53 | * Notify this listener of an exit succeeded event. | |
| 54 | * The specified event object will provide a reference | |
| 55 | * to the population, fitness scores, and the time (in number of generations). | |
| 56 | * | |
| 57 | * @see EvolutionaryAlgorithmEvent#getPopulation | |
| 58 | * @see EvolutionaryAlgorithmEvent#getScores | |
| 59 | * @see EvolutionaryAlgorithmEvent#getTime | |
| 60 | * @param e exit succeeded event | |
| 61 | */ | |
| 62 | void exitSucceeded(EvolutionaryAlgorithmEvent<I> e); | |
| 63 | ||
| 64 | /** | |
| 65 | * Notify this listener of a recombined event. | |
| 66 | * The specified event object will provide a reference | |
| 67 | * to the population of individuals and collection of recombined | |
| 68 | * individuals. | |
| 69 | * | |
| 70 | * @see EvolutionaryAlgorithmEvent#getPopulation | |
| 71 | * @see EvolutionaryAlgorithmEvent#getRecombined | |
| 72 | * @param e recombined event | |
| 73 | */ | |
| 74 | void recombined(EvolutionaryAlgorithmEvent<I> e); | |
| 75 | ||
| 76 | /** | |
| 77 | * Notify this listener of a mutated event. | |
| 78 | * The specified event object will provide a reference | |
| 79 | * to the collection recombined individuals and collection | |
| 80 | * of mutated individuals. | |
| 81 | * | |
| 82 | * @see EvolutionaryAlgorithmEvent#getRecombined | |
| 83 | * @see EvolutionaryAlgorithmEvent#getMutated | |
| 84 | * @param e mutated event | |
| 85 | */ | |
| 86 | void mutated(EvolutionaryAlgorithmEvent<I> e); | |
| 87 | ||
| 88 | /** | |
| 89 | * Notify this listener of a fitness calculated event. | |
| 90 | * The specified event object will provide a reference | |
| 91 | * to the individual and its fitness score. | |
| 92 | * | |
| 93 | * @see EvolutionaryAlgorithmEvent#getIndividual | |
| 94 | * @see EvolutionaryAlgorithmEvent#getScore | |
| 95 | * @param e fitness calculated event | |
| 96 | */ | |
| 97 | void fitnessCalculated(EvolutionaryAlgorithmEvent<I> e); | |
| 98 | ||
| 99 | /** | |
| 100 | * Notify this listener of a selected event. | |
| 101 | * The specified event object will provide a reference | |
| 102 | * to the original population of individuals, the collection of | |
| 103 | * selected individuals, and the fitness scores for the collection | |
| 104 | * of selected individuals. | |
| 105 | * | |
| 106 | * @see EvolutionaryAlgorithmEvent#getPopulation | |
| 107 | * @see EvolutionaryAlgorithmEvent#getSelected | |
| 108 | * @see EvolutionaryAlgorithmEvent#getScores | |
| 109 | * @param e selected event | |
| 110 | */ | |
| 111 | void selected(EvolutionaryAlgorithmEvent<I> e); | |
| 112 | } |