/// <summary>
        /// Returns the next integer choice.
        /// </summary>
        /// <param name="maxValue">Max value</param>
        /// <param name="next">Next</param>
        /// <returns>Boolean</returns>
        public override bool GetNextIntegerChoice(int maxValue, out int next)
        {
            CaptureAndCheckProgramState();

            if (IsReplayingCycle)
            {
                ScheduleStep nextStep = PotentialCycle[CurrentCycleIndex];
                if (nextStep.Type != ScheduleStepType.NondeterministicChoice ||
                    nextStep.IntegerChoice == null)
                {
                    Debug.WriteLine("<LivenessDebug> Trace is not reproducible: next step is not a nondeterministic integer choice.");
                    EscapeUnfairCycle();
                    return(SchedulingStrategy.GetNextIntegerChoice(maxValue, out next));
                }

                Debug.WriteLine("<LivenessDebug> Replaying '{0}' '{1}'.", nextStep.Index, nextStep.IntegerChoice.Value);

                next = nextStep.IntegerChoice.Value;

                SchedulingStrategy.ForceNextIntegerChoice(maxValue, next);

                CurrentCycleIndex++;
                if (CurrentCycleIndex == PotentialCycle.Count)
                {
                    CurrentCycleIndex = 0;
                }

                return(true);
            }
            else
            {
                return(SchedulingStrategy.GetNextIntegerChoice(maxValue, out next));
            }
        }
 /// <summary>
 /// Returns the next integer choice.
 /// </summary>
 /// <param name="maxValue">The max value.</param>
 /// <param name="next">Next</param>
 /// <returns>Boolean</returns>
 public override bool GetNextIntegerChoice(int maxValue, out int next)
 {
     CheckLivenessTemperature();
     return(SchedulingStrategy.GetNextIntegerChoice(maxValue, out next));
 }