net.sourceforge.cilib.pso.dynamic.detectionstrategies
Class RandomSentryPointsDetectionStrategy<E extends PopulationBasedAlgorithm>
java.lang.Object
net.sourceforge.cilib.pso.dynamic.detectionstrategies.EnvironmentChangeDetectionStrategy<E>
net.sourceforge.cilib.pso.dynamic.detectionstrategies.RandomSentriesDetectionStrategy<E>
net.sourceforge.cilib.pso.dynamic.detectionstrategies.RandomSentryPointsDetectionStrategy<E>
- Type Parameters:
E
- some population based algorithm
- All Implemented Interfaces:
- Serializable, Cloneable
public class RandomSentryPointsDetectionStrategy<E extends PopulationBasedAlgorithm>
- extends RandomSentriesDetectionStrategy<E>
This class defines a detection strategy that uses a user-specified
number of sentry points
and an value to
detect whether a change has occured in the environment within a number of
consecutive iterations
.
- Author:
- Theuns Cloete
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
sentries
protected ArrayList<Entity> sentries
RandomSentryPointsDetectionStrategy
public RandomSentryPointsDetectionStrategy()
RandomSentryPointsDetectionStrategy
public RandomSentryPointsDetectionStrategy(RandomSentryPointsDetectionStrategy<E> rhs)
getClone
public RandomSentryPointsDetectionStrategy<E> getClone()
- Description copied from class:
EnvironmentChangeDetectionStrategy
- Clone the EnvironmentChangeDetectionStrategy object.
- Specified by:
getClone
in interface Cloneable
- Overrides:
getClone
in class RandomSentriesDetectionStrategy<E extends PopulationBasedAlgorithm>
- Returns:
- A cloned EnvironmentChangeDetectionStrategy
- See Also:
Object.clone()
detect
public boolean detect(PopulationBasedAlgorithm algorithm)
- After every
EnvironmentChangeDetectionStrategy.interval
iterations, iterate through all sentry points
and compare their previous fitness values with their current fitness values. An
environment change is detected when the difference between the previous and current
fitness values are >= the specified EnvironmentChangeDetectionStrategy.epsilon
value. Although this detection
strategy only makes use of random sentry points, the entities in the population based
algorithm are sent through to the {@link #initializeSentryPoints(Topology) method to
initialize the sentry points.
- Overrides:
detect
in class RandomSentriesDetectionStrategy<E extends PopulationBasedAlgorithm>
- Parameters:
algorithm
- used to get hold of topology of entities and number of iterations
- Returns:
- true if a change has been detected, false otherwise
Copyright © 2009 CIRG. All Rights Reserved.