/// <summary> /// Resets the model to its initial state. /// </summary> /// <param name="traversalModifierStateVectorSize">Extra bytes in state vector for traversal parameters.</param> public sealed override void Reset(int traversalModifierStateVectorSize) { ChoiceResolver.Clear(); RuntimeModel.Reset(); TemporaryStateStorage.Reset(traversalModifierStateVectorSize); SavedActivations = RuntimeModel.NondeterministicFaults.Select(fault => fault.Activation).ToArray(); }
/// <summary> /// Replays the transition of the counter example with the zero-baesd <paramref name="transitionIndex" />. /// </summary> /// <param name="choiceResolver">The choice resolver that should be used to resolve nondeterministic choices.</param> /// <param name="transitionIndex">The zero-based index of the transition that should be replayed.</param> internal unsafe void Replay(ChoiceResolver choiceResolver, int transitionIndex) { if (StepCount == 0) return; choiceResolver.Clear(); choiceResolver.PrepareNextState(); choiceResolver.SetChoices(_replayInfo[transitionIndex]); fixed (byte* state = _states[transitionIndex]) RuntimeModel.Deserialize(state); if (transitionIndex == 0) RuntimeModel.ExecuteInitialStep(); else RuntimeModel.ExecuteStep(); RuntimeModel.NotifyFaultActivations(); }