private void ReadyToDepart(ILoad load) { Log("Ready to Depart", load); if (DebugMode) { Debug.WriteLine("{0}:\t{1}\tReadyToDepart\t{2}", ClockTime, this, load); } HSet_Serving.Remove(load); HSet_PendingToDepart.Add(load); HC_Serving.ObserveChange(-1, ClockTime); HC_PendingToDepart.ObserveChange(1, ClockTime); OnReadyToDepart.Invoke(load); }
public void Dequeue(ILoad load) { if (List_Queueing.Contains(load)) { Log("Dequeue", load); if (DebugMode) { Debug.WriteLine("{0}:\t{1}\tDequeue\t{2}", ClockTime, this, load); } List_Queueing.Remove(load); HC_Queueing.ObserveChange(-1, ClockTime); AtmptEnqueue(); } }
/// <summary> /// The external Start event to be called by RCQsModel to start the activity when requested resources are allocated /// Note: this is supposed to be internal event, calling from other modules shall be forbidden /// </summary> /// <param name="load">The load which starts to process on the activty</param> public void Start(ILoad load) { if (!(load is TLoad)) { throw new Exception("Load type is inconsistent."); } var tLoad = (TLoad)load; if (!PendingLoads.Contains(tLoad)) { throw new Exception("Load does not exists in the activity handler."); } PendingLoads.Remove(tLoad); ActiveLoads.Add(tLoad); _hc_Occupied.ObserveChange(1); StartActivity((TLoad)load); }
private void Arrive() { Log("Arrive"); HcInSystem.ObserveChange(1, ClockTime); }