Ejemplo n.º 1
0
        internal void AddTransitionCondition(SignalCondition <S, T, G> condition, Transition <S, T, G> transition)
        {
            if (condition == null || transition == null || !SignalTo.Exists(t => t.Name.Equals(transition.Name)))
            {
                return;
            }

            SignalTransitionConditions.Add(condition, transition);
        }
Ejemplo n.º 2
0
        public bool CreateTransitionCondition(ISignal signal, ITransition transition, params IState[] conditionalStates)
        {
            if (signal == null || !signals.ContainsKey((signal as ISignal <G>).Name) || transition == null || !transitions.ContainsKey((transition as ITransition <T>).Name))
            {
                return(false);
            }
            foreach (State <S, T, G> conditionalState in conditionalStates)
            {
                if (conditionalState == null || !states.ContainsKey(conditionalState.Name))
                {
                    return(false);
                }
            }

            SignalCondition <S, T, G> signalCondition = new SignalCondition <S, T, G>();

            signalCondition.AddCondition(conditionalStates);
            (signal as Signal <S, T, G>).AddTransitionCondition(signalCondition, transition as Transition <S, T, G>);
            return(true);
        }
Ejemplo n.º 3
0
        public bool CreateEmitCondition(ISignal signal, params IState[] conditionalStates)
        {
            if (signal == null || !signals.ContainsKey((signal as Signal <S, T, G>).Name))
            {
                return(false);
            }
            foreach (State <S, T, G> conditionalState in conditionalStates)
            {
                if (conditionalState == null || !states.ContainsKey(conditionalState.Name))
                {
                    return(false);
                }
            }

            SignalCondition <S, T, G> signalCondition = new SignalCondition <S, T, G>();

            signalCondition.AddCondition(conditionalStates);
            (signal as Signal <S, T, G>).AddEmitCondition(signalCondition);
            return(true);
        }
Ejemplo n.º 4
0
 internal void AddEmitCondition(SignalCondition <S, T, G> condition)
 {
     SignalEmitConditions.Add(condition);
 }