Beispiel #1
0
        private bool AnyPredIsQuiescent(PfcExecutionContext parentPfcec)
        {
            bool anyPredIsQuiescent = false;

            PredecessorStateMachines.ForEach(delegate(StepStateMachine ssm) { anyPredIsQuiescent |= ssm.IsInQuiescentState(parentPfcec); });
            return(anyPredIsQuiescent);
        }
Beispiel #2
0
        private void EvaluateCondition(IExecutive exec, object userData)
        {
            PfcExecutionContext pfcec   = (PfcExecutionContext)userData;
            TsmData             tsmData = GetTsmData(pfcec);

            tsmData.NextExpressionEvaluation = 0L;
            if (tsmData.State == TransitionState.Active && ExecutableCondition(pfcec, this))
            {
                PredecessorStateMachines.ForEach(delegate(StepStateMachine ssm) {
                    if (ssm.GetState(pfcec) != StepState.Complete)
                    {
                        ssm.Stop(pfcec);
                    }
                    ssm.Reset(pfcec);
                });
                // When the last predecessor goes to Idle, I will go to Inactive.
                Debug.Assert(AllPredsAreIdle(pfcec));
                Debug.Assert(tsmData.State == TransitionState.Inactive);
                if (s_diagnostics)
                {
                    Console.WriteLine("Done condition-scanning on transition " + m_myTransition.Name + " in EC " + pfcec.Name + ".");
                }
                SuccessorStateMachines.ForEach(delegate(StepStateMachine ssm) { RunSuccessor(ssm, pfcec); });
            }
            else
            {
                // Either I'm NotBeingEvaluated, or the evaluation came out false.
                // NOTE: Must halt event stream when "NotBeingEvaluated".
                tsmData.NextExpressionEvaluation = exec.RequestEvent(new ExecEventReceiver(EvaluateCondition), exec.Now + m_scanningPeriod, 0.0, pfcec, ExecEventType.Synchronous);
            }
        }
Beispiel #3
0
 private bool AllPredsAreNotIdle(PfcExecutionContext parentPfcec)
 {
     return(PredecessorStateMachines.TrueForAll(delegate(StepStateMachine ssm) { return ssm.GetState(parentPfcec) != StepState.Idle; }));
 }
Beispiel #4
0
 private bool NoPredIsQuiescent(PfcExecutionContext parentPfcec)
 {
     return(PredecessorStateMachines.TrueForAll(delegate(StepStateMachine ssm) { return !ssm.IsInQuiescentState(parentPfcec); }));
 }