コード例 #1
0
        /// <summary>
        /// Constructor for carReception
        /// </summary>
        /// <param name="open"></param>
        /// <param name="maxCapacity"></param>
        /// <param name="nEntryQueue"></param>
        /// <param name="sEntryQueue"></param>
        /// <param name="eEntryQueue"></param>
        /// <param name="wEntryQueue"></param>
        public CarReception(bool open, int maxCapacity, EntryQueue nEntryQueue, EntryQueue sEntryQueue, EntryQueue eEntryQueue, EntryQueue wEntryQueue)
        {
            this.maxCapacity = maxCapacity;
            this.nEntryQueue = nEntryQueue;
            this.eEntryQueue = eEntryQueue;
            this.sEntryQueue = sEntryQueue;
            this.wEntryQueue = wEntryQueue;
            this.open        = open;

            carId  = 0;
            eQueue = 0;
            rnd    = new Random();
        }
コード例 #2
0
        /// <summary>
        /// Method used to create all objects
        /// </summary>
        public void CreateObj()
        {
            nEntryQueue = new EntryQueue(sizeOfQueue, northQ);
            sEntryQueue = new EntryQueue(sizeOfQueue, southQ);
            eEntryQueue = new EntryQueue(sizeOfQueue, eastQ);
            wEntryQueue = new EntryQueue(sizeOfQueue, westQ);

            pHouse = new ParkingHouse(200, nEntryQueue, sEntryQueue, eEntryQueue,wEntryQueue, pHouseStatus, parkingQStatus);
            cReception = new CarReception(open, 500, nEntryQueue, sEntryQueue, eEntryQueue, wEntryQueue);

            nExitQueue = new ExitQueue(pHouse, northE);
            sExitQueue = new ExitQueue(pHouse,  southExit);
            eExitQueue = new ExitQueue(pHouse, eastExit);
            wExitQueue = new ExitQueue(pHouse, westExit);
        }
コード例 #3
0
        /// <summary>
        /// Constructor for ParkingHouse
        /// </summary>
        /// <param name="maxCapacity"></param>
        /// <param name="nEntryQueue"></param>
        /// <param name="sEntryQueue"></param>
        /// <param name="eEntryQueue"></param>
        /// <param name="wEntryQueue"></param>
        /// <param name="l1"></param>
        /// <param name="l2"></param>
        public ParkingHouse(int maxCapacity, EntryQueue nEntryQueue, EntryQueue sEntryQueue, EntryQueue eEntryQueue, EntryQueue wEntryQueue, Label l1, Label l2)
        {
            this.maxCapacity = maxCapacity;
            this.nEntryQueue = nEntryQueue;
            this.sEntryQueue = sEntryQueue;
            this.eEntryQueue = eEntryQueue;
            this.wEntryQueue = wEntryQueue;
            this.l1          = l1;
            this.l2          = l2;


            currentInQueue = 0;
            filled         = false;
            empty          = true;
            rnd            = new Random();
            carQueue       = new Queue <Car>();
            myLock         = new object();
        }