Ejemplo n.º 1
0
 public void Next()
 {
     if (FullyExplored)
     {
         throw new Exception("Scheduling choice already exhausted.");
     }
     Chosen = _alternatives.Successor(Chosen + 1);
     _numElemsSeen++;
 }
Ejemplo n.º 2
0
        public Choice(ThreadSet alternatives)
        {
            _alternatives = alternatives;
            int n = alternatives.NumElems;

            if (n == 0)
            {
                throw new ArgumentOutOfRangeException($"No alternatives to choose between.");
            }
            Chosen        = _alternatives.Successor(0);
            _numElemsSeen = 1;
        }