Package adams.opt.optimise
Class GeneticAlgorithm.GAJob
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.multiprocess.AbstractJob
-
- adams.opt.optimise.GeneticAlgorithm.GAJob
-
- All Implemented Interfaces:
CleanUpHandler
,LoggingLevelHandler
,LoggingSupporter
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,Job
,JobWithOwner<GeneticAlgorithm>
,Serializable
- Enclosing class:
- GeneticAlgorithm
public static class GeneticAlgorithm.GAJob extends AbstractJob implements JobWithOwner<GeneticAlgorithm>
Class for multithreading the ga.- Author:
- dale
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected FitnessFunction
m_ff
fitness function.double
m_fitness
protected GeneticAlgorithm
m_ga
ga.protected int[]
m_weights
weights.-
Fields inherited from class adams.multiprocess.AbstractJob
m_Complete, m_ExecutionError, m_JobCompleteListener, m_JobInfo, m_ProgressInfo, m_Stopped
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description GAJob(GeneticAlgorithm ga, FitnessFunction ff, int[] weights)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeneticAlgorithm
getOwner()
Returns the owner.protected String
postProcessCheck()
Checks whether all post-conditions have been met.protected String
preProcessCheck()
Checks whether all pre-conditions have been met.protected void
process()
Does the actual execution of the job.String
toString()
Returns a string representation of this job.-
Methods inherited from class adams.multiprocess.AbstractJob
cleanUp, execute, getAdditionalErrorInformation, getExecutionError, getJobCompleteListener, getJobInfo, getProgressInfo, hasExecutionError, isComplete, isStopped, jobCompleted, setJobCompleteListener, setJobInfo, setProgressInfo, stopExecution
-
Methods inherited from class adams.core.logging.CustomLoggingLevelObject
setLoggingLevel
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.multiprocess.Job
cleanUp, execute, getExecutionError, getJobCompleteListener, getJobInfo, hasExecutionError, isComplete, jobCompleted, setJobCompleteListener
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.Stoppable
stopExecution
-
Methods inherited from interface adams.core.StoppableWithFeedback
isStopped
-
-
-
-
Field Detail
-
m_ga
protected GeneticAlgorithm m_ga
ga.
-
m_ff
protected FitnessFunction m_ff
fitness function.
-
m_weights
protected int[] m_weights
weights.
-
m_fitness
public double m_fitness
-
-
Constructor Detail
-
GAJob
public GAJob(GeneticAlgorithm ga, FitnessFunction ff, int[] weights)
Constructor. Set GA params.- Parameters:
ff
- fitness functionweights
- weights
-
-
Method Detail
-
getOwner
public GeneticAlgorithm getOwner()
Returns the owner.- Specified by:
getOwner
in interfaceJobWithOwner<GeneticAlgorithm>
- Returns:
- the owner
-
postProcessCheck
protected String postProcessCheck()
Description copied from class:AbstractJob
Checks whether all post-conditions have been met.- Specified by:
postProcessCheck
in classAbstractJob
- Returns:
- null if everything is OK, otherwise an error message
-
preProcessCheck
protected String preProcessCheck()
Description copied from class:AbstractJob
Checks whether all pre-conditions have been met.- Specified by:
preProcessCheck
in classAbstractJob
- Returns:
- null if everything is OK, otherwise an error message
-
process
protected void process() throws Exception
Does the actual execution of the job.- Specified by:
process
in classAbstractJob
- Throws:
Exception
- if fails to execute job
-
toString
public String toString()
Description copied from class:AbstractJob
Returns a string representation of this job.- Specified by:
toString
in classAbstractJob
- Returns:
- the job as string
-
-