|
||||||||||
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.ReevaluationReactionStrategy<E>
E
- some population based algorithm
public class ReevaluationReactionStrategy<E extends PopulationBasedAlgorithm>
This reaction strategy reevaluates the specified
ratio
of randomly chosen entities in the given
Topology
.
Field Summary | |
---|---|
protected Random |
randomGenerator
|
protected double |
reevaluationRatio
|
Fields inherited from class net.sourceforge.cilib.pso.dynamic.responsestrategies.EnvironmentChangeResponseStrategy |
---|
hasMemory |
Constructor Summary | |
---|---|
ReevaluationReactionStrategy()
|
|
ReevaluationReactionStrategy(ReevaluationReactionStrategy<E> rhs)
|
Method Summary | |
---|---|
ReevaluationReactionStrategy<E> |
getClone()
Clone the EnvironmentChangeResponseStrategy object. |
protected Random |
getRandomGenerator()
Retrieve the random number generator being used. |
double |
getReevaluationRatio()
Get the ratio of entities that should be reevaluated. |
void |
performReaction(E algorithm)
Just reevaluate the entities inside the topology. |
protected void |
reevaluate(List<? extends Entity> entities,
int reevaluateCount)
Reevaluate a specified percentage of the given entities. |
protected void |
setRandomGenerator(Random r)
Set the random number generator to use. |
void |
setReevaluationRatio(double rer)
Set the ratio of entities that should be reevaluated. |
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 reevaluationRatio
protected Random randomGenerator
Constructor Detail |
---|
public ReevaluationReactionStrategy()
public ReevaluationReactionStrategy(ReevaluationReactionStrategy<E> rhs)
Method Detail |
---|
public ReevaluationReactionStrategy<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. An entity's
implementation should handle updating anything else that is necessary, e.g. a
StandardParticle
's personal best position
in the case of
PSO
.
This is the method responsible for responding that should be overridden by sub-classes.
performReaction
in class EnvironmentChangeResponseStrategy<E extends PopulationBasedAlgorithm>
protected void reevaluate(List<? extends Entity> entities, int reevaluateCount)
entities
- a List
of entities that should be considered for reevaluationreevaluateCount
- an int specifying how many entities should be
reevaluated
public void setReevaluationRatio(double rer)
rer
- a double value in the range (0.0, 1.0)
{@link
- IllegalArgumentException} when the ratio is not within the above
mentioned rangepublic double getReevaluationRatio()
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 |