Example #1
0
        }                                          // общее время обслуживания

        internal Channel(int capacity)
        {
            Capacity       = capacity;
            BusyTime       = 0;
            ServiceTime    = 0;
            NumberOfServed = 0;
            ServiceTimes   = IntervalGenerator.GenerateIntervals(capacity);
            Served         = new List <Tuple <int, decimal> >();
        }
Example #2
0
        private static void CreateRequests(int requestsCount)
        {
            Requests = new Request[requestsCount];
            decimal[] intervals = IntervalGenerator.GenerateIntervals(requestsCount);
            decimal   totalTime = 0;

            for (int i = 0; i < requestsCount; i++)
            {
                totalTime  += intervals[i];
                Requests[i] = new Request(i, totalTime);
            }
        }