public virtual StorePut Put(object item) { var put = new StorePut(Environment, TriggerGet, item); PutQueue.Enqueue(put); TriggerPut(); return(put); }
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); }
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); }
protected virtual void TriggerPut(Event @event = null) { while (PutQueue.Count > 0) { var put = PutQueue.Peek(); DoPut(put); if (put.IsTriggered) { PutQueue.Dequeue(); } else { break; } } }
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); }
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); }