Class ParticleFactory

  • All Implemented Interfaces:
    org.opt4j.core.IndividualFactory

    public class ParticleFactory
    extends org.opt4j.core.AbstractIndividualFactory<Particle>
    • Field Summary

      • Fields inherited from class org.opt4j.core.AbstractIndividualFactory

        creator, individualProvider, individualStateListeners
    • Constructor Summary

      Constructors 
      Constructor Description
      ParticleFactory​(com.google.inject.Provider<Particle> particleProvider, org.opt4j.core.problem.Creator<org.opt4j.core.Genotype> creator)
      Constructs a ParticleFactory.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Particle create()  
      Particle create​(int id, org.opt4j.core.Genotype position, org.opt4j.core.Genotype velocity)
      Builds a Particle with the given id, position, and velocity.
      Particle create​(org.opt4j.core.Genotype position)  
      • Methods inherited from class org.opt4j.core.AbstractIndividualFactory

        addIndividualStateListener, injectListeners, removeIndividualStateListener
      • Methods inherited from class java.lang.Object

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

      • ParticleFactory

        @Inject
        public ParticleFactory​(com.google.inject.Provider<Particle> particleProvider,
                               org.opt4j.core.problem.Creator<org.opt4j.core.Genotype> creator)
        Constructs a ParticleFactory.
        Parameters:
        particleProvider - the provider for particles
        creator - the creator
    • Method Detail

      • create

        public Particle create()
        Specified by:
        create in interface org.opt4j.core.IndividualFactory
        Overrides:
        create in class org.opt4j.core.AbstractIndividualFactory<Particle>
      • create

        public Particle create​(org.opt4j.core.Genotype position)
        Specified by:
        create in interface org.opt4j.core.IndividualFactory
        Overrides:
        create in class org.opt4j.core.AbstractIndividualFactory<Particle>
      • create

        public Particle create​(int id,
                               org.opt4j.core.Genotype position,
                               org.opt4j.core.Genotype velocity)
        Builds a Particle with the given id, position, and velocity.
        Parameters:
        id - the id
        position - the position
        velocity - the velocity
        Returns:
        the particle