Exemple #1
0
        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;
        }
Exemple #2
0
        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);
            }
        }