Class RandomSeedRepo

  • All Implemented Interfaces:
    org.powertac.common.repo.DomainRepo

    @Service
    public class RandomSeedRepo
    extends Object
    implements org.powertac.common.repo.DomainRepo
    Repository for RandomSeed instances. RandomSeeds are acquired by calls to getRandomSeed(). 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 Detail

      • RandomSeedRepo

        public RandomSeedRepo()
    • Method Detail

      • getRandomSeed

        public RandomSeed getRandomSeed​(String classname,
                                        long id,
                                        String purpose)
        Returns the RandomSeed instance identified by classname, id, and purpose, creating it if necessary.
      • restoreRandomSeed

        public void restoreRandomSeed​(RandomSeed seed)
        Adds the given seed to the map. Intended to be used when loading seeds from a file.
      • recycle

        public void recycle()
        Specified by:
        recycle in interface org.powertac.common.repo.DomainRepo