Package org.powertac.common.repo
Class RandomSeedRepo
- java.lang.Object
- 
- org.powertac.common.repo.RandomSeedRepo
 
- 
- All Implemented Interfaces:
- DomainRepo
 
 @Service public class RandomSeedRepo extends Object implements DomainRepo Repository for RandomSeed instances. RandomSeeds are acquired by calls togetRandomSeed(). These will be newly-constructed only if an existing RandomSeed with the same classname, id, and purpose has not already been created. Seeds may be created by loading a logfile from an existing game, in which case the same random sequences will be repeated in the current game. Otherwise they are created with random starting points when requested.- Author:
- John Collins
 
- 
- 
Constructor SummaryConstructors Constructor Description RandomSeedRepo()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description RandomSeedgetRandomSeed(String classname, long id, String purpose)Returns the RandomSeed instance identified by classname, id, and purpose, creating it if necessary.voidloadSeeds(File inputFile)Pre-loads seeds from an existing server logfile, or from a stripped-down logfile containing only the RandomSeed lines.voidloadSeeds(InputStreamReader reader)Pre-loads seeds from a stream.voidrecycle()Implementations must clear out the repository in preparation for a new simulation.
 
- 
- 
- 
Method Detail- 
getRandomSeedpublic RandomSeed getRandomSeed(String classname, long id, String purpose) Returns the RandomSeed instance identified by classname, id, and purpose, creating it if necessary.
 - 
loadSeedspublic void loadSeeds(File inputFile) throws FileNotFoundException Pre-loads seeds from an existing server logfile, or from a stripped-down logfile containing only the RandomSeed lines.- Throws:
- FileNotFoundException
 
 - 
loadSeedspublic void loadSeeds(InputStreamReader reader) Pre-loads seeds from a stream.
 - 
recyclepublic void recycle() Description copied from interface:DomainRepoImplementations must clear out the repository in preparation for a new simulation.- Specified by:
- recyclein interface- DomainRepo
 
 
- 
 
-