org.jgap.audit
Class FitnessImprovementMonitor
- java.lang.Object
-
- org.jgap.audit.FitnessImprovementMonitor
-
- All Implemented Interfaces:
- java.io.Serializable, IEvolutionMonitor
public class FitnessImprovementMonitor extends java.lang.Object implements IEvolutionMonitor
Monitors the evolution and stops it if evolution does not make a progress as desired. For usage of this monitor class, see class examples.audit.EvolutionMonitorExample.- Since:
- 3.4.4
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.jgap.audit.IEvolutionMonitor
MONITOR_EVENT_AFTER_BULK_EVAL, MONITOR_EVENT_AFTER_OPERATE, MONITOR_EVENT_AFTER_SELECT, MONITOR_EVENT_AFTER_UPDATE_CHROMOSOMES1, MONITOR_EVENT_AFTER_UPDATE_CHROMOSOMES2, MONITOR_EVENT_BEFORE_ADD_CHROMOSOME, MONITOR_EVENT_BEFORE_BULK_EVAL, MONITOR_EVENT_BEFORE_OPERATE, MONITOR_EVENT_BEFORE_SELECT, MONITOR_EVENT_BEFORE_UPDATE_CHROMOSOMES1, MONITOR_EVENT_BEFORE_UPDATE_CHROMOSOMES2, MONITOR_EVENT_READD_FITTEST, MONITOR_EVENT_REMOVE_CHROMOSOME
-
-
Constructor Summary
Constructors Constructor and Description FitnessImprovementMonitor(int a_initialWaitSeconds, int a_checkIntervalSeconds, double a_improvedFitnessExpected)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidevent(java.lang.String a_monitorEvent, int a_evolutionNo, java.lang.Object[] a_information)Called whenever it's worth monitoring.PopulationHistoryIndexedgetPopulations()booleannextCycle(Population a_pop, java.util.List<java.lang.String> a_messages)Called after another evolution cycle has been executed.voidstart(Configuration a_config)Called just before the evolution starts.
-
-
-
Constructor Detail
-
FitnessImprovementMonitor
public FitnessImprovementMonitor(int a_initialWaitSeconds, int a_checkIntervalSeconds, double a_improvedFitnessExpected)Constructor.- Parameters:
a_initialWaitSeconds- number of seconds to wait until first checka_checkIntervalSeconds- number of seconds to wait after the previous check (except for the first check, where a_initialWaitSeconds is taken)a_improvedFitnessExpected- number of fitness units the current best solution evolved is better than the best solution from the previously check- Since:
- 3.4.4
-
-
Method Detail
-
nextCycle
public boolean nextCycle(Population a_pop, java.util.List<java.lang.String> a_messages)
Called after another evolution cycle has been executed.- Specified by:
nextCyclein interfaceIEvolutionMonitor- Parameters:
a_pop- the currently evolved populationa_messages- the monitor can append messages to indicate why it asks evolution to stop- Returns:
- true: continue with the evolution; false: stop evolution
- Since:
- 3.4.4
-
start
public void start(Configuration a_config)
Called just before the evolution starts.- Specified by:
startin interfaceIEvolutionMonitor- Parameters:
a_config- the configuration used- Since:
- 3.4.4
-
event
public void event(java.lang.String a_monitorEvent, int a_evolutionNo, java.lang.Object[] a_information)Called whenever it's worth monitoring.- Specified by:
eventin interfaceIEvolutionMonitor- Parameters:
a_monitorEvent- see constants at top of class IEvolutionMonitora_evolutionNo- the index of the evolution round (1, 2, ...)a_information- event-specific information- Since:
- 3.5
-
getPopulations
public PopulationHistoryIndexed getPopulations()
- Specified by:
getPopulationsin interfaceIEvolutionMonitor- Returns:
- null as no data is gathered by this monitor
- Since:
- 3.5
-
-
DMelt 3.0 © DataMelt by jWork.ORG