コード例 #1
0
 public void SetSim(StoreSimulation.SimModels.Simulation sim)
 {
     this.sim = sim;
     this.sim.getStore().ClientAddedToQueue += new Store.ClientAddedToQueueEventHandler(ClientAddedToQueue);
     this.sim.getStore().ClientRemovedFromQueue += new Store.ClientRemovedFromQueueEventHandler(ClientRemovedFromQueue);
     this.sim.getStore().ClientInFrontOfQueue += new Store.ClientInFrontOfQueueEventHandler(ClientInFrontOfQueue);
     this.sim.getStore().ClientEnteredStore += new Store.ClientEnteredStoreEventHandler(ClientEnteredStore);
     this.sim.getStore().ClientLeftStore += new Store.ClientLeftStoreEventHandler(ClientLeftStore);
 }
コード例 #2
0
        public MainView()
        {
            InitializeComponent();
            client_args = new List<ClientStoreArg>();
            SP_args = new List<SPStoreArg>();
            output = new TextBoxStreamWriter(this.tbOutput);
            sim = new StoreSimulation.SimModels.Simulation();
            simView = new LoggingView(sim, (System.IO.TextWriter)output);
            Timer.TimerTicked += new Timer.TimerTickedEventHandler(updateTimerLbl);

            this.init();

            //event handlers
            //Store.ServicePointOpened += new Store.ServicePointOpenedEventHandler(onServicePointCreatedHandler);
        }
コード例 #3
0
        public LoggingView(StoreSimulation.SimModels.Simulation sim, TextWriter output)
        {
            this.sim = sim;
            this.output = output;
            Logger.changeOutput(this.output);

            //adding event listeners
            this.sim.getStore().ClientAddedToQueue += new Store.ClientAddedToQueueEventHandler(ClientAddedToQueue);
            this.sim.getStore().ClientRemovedFromQueue += new Store.ClientRemovedFromQueueEventHandler(ClientRemovedFromQueue);
            this.sim.getStore().ClientInFrontOfQueue += new Store.ClientInFrontOfQueueEventHandler(ClientInFrontOfQueue);
            this.sim.getStore().ClientEnteredStore += new Store.ClientEnteredStoreEventHandler(ClientEnteredStore);
            this.sim.getStore().ClientLeftStore += new Store.ClientLeftStoreEventHandler(ClientLeftStore);
            Store.ServicePointOpened += new Store.ServicePointOpenedEventHandler(ServicePointOpened);
            Store.ServicePointClosed += new Store.ServicePointClosedEventHandler(ServicePointClosed);
            ServicePoint.ClientEnteredCashier += new ServicePoint.ClientEnteredCashierEventHandler(ClientEnteredServicePoint);
            ServicePoint.ClientExitCashier += new ServicePoint.ClientExitCashierEventHandler(ClientExitServicePoint);
            ServicePoint.ClientInFrontOfQueueCashier += new ServicePoint.ClientInFrontOfQueueCashierEventHandler(ClientInFrontOfQueueCashier);
        }
コード例 #4
0
        public void init()
        {
            cbSupStrats.Items.Clear();
            lbQueues.Items.Clear();
            tbOutput.Clear();
            Timer.Reset();
            Client.CUSTOMERID = 0;

            client_args = new List<ClientStoreArg>();
            SP_args = new List<SPStoreArg>();
            output = new TextBoxStreamWriter(this.tbOutput);
            sim = new StoreSimulation.SimModels.Simulation();
            simView.SetSim(sim);

            List<SupervisorStrategy> strats = this.sim.getStore().getSupervisor().getStrategies();
            foreach (SupervisorStrategy strat in strats)
            {
                this.cbSupStrats.Items.Add(strat.ToString());
            }
            this.cbSupStrats.SelectedIndex = 0;

            lbQueues.Items.Add("MainQueue_Queue");
            lbQueues.SelectedIndex = 0;
        }