org.jgap.event
Class GeneticEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.jgap.event.GeneticEvent
-
- All Implemented Interfaces:
- java.io.Serializable
public class GeneticEvent extends java.util.EventObjectRepresents events that are fired via the EventManager when various genetic events occur. The specific kind of event is conveyed through the event name. Standard event names are provided as constants in this class.- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringAFTER_GENETIC_OPERATORFired after a genetic operator, liek mutation or crossing over, is executed.static java.lang.StringBEFORE_GENETIC_OPERATORFired before a genetic operator, liek mutation or crossing over, is executed.static java.lang.StringGENOTYPE_EVOLVED_EVENTPublic constant representing the name of the event that is fired each time a Genotype is finished with a single evolution cycle.static java.lang.StringGPGENOTYPE_EVOLVED_EVENTstatic java.lang.StringGPGENOTYPE_NEW_BEST_SOLUTION
-
Constructor Summary
Constructors Constructor and Description GeneticEvent(java.lang.String a_eventName, java.lang.Object a_source)Constructs a new GeneticEvent of the given name.GeneticEvent(java.lang.String a_eventName, java.lang.Object a_source, java.lang.Object a_value)Constructs a new GeneticEvent of the given name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetEventName()Retrieves the name of this event, which can be used to identify the type of event.java.lang.ObjectgetValue()
-
-
-
Field Detail
-
GENOTYPE_EVOLVED_EVENT
public static final java.lang.String GENOTYPE_EVOLVED_EVENT
Public constant representing the name of the event that is fired each time a Genotype is finished with a single evolution cycle.- See Also:
- Constant Field Values
-
GPGENOTYPE_EVOLVED_EVENT
public static final java.lang.String GPGENOTYPE_EVOLVED_EVENT
- See Also:
- Constant Field Values
-
GPGENOTYPE_NEW_BEST_SOLUTION
public static final java.lang.String GPGENOTYPE_NEW_BEST_SOLUTION
- See Also:
- Constant Field Values
-
BEFORE_GENETIC_OPERATOR
public static final java.lang.String BEFORE_GENETIC_OPERATOR
Fired before a genetic operator, liek mutation or crossing over, is executed.- See Also:
- Constant Field Values
-
AFTER_GENETIC_OPERATOR
public static final java.lang.String AFTER_GENETIC_OPERATOR
Fired after a genetic operator, liek mutation or crossing over, is executed.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GeneticEvent
public GeneticEvent(java.lang.String a_eventName, java.lang.Object a_source)Constructs a new GeneticEvent of the given name.- Parameters:
a_eventName- the name of the eventa_source- the genetic object that acted as the source of the event. The type of this object will be dependent on the kind of event (which can be identified by the event name). It may not be null- Throws:
java.lang.IllegalArgumentException- if the given source object is null- Since:
- 1.0
-
GeneticEvent
public GeneticEvent(java.lang.String a_eventName, java.lang.Object a_source, java.lang.Object a_value)Constructs a new GeneticEvent of the given name.- Parameters:
a_eventName- the name of the eventa_source- the genetic object that acted as the source of the event. The type of this object will be dependent on the kind of event (which can be identified by the event name). It may not be nulla_value- informative value of the event- Throws:
java.lang.IllegalArgumentException- if the given source object is null- Since:
- 1.0
-
-
Method Detail
-
getEventName
public java.lang.String getEventName()
Retrieves the name of this event, which can be used to identify the type of event.- Returns:
- the name of this GeneticEvent instance
- Since:
- 1.0
-
getValue
public java.lang.Object getValue()
- Returns:
- multi-purpose value of the event
- Since:
- 3.0
-
-
DMelt 3.0 © DataMelt by jWork.ORG