org.artoflife.gp
Class PopulationEvent
java.lang.Object
|
+--java.util.EventObject
|
+--org.artoflife.gp.PopulationEvent
- All Implemented Interfaces:
- java.io.Serializable
- public class PopulationEvent
- extends java.util.EventObject
Received by PopulationListener
s when
a Population
changes. The source of
this event is always a Population.
This is intended to enable views on the population
as it breeds new generations.
- Author:
- Steve Meyfroidt
- See Also:
- Serialized Form
Field Summary |
static int |
ADDED
Event type: added an individual. |
static int |
CHANGED
Event type: an individual changed internal state. |
static int |
REMOVED
Event type: culled an individual. |
Fields inherited from class java.util.EventObject |
source |
Methods inherited from class java.util.EventObject |
getSource |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
REMOVED
public static final int REMOVED
- Event type: culled an individual.
- See Also:
- Constant Field Values
ADDED
public static final int ADDED
- Event type: added an individual.
- See Also:
- Constant Field Values
CHANGED
public static final int CHANGED
- Event type: an individual changed internal state.
- See Also:
- Constant Field Values
PopulationEvent
public PopulationEvent(Population source,
int type,
Individual individual)
- Parameters:
source
- of this eventtype
- of this event. See ADDED
, REMOVED
, CHANGED
individual
- that changed
getSourcePopulation
public Population getSourcePopulation()
- Returns:
- Population that was source of this event
getType
public int getType()
- Returns:
- the type of event that just happened.
- See Also:
REMOVED
,
ADDED
,
CHANGED
getIndividual
public Individual getIndividual()
- Returns:
- the individual that was added or removed
toString
public java.lang.String toString()
- Overrides:
toString
in class java.util.EventObject
Copyright © 2002 the Art Of Life team. All Rights Reserved.