Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)

org.uncommons.watchmaker.framework.factories
Class BitStringFactory

java.lang.Object
  extended by org.uncommons.watchmaker.framework.factories.AbstractCandidateFactory<BitString>
      extended by org.uncommons.watchmaker.framework.factories.BitStringFactory
All Implemented Interfaces:
CandidateFactory<BitString>

public class BitStringFactory
extends AbstractCandidateFactory<BitString>

General purpose candidate factory for generating bit strings for genetic algorithms.

Author:
Daniel Dyer
See Also:
BitString

Constructor Summary
BitStringFactory(int length)
           
 
Method Summary
 BitString generateRandomCandidate(Random rng)
          Generates a random bit string, with a uniform distribution of ones and zeroes.
 
Methods inherited from class org.uncommons.watchmaker.framework.factories.AbstractCandidateFactory
generateInitialPopulation, generateInitialPopulation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitStringFactory

public BitStringFactory(int length)
Parameters:
length - The length of all bit strings created by this factory.
Method Detail

generateRandomCandidate

public BitString generateRandomCandidate(Random rng)
Generates a random bit string, with a uniform distribution of ones and zeroes.

Parameters:
rng - The source of randomness for setting the bits.
Returns:
A random bit string of the length configured for this factory.

Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)