/// <summary> /// Executes an initial transition of the model. /// </summary> protected override void ExecuteInitialTransition() { //TODO: _resetRewards(); RuntimeModel.ExecuteInitialStep(); switch (_minimalizationMode) { case EffectlessFaultsMinimizationMode.Disable: // Activate all faults // Note: Faults get activated and their effects occur, but they are not notified yet of their activation. foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.TryActivate(); } break; case EffectlessFaultsMinimizationMode.DontActivateEffectlessTransientFaults: // Activate all non-transient faults foreach (var fault in RuntimeModel.NondeterministicFaults) { if (!(fault is Modeling.TransientFault)) { fault.TryActivate(); } } break; default: throw new ArgumentOutOfRangeException(); } }
/// <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); foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.Reset(); } if (transitionIndex == 0) { RuntimeModel.ExecuteInitialStep(); } else { RuntimeModel.ExecuteStep(); } RuntimeModel.NotifyFaultActivations(); }
/// <summary> /// Executes an initial transition of the model. /// </summary> protected override void ExecuteInitialTransition() { foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.Reset(); } var savedActivations = RuntimeModel.NondeterministicFaults.ToDictionary(fault => fault, fault => fault.Activation); if (!_allowFaultsOnInitialTransitions) { foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.Activation = Activation.Suppressed; } } RuntimeModel.ExecuteInitialStep(); if (!_allowFaultsOnInitialTransitions) { foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.Activation = savedActivations[fault]; } } }
/// <summary> /// Executes an initial transition of the model. /// </summary> protected override void ExecuteInitialTransition() { foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.Reset(); } if (!_allowFaultsOnInitialTransitions) { foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.Activation = Activation.Suppressed; } } RuntimeModel.ExecuteInitialStep(); if (!_allowFaultsOnInitialTransitions) { for (var i = 0; i < RuntimeModel.NondeterministicFaults.Length; i++) { RuntimeModel.NondeterministicFaults[i].RestoreActivation(SavedActivations[i]); } } }
/// <summary> /// Executes an initial transition of the model. /// </summary> protected override void ExecuteInitialTransition() { //TODO: _resetRewards(); foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.Reset(); } var savedActivations = RuntimeModel.NondeterministicFaults.ToDictionary(fault => fault, fault => fault.Activation); if (!_allowFaultsOnInitialTransitions) { foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.Activation = Activation.Suppressed; } } if (_activateIndependentFaultsAtStepBeginning) { // Note: Faults get activated and their effects occur, but they are not notified yet of their activation. foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.TryActivate(); } } RuntimeModel.ExecuteInitialStep(); if (!_activateIndependentFaultsAtStepBeginning) { // force activation of non-transient faults foreach (var fault in RuntimeModel.NondeterministicFaults) { if (!(fault is Modeling.TransientFault)) { fault.TryActivate(); } } } if (!_allowFaultsOnInitialTransitions) { foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.Activation = savedActivations[fault]; } } }
/// <summary> /// Executes an initial transition of the model. /// </summary> protected override void ExecuteInitialTransition() { //TODO: _resetRewards(); foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.Reset(); } if (!_allowFaultsOnInitialTransitions) { foreach (var fault in RuntimeModel.NondeterministicFaults) { fault.Activation = Activation.Suppressed; } } // Note: Faults get activated and their effects occur, but they are not notified yet of their activation. foreach (var fault in RuntimeModel.OnStartOfStepFaults) { fault.TryActivate(); } foreach (var fault in RuntimeModel.OnCustomFaults) { if (fault.HasCustomDemand()) { fault.TryActivate(); } else { fault.Activation = Activation.Suppressed; } } RuntimeModel.ExecuteInitialStep(); for (var i = 0; i < RuntimeModel.NondeterministicFaults.Length; i++) { RuntimeModel.NondeterministicFaults[i].RestoreActivation(SavedActivations[i]); } }
/// <summary> /// Executes an initial transition of the model. /// </summary> protected override void ExecuteInitialTransition() { RuntimeModel.ExecuteInitialStep(); }