net.sourceforge.cilib.games.random
Class RandomListSeedingStrategy
java.lang.Object
net.sourceforge.cilib.games.random.GameSeedingStrategy
net.sourceforge.cilib.games.random.ListSeedingStrategy
net.sourceforge.cilib.games.random.RandomListSeedingStrategy
- All Implemented Interfaces:
- Serializable, Cloneable
- Direct Known Subclasses:
- FixedListSeedingStrategy
public class RandomListSeedingStrategy
- extends ListSeedingStrategy
- Author:
- leo
This is a seeding strategy that does the following.
At a specified interval a specified number of seeds are generated. These seeds are stored in a list.
Every time the
seedGenerator
method is called a new seed from this list is used.
Therefore this class generates a fixed number of seeds and alternates between them. And this list of seeds can be
re-generated at fixed intervals
- See Also:
- Serialized Form
Method Summary |
GameSeedingStrategy |
getClone()
Create a cloned copy of the current object and return it. |
void |
randomizeSeeds(int size)
Generate a list of seeds with the specified length |
void |
seedGenerator()
Get a seed value and seed the generator. |
void |
setIterationModulus(int iterationModulus)
set the iteration at which the seeds will be regenerated. |
protected void |
updateSeed()
Check if the seed list needs to be randomised. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RandomListSeedingStrategy
public RandomListSeedingStrategy()
RandomListSeedingStrategy
public RandomListSeedingStrategy(RandomListSeedingStrategy other)
- Parameters:
other
-
getClone
public GameSeedingStrategy getClone()
- Create a cloned copy of the current object and return it. In general
the created copy will be a deep copy of the provided instance. As
a result this operation an be quite expensive if used incorrectly.
- Specified by:
getClone
in interface Cloneable
- Overrides:
getClone
in class ListSeedingStrategy
- Returns:
- An exact clone of the current object instance.
- See Also:
Object.clone()
updateSeed
protected void updateSeed()
- Check if the seed list needs to be randomised. If so, generate a new list of seeds
seedGenerator
public void seedGenerator()
- Get a seed value and seed the generator.
- Overrides:
seedGenerator
in class ListSeedingStrategy
randomizeSeeds
public void randomizeSeeds(int size)
- Generate a list of seeds with the specified length
- Parameters:
size
-
setIterationModulus
public void setIterationModulus(int iterationModulus)
- set the iteration at which the seeds will be regenerated.
- Parameters:
iterationModulus
-
Copyright © 2009 CIRG. All Rights Reserved.