net.sourceforge.cilib.pso.dynamic.detectionstrategies
Class RandomSentriesDetectionStrategy<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>
Type Parameters:
E - some population based algorithm
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
RandomSentryPointsDetectionStrategy

public class RandomSentriesDetectionStrategy<E extends PopulationBasedAlgorithm>
extends EnvironmentChangeDetectionStrategy<E>

This class defines a detection strategy that uses a user-specified number of sentry entities and an value to detect whether a change has occured in the environment.

Author:
Theuns Cloete
See Also:
Serialized Form

Field Summary
protected  ControlParameter numberOfSentries
           
protected  Random randomGenerator
           
 
Fields inherited from class net.sourceforge.cilib.pso.dynamic.detectionstrategies.EnvironmentChangeDetectionStrategy
epsilon, interval
 
Constructor Summary
RandomSentriesDetectionStrategy()
           
RandomSentriesDetectionStrategy(RandomSentriesDetectionStrategy<E> rhs)
           
 
Method Summary
 boolean detect(E algorithm)
          After every EnvironmentChangeDetectionStrategy.interval iterations, pick a number of random entities from the given algorithm's topology and compare their previous fitness values with their current fitness values.
 RandomSentriesDetectionStrategy<E> getClone()
          Clone the EnvironmentChangeDetectionStrategy object.
 ControlParameter getNumberOfSentries()
           
 Random getRandomNumberGenerator()
           
 void setNumberOfSentries(ControlParameter parameter)
           
 void setRandomNumberGenerator(Random rng)
           
 
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

numberOfSentries

protected ControlParameter numberOfSentries

randomGenerator

protected Random randomGenerator
Constructor Detail

RandomSentriesDetectionStrategy

public RandomSentriesDetectionStrategy()

RandomSentriesDetectionStrategy

public RandomSentriesDetectionStrategy(RandomSentriesDetectionStrategy<E> rhs)
Method Detail

getClone

public RandomSentriesDetectionStrategy<E> getClone()
Description copied from class: EnvironmentChangeDetectionStrategy
Clone the EnvironmentChangeDetectionStrategy object.

Specified by:
getClone in interface Cloneable
Specified by:
getClone in class EnvironmentChangeDetectionStrategy<E extends PopulationBasedAlgorithm>
Returns:
A cloned EnvironmentChangeDetectionStrategy
See Also:
Object.clone()

detect

public boolean detect(E algorithm)
After every EnvironmentChangeDetectionStrategy.interval iterations, pick a number of random entities from the given algorithm's topology 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.

Specified by:
detect in class EnvironmentChangeDetectionStrategy<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

setNumberOfSentries

public void setNumberOfSentries(ControlParameter parameter)

getNumberOfSentries

public ControlParameter getNumberOfSentries()

setRandomNumberGenerator

public void setRandomNumberGenerator(Random rng)

getRandomNumberGenerator

public Random getRandomNumberGenerator()


Copyright © 2009 CIRG. All Rights Reserved.