Ejemplo n.º 1
0
        /// <summary>
        /// A quick hack that allows me to share code between the two constructors but still set
        /// readonly fields
        /// </summary>
        private StaticWeightedRandomizer(ThreadAwareRandom random)
        {
            _random              = random;
            _weights             = new Dictionary <TKey, int>();
            _listNeedsRebuilding = true;
            TotalWeight          = 0;

            _probabilityBoxes = new List <ProbabilityBox>();
            _heightPerBox     = 0;
        }
 /// <summary>
 /// Create a new DynamicWeightedRandomizer with the given seed
 /// </summary>
 public DynamicWeightedRandomizer(int seed)
 {
     _root    = _sentinel = new Node();
     _deleted = null;
     _random  = new ThreadAwareRandom(seed);
 }