Class Particle


  • public class Particle
    extends org.opt4j.core.Individual
    The Particle extends the Individual by an id, a velocity Genotype, a personal best Genotype and the corresponding best Objectives.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.opt4j.core.Individual

        org.opt4j.core.Individual.State
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.opt4j.core.Genotype best  
      protected int id  
      protected org.opt4j.core.Objectives objectivesBest  
      protected org.opt4j.core.Genotype velocity  
      • Fields inherited from class org.opt4j.core.Individual

        genotype, individualStateListeners, objectives, phenotype, state
    • Constructor Summary

      Constructors 
      Constructor Description
      Particle()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.opt4j.core.Genotype getBest()
      Returns the best position.
      org.opt4j.core.Objectives getBestObjectives()
      Returns the best objectives.
      int getId()
      Returns the id.
      org.opt4j.core.Genotype getVelocity()
      Returns the velocity.
      void setBest​(org.opt4j.core.Genotype best, org.opt4j.core.Objectives objectives)
      Sets the best position.
      void setId​(int id)
      Sets the id.
      void setVelocity​(org.opt4j.core.Genotype velocity)
      Sets the velocity.
      • Methods inherited from class org.opt4j.core.Individual

        getGenotype, getObjectives, getPhenotype, getState, isDecoded, isEvaluated, setGenotype, setIndividualStatusListeners, setObjectives, setPhenotype, setState
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • id

        protected int id
      • velocity

        protected org.opt4j.core.Genotype velocity
      • best

        protected org.opt4j.core.Genotype best
      • objectivesBest

        protected org.opt4j.core.Objectives objectivesBest
    • Constructor Detail

      • Particle

        public Particle()
    • Method Detail

      • setVelocity

        public void setVelocity​(org.opt4j.core.Genotype velocity)
        Sets the velocity.
        Parameters:
        velocity - the velocity to set
        See Also:
        getVelocity()
      • setBest

        public void setBest​(org.opt4j.core.Genotype best,
                            org.opt4j.core.Objectives objectives)
        Sets the best position.
        Parameters:
        best - the best to set
        objectives - the corresponding best objectives
        See Also:
        getBest()
      • getId

        public int getId()
        Returns the id.
        Returns:
        the id
        See Also:
        setId(int)
      • setId

        public void setId​(int id)
        Sets the id.
        Parameters:
        id - the id to set
        See Also:
        getId()