Пример #1
0
        /// <summary>
        /// Create all objects
        /// </summary>
        private void CreateObj()
        {
            //waitingCP.Text = " ";
            //waitingAPlable.Text = " ";

            wQLabelAP.Text      = " ";
            wQLabelCP.Text      = " ";
            visitorLabelAP.Text = " ";
            visitorLabelCP.Text = " ";
            exitAP.Text         = " ";
            exitCP.Text         = " ";

            wQueueAP = new WaitingQueueAP(10, wQLabelAP);
            wQueueCP = new WaitingQueueCP(10, wQLabelCP);

            reception = new Reception(10, wQueueCP, wQueueAP);

            apPool = new AdventurePool(10, wQueueAP, visitorLabelAP, apPictureBox);
            cpPool = new CommonPool(10, apPool, wQueueAP, wQueueCP, visitorLabelCP, moveFromCPLabel, cpPictureBox);

            exitQueue = new ExitQueue(apPool, cpPool, exitCP, exitAP);

            apPictureBox.BackColor = Color.Green;
            cpPictureBox.BackColor = Color.Green;
        }
Пример #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="maxCapacity"></param>
        /// <param name="wQueueCP"></param>
        /// <param name="wQueueAP"></param>
        public Reception(int maxCapacity, WaitingQueueCP wQueueCP, WaitingQueueAP wQueueAP)
        {
            this.maxCapacity = maxCapacity;
            this.wQueueAP    = wQueueAP;
            this.wQueueCP    = wQueueCP;
            receptionFull    = false;
            open             = false;

            rnd = new Random();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="maxCapacity"></param>
        /// <param name="wQueueAP"></param>
        /// <param name="label1"></param>
        public AdventurePool(int maxCapacity, WaitingQueueAP wQueueAP, Label label1, PictureBox p1)
        {
            this.maxCapacity = maxCapacity;
            this.wQueueAP    = wQueueAP;
            this.label1      = label1;
            this.p1          = p1;

            myLock = new object();

            filled = false;
            empty  = true;

            rnd = new Random();

            customerQueue = new Queue <Customer>();
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="maxCapacity"></param>
        /// <param name="wQueueAP"></param>
        /// <param name="wQueueCP"></param>
        /// <param name="label1"></param>
        /// <param name="label2"></param>
        public CommonPool(int maxCapacity, AdventurePool adventurePool, WaitingQueueAP wQueueAP, WaitingQueueCP wQueueCP, Label label1, Label label2, PictureBox p1)
        {
            this.wQueueAP    = wQueueAP;
            this.wQueueCP    = wQueueCP;
            this.maxCapacity = maxCapacity;
            this.label1      = label1;
            this.label2      = label2;
            this.p1          = p1;

            apClass = adventurePool;

            myLock = new object();
            rnd    = new Random();

            filled = false;
            empty  = true;

            customerQueue = new Queue <Customer>();
        }