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.FitnessFunctionm_fffitness function.doublem_fitnessprotected GeneticAlgorithmm_gaga.protected int[]m_weightsweights.
-
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 GeneticAlgorithmgetOwner()Returns the owner.protected StringpostProcessCheck()protected StringpreProcessCheck()protected voidprocess()Does the actual execution of the job.StringtoString()-
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:
getOwnerin interfaceadams.multiprocess.JobWithOwner<GeneticAlgorithm>- Returns:
- the owner
-
postProcessCheck
protected String postProcessCheck()
- Specified by:
postProcessCheckin classadams.multiprocess.AbstractJob
-
preProcessCheck
protected String preProcessCheck()
- Specified by:
preProcessCheckin classadams.multiprocess.AbstractJob
-
process
protected void process() throws ExceptionDoes the actual execution of the job.- Specified by:
processin classadams.multiprocess.AbstractJob- Throws:
Exception- if fails to execute job
-
toString
public String toString()
- Specified by:
toStringin classadams.multiprocess.AbstractJob
-
-