예제 #1
0
        /// <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);
        }
예제 #2
0
 /// <summary>
 /// A load requests to start the activity
 /// In its extension, the filtering condition can be added, i.e., loads can be ignored if the condition check fails
 /// </summary>
 /// <param name="load">The load flow through the activity</param>
 public virtual void RequestToArrive(TLoad load)
 {
     PendingLoads.Add(load);
     OnRequestToStart.Invoke(load);
 }