Package org.powertac.common
Class RandomSeed
java.lang.Object
java.util.Random
org.powertac.common.RandomSeed
- All Implemented Interfaces:
Serializable
public class RandomSeed extends Random
RandomSeed is used to store generated random seed in the database in
order to be able to "replay" PowerTAC competitions later on with
exactly the same random seed settings as originally used.
Note that server code is not intended to create instances of RandomSeed directly. Instead, please request seeds through RandomSeedRepo.getRandomSeed(). This way, your code will work the same whether using new seeds or replaying a previous simulation.
State log entry format:
requesterClass::requesterId::purpose::value
- Version:
- 1.0 - January 01, 2011
- Author:
- Carsten Block, John Collins
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description RandomSeed(String classname, long requesterId, String purpose)Constructor that creates a new seed with a random value.RandomSeed(String classname, long requesterId, String purpose, long value)Constructor to re-create a random seed with a given value. -
Method Summary
Modifier and Type Method Description longgetId()StringgetPurpose()StringgetRequesterClass()longgetRequesterId()longgetValue()
-
Constructor Details
-
RandomSeed
Constructor that creates a new seed with a random value. To keep the logfile simple, constructors are not logged in this class; only the init() method is logged. -
RandomSeed
Constructor to re-create a random seed with a given value.
-
-
Method Details
-
getId
public long getId() -
getRequesterClass
-
getRequesterId
public long getRequesterId() -
getPurpose
-
getValue
public long getValue()
-