private void InitializeQueue()
 {
     r1 = new Request(1, 1, 1); systemDiscipline.Put(r1);
     r2 = new Request(2, 1, 2); systemDiscipline.Put(r2);
     r3 = new Request(3, 1, 3); systemDiscipline.Put(r3);
     r4 = new Request(4, 1, 4); systemDiscipline.Put(r4);
 }
 public void TakeFreeDevice(Request request)
 {
     var device = devices.Find(d => d.IsFree);
     if (device != null)
     {
         device.Take(request);
     }
 }
 public RequestView(Request request)
 {
     this.request = request;
 }
 public void Put(Request r)
 {
     if (CountRequestsInQueue > TotalSize)
         throw new InvalidOperationException("Queue is full!");
     requests.AddLast(r);
 }
 public void Release()
 {
     processingRequest = null;
 }
 public void Take(Request request)
 {
     processingRequest = request;
     currentRequestProcessingTime = 0;
 }