示例#1
0
        IEvents Interrupter(SimProcess victim, double delay = 0, object value = null)
        {
            yield return(Env.Timeout(delay));

            if (value != null)
            {
                victim.Interrupt(value);
            }
            else
            {
                victim.Interrupt();
            }
        }
示例#2
0
 protected SimEvents Interrupter(SimProcess victim, String value, Double timeout = 0)
 {
     while (true)
     {
         victim.Interrupt(value);
         yield return(Env.Timeout(timeout));
     }
 }
示例#3
0
        static IEvents BreakBus(SimEnvironment env, SimProcess bus, double interval)
        {
            while (true)
            {
                yield return(env.Timeout(interval));

                if (bus.Succeeded)
                {
                    break;
                }
                bus.Interrupt("Breakdown Bus");
                yield return(env.Suspend());
            }
        }
示例#4
0
 static IEnumerable <SimEvent> Interrupter(SimProcess victim)
 {
     victim.Interrupt("NOW");
     yield break;
 }
示例#5
0
        static IEnumerable <SimEvent> EmergencyBrake(SimEnvironment env, SimProcess train)
        {
            yield return(env.Timeout(BreakTime));

            train.Interrupt("FRENO EMERGENZA");
        }