@@ -66,66 +66,6 @@ public void StartSimulation(InputParameters parameters)
6666 }
6767 FindNextSpecialEvent ( devices , sources , bufferManager , parameters ) ;
6868 }
69-
70-
71- //while (_results.AmountOfServedRequest >= parameters.AmountOfRequests &&
72- // !bufferManager.IsFree() &&
73- // !IsAllDevicesFree(devices))
74- //{
75- // // TODO CHECK FOR NEXT SPECIAL EVENT
76- // double timeOfClosestRequestCome = double.MaxValue;
77- // double timeOfClosestDeviceFree = double.MaxValue;
78-
79- // // Check requests
80- // int indexOfRequestWithClosestTimeCome = -1;
81- // for (int i = 0; i < sources.Count; i++)
82- // {
83- // if (sources[i].TimeOfNextRequest < timeOfClosestRequestCome)
84- // {
85- // timeOfClosestRequestCome = sources[i].TimeOfNextRequest;
86- // indexOfRequestWithClosestTimeCome = i;
87- // }
88- // }
89-
90- // int indexOfDeviceWithClosestTimeFree = -1;
91- // for (int i = 0; i < devices.Count; i++)
92- // {
93- // if (devices[i].TimeOfDeviceWillBeFree < indexOfDeviceWithClosestTimeFree)
94- // {
95- // timeOfClosestDeviceFree = devices[i].TimeOfDeviceWillBeFree;
96- // indexOfDeviceWithClosestTimeFree = i;
97- // }
98- // }
99-
100- // if (timeOfClosestDeviceFree < timeOfClosestRequestCome)
101- // {
102- // _deviceManager.FreeDevice(devices[indexOfDeviceWithClosestTimeFree]);
103-
104- // // Take from buffer and put on device.
105- // _deviceManager.TakeRequest(bufferManager.Get(), devices[indexOfDeviceWithClosestTimeFree]);
106- // }
107- // else
108- // {
109- // // Take request on work or add to buffer.
110- // var newRequestInSystem = _sourceManager.GetNewRequest(sources[indexOfRequestWithClosestTimeCome]);
111- // // find out free device
112- // bool wasFreeDevice = false;
113- // foreach (var device in devices)
114- // {
115- // if (!device.IsWorking)
116- // {
117- // _deviceManager.TakeRequest(newRequestInSystem, device);
118- // wasFreeDevice = true;
119- // }
120- // }
121-
122- // if (!wasFreeDevice)
123- // {
124- // // Add request to buffer if no free devices were found
125- // bufferManager.Add(newRequestInSystem);
126- // }
127- // }
128- //}
12969 }
13070
13171 private void FindNextSpecialEvent ( List < Device > devices , List < Source > sources , IBufferManager bufferManager , InputParameters parameters )
0 commit comments