Package org.opt4j.optimizer.mopso
Class ParticleFactory
- All Implemented Interfaces:
IndividualFactory
The
ParticleFactory
.-
Field Summary
Fields inherited from class org.opt4j.core.AbstractIndividualFactory
creator, individualProvider, individualStateListeners
-
Constructor Summary
ConstructorDescriptionParticleFactory
(com.google.inject.Provider<Particle> particleProvider, Creator creator) Constructs aParticleFactory
. -
Method Summary
Methods inherited from class org.opt4j.core.AbstractIndividualFactory
addIndividualStateListener, injectListeners, removeIndividualStateListener
-
Constructor Details
-
ParticleFactory
@Inject public ParticleFactory(com.google.inject.Provider<Particle> particleProvider, Creator creator) Constructs aParticleFactory
.- Parameters:
particleProvider
- the provider for particlescreator
- the creator
-
-
Method Details
-
create
Description copied from interface:IndividualFactory
Creates a newIndividual
.- Specified by:
create
in interfaceIndividualFactory
- Overrides:
create
in classAbstractIndividualFactory<Particle>
- Returns:
- the built individual
-
create
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
-
create
Builds aParticle
with the given id, position, and velocity.- Parameters:
id
- the idposition
- the positionvelocity
- the velocity- Returns:
- the particle
-