|
||||||||||
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.DualReactionStrategy<E>
E
- some population based algorithm
public class DualReactionStrategy<E extends PopulationBasedAlgorithm>
This reaction strategy
wraps both a
ReinitializationReactionStrategy
and a ReevaluationReactionStrategy
. It
firstly performs the specified
number of reinitializations
on randomly chosen
entities in the Topology
. Then it performs the specified
number of reevaluations
on randomly chosen entities
from those that remain.
Field Summary | |
---|---|
protected Random |
randomGenerator
|
protected ReevaluationReactionStrategy<E> |
reevaluation
|
protected ReinitializationReactionStrategy<E> |
reinitialization
|
Fields inherited from class net.sourceforge.cilib.pso.dynamic.responsestrategies.EnvironmentChangeResponseStrategy |
---|
hasMemory |
Constructor Summary | |
---|---|
DualReactionStrategy()
|
|
DualReactionStrategy(DualReactionStrategy<E> rhs)
|
Method Summary | |
---|---|
DualReactionStrategy<E> |
getClone()
Clone the EnvironmentChangeResponseStrategy object. |
Random |
getRandomGenerator()
Retrieve the random number generator being used. |
double |
getReevaluationRatio()
Get the ratio of entities that should be reevaluated. |
double |
getReinitializationRatio()
Get the ratio of entities that should be reinitialized. |
void |
performReaction(E algorithm)
Respond by firstly reinitializing a specified number of entities and then reevaluating another specified number of entities. |
void |
setRandomGenerator(Random r)
Set the random number generator to use. |
void |
setReevaluationRatio(double rer)
Set the ratio of entities that should be reevaluated. |
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 ReevaluationReactionStrategy<E extends PopulationBasedAlgorithm> reevaluation
protected ReinitializationReactionStrategy<E extends PopulationBasedAlgorithm> reinitialization
protected Random randomGenerator
Constructor Detail |
---|
public DualReactionStrategy()
public DualReactionStrategy(DualReactionStrategy<E> rhs)
Method Detail |
---|
public DualReactionStrategy<E> getClone()
EnvironmentChangeResponseStrategy
getClone
in interface Cloneable
getClone
in class EnvironmentChangeResponseStrategy<E extends PopulationBasedAlgorithm>
Object.clone()
public void performReaction(E algorithm)
performReaction
in class EnvironmentChangeResponseStrategy<E extends PopulationBasedAlgorithm>
public void setReinitializationRatio(double rr)
ReinitializationReactionStrategy
.
rr
- a double value in the range (0.0, 1.0)
public double getReinitializationRatio()
ReinitializationReactionStrategy
.
public void setReevaluationRatio(double rer)
ReevaluationReactionStrategy
.
rer
- a double value in the range (0.0, 1.0)
public double getReevaluationRatio()
ReevaluationReactionStrategy
.
public void setRandomGenerator(Random r)
reevaluation
and reinitialization
) use the same
generator, so that the random numbers that are retrieved are in the same sequence.
r
- a Random
objectpublic 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 |