net.sourceforge.cilib.pso.dynamic.detectionstrategies
Class RandomSentryPointsDetectionStrategy<E extends PopulationBasedAlgorithm>

java.lang.Object
  extended by net.sourceforge.cilib.pso.dynamic.detectionstrategies.EnvironmentChangeDetectionStrategy<E>
      extended by net.sourceforge.cilib.pso.dynamic.detectionstrategies.RandomSentriesDetectionStrategy<E>
          extended by 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

Field Summary
protected  ArrayList<Entity> sentries
           
 
Fields inherited from class net.sourceforge.cilib.pso.dynamic.detectionstrategies.RandomSentriesDetectionStrategy
numberOfSentries, randomGenerator
 
Fields inherited from class net.sourceforge.cilib.pso.dynamic.detectionstrategies.EnvironmentChangeDetectionStrategy
epsilon, interval
 
Constructor Summary
RandomSentryPointsDetectionStrategy()
           
RandomSentryPointsDetectionStrategy(RandomSentryPointsDetectionStrategy<E> rhs)
           
 
Method Summary
 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.
 RandomSentryPointsDetectionStrategy<E> getClone()
          Clone the EnvironmentChangeDetectionStrategy object.
 
Methods inherited from class net.sourceforge.cilib.pso.dynamic.detectionstrategies.RandomSentriesDetectionStrategy
getNumberOfSentries, getRandomNumberGenerator, setNumberOfSentries, setRandomNumberGenerator
 
Methods inherited from class net.sourceforge.cilib.pso.dynamic.detectionstrategies.EnvironmentChangeDetectionStrategy
getEpsilon, getIterationsModulus, setEpsilon, setIterationsModulus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sentries

protected ArrayList<Entity> sentries
Constructor Detail

RandomSentryPointsDetectionStrategy

public RandomSentryPointsDetectionStrategy()

RandomSentryPointsDetectionStrategy

public RandomSentryPointsDetectionStrategy(RandomSentryPointsDetectionStrategy<E> rhs)
Method Detail

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.