Пример #1
0
        public virtual StorePut Put(object item)
        {
            var put = new StorePut(Environment, TriggerGet, item);

            PutQueue.Enqueue(put);
            TriggerPut();
            return(put);
        }
Пример #2
0
        public virtual StorePut Put(object item, double priority = 1)
        {
            var put = new StorePut(Environment, TriggerGet, new PriorityItem(priority, item));

            PutQueue.Enqueue(put);
            TriggerPut();
            return(put);
        }
Пример #3
0
        public virtual ContainerPut Put(double amount)
        {
            if (amount > Capacity)
            {
                throw new ArgumentException("Cannot put more than capacity", "amount");
            }
            var put = new ContainerPut(Environment, TriggerGet, amount);

            PutQueue.Enqueue(put);
            TriggerPut();
            return(put);
        }
Пример #4
0
 protected virtual void TriggerPut(Event @event = null)
 {
     while (PutQueue.Count > 0)
     {
         var put = PutQueue.Peek();
         DoPut(put);
         if (put.IsTriggered)
         {
             PutQueue.Dequeue();
         }
         else
         {
             break;
         }
     }
 }
Пример #5
0
 protected virtual void TriggerPut(Event @event = null)
 {
     while (PutQueue.Count > 0)
     {
         var put = PutQueue.Peek();
         DoPut(put);
         if (put.IsTriggered)
         {
             PutQueue.Dequeue();
             TriggerWhenAtLeast();
             TriggerWhenChange();
         }
         else
         {
             break;
         }
     }
     Fillrate?.UpdateTo(Level / Capacity);
     PutQueueLength?.UpdateTo(PutQueue.Count);
 }
Пример #6
0
 protected virtual void TriggerPut(Event @event = null)
 {
     while (PutQueue.Count > 0)
     {
         var put = PutQueue.Peek();
         DoPut(put);
         if (put.IsTriggered)
         {
             PutQueue.Dequeue();
             TriggerWhenNew();
             TriggerWhenAny();
             TriggerWhenFull();
             TriggerWhenChange();
         }
         else
         {
             break;
         }
     }
     Utilization?.UpdateTo(Count / (double)Capacity);
     WIP?.UpdateTo(Count + PutQueue.Count + GetQueue.Count);
     PutQueueLength?.UpdateTo(PutQueue.Count);
 }