|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dishevelled.swarm.ParticleSwarmImpl
final class ParticleSwarmImpl
Particle swarm implementation.
| Constructor Summary | |
|---|---|
ParticleSwarmImpl(int particles,
int dimensions)
Create a new particle swarm implementation with the specified number of particles and number of dimensions. |
|
| Method Summary | |
|---|---|
(package private) double[] |
getCognitiveMemory(int particle)
Return a view of the cognitive memory matrix for the specified particle. |
(package private) double |
getCognitiveMemory(int particle,
int dimension)
Return the cognitive memory for the specified particle and dimension. |
int |
getDimensions()
Return the number of dimensions for this particle swarm. |
(package private) double |
getFitness(int particle)
Return the fitness for the specified particle. |
int |
getParticles()
Return the number of particles in this particle swarm. |
(package private) double[] |
getPosition(int particle)
Return a view of the position matrix for the specified particle. |
(package private) double |
getPosition(int particle,
int dimension)
Return the position for the specified particle and dimension. |
double[] |
getSocialMemory()
Return a view of the social memory matrix for this particle swarm. |
(package private) double |
getSocialMemory(int dimension)
Return the social memory for this particle swarm for the specified dimension. |
(package private) double[] |
getVelocity(int particle)
Return a view of the velocity matrix for the specified particle. |
(package private) double |
getVelocity(int particle,
int dimension)
Return the velocity for the specified particle and dimension. |
Iterator<Particle> |
iterator()
|
(package private) void |
setFitness(int particle,
double fitness)
Set the fitness for the specified particle to fitness. |
(package private) void |
setPosition(int particle,
int dimension,
double position)
Set the position for the specified particle and dimension to position. |
(package private) void |
setVelocity(int particle,
int dimension,
double velocity)
Set the velocity for the specified particle and dimension to velocity. |
(package private) void |
updateCognitiveMemory(int particle)
Update the cognitive memory for the specified particle. |
(package private) void |
updateSocialMemory(int particle)
Update the social memory for this particle swarm from the position of the specified particle. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
ParticleSwarmImpl(int particles,
int dimensions)
particles - number of particles for this particle swarm
implementation, must be >= 1dimensions - number of dimensions for this particle swarm
implementation, must be >= 1| Method Detail |
|---|
public int getParticles()
getParticles in interface ParticleSwarmpublic int getDimensions()
getDimensions in interface ParticleSwarmdouble[] getPosition(int particle)
particle - particle
double getPosition(int particle,
int dimension)
particle - particledimension - dimension
void setPosition(int particle,
int dimension,
double position)
position.
particle - particledimension - dimensionposition - positiondouble[] getVelocity(int particle)
particle - particle
double getVelocity(int particle,
int dimension)
particle - particledimension - dimension
void setVelocity(int particle,
int dimension,
double velocity)
velocity.
particle - particledimension - dimensionvelocity - velocitydouble[] getCognitiveMemory(int particle)
particle - particle
double getCognitiveMemory(int particle,
int dimension)
particle - particledimension - dimension
public double[] getSocialMemory()
getSocialMemory in interface ParticleSwarmdouble getSocialMemory(int dimension)
dimension - dimension
double getFitness(int particle)
particle - particle
void setFitness(int particle,
double fitness)
fitness.
particle - particlefitness - fitnessvoid updateCognitiveMemory(int particle)
particle - particlevoid updateSocialMemory(int particle)
particle - particlepublic Iterator<Particle> iterator()
iterator in interface Iterable<Particle>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||