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:
adams.core.CleanUpHandler
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.SizeOfHandler
,adams.core.Stoppable
,adams.core.StoppableWithFeedback
,adams.multiprocess.Job
,adams.multiprocess.JobWithOwner<GeneticAlgorithm>
,Serializable
- Enclosing class:
- GeneticAlgorithm
public static class GeneticAlgorithm.GAJob extends adams.multiprocess.AbstractJob implements adams.multiprocess.JobWithOwner<GeneticAlgorithm>
Class for multithreading the ga.- Author:
- dale
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.opt.optimise.FitnessFunction
m_ff
fitness function.double
m_fitness
protected GeneticAlgorithm
m_ga
ga.protected int[]
m_weights
weights.
-
Constructor Summary
Constructors Constructor Description GAJob(GeneticAlgorithm ga, adams.opt.optimise.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()
protected String
preProcessCheck()
protected void
process()
Does the actual execution of the job.String
toString()
-
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.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
m_ga
protected GeneticAlgorithm m_ga
ga.
-
m_ff
protected adams.opt.optimise.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, adams.opt.optimise.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 interfaceadams.multiprocess.JobWithOwner<GeneticAlgorithm>
- Returns:
- the owner
-
postProcessCheck
protected String postProcessCheck()
- Specified by:
postProcessCheck
in classadams.multiprocess.AbstractJob
-
preProcessCheck
protected String preProcessCheck()
- Specified by:
preProcessCheck
in classadams.multiprocess.AbstractJob
-
process
protected void process() throws Exception
Does the actual execution of the job.- Specified by:
process
in classadams.multiprocess.AbstractJob
- Throws:
Exception
- if fails to execute job
-
toString
public String toString()
- Specified by:
toString
in classadams.multiprocess.AbstractJob
-
-