Exemple #1
0
        static void Main(string[] args)
        {
            IModeling modeling = new Modeling();

            mainDevice = new Device(modeling);
            mainDevice.HandlingTime     = 10;
            mainDevice.Queue            = new Queue(modeling);
            mainDevice.OnStartHandling += mainDevice_OnStartHandling;

            modeling.Devices.Add(mainDevice);
            modeling.EndsAt   = 100;
            modeling.OnCause += modeling_OnCause;

            modeling.Reset();
            modeling.Schedule(new Event {
                Transaction = new Transaction {
                    Status = SampleTransactionStatus.Arriving
                }
            });
            modeling.Run();

            Console.WriteLine("--------------------------------------------------------------");
            Console.WriteLine("Время моделирования: {0}", modeling.EndsAt);
            Console.WriteLine("Обработано заявок:   {0}", mainDevice.HandledTransactionsCount);
            Console.WriteLine("Поступило заявок:    {0}", mainDevice.Queue.TotalAmount);
            Console.Read();
        }