Package org.opt4j.optimizer.mopso
Class ParticleFactory
- java.lang.Object
-
- org.opt4j.core.AbstractIndividualFactory<Particle>
-
- org.opt4j.optimizer.mopso.ParticleFactory
-
- All Implemented Interfaces:
IndividualFactory
public class ParticleFactory extends AbstractIndividualFactory<Particle>
TheParticleFactory.
-
-
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, Creator creator)Constructs aParticleFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Particlecreate()Creates a newIndividual.Particlecreate(int id, Genotype position, Genotype velocity)Builds aParticlewith the given id, position, and velocity.Particlecreate(Genotype position)Creates a newIndividualwith a specifiedGenotype.-
Methods inherited from class org.opt4j.core.AbstractIndividualFactory
addIndividualStateListener, injectListeners, removeIndividualStateListener
-
-
-
-
Constructor Detail
-
ParticleFactory
@Inject public ParticleFactory(com.google.inject.Provider<Particle> particleProvider, Creator creator)
Constructs aParticleFactory.- Parameters:
particleProvider- the provider for particlescreator- the creator
-
-
Method Detail
-
create
public Particle create()
Description copied from interface:IndividualFactoryCreates a newIndividual.- Specified by:
createin interfaceIndividualFactory- Overrides:
createin classAbstractIndividualFactory<Particle>- Returns:
- the built individual
-
create
public Particle create(Genotype position)
Description copied from interface:IndividualFactoryCreates a newIndividualwith a specifiedGenotype.- Specified by:
createin interfaceIndividualFactory- Overrides:
createin classAbstractIndividualFactory<Particle>- Parameters:
position- the genotype of the individual- Returns:
- the built individual
-
-