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 FitnessFunctionm_fffitness function.doublem_fitnessprotected GeneticAlgorithmm_gaga.protected int[]m_weightsweights.-
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 GeneticAlgorithmgetOwner()Returns the owner.protected StringpostProcessCheck()Checks whether all post-conditions have been met.protected StringpreProcessCheck()Checks whether all pre-conditions have been met.protected voidprocess()Does the actual execution of the job.StringtoString()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:
getOwnerin interfaceJobWithOwner<GeneticAlgorithm>- Returns:
- the owner
-
postProcessCheck
protected String postProcessCheck()
Description copied from class:AbstractJobChecks whether all post-conditions have been met.- Specified by:
postProcessCheckin classAbstractJob- Returns:
- null if everything is OK, otherwise an error message
-
preProcessCheck
protected String preProcessCheck()
Description copied from class:AbstractJobChecks whether all pre-conditions have been met.- Specified by:
preProcessCheckin classAbstractJob- Returns:
- null if everything is OK, otherwise an error message
-
process
protected void process() throws ExceptionDoes the actual execution of the job.- Specified by:
processin classAbstractJob- Throws:
Exception- if fails to execute job
-
toString
public String toString()
Description copied from class:AbstractJobReturns a string representation of this job.- Specified by:
toStringin classAbstractJob- Returns:
- the job as string
-
-