public void Next() { if (FullyExplored) { throw new Exception("Scheduling choice already exhausted."); } Chosen = _alternatives.Successor(Chosen + 1); _numElemsSeen++; }
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; }