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 Particle
create()
Creates a newIndividual
.Particle
create(int id, Genotype position, Genotype velocity)
Builds aParticle
with the given id, position, and velocity.Particle
create(Genotype position)
Creates a newIndividual
with 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:IndividualFactory
Creates a newIndividual
.- Specified by:
create
in interfaceIndividualFactory
- Overrides:
create
in classAbstractIndividualFactory<Particle>
- Returns:
- the built individual
-
create
public Particle create(Genotype position)
Description copied from interface:IndividualFactory
Creates a newIndividual
with a specifiedGenotype
.- Specified by:
create
in interfaceIndividualFactory
- Overrides:
create
in classAbstractIndividualFactory<Particle>
- Parameters:
position
- the genotype of the individual- Returns:
- the built individual
-
-