예제 #1
0
파일: Store.cs 프로젝트: ds0nt/group-15-4
        public Store(StoreParams sp)
        {
            Program.Debug("Creating Store...");
            //Store params are the C-01 - C-12 variables
            _storeParams = sp;

            //Singleton Instance
            myInstance = this;

            //Has references to SP and SPQueues
            ServicePoint.resetCounter();
            _spm = new ServicePointSystem();

            //Main Customer Queue
            Customer.resetCounter();
            _mainQueue = new Queue<Customer>();

            //customer pool
            _customerPool = new List<Customer>();

            //Manager
            if (StoreParams.ManagerPresent == true)
            {
                open = false;
                _manager = new Manager();

            }
            else
                open = true;
        }
예제 #2
0
파일: Program.cs 프로젝트: ds0nt/group-15-4
        public static void randomSimulation(StoreParams sp)
        {
            Store store = new Store(sp);
            DateTime lastTick = DateTime.Now;
            while (true)
            {
                store.Simulate((DateTime.Now - lastTick).TotalMilliseconds);
                lastTick = DateTime.Now;

                //sleep it a bit to get a better sample from rand
                System.Threading.Thread.Sleep(10);
            }
        }