com.anji.integration
Class PersistenceEventListener

java.lang.Object
  extended bycom.anji.integration.PersistenceEventListener
All Implemented Interfaces:
GeneticEventListener

public class PersistenceEventListener
extends java.lang.Object
implements GeneticEventListener

Writes genetic algorithm data, including chromosomes and run, to persistent storage.

Author:
Philip Tucker

Field Summary
static java.lang.String PERSIST_ALL_CHROMOSOMES_KEY
          properties key, whether or not to persist all chromosomes
static java.lang.String PERSIST_CHAMPIONS_KEY
          properties key, whether or not to persist generational champs
static java.lang.String PERSIST_LAST_GEN_KEY
          properties key, whether or not to persist all of final generation
 
Constructor Summary
PersistenceEventListener(NeatConfiguration aConfig, Run aRun)
          ctor
 
Method Summary
 void geneticEventFired(GeneticEvent event)
          Notify this GeneticEventListener that an event has been fired of a type to which this listener is subscribed.
 void init(Properties props)
          See Parameter Details for specific property settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERSIST_ALL_CHROMOSOMES_KEY

public static final java.lang.String PERSIST_ALL_CHROMOSOMES_KEY
properties key, whether or not to persist all chromosomes

See Also:
Constant Field Values

PERSIST_CHAMPIONS_KEY

public static final java.lang.String PERSIST_CHAMPIONS_KEY
properties key, whether or not to persist generational champs

See Also:
Constant Field Values

PERSIST_LAST_GEN_KEY

public static final java.lang.String PERSIST_LAST_GEN_KEY
properties key, whether or not to persist all of final generation

See Also:
Constant Field Values
Constructor Detail

PersistenceEventListener

public PersistenceEventListener(NeatConfiguration aConfig,
                                Run aRun)
ctor

Parameters:
aConfig - - need this to persist config
aRun -
Method Detail

init

public void init(Properties props)
See Parameter Details for specific property settings.

Parameters:
props - configuration data

geneticEventFired

public void geneticEventFired(GeneticEvent event)
Description copied from interface: GeneticEventListener
Notify this GeneticEventListener that an event has been fired of a type to which this listener is subscribed.

Specified by:
geneticEventFired in interface GeneticEventListener
Parameters:
event - GeneticEvent.GENOTYPE_EVALUATED_EVENT writes chromosomes and updates run; GeneticEvent.GENOTYPE_START_GENETIC_OPERATORS_EVENT loads config; GeneticEvent.GENOTYPE_FINISH_GENETIC_OPERATORS_EVEN stores config