Ejemplo n.º 1
0
        internal void CreateTransition(bool[] isFormulaSatisfied, byte *targetState, double p)
        {
            var transition = _transitionCount;

            _transitionCount++;
            _transitions[transition] = new LtmcTransition {
                Probability = p
            };
            var t = _transitions + transition;

            t->TargetStatePointer = targetState;
            t->Formulas           = new StateFormulaSet(isFormulaSatisfied);
            t->Flags           = TransitionFlags.IsValidFlag | TransitionFlags.IsStateTransformedToIndexFlag;
            t->ActivatedFaults = new FaultSet();
        }
Ejemplo n.º 2
0
        internal void CreateTransition(bool isFormulaSatisfied, int targetStateIndex, double p)
        {
            var transition = _transitionCount;

            _transitionCount++;
            _transitions[transition] = new LtmcTransition {
                Probability = p
            };
            var t = (Transition *)(_transitions + transition);

            t->SourceStateIndex = 0;
            t->TargetStateIndex = targetStateIndex;
            t->Formulas         = new StateFormulaSet(new Func <bool>[] { () => isFormulaSatisfied });
            t->Flags            = TransitionFlags.IsValidFlag | TransitionFlags.IsStateTransformedToIndexFlag;
            t->ActivatedFaults  = new FaultSet();
        }