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
ConstructorsConstructorDescriptionParticleFactory(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:IndividualFactoryCreates a newIndividual.- Specified by:
createin interfaceIndividualFactory- Overrides:
createin classAbstractIndividualFactory<Particle>- Returns:
- the built individual
-
create
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
-
create
Builds aParticlewith the given id, position, and velocity.- Parameters:
id- the idposition- the positionvelocity- the velocity- Returns:
- the particle
-