Beispiel #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();
            }
        }
Beispiel #2
0
 protected SimEvents Interrupter(SimProcess victim, String value, Double timeout = 0)
 {
     while (true)
     {
         victim.Interrupt(value);
         yield return(Env.Timeout(timeout));
     }
 }
Beispiel #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());
            }
        }
Beispiel #4
0
 static IEnumerable <SimEvent> Interrupter(SimProcess victim)
 {
     victim.Interrupt("NOW");
     yield break;
 }
        static IEnumerable <SimEvent> EmergencyBrake(SimEnvironment env, SimProcess train)
        {
            yield return(env.Timeout(BreakTime));

            train.Interrupt("FRENO EMERGENZA");
        }