net.sourceforge.cilib.games.random
Class ListSeedingStrategy

java.lang.Object
  extended by net.sourceforge.cilib.games.random.GameSeedingStrategy
      extended by 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

Field Summary
protected  int index
           
protected  List<Long> seeds
           
 
Fields inherited from class net.sourceforge.cilib.games.random.GameSeedingStrategy
currentSeed, generator
 
Constructor Summary
ListSeedingStrategy()
           
ListSeedingStrategy(ListSeedingStrategy other)
           
 
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 net.sourceforge.cilib.games.random.GameSeedingStrategy
getCurrentSeed, getGenerator, setGenerator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

seeds

protected List<Long> seeds

index

protected int index
Constructor Detail

ListSeedingStrategy

public ListSeedingStrategy()

ListSeedingStrategy

public ListSeedingStrategy(ListSeedingStrategy other)
Parameters:
other -
Method Detail

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.