Class 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.
      • 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, 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.CustomLoggingLevelObject

        setLoggingLevel
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • 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_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 function
        weights - weights
    • Method Detail

      • getOwner

        public GeneticAlgorithm getOwner()
        Returns the owner.
        Specified by:
        getOwner in interface adams.multiprocess.JobWithOwner<GeneticAlgorithm>
        Returns:
        the owner
      • postProcessCheck

        protected String postProcessCheck()
        Specified by:
        postProcessCheck in class adams.multiprocess.AbstractJob
      • preProcessCheck

        protected String preProcessCheck()
        Specified by:
        preProcessCheck in class adams.multiprocess.AbstractJob
      • process

        protected void process()
                        throws Exception
        Does the actual execution of the job.
        Specified by:
        process in class adams.multiprocess.AbstractJob
        Throws:
        Exception - if fails to execute job
      • toString

        public String toString()
        Specified by:
        toString in class adams.multiprocess.AbstractJob