|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.cilib.pso.dynamic.responsestrategies.EnvironmentChangeResponseStrategy<E> net.sourceforge.cilib.pso.dynamic.responsestrategies.ReinitializationReactionStrategy<E>
E
- some population based algorithm
public class ReinitializationReactionStrategy<E extends PopulationBasedAlgorithm>
This reaction strategy reinitializes the specified
ratio
of randomly chosen entities in the given
Topology
.
Field Summary | |
---|---|
protected Random |
randomGenerator
|
protected double |
reinitializationRatio
|
Fields inherited from class net.sourceforge.cilib.pso.dynamic.responsestrategies.EnvironmentChangeResponseStrategy |
---|
hasMemory |
Constructor Summary | |
---|---|
ReinitializationReactionStrategy()
|
|
ReinitializationReactionStrategy(ReinitializationReactionStrategy<E> rhs)
|
Method Summary | |
---|---|
ReinitializationReactionStrategy<E> |
getClone()
Clone the EnvironmentChangeResponseStrategy object. |
protected Random |
getRandomGenerator()
Retrieve the random number generator being used. |
double |
getReinitializationRatio()
Get the ratio of entities that should be reinitialized. |
void |
performReaction(E algorithm)
Reinitialize the entities inside the topology. |
protected void |
reinitialize(List<? extends Entity> entities,
int reinitializeCount)
Reinitialize a specified number of the given entities. |
protected void |
setRandomGenerator(Random r)
Set the random number generator to use. |
void |
setReinitializationRatio(double rr)
Set the ratio of entities that should be reinitialized. |
Methods inherited from class net.sourceforge.cilib.pso.dynamic.responsestrategies.EnvironmentChangeResponseStrategy |
---|
getHasMemory, respond, setHasMemory, updateNeighbourhoodBestEntities |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double reinitializationRatio
protected Random randomGenerator
Constructor Detail |
---|
public ReinitializationReactionStrategy()
public ReinitializationReactionStrategy(ReinitializationReactionStrategy<E> rhs)
Method Detail |
---|
public ReinitializationReactionStrategy<E> getClone()
EnvironmentChangeResponseStrategy
getClone
in interface Cloneable
getClone
in class EnvironmentChangeResponseStrategy<E extends PopulationBasedAlgorithm>
Object.clone()
public void performReaction(E algorithm)
entities
inside the topology.
This is the method responsible for responding that should be overridden by sub-classes.
performReaction
in class EnvironmentChangeResponseStrategy<E extends PopulationBasedAlgorithm>
protected void reinitialize(List<? extends Entity> entities, int reinitializeCount)
entities
- a List
of entities that should be considered for
reinitializationreinitializeCount
- anint specifying how many entities should be
reinitialized
public void setReinitializationRatio(double rr)
rr
- a double value in the range (0.0, 1.0)
{@link
- IllegalArgumentException} when the ratio is not within the above
mentioned rangepublic double getReinitializationRatio()
protected void setRandomGenerator(Random r)
r
- a Random
objectprotected Random getRandomGenerator()
Random
object being used to generate a random sequence of numbers
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |