예제 #1
0
        /// <summary>
        ///   Runs a step of the simulation. Returns <c>false</c> to indicate that the simulation is completed.
        /// </summary>
        public void SimulateStep()
        {
            Prune();

            var state = stackalloc byte[_runtimeModel.StateVectorSize];

            if (_counterExample == null)
            {
                _runtimeModel.ExecuteStep();

                _runtimeModel.Serialize(state);
                AddState(state);
            }
            else
            {
                if (_stateIndex + 1 >= _counterExample.StepCount)
                {
                    return;
                }

                _counterExample.DeserializeState(_stateIndex + 1);
                _runtimeModel.Serialize(state);

                EnsureStatesMatch(state, _counterExample.GetState(_stateIndex + 1));

                AddState(state);
                Replay();
            }
        }