IEvents Interrupter(SimProcess victim, double delay = 0, object value = null) { yield return(Env.Timeout(delay)); if (value != null) { victim.Interrupt(value); } else { victim.Interrupt(); } }
protected SimEvents Interrupter(SimProcess victim, String value, Double timeout = 0) { while (true) { victim.Interrupt(value); yield return(Env.Timeout(timeout)); } }
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()); } }
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"); }