Пример #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
 protected void Finish(TLoad load)
 {
     ActiveLoads.Remove(load);
     PassiveLoads.Add(load);
     OnReadyToDepart.Invoke(load);
 }