net.sourceforge.cilib.games.random
Class ListSeedingStrategy
java.lang.Object
net.sourceforge.cilib.games.random.GameSeedingStrategy
net.sourceforge.cilib.games.random.ListSeedingStrategy
- All Implemented Interfaces:
- Serializable, Cloneable
- Direct Known Subclasses:
- RandomListSeedingStrategy
public class ListSeedingStrategy
- extends GameSeedingStrategy
This class contains a list of seed values to use. When a seed is requested the
current index in the list is returned, and the index moves to the next item in the list.
When the index reaches the end of the list, it goes back to the beginning.
- Author:
- leo
- See Also:
- Serialized Form
Method Summary |
GameSeedingStrategy |
getClone()
Create a cloned copy of the current object and return it. |
void |
seedGenerator()
Get a seed value and seed the generator. |
void |
setSeed(long seed)
Set a seed value to use |
protected void |
updateIndex()
Change the index that is used in the list of seeds. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
seeds
protected List<Long> seeds
index
protected int index
ListSeedingStrategy
public ListSeedingStrategy()
ListSeedingStrategy
public ListSeedingStrategy(ListSeedingStrategy other)
- Parameters:
other
-
updateIndex
protected void updateIndex()
- Change the index that is used in the list of seeds.
seedGenerator
public void seedGenerator()
- Get a seed value and seed the generator.
- Specified by:
seedGenerator
in class GameSeedingStrategy
setSeed
public void setSeed(long seed)
- Set a seed value to use
- Parameters:
seed
- The seed value
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
- Specified by:
getClone
in class GameSeedingStrategy
- Returns:
- An exact clone of the current object instance.
- See Also:
Object.clone()
Copyright © 2009 CIRG. All Rights Reserved.