Ejemplo n.º 1
0
 public ExtendRandom Get(SeedEnum seed_enum)
 {
     if (!this.RandomDictionary.ContainsKey(seed_enum))
     {
         throw new Exception(seed_enum.ToString() + " is not registered");
     }
     return(this.RandomDictionary[seed_enum]);
 }
Ejemplo n.º 2
0
        public static InitableRandom Get(SeedEnum seed_enum)
        {
            if (!dict.ContainsKey(seed_enum.ToString()))
            {
                throw new Exception(seed_enum.ToString() + "is not declared");
            }

            return(dict[seed_enum.ToString()]);
        }
Ejemplo n.º 3
0
 public ExtendRandom(SeedEnum seed_enum, int seed)
 {
     this.MySeedEnum = seed_enum;
     this.Seed       = seed;
     rand            = new MersenneTwister(this.Seed);
 }
Ejemplo n.º 4
0
        public void Register(SeedEnum seed_enum, int seed)
        {
            ExtendRandom extended_random = new ExtendRandom(seed_enum, seed);

            this.RandomDictionary[seed_enum] = extended_random;
        }
Ejemplo n.º 5
0
        public static void Declare(SeedEnum seed_enum, int seed)
        {
            InitableRandom rand = new InitableRandom(seed);

            dict[seed_enum.ToString()] = rand; //
        }